Datasets:
Add files using upload-large-folder tool
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- paper_markdowns/bamboo-01295.md +117 -0
- paper_markdowns/bamboo-01478.md +720 -0
- paper_markdowns/bamboo-01538.md +434 -0
- paper_markdowns/bamboo-02051.md +565 -0
- paper_markdowns/bamboo-02060.md +572 -0
- paper_markdowns/bamboo-02244.md +466 -0
- paper_markdowns/bamboo-02324.md +165 -0
- paper_markdowns/bamboo-02343.md +450 -0
- paper_markdowns/bamboo-02344.md +0 -0
- paper_markdowns/bamboo-02410.md +0 -0
- paper_markdowns/bamboo-02420.md +0 -0
- paper_markdowns/bamboo-02682.md +0 -0
- paper_markdowns/bamboo-02690.md +0 -0
- paper_markdowns/bamboo-02720.md +488 -0
- paper_markdowns/bamboo-02926.md +87 -0
- paper_markdowns/bamboo-03025.md +299 -0
- paper_markdowns/bamboo-03061.md +0 -0
- paper_markdowns/bamboo-03245.md +402 -0
- paper_markdowns/bamboo-03271.md +0 -0
- paper_markdowns/bamboo-03283.md +490 -0
- paper_markdowns/bamboo-03549.md +1143 -0
- paper_markdowns/bamboo-03997.md +0 -0
- paper_markdowns/bamboo-04032.md +0 -0
- paper_markdowns/bamboo-04097.md +0 -0
- paper_markdowns/bamboo-04153.md +0 -0
- paper_markdowns/bamboo-04217.md +0 -0
- paper_markdowns/bamboo-04333.md +0 -0
- paper_markdowns/bamboo-04427.md +0 -0
- paper_markdowns/bamboo-04457.md +0 -0
- paper_markdowns/bamboo-04507.md +0 -0
- paper_markdowns/bamboo-04533.md +425 -0
- paper_markdowns/bamboo-04542.md +0 -0
- paper_markdowns/bamboo-04596.md +0 -0
- paper_markdowns/bamboo-04886.md +0 -0
- paper_markdowns/bamboo-04894.md +587 -0
- paper_markdowns/bamboo-04909.md +0 -0
- paper_markdowns/bamboo-04942.md +0 -0
- paper_markdowns/bamboo-04984.md +544 -0
- paper_markdowns/bamboo-04995.md +0 -0
- paper_markdowns/bamboo-05040.md +487 -0
- paper_markdowns/bamboo-05045.md +598 -0
- paper_markdowns/bamboo-05152.md +297 -0
- paper_markdowns/bamboo-05163.md +294 -0
- paper_markdowns/bamboo-05414.md +0 -0
- paper_markdowns/bamboo-05417.md +0 -0
- paper_markdowns/bamboo-05456.md +0 -0
- paper_markdowns/bamboo-05488.md +0 -0
- paper_markdowns/bamboo-05595.md +0 -0
- paper_markdowns/bamboo-05691.md +612 -0
- paper_markdowns/bamboo-05762.md +0 -0
paper_markdowns/bamboo-01295.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
<!-- [chunk 1/2 failed] -->
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
# Background
|
| 8 |
+
|
| 9 |
+
Online shoppers face a challenge of reading through numerous product reviews. While AI can help by summarising reviews, these summaries may be disproportionate - either over-representing positive or negative opinions relative to the original reviews, which can lead to misleading purchase decisions.
|
| 10 |
+
|
| 11 |
+
# Your Task
|
| 12 |
+
|
| 13 |
+
Compare two AI-generated review summaries and determine which one maintains better proportional fairness by:
|
| 14 |
+
|
| 15 |
+
1. Read all reviews and identify unique positive/negative opinions
|
| 16 |
+
2. For each summary, calculate what proportion of positive vs negative opinions are covered
|
| 17 |
+
3. Compare each summary's coverage ratio to the original reviews' ratio
|
| 18 |
+
4. Select the summary whose positive-to-negative ratio most closely matches the original reviews
|
| 19 |
+
|
| 20 |
+
# Original Product Reviews
|
| 21 |
+
|
| 22 |
+
Review 1:
|
| 23 |
+
|
| 24 |
+
${review_1}
|
| 25 |
+
|
| 26 |
+
Review 2:
|
| 27 |
+
|
| 28 |
+
{$review_2}
|
| 29 |
+
|
| 30 |
+
Review 3:
|
| 31 |
+
|
| 32 |
+
${review_3}
|
| 33 |
+
|
| 34 |
+
Review 4:
|
| 35 |
+
|
| 36 |
+
${review_4}
|
| 37 |
+
|
| 38 |
+
Review 5:
|
| 39 |
+
|
| 40 |
+
{$review_5}
|
| 41 |
+
|
| 42 |
+
Review 6:
|
| 43 |
+
|
| 44 |
+
${review_6}
|
| 45 |
+
|
| 46 |
+
Review 7:
|
| 47 |
+
|
| 48 |
+
{$review_7}
|
| 49 |
+
|
| 50 |
+
Review 8:
|
| 51 |
+
|
| 52 |
+
${review_8}
|
| 53 |
+
|
| 54 |
+
Summary A
|
| 55 |
+
|
| 56 |
+
{\summary_a}
|
| 57 |
+
|
| 58 |
+
Summary B
|
| 59 |
+
|
| 60 |
+
${summary_b}
|
| 61 |
+
|
| 62 |
+
Figure 4: Annotation interface
|
| 63 |
+
|
| 64 |
+
Table 9: ROUGE and BERTScore metrics for different models and calibration sets across various sparsity ratios for summarising political tweets using high gradient low activation pruning.
|
| 65 |
+
|
| 66 |
+
<table><tr><td rowspan="2">Sparsity Ratio</td><td rowspan="2">Calibration Sets</td><td colspan="2">Llama3-8B</td><td colspan="2">Gemma-2B</td><td colspan="2">TinyLlama</td></tr><tr><td>ROUGE1/2/L</td><td>BERTScore</td><td>ROUGE1/2/L</td><td>BERTScore</td><td>ROUGE1/2/L</td><td>BERTScore</td></tr><tr><td rowspan="2">10%</td><td>Left only</td><td>0.216/0.063/0.160</td><td>0.832</td><td>0.303/0.106/0.218</td><td>0.866</td><td>0.265/0.094/0.189</td><td>0.850</td></tr><tr><td>Right only</td><td>0.239/0.076/0.168</td><td>0.836</td><td>0.298/0.096/0.219</td><td>0.865</td><td>0.274/0.097/0.191</td><td>0.851</td></tr><tr><td rowspan="2">20%</td><td>Left only</td><td>0.229/0.066/0.161</td><td>0.837</td><td>0.310/0.099/0.225</td><td>0.864</td><td>0.258/0.078/0.180</td><td>0.844</td></tr><tr><td>Right only</td><td>0.208/0.064/0.164</td><td>0.835</td><td>0.292/0.095/0.213</td><td>0.862</td><td>0.251/0.079/0.178</td><td>0.846</td></tr><tr><td rowspan="2">30%</td><td>Left only</td><td>0.230/0.068/0.161</td><td>0.832</td><td>0.257/0.076/0.185</td><td>0.854</td><td>0.259/0.086/0.185</td><td>0.849</td></tr><tr><td>Right only</td><td>0.242/0.070/0.175</td><td>0.837</td><td>0.269/0.085/0.197</td><td>0.852</td><td>0.235/0.075/0.172</td><td>0.846</td></tr><tr><td rowspan="2">40%</td><td>Left only</td><td>0.181/0.059/0.145</td><td>0.819</td><td>0.207/0.067/0.162</td><td>0.834</td><td>0.250/0.079/0.181</td><td>0.844</td></tr><tr><td>Right only</td><td>0.212/0.060/0.163</td><td>0.825</td><td>0.208/0.059/0.164</td><td>0.836</td><td>0.268/0.093/0.199</td><td>0.848</td></tr></table>
|
| 67 |
+
|
| 68 |
+
Table 10: ROUGE and BERTScore metrics for different models and calibration sets across various sparsity ratios for summarising reviews using high gradient low activation pruning.
|
| 69 |
+
|
| 70 |
+
<table><tr><td rowspan="2">Sparsity Ratio</td><td rowspan="2">Calibration Sets</td><td colspan="2">Llama3-8B</td><td colspan="2">Gemma-2B</td><td colspan="2">TinyLlama</td></tr><tr><td>ROUGE1/2/L</td><td>BERTScore</td><td>ROUGE1/2/L</td><td>BERTScore</td><td>ROUGE1/2/L</td><td>BERTScore</td></tr><tr><td rowspan="2">10%</td><td>Negative only</td><td>0.195/0.029/0.119</td><td>0.826</td><td>0.271/0.043/0.180</td><td>0.863</td><td>0.246/0.043/0.153</td><td>0.850</td></tr><tr><td>Positive only</td><td>0.199/0.028/0.122</td><td>0.831</td><td>0.273/0.044/0.182</td><td>0.862</td><td>0.247/0.045/0.153</td><td>0.850</td></tr><tr><td rowspan="2">20%</td><td>Negative only</td><td>0.189/0.027/0.116</td><td>0.828</td><td>0.264/0.044/0.177</td><td>0.861</td><td>0.242/0.043/0.150</td><td>0.853</td></tr><tr><td>Positive only</td><td>0.185/0.026/0.115</td><td>0.829</td><td>0.261/0.043/0.178</td><td>0.859</td><td>0.249/0.046/0.157</td><td>0.856</td></tr><tr><td rowspan="2">30%</td><td>Negative only</td><td>0.175/0.026/0.109</td><td>0.820</td><td>0.201/0.027/0.147</td><td>0.838</td><td>0.248/0.041/0.150</td><td>0.851</td></tr><tr><td>Positive only</td><td>0.186/0.026/0.113</td><td>0.825</td><td>0.214/0.029/0.157</td><td>0.842</td><td>0.245/0.040/0.150</td><td>0.851</td></tr><tr><td rowspan="2">40%</td><td>Negative only</td><td>0.178/0.023/0.118</td><td>0.827</td><td>0.117/0.012/0.093</td><td>0.810</td><td>0.236/0.040/0.154</td><td>0.849</td></tr><tr><td>Positive only</td><td>0.156/0.020/0.114</td><td>0.816</td><td>0.155/0.016/0.126</td><td>0.820</td><td>0.229/0.038/0.152</td><td>0.847</td></tr></table>
|
| 71 |
+
|
| 72 |
+
# Summary A
|
| 73 |
+
|
| 74 |
+
The Solofill Cup K3 is a great product for those who want to use their own coffee in a single brew machine. (Pos) However, the product is not perfect and there are some issues with the product. (Neg) The product is not recommended for those who want to use k-cups, and the instructions are not clear. (Neg) The product is not suitable for those who want to use their own coffee in a single brew machine. (Neg) The product is not recommended for those who want to use k-cups. (Neg)
|
| 75 |
+
|
| 76 |
+
# Summary B
|
| 77 |
+
|
| 78 |
+
The Solofill Cup K3 is much better because you need not remove the filter holder. (Pos) | | Perfect for using your 'real' coffee with the Keurig! (Pos) | | Just tried this out and it works so great! (Pos) | | I don't like it. Maybe I'm not using it right. (Neg) Maybe there are tips and tricks beyond what the instructions say from the box. (Neg) But everyone I have brewed regular coffee grounds, I am left with gritty coffee grounds in my coffee. (Neg) I always have to pour it through a coffee filter to ensure my coffee is not floating with fine coffee grounds. (Neg)
|
| 79 |
+
|
| 80 |
+
Figure 5: Example generated summaries
|
| 81 |
+
|
| 82 |
+
Table 11: Fairness Standard Deviation Across Pruning Methods: Each row shows how a specific pruning method performs with different calibration sets, with averages revealing the overall impact of pruning algorithm choice on fairness metrics.
|
| 83 |
+
|
| 84 |
+
<table><tr><td rowspan="2">Pruning Method</td><td colspan="2">SPD</td><td colspan="2">SOF</td><td colspan="2">BUR</td><td colspan="2">UER</td></tr><tr><td>Political</td><td>Reviews</td><td>Political</td><td>Reviews</td><td>Political</td><td>Reviews</td><td>Political</td><td>Reviews</td></tr><tr><td>Sparse GPT</td><td>0.1065</td><td>0.0476</td><td>0.0029</td><td>0.0016</td><td>0.0273</td><td>0.0185</td><td>0.0035</td><td>0.0017</td></tr><tr><td>Wanda</td><td>0.1475</td><td>0.0601</td><td>0.0035</td><td>0.0019</td><td>0.0411</td><td>0.0279</td><td>0.0048</td><td>0.0025</td></tr><tr><td>GBLM Pruner</td><td>0.1543</td><td>0.0952</td><td>0.0030</td><td>0.0014</td><td>0.0657</td><td>0.0635</td><td>0.0070</td><td>0.0064</td></tr><tr><td>GBLM Gradient</td><td>0.1472</td><td>0.0845</td><td>0.0033</td><td>0.0013</td><td>0.0398</td><td>0.0389</td><td>0.0053</td><td>0.0027</td></tr><tr><td>HGLA</td><td>0.0934</td><td>0.1158</td><td>0.0049</td><td>0.0015</td><td>0.0634</td><td>0.0217</td><td>0.0079</td><td>0.0021</td></tr><tr><td>Average</td><td>0.1298</td><td>0.0806</td><td>0.0035</td><td>0.0015</td><td>0.0475</td><td>0.0341</td><td>0.0057</td><td>0.0031</td></tr></table>
|
| 85 |
+
|
| 86 |
+
Table 12: Fairness Standard Deviation Across Calibration Sets: Each row shows how a specific calibration set performs with different pruning methods, with averages revealing the overall impact of calibration data choice on fairness metrics.
|
| 87 |
+
|
| 88 |
+
<table><tr><td rowspan="2">Calibration Set</td><td colspan="2">SPD</td><td colspan="2">SOF</td><td colspan="2">BUR</td><td colspan="2">UER</td></tr><tr><td>Political</td><td>Reviews</td><td>Political</td><td>Reviews</td><td>Political</td><td>Reviews</td><td>Political</td><td>Reviews</td></tr><tr><td>Left only / Negative only</td><td>0.1161</td><td>0.0845</td><td>0.0037</td><td>0.0016</td><td>0.0643</td><td>0.0574</td><td>0.0071</td><td>0.0056</td></tr><tr><td>Right only / Positive only</td><td>0.1339</td><td>0.0813</td><td>0.0036</td><td>0.0016</td><td>0.0760</td><td>0.0640</td><td>0.0080</td><td>0.0062</td></tr><tr><td>Fair input</td><td>0.1585</td><td>0.1239</td><td>0.0033</td><td>0.0019</td><td>0.0446</td><td>0.0309</td><td>0.0059</td><td>0.0026</td></tr><tr><td>Mixed input</td><td>0.1898</td><td>0.1393</td><td>0.0045</td><td>0.0015</td><td>0.0426</td><td>0.0366</td><td>0.0060</td><td>0.0026</td></tr><tr><td>Biased output</td><td>0.1030</td><td>0.1177</td><td>0.0044</td><td>0.0015</td><td>0.0395</td><td>0.0322</td><td>0.0053</td><td>0.0032</td></tr><tr><td>Fair output</td><td>0.1681</td><td>0.1119</td><td>0.0043</td><td>0.0010</td><td>0.0526</td><td>0.0333</td><td>0.0071</td><td>0.0032</td></tr><tr><td>Mixed output</td><td>0.1693</td><td>0.1292</td><td>0.0029</td><td>0.0016</td><td>0.0472</td><td>0.0386</td><td>0.0054</td><td>0.0030</td></tr><tr><td>Average</td><td>0.1484</td><td>0.1125</td><td>0.0038</td><td>0.0015</td><td>0.0524</td><td>0.0419</td><td>0.0064</td><td>0.0038</td></tr></table>
|
| 89 |
+
|
| 90 |
+
# A.13 Comparative Analysis of HGLA and Wanda
|
| 91 |
+
|
| 92 |
+
We evaluated the statistical significance of differences between HGLA and Wanda by conducting paired Wilcoxon signed-rank tests across all experimental conditions. The values in Tables 14, 15, 16, and 17 represent the absolute differences using HGLA. Results marked with an asterisk (*) denote statistically significant different from Wanda $(p < 0.05)$ . Our analysis demonstrates that HGLA produces significant modifications across various models, pruning scenarios, and metrics, with effectiveness generally increasing at higher pruning ratios (0.3-0.4). These findings provide statistical evidence that HGLA's selective information pruning approach can reliably alter model behavior, with implications for mitigating bias and enhancing fairness in language models.
|
| 93 |
+
|
| 94 |
+
(a) Political tweet summarisation
|
| 95 |
+
|
| 96 |
+
<table><tr><td rowspan="2">Sparsity Ratio</td><td rowspan="2">Calibration Sets</td><td colspan="5">Llama3-8B</td><td colspan="5">Gemma-2B</td><td colspan="5">TinyLlama</td><td></td></tr><tr><td>Sparse GPT</td><td>GBLM Pruner</td><td>GBLM Gradient</td><td>HGLA</td><td>Sparse GPT</td><td>GBLM Pruner</td><td>GBLM Gradient</td><td>HGLA</td><td>Sparse GPT</td><td>GBLM Pruner</td><td>GBLM Gradient</td><td>HGLA</td><td>Sparse GPT</td><td>GBLM Pruner</td><td>GBLM Gradient</td><td>HGLA</td></tr><tr><td rowspan="7">10%</td><td>Left only</td><td>-0.134</td><td>-0.160</td><td>-0.183</td><td>-0.183</td><td>-0.209</td><td>-0.165</td><td>-0.142</td><td>-0.189</td><td>-0.157</td><td>-0.152</td><td>-0.008</td><td>-0.041</td><td>0.002</td><td>-0.062</td><td>-0.011</td><td></td></tr><tr><td>Right only</td><td>-0.152</td><td>-0.146</td><td>-0.123</td><td>-0.199</td><td>-0.124</td><td>-0.176</td><td>-0.165</td><td>-0.137</td><td>-0.183</td><td>-0.158</td><td>-0.035</td><td>-0.050</td><td>0.009</td><td>-0.070</td><td>-0.025</td><td></td></tr><tr><td>Fair input</td><td>-0.134</td><td>-0.159</td><td>-0.227</td><td>-0.188</td><td>-0.136</td><td>-0.142</td><td>-0.175</td><td>-0.212</td><td>-0.114</td><td>-0.124</td><td>-0.076</td><td>-0.021</td><td>-0.033</td><td>-0.024</td><td>-0.027</td><td></td></tr><tr><td>Mixed input</td><td>-0.095</td><td>-0.164</td><td>-0.112</td><td>-0.165</td><td>-0.131</td><td>-0.188</td><td>-0.153</td><td>-0.109</td><td>-0.179</td><td>-0.140</td><td>-0.072</td><td>-0.043</td><td>0.013</td><td>-0.059</td><td>-0.050</td><td></td></tr><tr><td>Biased output</td><td>-0.132</td><td>-0.130</td><td>-0.157</td><td>-0.078</td><td>-0.206</td><td>-0.122</td><td>-0.175</td><td>-0.128</td><td>-0.174</td><td>-0.125</td><td>-0.071</td><td>-0.042</td><td>-0.052</td><td>-0.082</td><td>-0.025</td><td></td></tr><tr><td>Fair output</td><td>-0.108</td><td>-0.154</td><td>-0.208</td><td>-0.166</td><td>-0.237</td><td>-0.162</td><td>-0.173</td><td>-0.138</td><td>-0.127</td><td>-0.118</td><td>-0.027</td><td>-0.028</td><td>-0.027</td><td>-0.021</td><td>-0.056</td><td></td></tr><tr><td>Mixed output</td><td>-0.131</td><td>-0.142</td><td>-0.149</td><td>-0.133</td><td>-0.217</td><td>-0.173</td><td>-0.152</td><td>-0.140</td><td>-0.179</td><td>-0.166</td><td>-0.054</td><td>-0.047</td><td>-0.055</td><td>-0.061</td><td>-0.065</td><td></td></tr><tr><td rowspan="7">20%</td><td>Left only</td><td>-0.149</td><td>-0.155</td><td>-0.168</td><td>-0.162</td><td>-0.161</td><td>-0.153</td><td>-0.132</td><td>-0.138</td><td>-0.167</td><td>-0.164</td><td>-0.016</td><td>-0.015</td><td>-0.005</td><td>-0.057</td><td>0.063</td><td></td></tr><tr><td>Right only</td><td>-0.136</td><td>-0.168</td><td>-0.132</td><td>-0.171</td><td>-0.095</td><td>-0.113</td><td>-0.114</td><td>-0.128</td><td>-0.130</td><td>-0.112</td><td>-0.040</td><td>-0.055</td><td>-0.045</td><td>-0.064</td><td>0.005</td><td></td></tr><tr><td>Fair input</td><td>-0.142</td><td>-0.148</td><td>-0.171</td><td>-0.159</td><td>-0.137</td><td>-0.156</td><td>-0.160</td><td>-0.147</td><td>-0.137</td><td>-0.119</td><td>-0.064</td><td>-0.039</td><td>-0.057</td><td>-0.050</td><td>0.082</td><td></td></tr><tr><td>Mixed input</td><td>-0.139</td><td>-0.149</td><td>-0.181</td><td>-0.152</td><td>-0.187</td><td>-0.144</td><td>-0.171</td><td>-0.150</td><td>-0.153</td><td>-0.156</td><td>-0.055</td><td>-0.033</td><td>-0.059</td><td>-0.059</td><td>-0.008</td><td></td></tr><tr><td>Biased output</td><td>-0.151</td><td>-0.129</td><td>-0.176</td><td>-0.156</td><td>-0.145</td><td>-0.154</td><td>-0.159</td><td>-0.153</td><td>-0.134</td><td>-0.122</td><td>-0.059</td><td>-0.046</td><td>-0.045</td><td>-0.042</td><td>0.017</td><td></td></tr><tr><td>Fair output</td><td>-0.142</td><td>-0.154</td><td>-0.182</td><td>-0.170</td><td>-0.150</td><td>-0.148</td><td>-0.132</td><td>-0.131</td><td>-0.144</td><td>-0.159</td><td>-0.016</td><td>-0.028</td><td>-0.039</td><td>-0.055</td><td>0.072</td><td></td></tr><tr><td>Mixed output</td><td>-0.124</td><td>-0.170</td><td>-0.127</td><td>-0.160</td><td>-0.127</td><td>-0.141</td><td>-0.162</td><td>-0.127</td><td>-0.160</td><td>-0.152</td><td>-0.054</td><td>-0.055</td><td>-0.034</td><td>-0.060</td><td>0.017</td><td></td></tr><tr><td rowspan="7">30%</td><td>Left only</td><td>-0.151</td><td>-0.154</td><td>-0.180</td><td>-0.157</td><td>-0.072</td><td>-0.155</td><td>-0.152</td><td>-0.173</td><td>-0.167</td><td>-0.238</td><td>-0.021</td><td>-0.032</td><td>-0.031</td><td>-0.062</td><td>-0.026</td><td></td></tr><tr><td>Right only</td><td>-0.165</td><td>-0.158</td><td>-0.148</td><td>-0.152</td><td>-0.034</td><td>-0.143</td><td>-0.127</td><td>-0.131</td><td>-0.143</td><td>-0.161</td><td>-0.061</td><td>-0.053</td><td>-0.021</td><td>-0.050</td><td>0.100</td><td></td></tr><tr><td>Fair input</td><td>-0.143</td><td>-0.164</td><td>-0.133</td><td>-0.127</td><td>-0.020</td><td>-0.142</td><td>-0.158</td><td>-0.120</td><td>-0.154</td><td>-0.101</td><td>-0.066</td><td>-0.051</td><td>-0.066</td><td>-0.050</td><td>0.164</td><td></td></tr><tr><td>Mixed input</td><td>-0.150</td><td>-0.162</td><td>-0.146</td><td>-0.128</td><td>-0.087</td><td>-0.143</td><td>-0.165</td><td>-0.162</td><td>-0.144</td><td>-0.213</td><td>-0.070</td><td>-0.045</td><td>-0.015</td><td>-0.057</td><td>-0.017</td><td></td></tr><tr><td>Biased output</td><td>-0.142</td><td>-0.156</td><td>-0.161</td><td>-0.157</td><td>-0.052</td><td>-0.143</td><td>-0.170</td><td>-0.143</td><td>-0.161</td><td>-0.141</td><td>-0.079</td><td>-0.032</td><td>-0.014</td><td>-0.063</td><td>0.112</td><td></td></tr><tr><td>Fair output</td><td>-0.151</td><td>-0.161</td><td>-0.150</td><td>-0.162</td><td>-0.077</td><td>-0.146</td><td>-0.158</td><td>-0.159</td><td>-0.130</td><td>-0.195</td><td>-0.053</td><td>-0.025</td><td>-0.035</td><td>-0.047</td><td>0.079</td><td></td></tr><tr><td>Mixed output</td><td>-0.149</td><td>-0.166</td><td>-0.138</td><td>-0.178</td><td>-0.096</td><td>-0.143</td><td>-0.164</td><td>-0.136</td><td>-0.145</td><td>-0.194</td><td>-0.064</td><td>-0.038</td><td>-0.059</td><td>-0.071</td><td>0.064</td><td></td></tr><tr><td rowspan="7">40%</td><td>Left only</td><td>-0.154</td><td>-0.154</td><td>-0.167</td><td>-0.170</td><td>-0.047</td><td>-0.166</td><td>-0.151</td><td>-0.130</td><td>-0.157</td><td>-0.212</td><td>-0.035</td><td>-0.040</td><td>-0.049</td><td>-0.058</td><td>-0.024</td><td></td></tr><tr><td>Right only</td><td>-0.146</td><td>-0.132</td><td>-0.132</td><td>-0.135</td><td>-0.008</td><td>-0.154</td><td>-0.176</td><td>-0.143</td><td>-0.156</td><td>-0.079</td><td>-0.015</td><td>-0.024</td><td>-0.033</td><td>-0.042</td><td>0.173</td><td></td></tr><tr><td>Fair input</td><td>-0.134</td><td>-0.152</td><td>-0.129</td><td>-0.134</td><td>-0.178</td><td>-0.158</td><td>-0.159</td><td>-0.137</td><td>-0.139</td><td>-0.097</td><td>-0.066</td><td>-0.038</td><td>-0.056</td><td>-0.061</td><td>0.046</td><td></td></tr><tr><td>Mixed input</td><td>-0.149</td><td>-0.137</td><td>-0.152</td><td>-0.140</td><td>0.006</td><td>-0.161</td><td>-0.146</td><td>-0.160</td><td>-0.158</td><td>-0.169</td><td>-0.050</td><td>-0.033</td><td>-0.011</td><td>-0.050</td><td>0.164</td><td></td></tr><tr><td>Biased output</td><td>-0.155</td><td>-0.137</td><td>-0.164</td><td>-0.161</td><td>-0.086</td><td>-0.167</td><td>-0.161</td><td>-0.145</td><td>-0.165</td><td>-0.164</td><td>-0.057</td><td>-0.051</td><td>-0.038</td><td>-0.074</td><td>0.224</td><td></td></tr><tr><td>Fair output</td><td>-0.147</td><td>-0.130</td><td>-0.137</td><td>-0.138</td><td>-0.086</td><td>-0.155</td><td>-0.182</td><td>-0.157</td><td>-0.170</td><td>-0.091</td><td>-0.035</td><td>-0.023</td><td>-0.055</td><td>-0.044</td><td>0.103</td><td></td></tr><tr><td>Mixed output</td><td>-0.149</td><td>-0.147</td><td>-0.131</td><td>-0.140</td><td>-0.041</td><td>-0.159</td><td>-0.151</td><td>-0.128</td><td>-0.158</td><td>-0.110</td><td>-0.053</td><td>-0.046</td><td>-0.057</td><td>-0.065</td><td>0.124</td><td></td></tr></table>
|
| 97 |
+
|
| 98 |
+
(b) Review summarisation
|
| 99 |
+
Table 13: Raw Second-Order SPD
|
| 100 |
+
|
| 101 |
+
<table><tr><td rowspan="2">Sparsity Ratio</td><td rowspan="2">Calibration Sets</td><td colspan="5">Llama3-8B</td><td colspan="5">Gemma-2B</td><td colspan="5">TinyLlama</td></tr><tr><td>Sparse GPT</td><td>GPT</td><td>GBLM Pruner</td><td>GBLM Gradient</td><td>HGLA</td><td>Sparse GPT</td><td>GPT</td><td>GBLM Pruner</td><td>GBLM Gradient</td><td>HGLA</td><td>Sparse GPT</td><td>GPT</td><td>GBLM Pruner</td><td>GBLM Gradient</td><td>HGLA</td></tr><tr><td rowspan="7">10%</td><td>Positive only</td><td>-0.236</td><td>-0.190</td><td>-0.208</td><td>-0.220</td><td>-0.238</td><td>-0.397</td><td>-0.393</td><td>-0.401</td><td>-0.393</td><td>-0.399</td><td>-0.187</td><td>-0.145</td><td>-0.179</td><td>-0.177</td><td>-0.176</td></tr><tr><td>Negative only</td><td>-0.211</td><td>-0.249</td><td>-0.266</td><td>-0.271</td><td>-0.206</td><td>-0.398</td><td>-0.416</td><td>-0.397</td><td>-0.395</td><td>-0.399</td><td>-0.172</td><td>-0.184</td><td>-0.179</td><td>-0.182</td><td>-0.177</td></tr><tr><td>Fair input</td><td>-0.220</td><td>-0.257</td><td>-0.296</td><td>-0.282</td><td>-0.198</td><td>-0.404</td><td>-0.421</td><td>-0.400</td><td>-0.426</td><td>-0.406</td><td>-0.200</td><td>-0.162</td><td>-0.187</td><td>-0.182</td><td>-0.177</td></tr><tr><td>Mixed input</td><td>-0.195</td><td>-0.243</td><td>-0.261</td><td>-0.261</td><td>-0.213</td><td>-0.403</td><td>-0.417</td><td>-0.411</td><td>-0.412</td><td>-0.391</td><td>-0.192</td><td>-0.171</td><td>-0.175</td><td>-0.182</td><td>-0.178</td></tr><tr><td>Biased output</td><td>-0.209</td><td>-0.248</td><td>-0.253</td><td>-0.246</td><td>-0.212</td><td>-0.399</td><td>-0.391</td><td>-0.399</td><td>-0.391</td><td>-0.396</td><td>-0.201</td><td>-0.159</td><td>-0.191</td><td>-0.187</td><td>-0.171</td></tr><tr><td>Fair output</td><td>-0.192</td><td>-0.253</td><td>-0.272</td><td>-0.278</td><td>-0.207</td><td>-0.402</td><td>-0.416</td><td>-0.401</td><td>-0.411</td><td>-0.392</td><td>-0.171</td><td>-0.156</td><td>-0.178</td><td>-0.173</td><td>-0.179</td></tr><tr><td>Mixed output</td><td>-0.183</td><td>-0.238</td><td>-0.240</td><td>-0.222</td><td>-0.205</td><td>-0.399</td><td>-0.402</td><td>-0.385</td><td>-0.392</td><td>-0.395</td><td>-0.190</td><td>-0.164</td><td>-0.175</td><td>-0.191</td><td>-0.180</td></tr><tr><td rowspan="7">20%</td><td>Positive only</td><td>-0.196</td><td>-0.239</td><td>-0.231</td><td>-0.237</td><td>-0.200</td><td>-0.408</td><td>-0.392</td><td>-0.414</td><td>-0.415</td><td>-0.406</td><td>-0.165</td><td>-0.150</td><td>-0.190</td><td>-0.183</td><td>-0.153</td></tr><tr><td>Negative only</td><td>-0.219</td><td>-0.248</td><td>-0.262</td><td>-0.246</td><td>-0.176</td><td>-0.409</td><td>-0.408</td><td>-0.398</td><td>-0.402</td><td>-0.409</td><td>-0.172</td><td>-0.173</td><td>-0.160</td><td>-0.176</td><td>-0.151</td></tr><tr><td>Fair input</td><td>-0.186</td><td>-0.205</td><td>-0.218</td><td>-0.222</td><td>-0.197</td><td>-0.401</td><td>-0.383</td><td>-0.396</td><td>-0.375</td><td>-0.418</td><td>-0.176</td><td>-0.173</td><td>-0.161</td><td>-0.159</td><td>-0.138</td></tr><tr><td>Mixed input</td><td>-0.203</td><td>-0.255</td><td>-0.246</td><td>-0.242</td><td>-0.190</td><td>-0.407</td><td>-0.397</td><td>-0.403</td><td>-0.411</td><td>-0.397</td><td>-0.170</td><td>-0.171</td><td>-0.155</td><td>-0.176</td><td>-0.190</td></tr><tr><td>Biased output</td><td>-0.202</td><td>-0.225</td><td>-0.231</td><td>-0.228</td><td>-0.212</td><td>-0.395</td><td>-0.387</td><td>-0.392</td><td>-0.406</td><td>-0.398</td><td>-0.186</td><td>-0.162</td><td>-0.160</td><td>-0.175</td><td>-0.163</td></tr><tr><td>Fair output</td><td>-0.174</td><td>-0.248</td><td>-0.244</td><td>-0.240</td><td>-0.227</td><td>-0.404</td><td>-0.392</td><td>-0.407</td><td>-0.401</td><td>-0.400</td><td>-0.181</td><td>-0.177</td><td>-0.165</td><td>-0.179</td><td>-0.151</td></tr><tr><td>Mixed output</td><td>-0.206</td><td>-0.215</td><td>-0.207</td><td>-0.265</td><td>-0.208</td><td>-0.399</td><td>-0.402</td><td>-0.391</td><td>-0.401</td><td>-0.398</td><td>-0.178</td><td>-0.154</td><td>-0.171</td><td>-0.162</td><td>-0.176</td></tr><tr><td rowspan="7">30%</td><td>Positive only</td><td>-0.193</td><td>-0.224</td><td>-0.214</td><td>-0.206</td><td>-0.210</td><td>-0.404</td><td>-0.393</td><td>-0.402</td><td>-0.393</td><td>-0.408</td><td>-0.182</td><td>-0.158</td><td>-0.166</td><td>-0.170</td><td>-0.159</td></tr><tr><td>Negative only</td><td>-0.183</td><td>-0.210</td><td>-0.187</td><td>-0.213</td><td>-0.191</td><td>-0.410</td><td>-0.405</td><td>-0.418</td><td>-0.400</td><td>-0.394</td><td>-0.162</td><td>-0.164</td><td>-0.154</td><td>-0.158</td><td>-0.141</td></tr><tr><td>Fair input</td><td>-0.210</td><td>-0.252</td><td>-0.253</td><td>-0.268</td><td>-0.190</td><td>-0.416</td><td>-0.404</td><td>-0.410</td><td>-0.407</td><td>-0.411</td><td>-0.182</td><td>-0.151</td><td>-0.171</td><td>-0.163</td><td>-0.136</td></tr><tr><td>Mixed input</td><td>-0.199</td><td>-0.229</td><td>-0.231</td><td>-0.228</td><td>-0.218</td><td>-0.410</td><td>-0.392</td><td>-0.405</td><td>-0.415</td><td>-0.427</td><td>-0.196</td><td>-0.175</td><td>-0.180</td><td>-0.191</td><td>-0.151</td></tr><tr><td>Biased output</td><td>-0.185</td><td>-0.250</td><td>-0.237</td><td>-0.248</td><td>-0.234</td><td>-0.418</td><td>-0.405</td><td>-0.411</td><td>-0.434</td><td>-0.378</td><td>-0.181</td><td>-0.156</td><td>-0.167</td><td>-0.183</td><td>-0.165</td></tr><tr><td>Fair output</td><td>-0.178</td><td>-0.231</td><td>-0.230</td><td>-0.252</td><td>-0.241</td><td>-0.412</td><td>-0.408</td><td>-0.417</td><td>-0.424</td><td>-0.402</td><td>-0.171</td><td>-0.159</td><td>-0.180</td><td>-0.176</td><td>-0.137</td></tr><tr><td>Mixed output</td><td>-0.182</td><td>-0.227</td><td>-0.236</td><td>-0.251</td><td>-0.224</td><td>-0.408</td><td>-0.401</td><td>-0.404</td><td>-0.402</td><td>-0.431</td><td>-0.196</td><td>-0.153</td><td>-0.165</td><td>-0.162</td><td>-0.173</td></tr><tr><td rowspan="7">40%</td><td>Positive only</td><td>-0.200</td><td>-0.236</td><td>-0.222</td><td>-0.220</td><td>-0.268</td><td>-0.417</td><td>-0.378</td><td>-0.385</td><td>-0.380</td><td>-0.323</td><td>-0.193</td><td>-0.160</td><td>-0.171</td><td>-0.182</td><td>-0.161</td></tr><tr><td>Negative only</td><td>-0.178</td><td>-0.248</td><td>-0.262</td><td>-0.263</td><td>-0.304</td><td>-0.406</td><td>-0.378</td><td>-0.383</td><td>-0.359</td><td>-0.283</td><td>-0.173</td><td>-0.160</td><td>-0.168</td><td>-0.162</td><td>-0.224</td></tr><tr><td>Fair input</td><td>-0.196</td><td>-0.261</td><td>-0.269</td><td>-0.280</td><td>-0.262</td><td>-0.419</td><td>-0.392</td><td>-0.391</td><td>-0.385</td><td>-0.356</td><td>-0.176</td><td>-0.165</td><td>-0.159</td><td>-0.166</td><td>-0.192</td></tr><tr><td>Mixed input</td><td>-0.199</td><td>-0.289</td><td>-0.289</td><td>-0.304</td><td>-0.385</td><td>-0.413</td><td>-0.379</td><td>-0.371</td><td>-0.382</td><td>-0.372</td><td>-0.185</td><td>-0.155</td><td>-0.160</td><td>-0.143</td><td>-0.171</td></tr><tr><td>Biased output</td><td>-0.182</td><td>-0.262</td><td>-0.282</td><td>-0.284</td><td>-0.307</td><td>-0.421</td><td>-0.378</td><td>-0.361</td><td>-0.358</td><td>-0.348</td><td>-0.178</td><td>-0.144</td><td>-0.169</td><td>-0.136</td><td>-0.196</td></tr><tr><td>Fair output</td><td>-0.206</td><td>-0.270</td><td>-0.322</td><td>-0.302</td><td>-0.290</td><td>-0.424</td><td>-0.396</td><td>-0.371</td><td>-0.379</td><td>-0.310</td><td>-0.186</td><td>-0.165</td><td>-0.207</td><td>-0.120</td><td>-0.196</td></tr><tr><td>Mixed output</td><td>-0.218</td><td>-0.272</td><td>-0.344</td><td>-0.315</td><td>-0.377</td><td>-0.436</td><td>-0.381</td><td>-0.313</td><td>-0.380</td><td>-0.347</td><td>-0.174</td><td>-0.140</td><td>-0.173</td><td>-0.082</td><td>-0.183</td></tr></table>
|
| 102 |
+
|
| 103 |
+
Table 14: Political tweet summarisation—Right Information Only Pruned (HGLA vs Wanda)
|
| 104 |
+
|
| 105 |
+
<table><tr><td rowspan="2">Ratio</td><td colspan="3">Llama3-8B</td><td colspan="3">Gemma-2B</td><td colspan="3">TinyLlama</td></tr><tr><td>SPD</td><td>SOF</td><td>UER</td><td>SPD</td><td>SOF</td><td>UER</td><td>SPD</td><td>SOF</td><td>UER</td></tr><tr><td>0.1</td><td>-0.060</td><td>-0.006</td><td>0.006</td><td>-0.046</td><td>0.005</td><td>0.002</td><td>0.038</td><td>-0.007</td><td>0.011</td></tr><tr><td>0.2</td><td>-0.004</td><td>-0.004</td><td>0.000</td><td>0.045</td><td>0.010</td><td>-0.002</td><td>0.077</td><td>0.003</td><td>0.010</td></tr><tr><td>0.3</td><td>0.119</td><td>-0.005</td><td>-0.001</td><td>-0.052</td><td>0.004*</td><td>-0.013</td><td>-0.111*</td><td>0.004*</td><td>0.024</td></tr><tr><td>0.4</td><td>0.170*</td><td>0.003</td><td>0.015</td><td>0.112</td><td>0.015</td><td>0.004</td><td>-0.258*</td><td>0.010</td><td>0.011</td></tr></table>
|
| 106 |
+
|
| 107 |
+
Table 15: Political tweet summarisation—Left Information Only Pruned (HGLA vs Wanda)
|
| 108 |
+
|
| 109 |
+
<table><tr><td rowspan="2">Ratio</td><td colspan="3">Llama3-8B</td><td colspan="3">Gemma-2B</td><td colspan="3">TinyLlama</td></tr><tr><td>SPD</td><td>SOF</td><td>UER</td><td>SPD</td><td>SOF</td><td>UER</td><td>SPD</td><td>SOF</td><td>UER</td></tr><tr><td>0.1</td><td>-0.232</td><td>-0.003*</td><td>-0.001</td><td>-0.035</td><td>0.005</td><td>0.001</td><td>0.065</td><td>-0.012*</td><td>0.015*</td></tr><tr><td>0.2</td><td>-0.134</td><td>0.004</td><td>0.002</td><td>-0.059*</td><td>0.015</td><td>0.000</td><td>-0.037*</td><td>-0.003*</td><td>0.015</td></tr><tr><td>0.3</td><td>0.043</td><td>-0.002</td><td>0.002</td><td>-0.205*</td><td>0.009</td><td>-0.008</td><td>0.037</td><td>-0.007</td><td>0.010</td></tr><tr><td>0.4</td><td>0.092*</td><td>0.001*</td><td>0.019</td><td>-0.153</td><td>0.017</td><td>0.002</td><td>0.040</td><td>-0.004</td><td>0.010</td></tr></table>
|
| 110 |
+
|
| 111 |
+
Table 16: Review summarisation—Positive Information Only Pruned (HGLA vs Wanda)
|
| 112 |
+
|
| 113 |
+
<table><tr><td rowspan="2">Ratio</td><td colspan="3">Llama3-8B</td><td colspan="3">Gemma-2B</td><td colspan="3">TinyLlama</td></tr><tr><td>SPD</td><td>SOF</td><td>UER</td><td>SPD</td><td>SOF</td><td>UER</td><td>SPD</td><td>SOF</td><td>UER</td></tr><tr><td>0.1</td><td>0.020*</td><td>0.000</td><td>-0.003</td><td>-0.013</td><td>-0.001</td><td>0.001</td><td>0.031</td><td>-0.001*</td><td>0.003*</td></tr><tr><td>0.2</td><td>0.097</td><td>-0.003</td><td>0.004</td><td>-0.028*</td><td>0.002</td><td>0.000</td><td>0.077</td><td>-0.001*</td><td>0.002</td></tr><tr><td>0.3</td><td>0.077*</td><td>-0.003</td><td>0.000</td><td>-0.032</td><td>-0.001*</td><td>0.005</td><td>0.064</td><td>-0.001</td><td>0.005</td></tr><tr><td>0.4</td><td>-0.040</td><td>0.001*</td><td>0.003*</td><td>0.140*</td><td>-0.003*</td><td>0.012</td><td>0.061</td><td>-0.001</td><td>-0.001</td></tr></table>
|
| 114 |
+
|
| 115 |
+
Table 17: Review summarisation—Negative Information Only Pruned (HGLA vs Wanda)
|
| 116 |
+
|
| 117 |
+
<table><tr><td rowspan="2">Ratio</td><td colspan="3">Llama3-8B</td><td colspan="3">Gemma-2B</td><td colspan="3">TinyLlama</td></tr><tr><td>SPD</td><td>SOF</td><td>UER</td><td>SPD</td><td>SOF</td><td>UER</td><td>SPD</td><td>SOF</td><td>UER</td></tr><tr><td>0.1</td><td>0.085</td><td>-0.003</td><td>-0.001</td><td>-0.013</td><td>0.001</td><td>0.000</td><td>0.029</td><td>-0.002*</td><td>0.003*</td></tr><tr><td>0.2</td><td>0.145</td><td>-0.003</td><td>0.000</td><td>-0.034*</td><td>0.001</td><td>0.000</td><td>0.080</td><td>-0.001</td><td>0.000</td></tr><tr><td>0.3</td><td>0.114*</td><td>0.001*</td><td>0.001*</td><td>-0.004</td><td>-0.003*</td><td>0.005*</td><td>0.101</td><td>-0.001</td><td>0.007</td></tr><tr><td>0.4</td><td>-0.112</td><td>-0.001</td><td>0.001</td><td>0.219*</td><td>-0.001*</td><td>0.007*</td><td>-0.065*</td><td>0.000</td><td>0.000</td></tr></table>
|
paper_markdowns/bamboo-01478.md
ADDED
|
@@ -0,0 +1,720 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# A Linear N-Point Solver for Structure and Motion from Asynchronous Tracks
|
| 2 |
+
|
| 3 |
+
Hang Su1* Yunlong Feng1* Daniel Gehrig2 Panfeng Jiang1 Ling Gao3 Xavier Lagorce1 Laurent Kneip1,4
|
| 4 |
+
|
| 5 |
+
1 ShanghaiTech University, 2 University of Pennsylvania, 3 Amap, Alibaba Group, 4 Shanghai Engineering Research Center of Intelligent Vision and Imaging
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Structure and continuous motion estimation from point correspondences is a fundamental problem in computer vision that has been powered by well-known algorithms such as the familiar 5-point or 8-point algorithm. However, despite their acclaim, these algorithms are limited to processing point correspondences originating from a pair of views each one representing an instantaneous capture of the scene. Yet, in the case of rolling shutter cameras, or more recently, event cameras, this synchronization breaks down. In this work, we present a unified approach for structure and linear motion estimation from 2D point correspondences with arbitrary timestamps, from an arbitrary set of views. By formulating the problem in terms of first-order dynamics and leveraging a constant velocity motion model, we derive a novel, linear point incidence relation allowing for the efficient recovery of both linear velocity and 3D points with predictable degeneracies and solution multiplicities. Owing to its general formulation, it can handle correspondences from a wide range of sensing modalities such as global shutter, rolling shutter, and event cameras, and can even combine correspondences from different collocated sensors. We validate the effectiveness of our solver on both simulated and real-world data, where we show consistent improvement across all modalities when compared to recent approaches. We believe our work opens the door to efficient structure and motion estimation from asynchronous data. Code can be found at https://github.com/ suhang99/AsyncTrack-Motion-Solver.
|
| 10 |
+
|
| 11 |
+
# 1. Introduction
|
| 12 |
+
|
| 13 |
+
Finding the continuous motion of a single monocular camera is one of the most fundamental problems in the area of geometric computer vision. In the calibrated case, the core of the solution to the visual odometry problem en-
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1. We develop a linear N-point solver for recovering 3D points $\mathbf { P } _ { i }$ and the velocity v of a camera undergoing quasi-linear motion, given a set of timestamped observations $\left( \mathbf { x } _ { i j } , t _ { i j } \right)$ . No assumptions are made about the temporal synchronization of observations $\mathbf { x } _ { i j }$ , yielding a general algorithm that can handle observations from global shutter, rolling-shutter, and fully asynchronous rolling sensors, such as event cameras. Observations $\mathbf { x } _ { i j }$ are converted into rotation compensated bearing vectors $\mathbf { f } _ { i j } ^ { \prime } \doteq$ $\exp \left( \left[ \omega t _ { i j } ^ { \prime } \right] _ { \times } \right) { \bf K } ^ { - 1 } \tilde { \bf x } _ { i j }$ , and used to construct a set of linear point incidence relations. Here $t _ { i j } ^ { \prime } = t _ { i j } - t _ { s }$ denotes relative time, $t _ { s }$ the reference time, K the camera intrinsics, $\omega$ the angular rate, which can be given by an IMU or upstream estimation algorithm.
|
| 17 |
+
|
| 18 |
+
tails the identification of the extrinsic parameters relating a pair of views of a scene, meaning a Euclidean transformation consisting of a relative orientation and an up-to-scale translational displacement. Note however that in the videobased, continuous motion setting, there is only a marginal difference between finding the relative pose and finding local camera dynamics. Indeed, if the images come from a constant-rate video stream, we merely have to divide the relative displacement variables by the frame sampling period to obtain approximate local camera dynamics.1
|
| 19 |
+
|
| 20 |
+
It might not seem obvious, but the primary reason why— in the classical visual odometry scenario—we stick to relative transformation parameters rather than first-order dynamics is the very nature of the sampling mechanism of traditional cameras: Images are sampled synchronously, and—at least in the common case—at a relatively low rate, which easily tends to temporally under-sample more agile camera motion. For this reason, motion estimation is traditionally framed as the recovery of delta transformations, instead of local first-order dynamics. However, with the introduction of temporally denser and notably asynchronously sampling sensors , the consideration of first-order dynamics and a constant velocity motion model becomes a practical necessity.
|
| 21 |
+
|
| 22 |
+
Important examples of such sensors are given by highspeed cameras, rolling shutter cameras, and event cameras. Rolling shutter cameras notably capture images one row at a time, in a quasi-asynchronous way, leading to timestamp differences at different rows of the image, and these differences need to be meaningfully addressed in a given motion estimation algorithm. The event camera on the other hand is a relatively new type of visual sensor [25] and has been a recent enabler of high-speed and low-power computer vision due to its unique working principle. It consists of independent pixels that return an asynchronous stream of per-pixel brightness change measurements, i.e. events. Each event indicates a discrete, signed change in perceived brightness timestamped by a clock with microsecond-level resolution.
|
| 23 |
+
|
| 24 |
+
In this work, we focus on motion estimation using geometric feature-based methods. While a plethora of such methods exist for global shutter and rolling shutter cameras, none manage to natively support features extracted at asynchronous timestamps from potentially row-wise or completely asynchronous sensors. We fill this gap by building upon a recently introduced geometric method for line feature-based motion and structure estimation from asynchronous measurements [10, 11], and extend it to operate on 3D points instead. Originally proposed for event cameras, the solver utilizes a small, sparse set of events generated anywhere along the reprojection of a straight line perceived under constant linear motion. Surprisingly, given sufficient measurements of a single line, it is possible to recover the full 3D location of the straight line as well as a projection of the 3D camera velocity.
|
| 25 |
+
|
| 26 |
+
The present work makes the following contributions:
|
| 27 |
+
|
| 28 |
+
• We propose a new solver for geometric motion and structure estimation from asynchronous, time-stamped reprojections of points measured under the assumption of constant linear motion with known rotation. We thus extend previous line-feature-based solvers by a novel, point-
|
| 29 |
+
|
| 30 |
+
feature based approach, and contribute to a growing theoretical body of geometric incidence relations that operate over dynamics and measurements sampled arbitrarily in space and time.
|
| 31 |
+
|
| 32 |
+
• The proposed method is a single-stage linear solver that operates over an arbitrary number of asynchronous point feature tracks and is highly efficient by employing the Schur complement trick. We furthermore outline the exact conditions under which the full linear velocity becomes observable. Surprisingly, under a linear motion model, three temporal observations of only a single point enable us to recover the full orientation of the displacement baseline as well as the corresponding 3D point.
|
| 33 |
+
• Through our experiments, we demonstrate general applicability of the theory to various types of cameras, including regular global shutter cameras, rolling shutter cameras, and event cameras.
|
| 34 |
+
|
| 35 |
+
# 2. Related Work
|
| 36 |
+
|
| 37 |
+
Geometric Solvers: The geometric solution of camera motion is undoubtedly one of the major success stories of computer vision. Based on epipolar geometry [15], a plethora of algorithms has been proposed to efficiently estimate scene properties and camera parameters from a set of 2D point correspondences (i.e. pixel observations) between two views [34, 43].
|
| 38 |
+
|
| 39 |
+
Relaxing the synchronicity assumption is already required when addressing correspondences captured from rolling shutter images. Important theory has been devised to estimate absolute pose and motion from known 2D-3D correspondences using either linear or polynomial solvers [1, 21, 22, 40]. In particular, Saurer et al. [40] use a similar point incidence relation as the one presented in this work. Unlike these works, our method uses only 2D point measurements and simultaneously solves motion and structure via a linear system. The work in [24] targets homography estimation from point correspondences derived from rolling shutter images, but requires the observed 3D points to be on a plane. Dai et al. [5] also relax the synchronicity assumption, however using a pair-wise epipolar co-planarity constraint instead of the N-point incidence relation proposed in this work. Further related approaches are given by n-linearities [15], visual-inertial bootstrapping approaches [20], or recent works on visual odometry on cars [16]. However—though able to process N-point feature tracks—these approaches are proposed for regularly sampling global shutter cameras, or simply multiple individual cameras. To the best of our knowledge, we propose the first theory that relies on a constant velocity motion model and permits for fully asynchronous measurements.
|
| 40 |
+
|
| 41 |
+
feature extraction and tracking—both data-driven [14, 30, 31], and traditional [12, 13, 23]—as well as visual odometry [18, 19, 27, 33, 36, 39, 45, 48] have already been proposed. A common strategy in many of these works, particularly in learning-based pipelines, is to aggregate events into synchronous, frame-like representations. This approach, however, sidesteps the advantage of event cameras. In parallel, some earlier research explicitly exploit the asynchronous nature of the data, developing methods for motion estimation that operate directly on the event stream. Despite these different approaches, the critical question of closed-form bootstrapping often remains unaddressed. An interesting alternative for event-based motion and structure estimation that processes raw events with their original timestamp is given by contrast maximization [8, 38, 44]. By employing a compact parametric image warping function, events are unwarped into a reference view in which— owing to the sparsity of strong appearance gradients—the entropy of their distribution is minimized. Although the framework has been successfully applied to various problems such as motion estimation, optical flow, and depth estimation [14, 17, 26, 42], it is a computationally intensive approach that involves iterative batch optimization over many events and remains restricted to homographic warping scenarios (e.g. pure rotation, planar scene).
|
| 42 |
+
|
| 43 |
+
Several works [4, 28, 35] also combine event cameras with IMU sensors to address high-speed maneuvers and challenging conditions, leveraging the complementary properties of both sensing modalities. Recent approaches have explored efficient, sparse geometric solvers better suited to the asynchronous nature of event data. Peng et al. [37] and Xu et al. [46] utilize three-view geometry based on 3D lines for camera ego-motion estimation. Gao et al. [10, 11] improve this idea by developing an Npoint linear solver for line and motion estimation, providing new insights into the manifold distribution of the events generated by the observation of a straight line under motion. Built upon this, Zhao et al. [47] propose a new solver for full-DoF motion estimation via rank minimization. Unlike these approaches, our work focuses on asynchronous point feature tracks and exploits their spatio-temporal characteristics for accurate motion estimation.
|
| 44 |
+
|
| 45 |
+
# 3. Methodology
|
| 46 |
+
|
| 47 |
+
We model the observations of $M$ 3D points $\{ \mathbf { P } _ { i } \} _ { i = 1 } ^ { M }$ by a calibrated camera undergoing an arbitrary 6 degrees of freedom (DoF) motion on the time interval $\mathcal { T } = [ t _ { s } - \Delta t , t _ { s } +$ $\Delta t ]$ , with reference time $t _ { s }$ , and half-width $\Delta t$ . We denote the camera pose at time $t \in \tau$ with $\mathbf { C } ( t ) \in S E ( 3 )$ . Throughout this duration we assume each point $\mathbf { P } _ { i } \in \mathbb { R } ^ { 3 }$ to be observed $N _ { i }$ times by a point tracker, leading to spatiotemporal track observations $\mathbf { \Phi } ^ { \mathrm { ~ ~ } } \mathcal { X } _ { i } = \{ ( \mathbf { x } _ { i j } , t _ { i j } ) \} _ { j = 1 } ^ { N _ { i } }$ Ni in the image plane. Each observation $\left( \mathbf { x } _ { i j } , t _ { i j } \right)$ comprises the projec-
|
| 48 |
+
|
| 49 |
+
tion $\mathbf { x } _ { i j }$ of point $\mathbf { P _ { i } }$ at timestamp $t _ { i j }$ in the image plane.
|
| 50 |
+
|
| 51 |
+
Note that no assumption is made on the synchronicity of timestamps $t _ { i j }$ , leading to a very general formulation. This formulation can handle a wide range of tracking scenarios and sensing modalities:
|
| 52 |
+
|
| 53 |
+
1. Tracks derived from a sequence of global shutter images, which may or may not be temporally aligned due to loss of tracking or track initialization.
|
| 54 |
+
2. Row-wise synchronized tracks derived from a rolling shutter camera, where points at different row coordinates do not necessarily share the same timestamp $t _ { i j }$ .
|
| 55 |
+
3. Fully asynchronous feature tracks from an event camera. These tracks may be densely sampled in time and have little to no timestamp coherence.
|
| 56 |
+
|
| 57 |
+
We will show that our solver seamlessly handles all of these cases. In Sec. 3.1, we will present the relevant incidence relation, which forms a set of linear constraints between the point location, camera motion, and point observation. Then, in Sec. 3.2 we will present how to write a set of such constraints as a linear system, before solving it in Sec. 3.3. We discuss properties of the solver in Sec. 3.4. Sec. 3.5 concludes with implementation details.
|
| 58 |
+
|
| 59 |
+
# 3.1. Incidence Relationship
|
| 60 |
+
|
| 61 |
+
We will assume a configuration as illustrated in Fig. 1, where a camera with pose $\mathbf { C } ( t )$ composed of orientation ${ \bf R } ( t )$ and position $\mathbf { p } ( t )$ undergoes quasi-linear dynamics on the small interval $\mathcal { T } = [ t _ { s } - \Delta t , t _ { s } + \Delta t ]$ .
|
| 62 |
+
|
| 63 |
+
Let $\tilde { \mathbf { x } } _ { i j }$ be the 3D homogeneous coordinate of $\mathbf { x }$ and $\mathbf { f } _ { i j } = \mathbf { K } ^ { - 1 } \tilde { \mathbf { x } } _ { i j }$ be the normalized coordinates (i.e. bearing vectors) of the feature tracks previously described. Our incidence relation leverages the fact that the 3D point $\mathbf { P } _ { i }$ observed at time $t _ { i j }$ should project onto the observed point $\mathbf { f } _ { i j }$ . We find the 3D point in camera coordinates $\mathbf { P } _ { i j } ^ { \prime }$ at time $t _ { i j }$ as
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathbf {P} _ {i j} ^ {\prime} = \mathbf {R} ^ {\intercal} \left(t _ {i j}\right) \left(\mathbf {P} _ {i} - \mathbf {p} \left(t _ {i j}\right)\right). \tag {1}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
The above constraint implies that $\mathbf { f } _ { i j }$ and $\mathbf { P } _ { i j } ^ { \prime }$ are parallel, which can be formulated as a constraint on their crossproduct
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
\mathbf {f} _ {i j} \times \left(\mathbf {R} ^ {\intercal} \left(t _ {i j}\right) \left(\mathbf {P} _ {i} - \mathbf {p} \left(t _ {i j}\right)\right)\right) = \mathbf {0} _ {3 \times 1}. \tag {2}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
Using properties of cross products and introducing the rotated bearing $\mathbf { f } _ { i j } ^ { \prime } \doteq \mathbf { R } ( t _ { i j } ) \mathbf { f } _ { i j }$ yields
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\mathbf {f} _ {i j} ^ {\prime} \times \left(\mathbf {P} _ {i} - \mathbf {p} \left(t _ {i j}\right)\right) = \mathbf {0} _ {3 \times 1}, \tag {3}
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
which is our desired incidence relation, also treated in [40]. In the appendix we show that this incidence relation can be specialized to the epipolar constraint used in the familiar 5- point or 8-point algorithm [15] or the line incidence relation used in the recent line solver in [10, 11]. In the next section, we will describe how to use this relation to solve for the 3D points and camera motion.
|
| 82 |
+
|
| 83 |
+
# 3.2. Transition to Linear System
|
| 84 |
+
|
| 85 |
+
Expressing all quantities with respect to the reference frame $\mathbf { C } ( t _ { s } ) \ = \ \mathbf { I } _ { 4 \times 4 }$ at time $t _ { s }$ we expand the motion of the camera with a Taylor Series $\begin{array} { r } { { \bf R } ( t _ { i j } ) \approx \exp ( \left[ \omega t _ { i j } ^ { \prime } \right] _ { \times } ) } \end{array}$ and $\mathbf { p } ( t _ { i j } ) \approx \mathbf { v } t _ { i j } ^ { \prime }$ . We introduce angular rate $\omega$ , linear velocity v and relative timestamp $t _ { i j } ^ { \prime } = t _ { i j } - t _ { s }$ . The operation $[ . ] _ { \times }$ maps vectors to a skew-symmetric matrix. Note that the degree of expansion is arbitrary, and each chosen degree will yield a given system of equations that are linear in the 3D points and body rates. In what follows, however, we will focus on a linear expansion, and will present the arbitrary case in the appendix, and applications in the experiments.
|
| 86 |
+
|
| 87 |
+
As done in previous work, we focus on finding the linear velocity v for a given $\omega$ , which we assume to be given either by an external IMU (as in [11]), or other rotation estimation algorithms [7, 47].
|
| 88 |
+
|
| 89 |
+
We make use of the fact that the cross product with $\mathbf { f } _ { i j } ^ { \prime }$ can be rewritten as a product with $\left[ \mathbf { f } _ { i j } ^ { \prime } \right] _ { \times }$
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} - t _ {i j} ^ {\prime} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {v} = \mathbf {0} _ {3 \times 1}. \qquad (4)
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
We gather all such constraints that involve the point $\mathbf { P } _ { i }$ into a single system of equations.
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\underbrace {\left[ \begin{array}{c c} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} & - t _ {i 1} ^ {\prime} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \\ \vdots & \vdots \\ \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} & - t _ {i N _ {i}} ^ {\prime} \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} \end{array} \right]} _ {\doteq \left[ \begin{array}{c c} \mathbf {F} _ {i} & \mathbf {G} _ {i} \end{array} \right] \in \mathbb {R} ^ {3 N _ {i} \times 6}} \left[ \begin{array}{c} \mathbf {P} _ {i} \\ \mathbf {v} \end{array} \right] = \mathbf {0} _ {3 N _ {i} \times 1} . \qquad (5)
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
In a last step, we stack all such constraints originating from different points $\mathbf { P } _ { i }$ into one large system yielding
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\underbrace {\left[ \begin{array}{c c c c} \mathbf {F} _ {1} & & & \\ & \mathbf {F} _ {2} & & \mathbf {G} _ {1} \\ & & \ddots & \\ & & & \mathbf {F} _ {M} \end{array} \right]} _ {\doteq \mathbf {A} \in \mathbb {R} ^ {3 N \times (3 M + 3)}} \underbrace {\left[ \begin{array}{c} \mathbf {P} _ {1} \\ \mathbf {P} _ {2} \\ \vdots \\ \mathbf {P} _ {M} \\ \mathbf {v} \end{array} \right]} _ {\doteq \mathbf {x} \in \mathbb {R} ^ {3 M + 3}} = \mathbf {0} _ {3 N \times 1}, \quad (6)
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where we call $N = \textstyle \sum _ { i } N _ { i }$ the total number of observations. Finally, we notice that this system imposes a linear constraint on the unknown points $\mathbf { P } _ { i }$ and camera velocity v, and thus it admits an efficient solver, discussed next.
|
| 108 |
+
|
| 109 |
+
# 3.3. Solver
|
| 110 |
+
|
| 111 |
+
The linear system above could be solved with standard tools, by employing a singular value decomposition (SVD) on the matrix A and then recovering the last column of the orthogonal matrix V corresponding to the smallest singular value of A. However, as the number of observations increases, computing the singular value decomposition may
|
| 112 |
+
|
| 113 |
+
start to pose a computational burden. For this reason, we first limit our focus to only recovering v, and then show how to find the $\mathbf { P } _ { i }$ . As we will see, the sparse structure of A allows the derivation of an efficient solver. We start off by left multiplying the linear system by $\mathbf { A } ^ { \top }$ , and writing the resulting system as a block system of equations:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\underline {{\mathbf {A}}} ^ {\mathsf {T}} \mathbf {A} \mathbf {x} = \left[ \begin{array}{l l} \mathbf {M} _ {A} & \mathbf {M} _ {B} \\ \mathbf {M} _ {B} ^ {\mathsf {T}} & \mathbf {M} _ {D} \end{array} \right] \left[ \begin{array}{l} \mathbf {P} _ {1: M} \\ \mathbf {v} \end{array} \right] = \mathbf {0} _ {(3 M + 3) \times 1}, \tag {7}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where we have stacked $\mathbf { P } _ { i }$ into $\mathbf { P } _ { 1 : M }$ , and the dimensions of the subblocks are $\mathbf { M } _ { A } \in \mathbb { R } ^ { 3 M \times 3 M }$ , $\mathbf { M } _ { B } \in \mathbb { R } ^ { 3 M \times 3 }$ and ${ \bf M } _ { D } \in \mathbb { R } ^ { 3 \times 3 }$ . We write out the explicit form of these matrices in the appendix. We then employ the Shur-complement trick to write a system only in v which has the form
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\underbrace {\left(\mathbf {M} _ {D} - \mathbf {M} _ {B} ^ {\mathsf {T}} \mathbf {M} _ {A} ^ {- 1} \mathbf {M} _ {B}\right)} _ {\dot {\mathbf {\Phi}} \mathbf {B} \in \mathbb {R} ^ {3 \times 3}} \mathbf {v} = \mathbf {0}. \tag {8}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
This last equation can be efficiently solved by employing SVD on the matrix B, finding the normalized velocity estimate $\hat { \mathbf { v } }$ as the principle direction corresponding with the smallest singular value of B. Note that the velocity is normalized due to absence of scale in a monocular setup.
|
| 126 |
+
|
| 127 |
+
One may think that the inversion of $\mathbf { M } _ { A }$ in Eq. 8 is expensive since $\mathbf { M } _ { A } \in \mathbb { R } ^ { 3 M \times 3 M }$ leading naively to $O ( M ^ { 3 } )$ complexity. However, the matrix $\mathbf { M } _ { A }$ is actually block diagonal with $M$ blocks of size $3 \times 3$ , leading to an efficient inversion algorithm of complexity $O ( M )$ instead. Moreover, all terms can be computed from a linear combination of terms $[ \mathbf { f } _ { i j } ^ { \prime } ] _ { \times } ^ { 2 } = \mathbf { f } _ { i j } ^ { \prime } { \mathbf { f } _ { i j } ^ { \prime } } ^ { \mathsf { T } } - \| \mathbf { f } _ { i j } ^ { \prime } \| ^ { 2 } \mathbf { I } _ { 3 \times 3 }$ , leading to significant sharing of computation. Finally, having found the estimate $\hat { \mathbf { v } }$ we can find the solution to $\mathbf { P } _ { i }$ as
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\hat {\mathbf {P}} _ {i} = - \left(\mathbf {F} _ {i} ^ {\intercal} \mathbf {F} _ {i}\right) ^ {- 1} \mathbf {F} _ {i} ^ {\intercal} \mathbf {G} _ {i} \hat {\mathbf {v}}, \tag {9}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
which can be done efficiently by reusing computation from Eq. 8. Now let us analyze the properties of our solver, how many solutions it generates, and when it may fail.
|
| 134 |
+
|
| 135 |
+
# 3.4. Solver Properties
|
| 136 |
+
|
| 137 |
+
Solution Multiplicity: We start off by discussing the solution multiplicity of the above solver. The SVD operation in Eq. 8 yields two possible unit vectors $\hat { \mathbf { v } }$ and $- \hat { \mathbf { v } }$ which entail the two possible solutions $\hat { \mathbf { P } } _ { 1 : M }$ and $- \hat { \mathbf { P } } _ { 1 : M }$ . During deployment, we select the correct solution by recognizing that the recovered points $\hat { { \bf P } } _ { i }$ must have positive depth. We thus test for the following condition
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\left(\hat {\mathbf {P}} _ {i}\right) _ {z} = - \left(\left(\mathbf {F} _ {i} ^ {\top} \mathbf {F} _ {i}\right) ^ {- 1} \mathbf {F} _ {i} ^ {\top} \mathbf {G} _ {i} \hat {\mathbf {v}}\right) _ {z} > 0 \tag {10}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
and invert the velocity if it is violated.
|
| 144 |
+
|
| 145 |
+
Degeneracy: Next, let us analyze when degenerate solutions may be encountered. We see that the solution of $\mathbf { v }$
|
| 146 |
+
|
| 147 |
+
in Eq. 8 depends on the inversion of $\mathbf { M } _ { A }$ which in turn depends on the inversion of block diagonal matrices of the form $\mathbf { F } _ { i } ^ { \mathsf { T } } \mathbf { F } _ { i }$ . To successfully invert these matrices, we require that $\mathbf { F } _ { i }$ has a full rank. $\mathbf { F } _ { i }$ is composed of matrices $[ { \bf f } _ { i j } ^ { \prime } ] _ { \times }$ which only have two independent rows. We may thus consider the reduced form of $\mathbf { F } _ { i }$ with size $2 N _ { i } \times 3$ where we have deleted every third row. Thus, to have full rank $N _ { i } \geq 2$ , i.e. we must enforce that every track has at least two different observations. In practice, we do this by simply discarding tracks with only one observation. Finally, enforcing $\mathbf { \hat { a } n k } ( \mathbf { B } ) \geq 2$ ensures that the SVD step succeeds in Eq. 8. For a discussion on the rank of B see the appendix. Constraint Analysis: The system in Eq. 6 has $3 M + 2$ unknowns (number of variables minus one for unobservability of scale), and 3N constraints. However, each $[ { \bf f } _ { i j } ^ { \prime } ] _ { \times }$ only adds two linearly independent constrains, so the number of constraints is actually $2 N$ . Thus recovering all unknowns needs
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
2 N \geq 3 M + 2 \Longrightarrow N \geq \left\lceil \frac {3 M}{2} \right\rceil + 1 \tag {11}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
observations. As discussed above, we require at least two observations per 3D point for stable inversion, i.e.
|
| 154 |
+
|
| 155 |
+
$$
|
| 156 |
+
N \geq 2 M \tag {12}
|
| 157 |
+
$$
|
| 158 |
+
|
| 159 |
+
We now consider four cases:
|
| 160 |
+
|
| 161 |
+
• $M = 1$ : Here $N = N _ { 1 } \geq 3$ leads to a overconstrained system of at least 6 equations with 5 unknowns. Dropping one equation makes this case minimal.
|
| 162 |
+
• $M = 2$ : Here $N \geq 4$ . In particular $N _ { 1 } = N _ { 2 } = 2$ leads to minimal solver with 8 equations in 8 unknowns. For larger $N$ the system becomes overconstrained again.
|
| 163 |
+
• $M = 3$ : Here $N \geq 6$ with $N _ { 1 } = N _ { 2 } = N _ { 3 } = 2$ yielding a minimal system of 12 equations in 12 unknowns.
|
| 164 |
+
• $M > 3$ : Here $N \ge 2 M$ leading to an overconstrained system of $2 N$ equations in $3 M + 2$ unknowns.
|
| 165 |
+
|
| 166 |
+
Interestingly, the first three cases all give rise to minimal 3 point, 4 point or 6 point algorithms. We summarize the complete algorithm in Alg. 1.
|
| 167 |
+
|
| 168 |
+
# 3.5. Implementation Details
|
| 169 |
+
|
| 170 |
+
We derive feature tracks from a variety of input modalities using off-the-shelf trackers, and then embed the proposed point solver into a RANSAC loop. This loop removes outliers from poor tracking, and produces a refined estimate based on the found inliers [6].
|
| 171 |
+
|
| 172 |
+
Feature Tracking: We use off-the-shelf trackers designed for (i) global shutter cameras, (ii) rolling shutter cameras, and (iii) event cameras. Each tracker provides observations $\mathbf { x } _ { i j }$ , which are converted into rotated bearing vectors $\mathbf { f } _ { i j } ^ { \prime }$ , based on IMU angular rate readings $\omega$ . For global shutter cameras, the timestamp $t _ { i j }$ of the observation is simply the image timestamp. For rolling shutter cameras tij − (H−1)Trs $\begin{array} { r } { t _ { i j } - \frac { y _ { i j } } { ( H - 1 ) T _ { \mathrm { r s } } } } \end{array}$ yij
|
| 173 |
+
|
| 174 |
+
# Algorithm 1 N-Point Solver for Structure & Motion
|
| 175 |
+
|
| 176 |
+
Input: A set of track observations $( \mathbf { x } _ { i j } , t _ { i j } )$ , and angular rate $\omega$ from an IMU. Reference time $t _ { s }$ .
|
| 177 |
+
|
| 178 |
+
Output: Estimates of points $\hat { { \bf P } } _ { i }$ and linear velocity $\hat { \mathbf { v } }$ .
|
| 179 |
+
|
| 180 |
+
• Compute rotated bearing vectors $\mathbf { f } _ { i j } ^ { \prime } = \exp \left( [ \omega t _ { i j } ^ { \prime } ] _ { \times } \right) \mathbf { f } _ { i j }$ .
|
| 181 |
+
• Compute $\mathbf { F } _ { i }$ and $\mathbf { G } _ { i }$ in Eq. 5. Ensure that ra $\mathrm { n k } ( \mathbf { F } _ { i } ) = 3$ otherwise terminate.
|
| 182 |
+
• Compute B in Eq. 8 and solve for $\hat { \mathbf { v } }$ . Terminate if the rank of B is smaller than 2.
|
| 183 |
+
• Compute $\hat { { \bf P } } _ { i }$ from Eq. 9.
|
| 184 |
+
• Check the depth via inequality Eq. 10. If it is negative, invert the signs of $\hat { { \bf P } } _ { i }$ and $\hat { \mathbf { v } } _ { i }$ .
|
| 185 |
+
|
| 186 |
+
is corrected by the row index $y _ { i j }$ scaled by the row scanning time $T _ { \mathrm { r s } }$ , and height in pixels $H$ of the sensor. For event cameras, timestamps are assigned based on measured events, resulting in asynchronous tracks. Tracks shorter than 2 are pruned to avoid degeneracy in the solver.
|
| 187 |
+
|
| 188 |
+
RANSAC: In each iteration of RANSAC we perform the following three steps: First, to balance computational complexity with spatio-temporal distribution, we sample $M$ feature tracks, and then $N _ { i } = n \ge 2$ temporally distributed observations $( \mathbf { f } _ { i j } ^ { \prime } , t _ { i j } ^ { \prime } )$ . Then, we generate a velocity hypothesis $\hat { \mathbf { v } }$ based on the $\begin{array} { r } { N = \sum _ { i } N _ { i } } \end{array}$ observations following the solver in Sec. 3.3, and rejecting the solution yielding negative point depth. Next, inliers are identified via the consistency of $\hat { \mathbf { v } }$ with observations $( \mathbf { f } _ { i j } ^ { \prime } , t _ { i j } )$ . For track $i$ , we predict the 3D point $\hat { { \bf P } } _ { i }$ from Eq. 9, map it into the frame at each time $t _ { i j }$ , resulting in $\hat { \mathbf { P } } _ { i j } ^ { \prime } = \hat { \mathbf { P } } _ { i } - \hat { \mathbf { v } } t _ { i j } ^ { \prime }$ and then project it into the current frame, yielding bearing estimate $\hat { \mathbf { f } } _ { i j } ^ { \prime }$ . We use the average angular residual $\bar { \theta }$ between the observed and estimated bearing vectors along the track as error metric
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\bar {\theta} _ {i} = \frac {1}{N _ {i}} \sum_ {j = 1} ^ {N _ {i}} \operatorname {a r c c o s} \left(\frac {\mathbf {f} _ {i j} ^ {\prime \mathsf {T}} \hat {\mathbf {f}} _ {i j} ^ {\prime}}{\| \mathbf {f} _ {i j} ^ {\prime} \| \| \hat {\mathbf {f}} _ {i j} ^ {\prime} \|}\right) \tag {13}
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
A track is classified as an inlier if ${ \bar { \theta _ { i } } }$ is lower than a certain threshold (e.g. 5◦), and the hypothesis with the highest number of inliers is retained throughout iteration.
|
| 195 |
+
|
| 196 |
+
After termination, the inliers corresponding with the best hypothesis are used to estimate the hypothesis $\hat { \mathbf { v } }$ leading to a refined estimate. The inlier ratio serves as a confidence metric reflecting the solver’s robustness to outlier tracks.
|
| 197 |
+
|
| 198 |
+
# 4. Experiments
|
| 199 |
+
|
| 200 |
+
We comprehensively evaluate the performance of the proposed point solver, in two stages: First, we validate our method in a simulated environment (Sec. 4.1), where we study its sensitivity to different noise source including timestamp jitter, pixel noise and noise on the angular rate readings. We also study its accuracy as a function of the number of tracks and number of observations per track.
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Figure 2. Left: Pixel noise sensitivity; Middle: Timestamp jitter impact; Right: Rotation perturbation effects. Each plot compares three observation levels with the number of features and the number of observation per track: sparse (5-5), moderate (20-20), and dense (100-50). Shaded regions represent error bounds across 1000 trials.
|
| 208 |
+
|
| 209 |
+
In a second step, we then report results in real world settings (Sec. 4.2), where we study its application to tracks derived from global-shutter, rolling-shutter and event-based cameras. Throughout the experimental section, we will report the accuracy of the scale-less velocity similar to [11], which is defined as the angular error between the true velocity $\mathbf { v } _ { \mathrm { g t } }$ and estimate $\hat { \mathbf { v } }$ by
|
| 210 |
+
|
| 211 |
+
$$
|
| 212 |
+
\theta_ {\text {e r r}} = \arccos \left(\frac {\mathbf {v} _ {\mathrm {g t}} ^ {\mathsf {T}} \hat {\mathbf {v}}}{\| \mathbf {v} _ {\text {t r u e}} \| \| \hat {\mathbf {v}} \|}\right) \tag {14}
|
| 213 |
+
$$
|
| 214 |
+
|
| 215 |
+
Errors in 3D point estimation are not reported, as they are typically subsumed in the velocity error. In the appendix, we also apply our method for normalized acceleration estimation, with a similar error metric as above.
|
| 216 |
+
|
| 217 |
+
# 4.1. Simulation Experiments
|
| 218 |
+
|
| 219 |
+
We set a virtual camera with a resolution of $6 4 0 \times 4 8 0$ and a focal length of 320 pixels. A velocity vector with fixed magnitude $\| \mathbf { v } \| = 1 m / s$ and random direction is generated to simulate camera motion. Static 3D points are randomly distributed within a one-meter cubic volume positioned two meters in front of the camera. This ensures that no points cross the camera plane during the motion. Observations are generated over a sliding time window of 0.2 seconds, with timestamps uniformly sampled within this interval. Each scenario is repeated 1,000 times to ensure statistical significance. Our solver achieves a minimal-case runtime of $6 3 \mu \mathrm { s }$ on CPU (Intel Xeon Platinum $8 3 5 2 \mathrm { V } @ 3 . 5 \mathrm { G H z } )$ . In the following sections, we analyze three key factors: noise resilience, observation count and track length.
|
| 220 |
+
|
| 221 |
+
# 4.1.1. Analysis of Noise Resilience
|
| 222 |
+
|
| 223 |
+
We first evaluate the solver’s robustness under three noise sources: inaccurate point tracking, temporal misalignment, and orientation drift in camera pose. As illustrated in Fig. 2, experiments vary noise level across practical ranges: pixel noise (0 - 5 pixels), timestamp jitter (0 - 50ms), and rotational perturbation (angular velocity noise of $0 - 3 0 \mathrm { d e g / s } )$ ,
|
| 224 |
+
|
| 225 |
+
while testing three different settings of observation. The results demonstrate that the solver achieves sub- $5 ^ { \circ }$ error at moderate noise levels (1 pixels, 10 ms jitter, 5 deg/s), validating its feasibility in typical operational scenarios. Notably, timestamp jitter exhibits a nonlinear error escalation, with error rising sharply beyond 15 ms. In contrast, pixel noise induces near-linear error scaling, suggesting the tolerance to common feature-tracking inaccuracies, while rotation perturbation has linear impact on the performance. We also notice more observations can effectively mitigate errors due to pixel noise and timestamp jitter, yet yield limited improvement for rotation-induced errors. Nevertheless, external sensor such as IMU can address this limitation by providing rotation-compensated inputs.
|
| 226 |
+
|
| 227 |
+
# 4.1.2. Analysis of Spatial-temporal Observations
|
| 228 |
+
|
| 229 |
+
We also analyzed the effects of feature track count $M$ and per-track observation number $N _ { i } ~ = ~ n$ under two combined noise conditions: $\mathrm { 1 p x + 1 m s + 2 d e g / s }$ and $\mathrm { 2 p x + }$ $\mathrm { 2 m s + 5 d e g / s }$ . In general, track count $( M )$ correlates with spatial resolution—high-resolution cameras (e.g. regular frame-based sensors) can maintain hundreds of tracks spatially. Observation count $N _ { i } = n ,$ ) depends on temporal resolution: event cameras, with microsecond-level precision, can densely sample a track over short time windows, enabling high $n$ values (e.g. 50 observations) even in constrained durations, which explains our choice of the upper bound. As shown in Fig. 3 (left), increasing tracks from 3 to 30 significantly reduces velocity errors under both noise levels, but has marginal gains beyond 30 tracks. In contrast, raising observation counts per track under fixed time windows (Fig. 3 right) shows limited efficacy. Thus, the interplay between $M$ and $n$ reflects sensor-specific spatiotemporal trade-offs: frame-based systems excel in spatial coverage (high $M$ ) with temporally sparse measurements, while event cameras leverage temporal uniformity (high n) despite lower track counts. This highlights how sensor archi-
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
Figure 3. Track count (left) vs. Observation count per track (right). Box colors indicate noise levels (green: low, violet: high).
|
| 235 |
+
|
| 236 |
+

|
| 237 |
+
Figure 4. Velocity errors vs. time window length and noise.
|
| 238 |
+
|
| 239 |
+
tecture shapes robustness under multi-source noise.
|
| 240 |
+
|
| 241 |
+
# 4.1.3. Analysis of Track Length
|
| 242 |
+
|
| 243 |
+
We further analyze the impact of the track length– determined by the temporal observation window–on velocity estimation. The time interval indicates the spatial displacement of feature tracks on the imaging plane: longer windows generally provide longer tracks, as features travel larger pixel distances under camera or scene motion. As illustrated in Fig. 4, we indirectly control track length by varying the size of the time window. Under combined noise conditions, larger time windows consistently improve the solver’s robustness. Longer tracks are able to average out high-frequency noise which enables the solver to recover stable velocity estimates. It also suggests that 3D points with smaller depth that induce larger apparent motion on the imaging plane can provide more reliable results. Notably, event cameras, which maintain temporally uniform observations, can benefit from larger time window.
|
| 244 |
+
|
| 245 |
+
# 4.2. Real Experiments
|
| 246 |
+
|
| 247 |
+
In a next step, we deploy our solver on real data collected with three different sensing modalities (as described in Sec. 3) using public datasets: The Event Camera Dataset [32] was collected using a DAVIS camera [2] which provides a pixel-aligned and time-synchronized stream of global shutter $2 4 0 \times 1 8 0 @ 2 4 \mathrm { H z } )$ and event camera data,
|
| 248 |
+
|
| 249 |
+
as well as IMU measurements. The VECtor dataset [9] provides event camera data and global shutter frames $\mathrm { 1 2 2 4 \times }$ $1 0 2 4 @ 3 0 \mathrm { H z } )$ from a stereo rig, as well as IMU data. Finally, the TUM dataset [41] provides rolling shutter images $( 1 2 8 0 \times 1 0 2 4 @ 2 0 \mathrm { H z } )$ . We compare our method against eventail [11], an asynchronous line-based velocity solver. It uses clusters of events, each generated by a separate line to regress velocity components, and fuses these to a full normalized velocity via velocity averaging. On rolling shutter images we implement a similar baseline based on eventail, termed eventail $+ \ \mathrm { R S }$ . eventail $+ \ \mathrm { R S }$ first extracts Canny edges [3] from the rolling shutter images, and then treats the detected points as events with timestamps assigned according to their row index. We do not report acceleration estimation results on real data due to high noise sensitivity, and leave addressing this challenge for future work.
|
| 250 |
+
|
| 251 |
+
Experimental Setup: For global and rolling shutter images, we employ the standard Kanade-Lucas-Tomasi Tracker [29]. For global shutter images we assign timestamps at the midpoint of the exposure time. For rolling shutter images we compute timestamps based on the row index of the feature and scanning time. For event camera data we use the recent learning-based point tracker ETAP [14] to generate point tracks that preserve the high temporal resolution. To ensure the numerical stability of the solver, we filter out tracks shorter than 10 pixels, as these often amplify noise. All methods operate within identical time windows to enable fair comparison. In each sequence we use angular rates measured by an IMU to rotation compensate the bearing vectors. The RANSAC pipeline is configured with a maximum iteration of 200, with each iteration sampling $M = 4$ randomly selected tracks containing $N _ { i } = 5$ observations. A point track is classified as an inlier if its angular error falls below $5 ^ { \circ }$ . To speed up convergence, we terminate RANSAC when the inlier ratio exceeds 0.9.
|
| 252 |
+
|
| 253 |
+
Application to Global Shutter Cameras We report the result of our method in Tab. 1. It can be seen that our method using global shutter images achieves a lower error than the eventail solver operating on events. This is due to two effects: First, the eventail solver relies on extracting events
|
| 254 |
+
|
| 255 |
+
Table 1. Mean / median velocity error in degrees on tracks from global shutter images. * and gray: results on subset with track inlier ratio $> 0 . 9$ . eventail $+ \textrm { E }$ uses events from an event camera.
|
| 256 |
+
|
| 257 |
+
<table><tr><td>Seq.</td><td>eventail [11] + E</td><td>Ours</td><td>Ours*</td></tr><tr><td>desk-normal</td><td>22.7 / 23.4</td><td>15.1 / 8.5</td><td>10.2 / 7.3</td></tr><tr><td>sofa-normal</td><td>21.9 / 17.6</td><td>15.9 / 7.8</td><td>9.8 / 6.3</td></tr><tr><td>mountain-normal</td><td>25.2 / 21.4</td><td>17.1 / 7.5</td><td>10.9 / 6.1</td></tr><tr><td>shapes Translation</td><td>31.8 / 32.7</td><td>17.1 / 7.2</td><td>9.9 / 6.2</td></tr><tr><td>boxes Translation</td><td>34.8 / 34.1</td><td>16.5 / 11.6</td><td>13.3 / 10.7</td></tr></table>
|
| 258 |
+
|
| 259 |
+
Table 2. Mean / median velocity error in degrees on tracks from rolling shutter images. * and gray: results on subset with inlier ratio $> 0 . 9$ . eventail $+ \mathrm { R } S$ uses canny edges from rolling shutter images. “no correction”: no rolling shutter timestamp correction.
|
| 260 |
+
|
| 261 |
+
<table><tr><td rowspan="2">Seq.</td><td colspan="3">with correction</td><td colspan="2">no correction</td></tr><tr><td>eventail [11] + RS</td><td>Ours</td><td>Ours*</td><td>Ours</td><td>Ours*</td></tr><tr><td>Seq 4</td><td>43.8 / 40.8</td><td>27.5 / 20.1</td><td>22.6 / 17.4</td><td>28.1 / 22.9</td><td>22.8 / 15.7</td></tr><tr><td>Seq 5</td><td>45.5 / 44.8</td><td>24.7 / 17.0</td><td>19.3 / 13.8</td><td>27.0 / 18.4</td><td>19.2 / 14.6</td></tr></table>
|
| 262 |
+
|
| 263 |
+
generated by 3D lines in the scene, which is limited to highly geometric structures. By contrast our method can rely on tracks which can be extracted more easily. The second effect is the use of images vs. events. Events are known to suffer from changing appearance due motion changes, leading to drift in the feature tracks [12, 13]. We will see later that combining tracks from colocated GS cameras and events can improve results, even beyond the results using global shutter cameras alone. Next, we focus on the results marked with *, indicating evaluation on the subset where over $90 \%$ of tracks are termed inliers. On this subset, errors are further reduced, showing the importance of having geometrically consistent observations.
|
| 264 |
+
|
| 265 |
+
Application to Rolling Shutter Cameras We report the results of our method in Tab. 2. We see that our point solver yields a significant improvement with respect to the eventail solver. This is mainly due to the fact that eventail found few lines in the presented sequences. By contrast, our method relies on feature tracks which are more easily extracted. We also show a result without rolling shutter timestamp correction, denoted with “no correction”. It is visible that this reduces the accuracy of the method by a few degrees, showing the benefit of correct timestamp association, and the flexibility of our method to take non-synchronized feature tracks into account. Finally, as before we see that results on the subset marked with * are better, indicating the importance of geometrically consistent tracks for estimation.
|
| 266 |
+
|
| 267 |
+
Application to Event-based Cameras Finally, we apply our method to tracks derived from an event-based camera, and show results in Tab. 3. Our point solver running on events alone outperforms eventail by $1 0 \mathrm { ~ - ~ } 3 0 \%$ , and this is again due to the use of point tracks instead of lines. Interestingly, frame-based tracks yield better perfor-
|
| 268 |
+
|
| 269 |
+
Table 3. Mean / median velocity error in degrees on tracks from events. * and gray: results on subset with track inlier ratio $> 0 . 9$ . E stands for events from an event camera. $\mathrm { E } { + } \mathrm { G } \mathrm { S }$ refers to our method combining tracks from events and global shutter images. Note that for - no collocated GS and event sensor are available.
|
| 270 |
+
|
| 271 |
+
<table><tr><td>Seq.</td><td>eventail [11] + E</td><td>Ours + E</td><td>Ours* + E</td><td>Ours + E + GS</td><td>Ours* + E + GS</td></tr><tr><td>desk-normal</td><td>22.7 / 23.4</td><td>19.3 / 17.8</td><td>14.2 / 14.2</td><td>-</td><td>-</td></tr><tr><td>sofa-normal</td><td>21.9 / 17.6</td><td>19.0 / 18.5</td><td>16.3 / 14.9</td><td>-</td><td>-</td></tr><tr><td>mountain-normal</td><td>25.2 / 21.4</td><td>17.1 / 16.1</td><td>16.9 / 15.8</td><td>-</td><td>-</td></tr><tr><td>shapes Translation</td><td>31.8 / 32.7</td><td>16.8 / 10.1</td><td>13.0 / 9.1</td><td>14.4 / 7.5</td><td>7.0 / 6.7</td></tr><tr><td>boxes Translation</td><td>34.3 / 34.1</td><td>12.6 / 10.0</td><td>12.1 / 7.7</td><td>10.3 / 8.1</td><td>9.3 / 5.9</td></tr></table>
|
| 272 |
+
|
| 273 |
+
mance than event-based ones, particularly on the VECtor sequences. This aligns with our simulation findings where higher feature density (from frame cameras’ $5 \times$ resolution advantage over event cameras) improves spatial sampling. We show the benefit of combining tracks from different sensing modalities, denoted with $\mathbf { E } { + } \mathrm { G } \mathbf { S }$ . In particular, the sequences shapes translation and boxes translation were recorded with a DAVIS camera [2] which features pixels that simultaneously record events and global shutter images. In this setting, we see that adding images significantly reduces errors. Moreover, comparing to Tab. 1 we also see that adding events improves over the global shutter result, highlighting the complementarity of the sensors. This result highlights the benefit of having an asynchronous point solver that can flexibly incorporate both global shutter and event-based observations.
|
| 274 |
+
|
| 275 |
+
# 5. Future Work and Conclusion
|
| 276 |
+
|
| 277 |
+
Future Work: While we believe that the proposed solver makes a significant stride toward handling asynchronous tracks in an efficient way, we acknowledge its dependence on available angular rates from an IMU. Initial steps have been made in incorporating angular rate estimation into existing solvers [10, 11], but further work is needed to make these solvers efficient. Finally, we only show linear acceleration estimation in simulation (see appendix), and found significant challenges with noise on real-world data. This indicates estimation stability issues for higher-order derivatives. Future work should aim to identify and reduce the effect of noise on higher-order derivative estimation.
|
| 278 |
+
|
| 279 |
+
Conclusion: We present a linear N-point solver for recovering structure and linear motion from asynchronous feature tracks. It generalizes solvers that rely on additional structure constraints such as points lying on a line, or time constraints, such as assuming synchronized timestamps. We showed experimentally that the motions recovered by our solver are more accurate than those produced by previous work, and also more robust in natural, line-deprived environments. We believe that our solver sets the stage for many new innovations to come by enabling the seamless integration of asynchronous feature tracks into geometric solvers.
|
| 280 |
+
|
| 281 |
+
# Acknowledgments
|
| 282 |
+
|
| 283 |
+
# References
|
| 284 |
+
|
| 285 |
+
[1] Cenek Albl, Zuzana Kukelova, Viktor Larsson, and Tomas Pajdla. Rolling shutter camera absolute pose. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 42(6):1439–1452, 2020. 2
|
| 286 |
+
[2] Christian Brandli, Raphael Berner, Minhao Yang, Shih-Chii Liu, and Tobi Delbruck. A $2 4 0 \times 1 8 0$ 130db $3 \mu \mathrm { s }$ latency global shutter spatiotemporal vision sensor. IEEE Journal of Solid-State Circuits, 49(10):2333–2341, 2014. 7, 8
|
| 287 |
+
[3] John Canny. A computational approach to edge detection. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), PAMI-8(6):679–698, 1986. 7
|
| 288 |
+
[4] William Chamorro, Joan Sola, and Juan Andrade-Cetto. ` Event-imu fusion strategies for faster-than-imu estimation throughput. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3976– 3983, 2023. 3
|
| 289 |
+
[5] Yuchao Dai, Hongdong Li, and Laurent Kneip. Rolling shutter camera relative pose: Generalized epipolar geometry. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4132–4140, 2016. 2
|
| 290 |
+
[6] Martin A. Fischler and Robert C. Bolles. Random sample consensus: A paradigm for model fitting with applications to image analysis and automated cartography. Communications of the ACM, 24(6):381–395, 1981. 5
|
| 291 |
+
[7] Guillermo Gallego and Davide Scaramuzza. Accurate angular velocity estimation with an event camera. IEEE Robotics and Automation Letters, 2(2):632–639, 2017. 4
|
| 292 |
+
[8] Guillermo Gallego, Henri Rebecq, and Davide Scaramuzza. A unifying contrast maximization framework for event cameras, with applications to motion, depth and optical flow estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 3867–3876, 2018. 3
|
| 293 |
+
[9] Ling Gao, Yuxuan Liang, Jiaqi Yang, Shaoxun Wu, Chenyu Wang, Jiaben Chen, and Laurent Kneip. VECtor: A versatile event-centric benchmark for multi-sensor slam. IEEE Robotics and Automation Letters, 7(3):8217–8224, 2022. 7
|
| 294 |
+
[10] Ling Gao, Hang Su, Daniel Gehrig, Marco Cannici, Davide Scaramuzza, and Laurent Kneip. A 5-point minimal solver for event camera relative motion estimation. In Proceedings of the International Conference on Computer Vision (ICCV), pages 8015–8025, 2023. 2, 3, 8
|
| 295 |
+
[11] Ling Gao, Daniel Gehrig, Hang Su, Davide Scaramuzza, and Laurent Kneip. A linear n-point solver for line and motion estimation with event cameras. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2024. 2, 3, 4, 6, 7, 8, 12
|
| 296 |
+
|
| 297 |
+
This research has been supported by project 62250610225 by the Natural Science Foundation of China, as well as projects 22DZ1201900, and dfycbj-1 by the Natural Science Foundation of Shanghai and project 225354 of the Swiss National Science Foundation.
|
| 298 |
+
[12] Daniel Gehrig, Henri Rebecq, Guillermo Gallego, and Davide Scaramuzza. Asynchronous, photometric feature tracking using events and frames. In Proceedings of the European Conference on Computer Vision (ECCV), pages 750– 765, 2018. 3, 8
|
| 299 |
+
[13] Daniel Gehrig, Henri Rebecq, Guillermo Gallego, and Davide Scaramuzza. Eklt: Asynchronous photometric feature tracking using events and frames. International Journal of Computer Vision (IJCV), 128(3):601–618, 2020. 3, 8
|
| 300 |
+
[14] Friedhelm Hamann, Daniel Gehrig, Filbert Febryanto, Kostas Daniilidis, and Guillermo Gallego. Event-based tracking of any point with motion-robust correlation features. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 18–37. Springer, 2025. 3, 7
|
| 301 |
+
[15] Richard Hartley and Andrew Zisserman. Multiple View Geometry in Computer Vision. Cambridge University Press, 2004. 2, 3
|
| 302 |
+
[16] Kun Huang, Yifu Wang, and Laurent Kneip. Motion estimation of non-holonomic ground vehicles from a single feature correspondence measured over n views. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 12698–12707, 2019. 2
|
| 303 |
+
[17] Haram Kim and H Jin Kim. Real-time rotational motion estimation with contrast maximization over globally aligned events. IEEE Robotics and Automation Letters, 6(3):6016��� 6023, 2021. 3
|
| 304 |
+
[18] Hanme Kim, Stefan Leutenegger, and Andrew J. Davison. Real-time 3d reconstruction and 6-dof tracking with an event camera. In Proceedings of the European Conference on Computer Vision (ECCV), pages 349–364, 2016. 3
|
| 305 |
+
[19] Simon Klenk, Marvin Motzet, Lukas Koestler, and Daniel Cremers. Deep event visual odometry. In International Conference on 3D Vision (3DV), pages 739–749. IEEE, 2024. 3
|
| 306 |
+
[20] Laurent Kneip, Agostino Martinelli, Stephan Weiss, Davide Scaramuzza, and Roland Siegwart. Closed-form solution for absolute scale velocity determination combining inertial measurements and a single feature correspondence. In Proceedings of the IEEE International Conference on Robotics and Automation (ICRA), pages 4546–4553. IEEE, 2011. 2
|
| 307 |
+
[21] Zuzana Kukelova, Cenek Albl, Akihiro Sugimoto, and Tomas Pajdla. Linear solution to the minimal absolute pose rolling shutter problem. In Proceedings of the Asian Conference on Computer Vision (ACCV), pages 265–280, Cham, 2019. Springer International Publishing. 2
|
| 308 |
+
[22] Zuzana Kukelova, Cenek Albl, Akihiro Sugimoto, Konrad Schindler, and Tomas Pajdla. Minimal rolling shutter absolute pose with unknown focal length and radial distortion. In Proceedings of the European Conference on Computer Vision (ECCV), pages 698–714. Springer, 2020. 2
|
| 309 |
+
[23] Xavier Lagorce, Sio-Hoi Ieng, Xavier Clady, Michael Pfeiffer, and Ryad B Benosman. Spatiotemporal features for asynchronous event-based data. Frontiers in neuroscience, 9:46, 2015. 3
|
| 310 |
+
[24] Yizhen Lao and Omar Ait-Aider. Rolling shutter homography and its applications. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 43(8):2780–2793, 2021. 2
|
| 311 |
+
|
| 312 |
+
[25] Patrick Lichtensteiner, Christoph Posch, and Tobi Delbruck. A $1 2 8 \times 1 2 8$ 120db $1 5 \mu \mathrm { s }$ latency asynchronous temporal contrast vision sensor. IEEE Journal of Solid-State Circuits (JSSC), 43(2):566–576, 2008. 2
|
| 313 |
+
[26] Daqi Liu, Alvaro Parra, and Tat-Jun Chin. Globally optimal contrast maximisation for event-based motion estimation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 6348–6357, 2020. 3
|
| 314 |
+
[27] Daqi Liu, Alvaro Parra, and Tat-Jun Chin. Spatiotemporal registration for event-based visual odometry. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 4937–4946, 2021. 3
|
| 315 |
+
[28] Xiuyuan Lu, Yi Zhou, Junkai Niu, Sheng Zhong, and Shaojie Shen. Event-based visual inertial velometer. In Proceedings of Robotics: Science and Systems (RSS), 2024. 3
|
| 316 |
+
[29] Bruce D. Lucas and Takeo Kanade. An iterative image registration technique with an application to stereo vision. In Proceedings of the International Joint Conference on Artificial Intelligence (IJCAI), pages 674–679. William Kaufmann, 1981. 7
|
| 317 |
+
[30] Nico Messikommer*, Carter Fang*, Mathias Gehrig, and Davide Scaramuzza. Data-driven feature tracking for event cameras. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2023. 3
|
| 318 |
+
[31] Nico Messikommer, Carter Fang, Mathias Gehrig, Giovanni Cioffi, and Davide Scaramuzza. Data-driven feature tracking for event cameras with and without frames. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 2025. 3
|
| 319 |
+
[32] Elias Mueggler, Henri Rebecq, Guillermo Gallego, Tobi Delbruck, and Davide Scaramuzza. The event-camera dataset and simulator: Event-based data for pose estimation, visual odometry, and slam. International Journal of Robotics Research (IJRR), 36(2):142–149, 2017. 7
|
| 320 |
+
[33] Elias Mueggler, Guillermo Gallego, Henri Rebecq, and Davide Scaramuzza. Continuous-time visual-inertial odometry for event cameras. IEEE Transactions on Robotics (T-RO), 34(6):1425–1440, 2018. 3
|
| 321 |
+
[34] D. Nister. An efficient solution to the five-point relative pose problem. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 26(6):756–770, 2004. 2
|
| 322 |
+
[35] Junkai Niu, Sheng Zhong, Xiuyuan Lu, Shaojie Shen, Guillermo Gallego, and Yi Zhou. Esvo2: Direct visualinertial odometry with stereo event cameras. arXiv preprint arXiv:2410.09374, 2024. 3
|
| 323 |
+
[36] Roberto Pellerito, Marco Cannici, Daniel Gehrig, Joris Belhadj, Olivier Dubois-Matra, Massimo Casasco, and Davide Scaramuzza. Deep visual odometry with events and frames. In Proceedings of the IEEE/RSJ Conference on Intelligent Robots and Systems (IROS), 2024. 3
|
| 324 |
+
[37] Xin Peng, Wanting Xu, Jiaqi Yang, and Laurent Kneip. Continuous event-line constraint for closed-form velocity initialization. In Proceedings of the British Machine Vision Conference (BMVC), 2021. 3
|
| 325 |
+
[38] Xin Peng, Ling Gao, Yifu Wang, and Laurent Kneip. Globally-optimal contrast maximisation for event cameras.
|
| 326 |
+
|
| 327 |
+
IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 44(7):3479–3495, 2022. 3
|
| 328 |
+
[39] Henri Rebecq, Timo Horstschafer, Guillermo Gallego, and ¨ Davide Scaramuzza. EVO: A geometric approach to eventbased 6-dof parallel tracking and mapping in real-time. IEEE Robotics and Automation Letters, 2(2):593–600, 2016. 3
|
| 329 |
+
[40] Olivier Saurer, Marc Pollefeys, and Gim Hee Lee. A minimal solution to the rolling shutter pose estimation problem. In Proceedings of the IEEE/RSJ Conference on Intelligent Robots and Systems (IROS), pages 1328–1334, 2015. 2, 3
|
| 330 |
+
[41] David Schubert, Nikolaus Demmel, Lukas Von Stumberg, Vladyslav Usenko, and Daniel Cremers. Rolling-shutter modelling for direct visual-inertial odometry. In Proceedings of the IEEE/RSJ Conference on Intelligent Robots and Systems (IROS), pages 2462–2469. IEEE, 2019. 7
|
| 331 |
+
[42] Shintaro Shiba, Yannick Klose, Yoshimitsu Aoki, and Guillermo Gallego. Secrets of event-based optical flow, depth and ego-motion estimation by contrast maximization. IEEE Transactions on Pattern Analysis and Machine Intelligence (PAMI), 2024. 3
|
| 332 |
+
[43] Henrik Stewenius, Christopher Engels, and David Nist ´ er. ´ Recent developments on direct relative orientation. ISPRS Journal of Photogrammetry and Remote Sensing, 60(4):284– 294, 2006. 2
|
| 333 |
+
[44] Timo Stoffregen and Lindsay Kleeman. Event cameras, contrast maximization and reward functions: An analysis. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 12292–12300, 2019. 3
|
| 334 |
+
[45] Antoni Rosinol Vidal, Henri Rebecq, Timo Horstschaefer, and Davide Scaramuzza. Ultimate slam? combining events, images, and imu for robust visual slam in hdr and high-speed scenarios. IEEE Robotics and Automation Letters, 3(2):994– 1001, 2018. 3
|
| 335 |
+
[46] Wanting Xu, Xin Peng, and Laurent Kneip. Tight fusion of events and inertial measurements for direct velocity estimation. IEEE Transactions on Robotics (T-RO), 40:240–256, 2024. 3
|
| 336 |
+
[47] Ji Zhao, Banglei Guan, Zibin Liu, and Laurent Kneip. Fulldof egomotion estimation for event cameras using geometric solvers. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2025. 3, 4
|
| 337 |
+
[48] Alex Zihao Zhu, Nikolay Atanasov, and Kostas Daniilidis. Event-based visual inertial odometry. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), pages 5816–5824, 2017. 3
|
| 338 |
+
|
| 339 |
+
# 6. Appendix
|
| 340 |
+
|
| 341 |
+
# 6.1. Explicit Matrix Formulas
|
| 342 |
+
|
| 343 |
+
In the main text, we discuss the use of matrices $\mathbf { M } _ { A } , \mathbf { M } _ { B } , \mathbf { M } _ { C }$ defined via
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\underbrace {\mathbf {A} ^ {\mathsf {T}} \mathbf {A}} _ {\doteq \mathbf {M}} \mathbf {x} = \left[ \begin{array}{l l} \mathbf {M} _ {A} & \mathbf {M} _ {B} \\ \mathbf {M} _ {B} ^ {\mathsf {T}} & \mathbf {M} _ {D} \end{array} \right] \left[ \begin{array}{l} \mathbf {P} _ {1: M} \\ \mathbf {v} \end{array} \right] = \mathbf {0} _ {(3 M + 3) \times 1}, \tag {15}
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
where A is defined via
|
| 350 |
+
|
| 351 |
+
$$
|
| 352 |
+
\underbrace {\left[ \begin{array}{c c c c} \mathbf {F} _ {1} & & & \\ & \mathbf {F} _ {2} & & \mathbf {G} _ {1} \\ & & \ddots & \\ & & & \mathbf {F} _ {M} \end{array} \right]} _ {\doteq \mathbf {A} \in \mathbb {R} ^ {3 N \times (3 M + 3)}} \underbrace {\left[ \begin{array}{c} \mathbf {P} _ {1} \\ \mathbf {P} _ {2} \\ \vdots \\ \mathbf {P} _ {M} \\ \mathbf {v} \end{array} \right]} _ {\doteq \mathbf {x} \in \mathbb {R} ^ {3 M + 3}} = \mathbf {0} _ {3 N \times 1} \quad (1 6)
|
| 353 |
+
$$
|
| 354 |
+
|
| 355 |
+
and each $\mathbf { F } _ { i } , \mathbf { G } _ { i }$ is defined as
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\underbrace {\left[ \begin{array}{c c} {\left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times}} & {- t _ {i j} ^ {\prime} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times}} \\ {\vdots} & \vdots \\ {\left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times}} & {- t _ {i N _ {i}} ^ {\prime} \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times}} \end{array} \right]} _ {\doteq \left[ \begin{array}{l l} \mathbf {F} _ {i} & \mathbf {G} _ {i} \end{array} \right] \in \mathbb {R} ^ {3 N _ {i} \times 6}} \left[ \begin{array}{l} \mathbf {P} _ {i} \\ \mathbf {v} \end{array} \right] = \mathbf {0} _ {3 N _ {i} \times 1} \tag {17}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
We thus see that
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\mathbf {M} _ {A} = \left[ \begin{array}{c c c c} \mathbf {F} _ {1} ^ {\intercal} \mathbf {F} _ {1} & & & \\ & \mathbf {F} _ {2} ^ {\intercal} \mathbf {F} _ {2} & & \\ & & \ddots & \\ & & & \mathbf {F} _ {M} ^ {\intercal} \mathbf {F} _ {M} \end{array} \right] \tag {18}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
$$
|
| 368 |
+
\mathbf {M} _ {B} = \left[ \begin{array}{c} \mathbf {F} _ {1} ^ {\intercal} \mathbf {G} _ {1} \\ \mathbf {F} _ {2} ^ {\intercal} \mathbf {G} _ {2} \\ \vdots \\ \mathbf {F} _ {M} ^ {\intercal} \mathbf {G} _ {M} \end{array} \right] \tag {19}
|
| 369 |
+
$$
|
| 370 |
+
|
| 371 |
+
$$
|
| 372 |
+
\mathbf {M} _ {D} = \sum_ {i = 1} ^ {M} \mathbf {G} _ {i} ^ {\mathsf {T}} \mathbf {G} _ {i} \tag {20}
|
| 373 |
+
$$
|
| 374 |
+
|
| 375 |
+
where
|
| 376 |
+
|
| 377 |
+
$$
|
| 378 |
+
\mathbf {F} _ {i} ^ {\intercal} \mathbf {F} _ {i} = - \sum_ {j = 1} ^ {N _ {i}} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} ^ {2} \tag {21}
|
| 379 |
+
$$
|
| 380 |
+
|
| 381 |
+
$$
|
| 382 |
+
\mathbf {F} _ {i} ^ {\mathsf {T}} \mathbf {G} _ {i} = \sum_ {j = 1} ^ {N _ {i}} t _ {i j} ^ {\prime} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} ^ {2} \tag {22}
|
| 383 |
+
$$
|
| 384 |
+
|
| 385 |
+
$$
|
| 386 |
+
\mathbf {G} _ {i} ^ {\mathsf {T}} \mathbf {G} _ {i} - = \sum_ {j = 1} ^ {N _ {i}} t _ {i j} ^ {\prime} ^ {2} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} ^ {2} \tag {23}
|
| 387 |
+
$$
|
| 388 |
+
|
| 389 |
+
share significant computation due to the products $[ { \bf f } _ { i j } ^ { \prime } ] _ { \times } ^ { 2 }$ . Finally, computing the Shur complement
|
| 390 |
+
|
| 391 |
+
$$
|
| 392 |
+
\mathbf {B} = \mathbf {M} _ {D} - \mathbf {M} _ {B} ^ {\top} \mathbf {M} _ {A} ^ {- 1} \mathbf {M} _ {B} \tag {24}
|
| 393 |
+
$$
|
| 394 |
+
|
| 395 |
+
we find that
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\mathbf {B} = \sum_ {i = 1} ^ {M} \mathbf {G} _ {i} ^ {\top} \mathbf {G} _ {i} - \mathbf {G} _ {i} ^ {\top} \mathbf {F} _ {i} \left(\mathbf {F} _ {i} ^ {\top} \mathbf {F} _ {i}\right) ^ {- 1} \mathbf {F} _ {i} ^ {\top} \mathbf {G} _ {i} \tag {25}
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
# 6.2. Rank of B
|
| 402 |
+
|
| 403 |
+
Assuming a full rank of $\mathbf { F } _ { i }$ , we know that each $\mathbf { G } _ { i }$ has full rank, since $\mathbf { G } _ { i } = \mathrm { d i a g } ( t _ { i 1 } ^ { \prime } \mathbf { I } _ { 3 \times 3 } , . . . , t _ { i N _ { i } } ^ { \prime } \mathbf { I } _ { 3 \times 3 } ) \mathbf { F } _ { i }$ , and the diagonal matrix has full rank for $t _ { i j } ^ { \prime } \neq 0$ . Thus, assume given the SVD of $\mathbf { F } _ { i } = \mathbf { U } _ { i } \mathbf { \Sigma } \mathbf { \Sigma } \mathbf { \Sigma } _ { i } \mathbf { V } _ { i } ^ { \top }$ . Due to the full rank we have that $\pmb { \Sigma } _ { i } ^ { - 1 }$ exists.
|
| 404 |
+
|
| 405 |
+
Thus, the above formula for $\mathbf { B }$ becomes
|
| 406 |
+
|
| 407 |
+
$$
|
| 408 |
+
\mathbf {B} = \sum_ {i = 1} ^ {M} \mathbf {G} _ {i} ^ {\intercal} \mathbf {G} _ {i} - \mathbf {G} _ {i} ^ {\intercal} \mathbf {U} _ {i} \mathbf {U} _ {i} ^ {\intercal} \mathbf {G} _ {i} \tag {26}
|
| 409 |
+
$$
|
| 410 |
+
|
| 411 |
+
which can be factored into
|
| 412 |
+
|
| 413 |
+
$$
|
| 414 |
+
\mathbf {B} = \mathbf {G} ^ {\top} \left(\mathbf {I} _ {3 N \times 3 N} - \mathbf {U} \mathbf {U} ^ {\top}\right) \mathbf {G} \tag {27}
|
| 415 |
+
$$
|
| 416 |
+
|
| 417 |
+
where
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\mathbf {G} = \left[ \begin{array}{c} \mathbf {G} _ {1} \\ \vdots \\ \mathbf {G} _ {M} \end{array} \right] \quad \mathbf {U} = \left[ \begin{array}{c c c} \mathbf {U} _ {1} & & \\ & \ddots & \\ & & \mathbf {U} _ {M} \end{array} \right] \tag {28}
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
To check that B has full rank we assume a solution $\hat { \mathbf { v } }$ to $\mathbf { B } \hat { \mathbf { v } } = \mathbf { 0 } _ { 3 \times 1 }$ , and then need to enforce that it must be zero. Then
|
| 424 |
+
|
| 425 |
+
$$
|
| 426 |
+
\mathbf {G} ^ {\mathsf {T}} \left(\mathbf {I} _ {3 N \times 3 N} - \mathbf {U} \mathbf {U} ^ {\mathsf {T}}\right) \mathbf {G} \hat {\mathbf {v}} = \mathbf {0} _ {3 \times 1} \tag {29}
|
| 427 |
+
$$
|
| 428 |
+
|
| 429 |
+
However, since $\mathbf { G } ^ { \intercal }$ has full rank, this implies
|
| 430 |
+
|
| 431 |
+
$$
|
| 432 |
+
\left(\mathbf {I} _ {3 N \times 3 N} - \mathbf {U} \mathbf {U} ^ {\top}\right) \mathbf {G} \hat {\mathbf {v}} = \mathbf {0} _ {3 \times 1} \tag {30}
|
| 433 |
+
$$
|
| 434 |
+
|
| 435 |
+
in other words $\mathbf { G } \hat { \mathbf { v } }$ must be in the null space of ${ \mathbf { I } } _ { 3 N \times 3 N } -$ UU⊺. This null space is exactly the column space of U, i.e. vectors of the form Uλ with $\pmb { \lambda } \in \mathbb { R } ^ { 3 M }$ . So
|
| 436 |
+
|
| 437 |
+
$$
|
| 438 |
+
\mathbf {G} \hat {\mathbf {v}} = \mathbf {U} \lambda \tag {31}
|
| 439 |
+
$$
|
| 440 |
+
|
| 441 |
+
or equivalently for each block
|
| 442 |
+
|
| 443 |
+
$$
|
| 444 |
+
\mathbf {G} _ {i} \hat {\mathbf {v}} = \mathbf {U} _ {i} \boldsymbol {\lambda} _ {i} \tag {32}
|
| 445 |
+
$$
|
| 446 |
+
|
| 447 |
+
which can be converted into the equation
|
| 448 |
+
|
| 449 |
+
$$
|
| 450 |
+
\left[ \begin{array}{l l} \mathbf {G} & - \mathbf {U} _ {i} \end{array} \right] \left[ \begin{array}{l} \hat {\mathbf {v}} \\ \boldsymbol {\lambda} _ {i} \end{array} \right] = \mathbf {0} _ {3 N \times 1} \tag {33}
|
| 451 |
+
$$
|
| 452 |
+
|
| 453 |
+
If any of the matrices on the left-hand side have full rank, this implies that $\hat { \mathbf { v } } = \mathbf { 0 } _ { 3 \times 1 }$ , and thus that B has full rank.
|
| 454 |
+
|
| 455 |
+
# 6.3. Connection to Epipolar Constraint
|
| 456 |
+
|
| 457 |
+
Here we show that the point incidence relation is related to the epipolar constraint used in the well-known 5-point or 8-point algorithms. This constraint is formed from point correspondences $\mathbf { x } _ { i j }$ across two views at times $t _ { 1 } , t _ { 0 }$ . This means in our setting, for each 3D point we have $N _ { i } = 2$ , and $j = 0 , 1$ . Moreover, all point in one view are synchronized,
|
| 458 |
+
|
| 459 |
+
i.e. $t _ { i 0 } = t _ { 0 }$ and $t _ { i 1 } = t _ { 1 }$ for all $i = 1 , . . . , M$ . We are left with two sets of equations
|
| 460 |
+
|
| 461 |
+
$$
|
| 462 |
+
\left[ \mathbf {f} _ {i 0} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} - t _ {0} ^ {\prime} \left[ \mathbf {f} _ {i 0} ^ {\prime} \right] _ {\times} \mathbf {v} = \mathbf {0} _ {3 \times 1} \tag {34}
|
| 463 |
+
$$
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} - t _ {1} ^ {\prime} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \mathbf {v} = \mathbf {0} _ {3 \times 1} \tag {35}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
where $t _ { 0 } ^ { \prime } = t _ { 0 } - t _ { s }$ and $t _ { 1 } ^ { \prime } = t _ { 1 } - t _ { s }$ . Without loss of generality we will set $t _ { s } = t _ { 0 }$ so that $t _ { 0 } ^ { \prime } = 0$ , $t _ { 1 } ^ { \prime } = t _ { 1 } - t _ { 0 }$ . Introducing translation ${ \mathbf t } \doteq { \mathbf v } ( t _ { 1 } - t _ { 0 } )$ yields
|
| 470 |
+
|
| 471 |
+
$$
|
| 472 |
+
\left[ \mathbf {f} _ {i 0} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} = \mathbf {0} _ {3 \times 1} \tag {36}
|
| 473 |
+
$$
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
\left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} - \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \mathbf {t} = \mathbf {0} _ {3 \times 1} \tag {37}
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
Next we left-multiply the second set of equations by ${ \bf { f } } _ { i 0 } ^ { \prime \top }$ yielding
|
| 480 |
+
|
| 481 |
+
$$
|
| 482 |
+
\mathbf {f} _ {i 0} ^ {\prime \mathsf {T}} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} - \mathbf {f} _ {i 0} ^ {\prime \mathsf {T}} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \mathbf {t} = 0 \tag {38}
|
| 483 |
+
$$
|
| 484 |
+
|
| 485 |
+
We cycle both triple products to get
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
\underbrace {\mathbf {f} _ {i 1} ^ {\prime \mathsf {T}} \left[ \mathbf {P} _ {i} \right] _ {\times} \mathbf {f} _ {i 0} ^ {\prime}} _ {= 0} - \mathbf {f} _ {i 1} ^ {\prime \mathsf {T}} \left[ \mathbf {t} \right] _ {\times} \mathbf {f} _ {i 0} ^ {\prime} = 0 \tag {39}
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
The first term is 0 due to $[ { \bf f } _ { i 0 } ^ { \prime } ] _ { \times } { \bf P } _ { i } = { \bf 0 } _ { 3 \times 1 }$ and we are thus left with
|
| 492 |
+
|
| 493 |
+
$$
|
| 494 |
+
\mathbf {f} _ {i 1} ^ {\prime \mathsf {T}} [ \mathbf {t} ] _ {\times} \mathbf {f} _ {i 0} ^ {\prime} = 0 \tag {40}
|
| 495 |
+
$$
|
| 496 |
+
|
| 497 |
+
Next we substitute ${ \bf f } _ { i 0 } ^ { \prime } = { \bf I } _ { 3 \times 3 } { \bf f } _ { i 0 }$ and ${ \bf f } _ { i 1 } ^ { \prime } = { \bf R } ( t _ { 1 } ) { \bf f } _ { i 0 }$ . We call $\mathbf { R } \doteq \mathbf { R } ( t _ { 1 } )$ , then
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\mathbf {f} _ {i 1} ^ {\mathsf {T}} \underbrace {\mathbf {R} ^ {\mathsf {T}} [ \mathbf {t} ] _ {\times}} _ {\dot {\mathbf {= E}}} \mathbf {f} _ {i 0} = 0 \tag {41}
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
The underlined matrix is also called the essential matrix, and the above constraint is exactly the epipolar constraint.
|
| 504 |
+
|
| 505 |
+
# 6.4. Connection to Line Solver
|
| 506 |
+
|
| 507 |
+
The line solver in [11] makes the assumption that points $\mathbf { P } _ { i }$ lie on a line positioned at unit depth. We can thus write the position of $\mathbf { P } _ { i }$ as a linear combination of unit vectors ${ \bf e } _ { 1 } ^ { \ell }$ and ${ \bf e } _ { 3 } ^ { \ell }$ as
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\mathbf {P} _ {i} = p _ {i, 1} \mathbf {e} _ {1} ^ {\ell} - \mathbf {e} _ {3} ^ {\ell}. \tag {42}
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
Here ${ \bf e } _ { 3 } ^ { \ell }$ points from the closest point on the line to the origin, and ${ \bf e } _ { 1 } ^ { \ell }$ points in the direction of the line. Further define the unit vector ${ \bf e } _ { 2 } ^ { \ell } = { \bf e } _ { 3 } ^ { \ell } \times { \bf e } _ { 1 } ^ { \ell }$ . We start off by multiplying the original incidence relation from the left with ${ \bf e } _ { 1 } ^ { \ell ^ { \dagger } }$ yielding
|
| 514 |
+
|
| 515 |
+
$$
|
| 516 |
+
\mathbf {e} _ {1} ^ {\ell} \mathbf {e} _ {i j} ^ {\top} \left[ \mathbf {f} _ {i j} \right] _ {\times} \mathbf {P} _ {i} - t _ {i j} ^ {\prime} \mathbf {e} _ {1} ^ {\ell} \mathbf {e} _ {1} ^ {\top} \left[ \mathbf {f} _ {i j} \right] _ {\times} \mathbf {v} = 0. \tag {43}
|
| 517 |
+
$$
|
| 518 |
+
|
| 519 |
+
Next, we use ${ \mathbf { a } } ^ { \mathsf { T } } [ { \mathbf { b } } ] _ { \times } { \mathbf { c } } = { \mathbf { c } } ^ { \mathsf { T } } [ { \mathbf { a } } ] _ { \times } { \mathbf { b } }$ to arrive at
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
\mathbf {f} _ {i j} ^ {\mathsf {T}} \mathbf {e} _ {2} ^ {\ell} - t _ {i j} ^ {\prime} \mathbf {f} _ {i j} ^ {\mathsf {T}} \left(\mathbf {e} _ {1} ^ {\ell} \times \mathbf {v}\right) = 0. \tag {44}
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
Finally, we express the linear velocity in the basis $\mathbf { e } _ { 1 } ^ { \ell } , \mathbf { e } _ { 2 } ^ { \ell } , \mathbf { e } _ { 3 } ^ { \ell }$ , i.e.
|
| 526 |
+
|
| 527 |
+
$$
|
| 528 |
+
\mathbf {v} = u _ {x} \mathbf {e} _ {1} ^ {\ell} + u _ {y} \mathbf {e} _ {2} ^ {\ell} + u _ {z} \mathbf {e} _ {3} ^ {\ell} \tag {45}
|
| 529 |
+
$$
|
| 530 |
+
|
| 531 |
+
inserting above, and expanding the cross product we have that
|
| 532 |
+
|
| 533 |
+
$$
|
| 534 |
+
\mathbf {f} _ {i j} ^ {\mathsf {T}} \mathbf {e} _ {2} ^ {\ell} + t _ {i j} ^ {\prime} \mathbf {f} _ {i j} ^ {\mathsf {T}} \left(u _ {z} \mathbf {e} _ {2} ^ {\ell} - u _ {y} \mathbf {e} _ {3} ^ {\ell}\right) = 0. \tag {46}
|
| 535 |
+
$$
|
| 536 |
+
|
| 537 |
+
This is exactly Eq. 6 in [11], which demonstrates that the line solver is a special case of the point solver described here.
|
| 538 |
+
|
| 539 |
+
# 6.5. Arbitrary Taylor Expansions
|
| 540 |
+
|
| 541 |
+
In what follows, we will expand the camera motion as an $S$ order Taylor Series:
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
\mathbf {R} \left(t _ {i j}\right) \approx \exp \left(\left[ \sum_ {s = 1} ^ {S} \frac {\omega^ {(s)} t _ {i j} ^ {\prime s}}{s !} \right] _ {\times}\right) \tag {47}
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
$$
|
| 548 |
+
\mathbf {p} \left(t _ {i j}\right) \approx \sum_ {s = 1} ^ {S} \frac {\mathbf {v} ^ {(s)} t _ {i j} ^ {s}}{s !}. \tag {48}
|
| 549 |
+
$$
|
| 550 |
+
|
| 551 |
+
Here we denote $\boldsymbol { \omega } ^ { ( s ) }$ the $s$ order angular rate, and $\mathbf { v } ^ { ( s ) }$ the $s$ order linear rate. Again we will focus on recovering the linear rates, and leave the angular rates as given. Inserting these definitions into the incidence relations yields the linear system
|
| 552 |
+
|
| 553 |
+
$$
|
| 554 |
+
\left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} - \sum_ {s = 1} ^ {S} \frac {t _ {i j} ^ {\prime s}}{s !} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {v} ^ {(s)} = \mathbf {0} _ {3 \times 1} \tag {49}
|
| 555 |
+
$$
|
| 556 |
+
|
| 557 |
+
We stack all such constraints that involve the point $\mathbf { P } _ { i }$ into a single system of equations.
|
| 558 |
+
|
| 559 |
+
$$
|
| 560 |
+
\underbrace {\left[ \begin{array}{c c c c} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} & - t _ {i 1} ^ {\prime} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} & \dots & - \frac {t _ {i 1} ^ {\prime S}}{S !} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \\ \vdots & \vdots & \ddots & \vdots \\ \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} & - t _ {i N _ {i}} ^ {\prime} \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} & \dots & - \frac {t _ {i N _ {i}} ^ {\prime S}}{S !} \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} \end{array} \right]} _ {\doteq \left[ \begin{array}{c c c c} \mathbf {F} _ {i} & & & \\ \mathbf {V} ^ {(1)} & & & \\ \vdots & & & \\ \mathbf {V} ^ {(S)} & & & \end{array} \right]} \left[ \begin{array}{c} \mathbf {P} _ {i} \\ \mathbf {v} ^ {(1)} \\ \vdots \\ \mathbf {v} ^ {(S)} \end{array} \right] = \mathbf {0} _ {3 N _ {i} \times 1} \tag {50}
|
| 561 |
+
$$
|
| 562 |
+
|
| 563 |
+
where $\mathbf { G } _ { i } ^ { ( s ) } \in \mathbb { R } ^ { 3 N _ { i } \times 3 }$ . For $S ~ = ~ 1$ we recover the old case. Denoting
|
| 564 |
+
|
| 565 |
+
$$
|
| 566 |
+
\mathbf {v} \doteq \left[ \begin{array}{c} \mathbf {v} ^ {(1)} \\ \vdots \\ \mathbf {v} ^ {(S)} \end{array} \right] \quad \mathbf {G} _ {i} \doteq \left[ \begin{array}{c c c} \mathbf {G} _ {\mathbf {i}} ^ {(1)} & \dots & \mathbf {G} _ {\mathbf {i}} ^ {(\mathbf {S})} \end{array} \right] \tag {51}
|
| 567 |
+
$$
|
| 568 |
+
|
| 569 |
+
we arrive at the same algorithm as before. However, crucially, $\mathbf { A } \in \mathbb { R } ^ { 3 N \times ( 3 M + 3 S ) }$ and the Shur complement reduces $\mathbf { A } ^ { \mathsf { T } } \mathbf { A }$ to a matrix $\mathbf { B } \in \mathbb { R } ^ { 3 S \times 3 S }$ . The solution duality and degeneracy remains the same. However, the minimality discussion needs to be adjusted since more unknowns are now introduced.
|
| 570 |
+
|
| 571 |
+
Minimality: The total system has $2 N$ constraints, with $3 M +$ $3 S - 1$ unknowns (including scale ambiguity). This means that
|
| 572 |
+
|
| 573 |
+
$$
|
| 574 |
+
N \geq \left\lceil \frac {3 M + 3 S - 1}{2} \right\rceil \tag {52}
|
| 575 |
+
$$
|
| 576 |
+
|
| 577 |
+
At the same time, stability in the solver requires
|
| 578 |
+
|
| 579 |
+
$$
|
| 580 |
+
N \geq 2 M \tag {53}
|
| 581 |
+
$$
|
| 582 |
+
|
| 583 |
+
we will try to find out when a minimal system arises, i.e. when 3M+3S−1 = 2M . We will treat two cases: $\begin{array} { r } { \left\lceil \frac { 3 M + 3 S - \mathbf { \bar { 1 } } } { 2 } \right\rceil = 2 M } \end{array}$
|
| 584 |
+
|
| 585 |
+
Case 1: Let $h \doteq 3 M + 3 S - 1$ be odd with $h = 2 k + 1$ and $k = \frac { h - 1 } { 2 }$ h−12 for some k, then the left side of the above equation $k$ becomes
|
| 586 |
+
|
| 587 |
+
$$
|
| 588 |
+
\begin{array}{l} \left\lceil \frac {h}{2} \right\rceil = k + 1 (54) \\ = \frac {3 M + 3 S - 2}{2} + 1 (55) \\ = \frac {3 M + 3 S}{2} (56) \\ \end{array}
|
| 589 |
+
$$
|
| 590 |
+
|
| 591 |
+
Setting this equal to $2 M$ yields
|
| 592 |
+
|
| 593 |
+
$$
|
| 594 |
+
M = 3 S \tag {57}
|
| 595 |
+
$$
|
| 596 |
+
|
| 597 |
+
We thus find that configurations $( S , M ) = ( s , 3 s )$ for $s = 1 , 2 , \dots$ yield minimal systems. Setting $N = 2 M = 6 s$ with $N _ { i } ~ = ~ 2$ yields a total of $1 2 s$ equations with 12s unknowns coming from 3s 3D points and 6s observations.
|
| 598 |
+
|
| 599 |
+
Case 2: Let $h \doteq 3 M + 3 S - 1$ be even, so that $h = 2 k$ and
|
| 600 |
+
|
| 601 |
+
$$
|
| 602 |
+
\begin{array}{l} \left\lceil \frac {h}{2} \right\rceil = k (58) \\ = \frac {3 M + 3 S - 1}{2}. (59) \\ \end{array}
|
| 603 |
+
$$
|
| 604 |
+
|
| 605 |
+
Setting this equal to $2 M$ we have that
|
| 606 |
+
|
| 607 |
+
$$
|
| 608 |
+
M = 3 S - 1. \tag {60}
|
| 609 |
+
$$
|
| 610 |
+
|
| 611 |
+
As a result, configurations $( S , M ) = ( s , 3 s - 1 )$ for $s = 1 , 2 , \dots$ also yield minimal systems. In particular, setting $N = 2 M$ with $N _ { i } ~ = ~ 2$ we have a system of $1 2 s \mathrm { ~ - ~ } 4$ equations with $1 2 s \mathrm { ~ - ~ } 4$ unknowns coming from $3 s - 1$ 3D points, and $6 s - 2$ observations.
|
| 612 |
+
|
| 613 |
+
Checking the above equations for $S = 1$ recovers the minimal 4 and 6 point algorithms discussed in the main text.
|
| 614 |
+
|
| 615 |
+
# 6.5.1. Experiments with Acceleration Aware Solver
|
| 616 |
+
|
| 617 |
+
To extend our methodology to acceleration-aware motion estimation, we conducted simulation experiments as described in Sec.4.1 with a 1-second time window. The results shown in Fig. 6 and Fig. 7 reveal that introducing acceleration parameters (adding three degrees of freedom) systematically amplifies the solver’s noise sensitivity. Notably, acceleration estimation exhibits 3-4 times higher error susceptibility than velocity under identical noise conditions. This effect arises because the acceleration term’s coefficient scales quadratically with the timestamp in the motion model. Nevertheless, it can be mitigated by fusing IMU acceleration data to bootstrap initial velocity estimation.
|
| 618 |
+
|
| 619 |
+
# 6.6. Extending the Acceleration-aware Solver
|
| 620 |
+
|
| 621 |
+
The above formulation for $S = 2$ expands the camera motion up to acceleration yielding the incidence relation
|
| 622 |
+
|
| 623 |
+
$$
|
| 624 |
+
\left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} - t _ {i j} ^ {\prime} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {v} - \frac {1}{2} t _ {i j} ^ {\prime 2} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {a} = \mathbf {0} _ {3 \times 1} \tag {61}
|
| 625 |
+
$$
|
| 626 |
+
|
| 627 |
+
Instead of solving for the unknown a we can assume it given by an IMU (which we already use to estimate angular velocity). For simplicity, we assume it to be constant over the time interval. We thus find that our system transforms into an in-homogeneous system :
|
| 628 |
+
|
| 629 |
+
$$
|
| 630 |
+
\left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {P} _ {i} - t _ {i j} ^ {\prime} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {v} = \frac {1}{2} t _ {i j} ^ {\prime 2} \left[ \mathbf {f} _ {i j} ^ {\prime} \right] _ {\times} \mathbf {a} \tag {62}
|
| 631 |
+
$$
|
| 632 |
+
|
| 633 |
+
stacking these equations for one track yields
|
| 634 |
+
|
| 635 |
+
$$
|
| 636 |
+
\underbrace {\left[ \begin{array}{c c} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} & - t _ {i 1} ^ {\prime} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \\ \vdots & \vdots \\ \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} & - t _ {i N _ {i}} ^ {\prime} \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} \end{array} \right]} _ {\doteq \left[ \begin{array}{l l} \mathbf {F} _ {i} & \mathbf {G} _ {\mathbf {i}} \end{array} \right] \in \mathbb {R} ^ {3 N _ {i} \times 6}} \left[ \begin{array}{l} \mathbf {P} _ {i} \\ \mathbf {v} \end{array} \right] = \underbrace {\left[ \begin{array}{c} \frac {1}{2} t _ {i 1} ^ {\prime 2} \left[ \mathbf {f} _ {i 1} ^ {\prime} \right] _ {\times} \mathbf {a} \\ \vdots \\ \frac {1}{2} t _ {i N _ {i}} ^ {\prime 2} \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} \mathbf {a} \end{array} \right]} _ {\doteq \mathbf {b} _ {i} \in \mathbb {R} ^ {3 N _ {i} \times 1}} \tag {63}
|
| 637 |
+
$$
|
| 638 |
+
|
| 639 |
+
and stacking these equations for each point we get
|
| 640 |
+
|
| 641 |
+
$$
|
| 642 |
+
\underbrace {\left[ \begin{array}{c c c c} \mathbf {F} _ {1} & & & \mathbf {G} _ {1} \\ & \mathbf {F} _ {2} & & \mathbf {G} _ {2} \\ & & \ddots & \vdots \\ & & & \mathbf {F} _ {M} \end{array} \right]} _ {\doteq \mathbf {A} \in \mathbb {R} ^ {3 N \times (3 M + 3)}} \underbrace {\left[ \begin{array}{c} \mathbf {P} _ {1} \\ \mathbf {P} _ {2} \\ \vdots \\ \mathbf {P} _ {M} \\ \mathbf {v} \end{array} \right]} _ {\doteq \mathbf {x} \in \mathbb {R} ^ {3 M + 3}} = \underbrace {\left[ \begin{array}{c} \mathbf {b} _ {1} \\ \vdots \\ \mathbf {b} _ {M} \end{array} \right]} _ {\doteq \mathbf {b} \in \mathbb {R} ^ {3 N \times 1}} \tag {64}
|
| 643 |
+
$$
|
| 644 |
+
|
| 645 |
+
multiplying from the left with $\mathbf { A } ^ { \top }$ we have the system
|
| 646 |
+
|
| 647 |
+
$$
|
| 648 |
+
\underbrace {\mathbf {A} ^ {\intercal} \mathbf {A}} _ {\dot {\cong} \mathbf {M}} \mathbf {x} = \left[ \begin{array}{l l} \mathbf {M} _ {A} & \mathbf {M} _ {B} \\ \mathbf {M} _ {B} ^ {\intercal} & \mathbf {M} _ {D} \end{array} \right] \left[ \begin{array}{l} \mathbf {P} _ {1: M} \\ \mathbf {v} \end{array} \right] = \underbrace {\mathbf {A} ^ {\intercal} \mathbf {b}} _ {\dot {\cong} \mathbf {c}} = \left[ \begin{array}{l} \mathbf {c} _ {A} \\ \mathbf {c} _ {B} \end{array} \right], \tag {65}
|
| 649 |
+
$$
|
| 650 |
+
|
| 651 |
+
where we now define $\mathbf { c } \in \mathbb { R } ^ { ( 3 M + 3 ) \times 1 }$ with $\mathbf { c } _ { A } ~ \in ~ \mathbb { R } ^ { 3 M \times 1 }$ and $\mathbf { c } _ { B } \in \mathbb { R } ^ { 3 \times 1 }$ . Explicit formulas for these are
|
| 652 |
+
|
| 653 |
+
$$
|
| 654 |
+
\mathbf {c} _ {A} = \left[ \begin{array}{c} \mathbf {F} _ {1} ^ {\intercal} \mathbf {b} _ {1} \\ \vdots \\ \mathbf {F} _ {M} ^ {\intercal} \mathbf {b} _ {M} \end{array} \right] \quad \mathbf {c} _ {B} = \sum_ {i = 1} ^ {M} \mathbf {G} _ {i} ^ {\intercal} \mathbf {b} _ {i} \tag {66}
|
| 655 |
+
$$
|
| 656 |
+
|
| 657 |
+
where
|
| 658 |
+
|
| 659 |
+
$$
|
| 660 |
+
\mathbf {F} _ {i} ^ {\top} \mathbf {b} _ {i} = - \frac {1}{2} \sum_ {j = 1} ^ {N _ {i}} t _ {i j} ^ {\prime 2} \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} ^ {2} \mathbf {a} \tag {67}
|
| 661 |
+
$$
|
| 662 |
+
|
| 663 |
+
and
|
| 664 |
+
|
| 665 |
+
$$
|
| 666 |
+
\mathbf {G} _ {i} ^ {\intercal} \mathbf {b} _ {i} = \frac {1}{2} \sum_ {j = 1} ^ {N _ {i}} t _ {i j} ^ {\prime 3} \left[ \mathbf {f} _ {i N _ {i}} ^ {\prime} \right] _ {\times} ^ {2} \mathbf {a} \tag {68}
|
| 667 |
+
$$
|
| 668 |
+
|
| 669 |
+
Applying the Schur-complement trick to this system yields the following system for v
|
| 670 |
+
|
| 671 |
+
$$
|
| 672 |
+
\mathbf {B} \mathbf {v} = \underbrace {\mathbf {c} _ {B} - \mathbf {M} _ {B} ^ {\mathrm {T}} \mathbf {M} _ {A} ^ {- 1} \mathbf {c} _ {A}} _ {\doteq \mathbf {d}} \tag {69}
|
| 673 |
+
$$
|
| 674 |
+
|
| 675 |
+
where we have defined B previously, and we now have introduced $\mathbf { d } \in \mathbb { R } ^ { 3 \times 1 }$ with the following explicit formula
|
| 676 |
+
|
| 677 |
+
$$
|
| 678 |
+
\mathbf {d} = \sum_ {j = 1} ^ {M} \mathbf {G} _ {i} ^ {\intercal} \mathbf {b} _ {i} - \mathbf {G} _ {i} ^ {\intercal} \mathbf {F} _ {i} \left(\mathbf {F} _ {i} ^ {\intercal} \mathbf {F} _ {i}\right) ^ {- 1} \mathbf {F} _ {i} ^ {\intercal} \mathbf {b} _ {i} \tag {70}
|
| 679 |
+
$$
|
| 680 |
+
|
| 681 |
+

|
| 682 |
+
|
| 683 |
+

|
| 684 |
+
|
| 685 |
+

|
| 686 |
+
|
| 687 |
+

|
| 688 |
+
|
| 689 |
+

|
| 690 |
+
|
| 691 |
+

|
| 692 |
+
Figure 5. The robustness of acceleration-aware point solver against pixel noise (left) and timestamp jitter (middle) and rotation (right)
|
| 693 |
+
|
| 694 |
+
Solving for v requires simply inverting the matrix, yielding
|
| 695 |
+
|
| 696 |
+
$$
|
| 697 |
+
\hat {\mathbf {v}} = \mathbf {B} ^ {- 1} \mathbf {d} \tag {71}
|
| 698 |
+
$$
|
| 699 |
+
|
| 700 |
+
and back substitution to get the 3D points yields
|
| 701 |
+
|
| 702 |
+
$$
|
| 703 |
+
\hat {\mathbf {P}} _ {i} = \left(\mathbf {F} _ {i} ^ {\intercal} \mathbf {F} _ {i}\right) ^ {- 1} \mathbf {F} _ {i} ^ {\intercal} \left(\mathbf {b} _ {i} - \mathbf {G} _ {i} \hat {\mathbf {v}}\right) \tag {72}
|
| 704 |
+
$$
|
| 705 |
+
|
| 706 |
+
It is important to note that, having taken the acceleration into account adds two qualitative differences between our solution to the previous cases: First, absolute scale suddenly becomes observable, meaning that the recovered $\hat { \mathbf { v } } , \hat { \mathbf { P } } _ { i }$ are in meters. Second, our method no longer has multiple solutions, making the depth check unnecessary.
|
| 707 |
+
|
| 708 |
+

|
| 709 |
+
|
| 710 |
+

|
| 711 |
+
|
| 712 |
+

|
| 713 |
+
|
| 714 |
+

|
| 715 |
+
Figure 6. Analysis of acceleration-aware point solver on the number of feature tracks (left) and observations (right) under different combined noise level.
|
| 716 |
+
|
| 717 |
+

|
| 718 |
+
|
| 719 |
+

|
| 720 |
+
Figure 7. Analysis of the impact of time window on acceleration-aware solver under different noise level.
|
paper_markdowns/bamboo-01538.md
ADDED
|
@@ -0,0 +1,434 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CAPTURE: Evaluating Spatial Reasoning in Vision Language Models via Occluded Object Counting
|
| 2 |
+
|
| 3 |
+
Atin Pothiraj
|
| 4 |
+
|
| 5 |
+
Elias Stengel-Eskin
|
| 6 |
+
|
| 7 |
+
Jaemin Cho
|
| 8 |
+
|
| 9 |
+
Mohit Bansal
|
| 10 |
+
|
| 11 |
+
UNC Chapel Hill
|
| 12 |
+
|
| 13 |
+
{atin, esteng, jmincho, mbansal}@cs.unc.edu
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
Recognizing and reasoning about occluded (partially or fully hidden) objects is vital to understanding visual scenes, as occlusions frequently occur in real-world environments and act as obstacles for spatial comprehension. To test models’ ability to reason about multiple occluded objects, we introduce a novel task, Counting Amodally for Patterns Through Unseen REgions (CAPTURE), which requires a model to count objects arranged in a pattern by inferring how the pattern continues behind an occluder (an object which blocks parts of the scene). CAPTURE requires both recognizing visual patterns and reasoning, making it a useful testbed for evaluating vision-language models (VLMs) on whether they understand occluded patterns and possess spatial understanding skills. By requiring models to reason about occluded objects, CAPTURE also tests VLMs’ ability to form world models that would allow them to fill in missing information. CAPTURE consists of two parts: (1) CAPTUREreal, with manually filtered images of real objects in patterns and (2) CAPTUREsynthetic, a controlled diagnostic with generated patterned images. We evaluate four strong VLMs (GPT-4o, Intern-VL2, Molmo, and Qwen2- VL) on CAPTURE, finding that models struggle to count on both occluded and unoccluded patterns. Crucially, we find that models perform worse with occlusion, suggesting that VLMs are also deficient in inferring unseen spatial relationships: even the strongest VLMs like GPT-4o fail to count with occlusion. In contrast, we find that humans achieve very little error on CAPTURE. We also find that providing auxiliary information of occluded object locations increases performance, underscoring that the model error comes both from an inability to handle occlusion as well as difficulty in counting in images.
|
| 18 |
+
|
| 19 |
+
# 1. Introduction
|
| 20 |
+
|
| 21 |
+
Inferring what lies behind different objects in occluded scenes is crucial for human perception, as it allows us to
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Instruction: Count the exact number of cups in the image, assuming the pattern continues behind the black box.
|
| 25 |
+
|
| 26 |
+

|
| 27 |
+
Figure 1. CAPTURE example with an output from GPT-4o. While people can easily infer the missing number of cups and correctly reason over occluded patterns, models generally struggle to reason over these occluded scenes.
|
| 28 |
+
|
| 29 |
+
maintain a coherent understanding of our environment even when parts are hidden. The human visual system accomplishes this by integrating past experiences, context, and sensory inputs to reconstruct incomplete scenes [19, 27, 30, 45]. Meanwhile, recent advancements in vision-language models (VLMs) – especially in terms of visual and spatial reasoning – raise the question of whether these systems can perform similar inferential tasks. One way of measuring such capabilities is through amodal completion – the task of inferring the invisible parts of partially occluded objects; here, vision-only models are typically evaluated via dense prediction tasks like object segmentation and image inpainting [5]. However, this format is not well-suited for assessing VLMs, whose outputs consist of text tokens rather than pixel-level predictions. This raises a critical question: How can we quantify the ability of VLMs to form spatial world modeling [17] in the presence of occlusion?
|
| 30 |
+
|
| 31 |
+
To address this, we introduce CAPTURE, Counting Amodally for Patterns Through Unseen REgions, a novel benchmark that tests a VLM’s world modeling and spatial reasoning abilities through the task of amodal counting, where models are prompted to count occluded objects
|
| 32 |
+
|
| 33 |
+
by amodally completing a pattern. CAPTURE focuses on counting as it provides an objective and easy-to-verify output by comparing predicted counts with ground truth values. Moreover, patterned objects appear in various real-world domains, especially in man-made environments like parking lots, cities, and warehouses, where counting objects is often required. Fig. 1 illustrates the CAPTURE task. We show a VLM an image where objects are placed in a regular pattern (e.g., a 4x4 grid) with some objects occluded, and ask the model to count the total number of objects in the image assuming that the pattern continues behind the occlusion. The task requires handling occlusion, pattern recognition, and counting skills that exist in humans from a fairly young age [27, 30, 45], thus humans can easily answer such questions – indeed, we find that people can complete CAPTURE tasks with almost no error.
|
| 34 |
+
|
| 35 |
+
CAPTURE consists of two subsets: CAPTUREreal and CAPTUREsynthetic. As shown in Fig. 2, CAPTUREreal contains real-world images and tests the ability of models to perform amodal counting in naturalistic contexts, while CAPTUREsynthetic allows us to analyze specific factors by controlling different variables like color, shape, and number of objects. All images in CAPTURE contain a pattern of objects and a manually annotated occluding black box covering some objects. CAPTUREreal contains 924 images with a diverse range of settings and objects, covering 92 different object types, while CAPTUREsynthetic contains 1250 images across multiple attribute classes.
|
| 36 |
+
|
| 37 |
+
By combining vision encoders with large language models (LLMs), VLMs have the potential to reason in a zeroshot way about visual inputs. To put this ability to the test and measure VLMs’ ability to reason about missing visual information, we evaluate four strong recent VLMs (GPT-4o, InternVL2, Molmo, and Qwen2VL) on CAPTURE. Our experiment results (Sec. 4) show that models generally struggle with the multiple aspects of the task, with high error rates on both CAPTUREreal and CAPTUREsynthetic for occluded and unoccluded images. In contrast, we find that humans can perform the task easily: whereas model performance deteriorates as more objects in images are occluded, humans complete the task almost perfectly. We also compare VLMs to a vision-only model trained to count visible objects; while this model generally outperforms VLMs, its error is directly tied to the number of occluded objects – the more objects are occluded, the higher its error will be.
|
| 38 |
+
|
| 39 |
+
By objectively measuring VLMs’ spatial reasoning capabilities under occlusion, CAPTURE highlights an unexpected weakness in VLMs. We analyze this weakness by providing the model with additional clues and information. Specifically, we test to what degree the VLMs’ failure stems from an inability to integrate visual information by providing it with a text-based representation of the visible objects in the image in the form of object coordinates; here, VLMs
|
| 40 |
+
|
| 41 |
+
perform substantially better, indicating that their poor performance on CAPTURE stems partly from an inability to count objects in images, rather than an inability to count more generally. Our findings align with previous work, which similarly finds that VLMs struggle to count in images [22, 33, 42]. We also test the degree to which VLM errors stem from an inability to form a world model by providing it with auxiliary information (the coordinates of the occluded objects in text, or inpainting the occluded regions). We find that VLMs perform substantially better with this auxiliary information, suggesting that VLMs are partly limited by their inability to imagine the missing visual information. Addressing these gaps is critical for VLMs to function effectively in real-world scenarios, where visual reasoning often involves occlusions – whether counting stadium seats, components on production lines, or buildings in neighborhoods. We hope that our work will foster future research on improving the world modeling capabilities of VLMs.
|
| 42 |
+
|
| 43 |
+
# 2. CAPTURE
|
| 44 |
+
|
| 45 |
+
# 2.1. Task Overview
|
| 46 |
+
|
| 47 |
+
Input/output formulation. CAPTURE tests VLMs on occlusion reasoning, pattern recognition, and counting of both visible and occluded objects. VLMs already achieve high accuracy in classifying single, occluded objects [20]. Thus, we also argue that VLMs have the potential to perform well on CAPTURE’s challenging task because their proficiency in handling occlusion ought to enable them to recognize occluded objects and reason accordingly. All images in CAPTURE contain a pattern. This makes the task solvable for models and people – if the objects were not placed in a pattern, it would be unreasonable to expect models to infer the position of the occluded objects. For example, given an image of a random pile of coins with a region occluded, it is not easy to infer whether the occluded region contains no coins or contains roughly the same amount as the rest of the pile. For this task, the patterns considered are all regular and fairly small, e.g. grids, circles, triangles, and other regular shapes – see Fig. 2 for further examples. The last step of CAPTURE is counting, asking the model to provide an objectively measurable output. In addition to VLMs, we also test COUNTGD [3], a state-of-the-art object detection-based counting method, finding that it fails to account for the occluded scenario, as its training entails solely predicting the visible, unoccluded objects in the image.
|
| 48 |
+
|
| 49 |
+
Metric. We use symmetric mean percent error (sMAPE) as the primary metric. sMAPE is given by:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\mathrm {s M A P E} = 1 0 0 \cdot \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {\left| y _ {i} - \hat {y} _ {i} \right|}{\left| y _ {i} \right| + \left| \hat {y} _ {i} \right|} \tag {1}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
where $y _ { i }$ represents the actual values, $\hat { y } _ { i }$ represents the pre-
|
| 56 |
+
|
| 57 |
+
# CAPTURereal
|
| 58 |
+
|
| 59 |
+
Instruction: Count the exact number of [object] in the image. Assume the pattern of [object] continues behind any black box. Provide the total number of [object] as if the black box were not there.
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
GPT-4o: 18 bottle caps visible…black box covers…5 caps…total estimated count…is 23. Ground truth: 19
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
GPT-4o: Bread rolls are organized in a 4x4 grid, which suggests there are 16 rolls in total. Ground truth: 20
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
GPT-4o: Total nuts in each row…6 times 6 $= 3 6$ . Nuts in the hidden $3 { \times } 3$ section $=$ $9 . 3 6 + 9 = 4 5$ nuts. Ground truth: 42
|
| 69 |
+
|
| 70 |
+
# CAPTUResynthetic
|
| 71 |
+
|
| 72 |
+
Instruction: Your task is to count objects in the image. Assume the pattern of [object] continues behind the black box. First, state what the pattern is, then give your final count.
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
GPT-4o: Pattern: A circular arrangement… Visible count: …8 … Total count: …12 dots. Ground truth: 11
|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
GPT-4o: …pattern consists of…a 2x2 grid… can infer…an additional four blue squares in the obscured section. Final count: 8 blue squares Ground truth: 6
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
GPT-4o: Pattern: Triangular arrangement … Final Count: 7 red dots (5 visible $^ { + 2 }$ estimated behind the black box). Ground truth: 6
|
| 82 |
+
Figure 2. Example images with GPT-4o responses to CAPTUREreal and CAPTUREsynthetic occluded splits.
|
| 83 |
+
|
| 84 |
+
dicted values, and $n$ is the number of observations. sMAPE is capped at $100 \%$ , providing a fixed range. This makes sMAPE ideal for challenging tasks like ours, as we can penalize responses that fail to produce an answer with a maximum error of $100 \%$ . For a justification of sMAPE over other metrics, see Appendix A.1.
|
| 85 |
+
|
| 86 |
+
# 2.2. Dataset
|
| 87 |
+
|
| 88 |
+
CAPTUREreal. We introduce a set of real images with patterns to test amodal counting in naturalistic settings. The original images and annotations come from the FSC-147 dataset [37], a diverse counting dataset with manual annotations for the number of target objects and all object bounding boxes in each image. FSC-147 contains a diverse array of objects, with 6146 real-world images across 147 object categories. We filter FSC-147 for images that contain identifiable and regular patterns of objects and manually overlay a black box to occlude some objects, resulting in 924 images. Filtering is first performed with GPT-4o and then manually verified; we also manually verify that determining objects despite the occlusion is feasible. For each example, we maintain both occluded and unoccluded versions. Further details on CAPTUREreal can be found in Appendix B.
|
| 89 |
+
|
| 90 |
+
CAPTUREsynthetic. While CAPTUREreal makes CAP-TURE more applicable to real-world scenarios, each image is unique, making the data less controlled and challenging to draw clear conclusions about model performance. Images without background distractors, texture variance, and other potential visual obstacles provide a more controlled version of the task. Therefore, we create CAP-TUREsynthetic to examine the task in a fully controlled environment. CAPTUREsynthetic comprises 1250 images of simple objects in patterns, where different variables are held constant or changed. We vary the following features:
|
| 91 |
+
|
| 92 |
+
1. Object count: varies from 5 to 15.
|
| 93 |
+
2. Object: can be either dots or squares.
|
| 94 |
+
|
| 95 |
+
Table 1. Statistics and strengths for CAPTURE splits.
|
| 96 |
+
|
| 97 |
+
<table><tr><td></td><td>CAPTUREreal</td><td>CAPTUREsynthetic</td></tr><tr><td># Images</td><td>924</td><td>1250</td></tr><tr><td># Object Types</td><td>92</td><td>2</td></tr><tr><td>Avg. Occluded Obj.</td><td>13.97</td><td>2.73</td></tr><tr><td>Avg. Total Obj.</td><td>61.45</td><td>10.00</td></tr><tr><td rowspan="3">Strengths</td><td>Diverse Objects/Settings</td><td>Confounder-free</td></tr><tr><td>Naturalistic</td><td>Controllable Attributes</td></tr><tr><td>Realistic Context</td><td>Uniformly Distributed</td></tr></table>
|
| 98 |
+
|
| 99 |
+
3. Arrangement/shape: can be a rectangle, circle, or pyramid (where feasible based on object count).
|
| 100 |
+
4. Location: we consider five positions on the page: center, top-left, top-right, bottom-left, or bottom-right.
|
| 101 |
+
5. Color: we randomly choose one of 5 colors for all the objects in an image.
|
| 102 |
+
|
| 103 |
+
The CAPTUREsynthetic data is split similarly to the CAP-TUREreal data; each configuration has a variant with an overlaid occluding box and one without.
|
| 104 |
+
|
| 105 |
+
# 2.3. Statistics and Examples
|
| 106 |
+
|
| 107 |
+
Fig. 2 shows examples from CAPTUREreal and CAP-TUREsynthetic paired with their corresponding answers from GPT-4o and their ground truth answers. These examples show the range of objects and patterns in the dataset and highlight the task’s feasibility for humans. Tab. 1 reports summary statistics for CAPTURE, including the number of images and object types, as well as the mean number of occluded and total objects in both splits of CAPTURE. The number of objects in CAPTUREreal is shown in Fig. 3, where most images have between 0 and 30 objects. On CAPTUREsynthetic, the maximum number of objects is 15, and CAPTUREsynthetic images generally have 1-6 occluded objects (shown in Fig. 4, as further occlusion could make the count unresolvable).
|
| 108 |
+
|
| 109 |
+

|
| 110 |
+
|
| 111 |
+

|
| 112 |
+
Figure 3. # of objects in CAPTUREreal images.
|
| 113 |
+
Figure 4. # of occluded objects in CAPTUREsynthetic images.
|
| 114 |
+
|
| 115 |
+
# 3. Experiment Setup
|
| 116 |
+
|
| 117 |
+
# 3.1. Models
|
| 118 |
+
|
| 119 |
+
We experiment with GPT-4o [28], Intern-VL2-Llama3-8B [9, 10], Qwen2-VL-7B [41], MiniCPM-o 2.6 [47], and Kimi-VL-A3B [40] for their high scores on other VLM tasks [29]. We add Molmo 7B-D [13], because of its ability to “point and count,” giving it a potential advantage on CAPTURE. Specifically, Molmo is trained on millions of examples that directly ground text to 2D coordinates (or “points”) in images. This allows Molmo to directly point to image coordinates and count more easily by pointing to several objects. All the VLMs feature a different language backbone and vision encoder to provide broad coverage of model architectures. To evaluate models, we provide the model with the name of the specific object to be counted and the explicit instruction to count fully visible objects and objects behind the occluding box (in the occluded images). For each model, we test ten prompts on a validation set of 100 images, selecting the best prompt for each model in each dataset section (CAPTUREreal/CAPTUREsynthetic) and for each environment (occluded/unoccluded). We provide the selected prompts in Appendix D.
|
| 120 |
+
|
| 121 |
+
# 3.2. Answer Generation and Extraction
|
| 122 |
+
|
| 123 |
+
Given the complex nature of CAPTURE, we allow models to generate open-ended responses and then subsequently extract answers. Further details (including the maximum number of tokens) can be found in Appendix A.2.
|
| 124 |
+
|
| 125 |
+
Answer extraction. Empirically, we found that constraining the output to a specific format for ease of analysis neg-
|
| 126 |
+
|
| 127 |
+
atively impacted benchmark performance. Therefore, we instead prompt models to generate freely and extract the final output number using a separate answer extractor based on Llama 3.1 8B [1]. This answer extractor takes the output from the model as input and prompts it to extract a single number representing the final answer. The answer extractor also identifies if an output failed to converge on a singular number answer and assigns a label to these examples. We mark such incomplete/incoherent model generations as ‘skipped’ questions and when calculating the error later, these responses are assigned the worst possible sMAPE score $( 1 0 0 \% )$ . The answer extractor outputs were manually verified on 1000 outputs, and the extractor was found to be $100 \%$ accurate.
|
| 128 |
+
|
| 129 |
+
Human and object detection baselines. We also report the performance of humans and a recent counting model (COUNTGD [3]) as baselines to establish a point of reference for model performance. To confirm that humans can perform the CAPTURE task, we provided 100 randomly selected occluded examples each from the CAPTUREreal and CAPTUREsynthetic subsets to 3 undergraduate students with no prior knowledge of the task.
|
| 130 |
+
|
| 131 |
+
# 4. Results and Analysis
|
| 132 |
+
|
| 133 |
+
# 4.1. Main Results on CAPTUREreal
|
| 134 |
+
|
| 135 |
+
Models consistently struggle with counting and perform worse on occluded images. We run the VLMs on the occluded and unoccluded versions of CAPTURE to discern whether occlusion significantly impacts model performance. Tab. 2 shows that all models struggle with counting generally, performing poorly on both splits. Moreover, we see that every model performs better on the unoccluded images. On average, the models perform $6 . 2 8 \%$ worse in CAPTUREreal occluded images and $4 . 8 5 \%$ worse in CAPTUREsynthetic occluded images (in terms of absolute sMAPE), indicating increased difficulty from a standard counting task. The best model for both splits, GPT-4o, has an error rate of $1 4 . 7 5 \%$ on CAPTUREreal and a lower error rate of $9 . 7 1 \%$ on CAPTUREsynthetic. Across both the real and synthetic split, GPT-4o’s error increases with occlusion, by $1 . 4 1 \%$ on the real data and $3 . 8 1 \%$ on the synthetic split. Interestingly, despite its fine-tuning on counting tasks, Molmo exhibits a sizable error rate of $3 2 . 5 \%$ on CAPTUREreal occluded images. The high error rates of VLMs indicate limited capabilities in visual understanding under occlusions, pattern recognition, and counting. We further analyze the source of these errors with oracle experiments in Sec. 4.3.
|
| 136 |
+
|
| 137 |
+
Humans complete the task with almost no error. Tab. 3, evaluated on a 100-example subset of each split, confirms that humans complete the task with ease despite occlusion,
|
| 138 |
+
|
| 139 |
+
Table 2. Results across VLMs on all splits of CAPTURE, with average error for each column. Metric: sMAPE (lower is better).
|
| 140 |
+
|
| 141 |
+
<table><tr><td rowspan="3">Model</td><td colspan="4">Error (%) [↓]</td></tr><tr><td colspan="2">CAPTUREreal</td><td colspan="2">CAPTUREsynthetic</td></tr><tr><td>Original</td><td>w/ Occlusion (Δ)</td><td>Original</td><td>w/ Occlusion (Δ)</td></tr><tr><td>GPT-4o</td><td>13.34</td><td>14.75 (+1.41)</td><td>5.90</td><td>9.71 (+3.81)</td></tr><tr><td>InternVL2</td><td>26.17</td><td>32.90 (+6.73)</td><td>16.44</td><td>17.57 (+1.13)</td></tr><tr><td>Molmo</td><td>25.90</td><td>32.49 (+6.59)</td><td>8.40</td><td>17.73 (+9.33)</td></tr><tr><td>Qwen2VL</td><td>18.96</td><td>29.33 (+10.37)</td><td>6.63</td><td>11.74 (+5.11)</td></tr><tr><td>MiniCPM-o 2.6</td><td>23.84</td><td>30.08 (+6.24)</td><td>17.06</td><td>19.00 (+1.94)</td></tr><tr><td>Kimi-VL-A3B</td><td>23.48</td><td>25.96 (+2.48)</td><td>16.91</td><td>18.07 (+1.16)</td></tr><tr><td>Avg. of 6 VLMs</td><td>21.95</td><td>27.59 (+5.64)</td><td>11.89</td><td>15.64 (+3.75)</td></tr></table>
|
| 142 |
+
|
| 143 |
+
Table 3. Human baseline vs VLMs on CAPTUREreal and CAP-TUREsynthetic (occluded split). Metric: sMAPE (lower is better).
|
| 144 |
+
|
| 145 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Error (%) [↓]</td></tr><tr><td>CAPTUREreal</td><td>CAPTUREsynthetic</td></tr><tr><td>(Baseline)</td><td></td><td></td></tr><tr><td>Human</td><td>3.79</td><td>0.92</td></tr><tr><td>(VLMs)</td><td></td><td></td></tr><tr><td>GPT-4o</td><td>14.75</td><td>9.71</td></tr><tr><td>InternVL2</td><td>32.90</td><td>17.57</td></tr><tr><td>Molmo</td><td>32.49</td><td>17.73</td></tr><tr><td>Qwen2VL</td><td>29.33</td><td>11.74</td></tr><tr><td>Avg. of 4 VLMs</td><td>27.37</td><td>14.19</td></tr></table>
|
| 146 |
+
|
| 147 |
+
with an sMAPE of $3 . 7 9 \%$ on CAPTUREreal and $0 . 9 2 \%$ on CAPTUREsynthetic. On the same subset of examples, models performed 7 times worse on CAPTUREreal and 14 times worse on CAPTUREsynthetic than humans, underscoring the gap between VLMs and humans in this task.
|
| 148 |
+
|
| 149 |
+
Object detection-based baseline outperforms VLMs. We attempt the task with a strong object detection-based model to highlight that a standard counting approach will experience a greater loss going from unoccluded to occluded environments, as it cannot capture any occluded objects, i.e. cannot reason. We choose COUNTGD [3], the top solution for unoccluded counting on FSC-147, on which it was trained. Because we draw our images from FSC-147’s train and test sets, and COUNTGD trains on FSC-147, we only evaluate COUNTGD on the subset of our data sourced from the FSC-147 test set, consisting of 149 images.
|
| 150 |
+
|
| 151 |
+
We find that COUNTGD deteriorates by $7 . 1 9 \%$ on occluded images, increasing from $3 . 1 5 \%$ sMAPE to $1 0 . 3 4 \%$ as observed in Fig. 5. As expected, COUNTGD outperforms all VLMs on the unoccluded split as it is trained for counting on FSC-147. COUNTGD also outperforms the VLMs on the occluded split, reinforcing that only counting the visible objects is a hard-to-beat baseline. However, the drop in performance with occlusion is greater than the average
|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 5. VLM vs. VLM + CountGD hybrid on questions from the CAPTUREreal (occluded split) that are not in COUNTGD training set. Metric: sMAPE (lower is better).
|
| 155 |
+
|
| 156 |
+
VLM’s drop, highlighting a disadvantage of non-reasoning solutions on CAPTURE: their error is necessarily tied directly to the number of occluded objects and they cannot address the task on their own, whereas a VLM might be able to infer missing objects via reasoning.
|
| 157 |
+
|
| 158 |
+
Hybrid VLM counting systems improve performance. Finding that COUNTGD is far better at counting visible objects than VLMs, we leverage the advantage that COUNTGD has by feeding its visible object count information to the VLMs as part of the prompt. As expected, Fig. 5 illustrates that there is a considerable decrease in error when CountGD and the VLMs are combined. However, this hybrid system still performs worse than COUNTGD alone, indicating VLMs are still subpar even at counting just occluded objects (as further reinforced by Appendix C.3).
|
| 159 |
+
|
| 160 |
+
# 4.2. Effect of Data Factors on VLM Performance
|
| 161 |
+
|
| 162 |
+
Here, we use the CAPTUREsynthetic data (which can be controlled precisely and fully annotated ) to examine which features correlate with model performance. We test the effect of the following variables on final performance: (1) Increasing the number of occluded objects; (2) Varying the pattern. We also investigate whether models can classify patterns, and to what degree models can predict the number of occluded objects only (rather than the total).
|
| 163 |
+
|
| 164 |
+
Models perform worse when more dots are occluded. In Fig. 6 (right), we observe that error increases with re-
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Figure 6. Effect of number of total objects in the image and number of occluded objects on sMAPE from CAPTUREsynthetic (occluded split). Metric: sMAPE (lower is better).
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Figure 7. Effect of pattern type in CAPTUREsynthetic (occluded split) on sMAPE. Metric: sMAPE (lower is better).
|
| 173 |
+
|
| 174 |
+
spect to the number of occluded dots. However, Fig. 6 (left) also shows that performance is less affected by the total number of dots. This suggests that the task difficulty is more closely correlated with the difficulty of occlusion – i.e. the difficulty of the world modeling task – rather than the complexity of the pattern. Some models, such as GPT-4o, deviate from this trend, which has lower error on specific numbers. We further explore model bias in Appendix C.5.
|
| 175 |
+
|
| 176 |
+
Performance depends on pattern type. The controllability of CAPTUREsynthetic allows us to measure the effect of pattern type on performance. In Fig. 7, we find that model performance differs across shapes with some regularity: objects arranged in a circle generally have lower sMAPE than other shapes, across all models. Qwen2VL has an espe-
|
| 177 |
+
|
| 178 |
+
Table 4. VLM accuracy in identifying the correct pattern in CAP-TUREsynthetic. Metric: accuracy (higher is better).
|
| 179 |
+
|
| 180 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Accuracy (%) [↑]</td></tr><tr><td>Original</td><td>w/ Occlusion (Δ)</td></tr><tr><td>GPT-4o</td><td>84.00</td><td>78.52 (-5.48)</td></tr><tr><td>InternVL2</td><td>68.52</td><td>47.48 (-21.04)</td></tr><tr><td>Molmo</td><td>80.70</td><td>65.22 (-15.48)</td></tr><tr><td>Qwen2VL</td><td>88.35</td><td>86.43 (-1.92)</td></tr><tr><td>Avg. of 4 VLMs</td><td>80.39</td><td>69.41 (-10.98)</td></tr></table>
|
| 181 |
+
|
| 182 |
+
cially large decrease in error when given circular arrangements compared to rectangles or triangles.
|
| 183 |
+
|
| 184 |
+
Models can identify patterns. To determine how much model errors can be attributed to a lack of pattern recognition ability, we formulate a separate task where models must recognize the pattern in the image on CAPTUREsynthetic. Here, we frame the task as multiple-choice, asking the model to select from the pattern types available (rectangle, triangle, or circle). Table 4 illustrates that all perform substantially better than random at this task, with most models except InternVL2 achieving accuracy above $80 \%$ in the unoccluded setting. As expected, the patterns were easier to identify in unoccluded scenarios, with models suffering an average accuracy drop of $1 0 . 9 5 \%$ in the occluded setting. Notably, GPT-4o and Qwen2VL have a fairly small drop in performance, suggesting they can generally capture the pattern even in the presence of occlusion.
|
| 185 |
+
|
| 186 |
+
# 4.3. Analysis with Auxiliary Information
|
| 187 |
+
|
| 188 |
+
In Sec. 4.1, we see that models broadly struggle with amodal counting. Here, we seek to disentangle whether this problem results from a failure to reason, the absence of a world model, or both by giving VLMs two different types of auxiliary information: oracle information and predicted information. Oracle information is ground truth and is directly pulled from CAPTURE’s metadata, e.g., object locations. Predicted information generates new information from a completely separate model and gives it to the VLM. This information is not ground truth and is sourced from an external model, such as an image inpainting model, rather than the VLM. By giving the model auxiliary information in the form of reasoning and spatial clues, we can establish how much of each model’s error results from an inability to handle occlusion rather than an inability to recognize and count visible objects.
|
| 189 |
+
|
| 190 |
+
Oracle setup. We test two oracles for CAPTUREreal’s occluded split based on its constituent subtasks: counting the visible objects and inferring/counting occluded objects. Both oracles provide the VLM with text-based coordinates
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
With Occlusion
|
| 194 |
+
With Occlusion Prompt: Count the exact number of cans in the image. Assume the pattern of cans continues behind any black box. Provide the total number of cans as if the black box were not there.
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
All Object Coordinate Oracle
|
| 198 |
+
(w/ Oracle information) All Object Coordinate Oracle Prompt: Count the exact number of cans in the image, including behind the black box… Coordinates of all cans: (59, 43), (219, 38), (356, 43), (522, 36), (63, 180), (73, 335), (214, 186), (379, 184), (524, 177), (220, 332), (372, 329), (525, 325)
|
| 199 |
+
|
| 200 |
+

|
| 201 |
+
Visible Object Coordinate Oracle
|
| 202 |
+
(w/ Oracle information) Visible Object Coordinate Oracle Prompt: Count the exact number of cans in the image, including behind the black box… Coordinates of visible cans: (59, 43), (219, 38), (356, 43), (522, 36), (63, 180), (73, 335)
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Inpainting Pipeline
|
| 206 |
+
(w/ Predicted information) Inpainting Pipeline Prompt: Count the exact number of cans in the image.
|
| 207 |
+
(Fading added only for emphasis to visualize infilling. Final image given to VLM is not faded)
|
| 208 |
+
Figure 8. Example image and text inputs for experiments with auxiliary information experiments (Sec. 4.3). Blue eyes indicate objects for which the All Object Coordinate Oracle or Visible Object Coordinate Oracle extracts coordinates. The brighter part of the image represents the area which Inpainting Pipeline fills in. Example prompts are shown in italics. Blue eye overlays and faded parts of images are for demonstration purposes and are not passed with the image.
|
| 209 |
+
|
| 210 |
+
Table 5. Effect of auxiliary information on occluded CAPTUREreal. $\Delta =$ (Auxiliary Information) − (w/ Occlusion). Metric: sMAPE.
|
| 211 |
+
|
| 212 |
+
<table><tr><td rowspan="2">Model</td><td rowspan="2">Original</td><td rowspan="2">w/ Occlusion</td><td colspan="2">Oracle Information</td><td>Predicted Information</td></tr><tr><td>+ All Coordinates (Δ)</td><td>+ Visible (Δ)</td><td>+ Inpainting (Δ)</td></tr><tr><td>GPT-4o</td><td>13.34</td><td>14.75</td><td>2.93 (-11.82)</td><td>9.20 (-5.55)</td><td>15.89 (+1.14)</td></tr><tr><td>InternVL2</td><td>26.17</td><td>32.90</td><td>17.48 (-15.42)</td><td>25.13 (-7.77)</td><td>31.12 (-1.78)</td></tr><tr><td>Qwen2VL</td><td>18.96</td><td>29.33</td><td>9.62 (-19.71)</td><td>17.70 (-11.63)</td><td>22.64 (-6.69)</td></tr><tr><td>Avg. of 3 VLMs</td><td>19.49</td><td>25.66</td><td>10.01 (-15.65)</td><td>17.34 (-8.32)</td><td>23.22 (-2.44)</td></tr></table>
|
| 213 |
+
|
| 214 |
+
of objects in the image, simplifying the visual task by assuming the VLM effectively has a perfect visual system that can recognize and localize objects in the image. The first oracle, the Visible Object Coordinate Oracle, gives the VLM the coordinates of all unoccluded objects (encoded as text, as seen in Fig. 8) and instructs the model to estimate the number of occluded objects, count the number of visible object coordinates, and add the two. In other words, the model is given oracle information about what objects are visible, thus also revealing key information about the pattern. The second oracle, the All Object Coordinate Oracle, instead gives the model the coordinates of all objects. Here, the model only needs to count the coordinates in the prompt, eliminating the need to reason on the visual input. Note that Molmo is excluded in these tests because it contains a prompt limit that would truncate the list of coordinates. An example of the oracle inputs can be seen in Fig. 8.
|
| 215 |
+
|
| 216 |
+
Prediction setup. In this setting, we provide the VLM with an external world model representation predicted by another model. Specifically, we develop the Inpainting Pipeline to fill in the occluded region via a diffusion-based inpainting model and pass the inpainted image to the VLMs. For the inpainting model, we choose FLUX.1-Fill [dev],
|
| 217 |
+
|
| 218 |
+
whose backbone FLUX.1 [dev] [21] is a top public model in the Text to Image Model Arena [7]. An example input to the VLM can be seen on the far-right of Fig. 8.
|
| 219 |
+
|
| 220 |
+
Providing visible or all object coordinates improves performance substantially. The results in Tab. 2 indicate that models struggle on CAPTURE, which requires identifying a pattern and counting both visible and occluded objects. Moreover, models generally struggle with counting even in unoccluded settings. Both oracles simplify the counting task: All Object Coordinate Oracle reduces the task to simply counting coordinates with no reasoning involved, and Visible Object Coordinate Oracle similarly simplifies the task for visible objects, while still requiring inferring occluded objects. Additionally, under Visible Object Coordinate Oracle, recognizing the pattern shifts from a visual reasoning task to an augmented math problem. Instead of visually reasoning about where objects are located, the VLM considers what patterns the coordinates could make. Translating this task into a text problem results in an average increase of $15 \%$ with all objects coordinate oracle; the errors LLMs make here are due to an inability to count in the text prompt, as opposed to weaknesses in handling occlusion (since all object coordinates are given), and the strongest
|
| 221 |
+
|
| 222 |
+
model, GPT-4o, achieves minimal error here. We also obtain an average increase of $8 \%$ with the visible objects coordinate oracle (shown in Tab. 5), possibly because it allows the more powerful LLM backbone (which is far larger than the vision model in all models tested) to complete the counting task. Taken together, these results suggest that there is much room for improvement in visual world modeling beyond text-based reasoning of VLMs.
|
| 223 |
+
|
| 224 |
+
Providing diffusion-based inpainting improves performance marginally. Similar to the object coordinate oracles, the Inpainting Pipeline (rightmost columns in Fig. 8 and Tab. 5) eliminates the need for world modeling and provides VLMs with an approximation of the image behind the occluder. With the inpainted images, VLM error decreases by almost $2 \%$ for InternVL2 and $7 \%$ for Qwen2VL compared to the original occluded images. GPT-4o’s error increases on inpainted images by a small margin; we hypothesize that this may be because GPT-4o has one of the better world models (based on its superior performance), and thus does not improve further with the inpainted images. Moreover, every VLM still falls short of its unoccluded image performance, indicating that the diffusion model is not a perfect world model. Qualitatively, we find that the inpainting model sometimes fails to output the correct pattern.
|
| 225 |
+
|
| 226 |
+
# 5. Related Work
|
| 227 |
+
|
| 228 |
+
Spatial reasoning in visual question answering. Past work measures the spatial reasoning capabilities of VLMs in the form of visual question answering (VQA) [4, 16] benchmarks. SpartQA [26] asks VLMs to identify the spatial relation (e.g., above, behind, left of) between objects in synthetically created 2D images from NLVR [39]. More recent benchmarks test similar spatial relation understanding with real images [2, 24, 36]. While this past work asks models to provide a text description for a relation between two fully observed objects, CAPTURE measures the world modeling from a partially observed scene, thus requiring the handling of occlusion, pattern recognition, and counting. Together, these constitute a stricter test of spatial reasoning than typical VQA settings.
|
| 229 |
+
|
| 230 |
+
Amodal completion. Occlusions are common in natural scenes, and vision solutions for amodal completion have made significant progress in infilling occlusions [6, 38, 46]. The amodal completion task has evolved from simply completing a shape to filling in appearance (e.g., texture, color, etc.) to finally dealing with fine-grained order perception (multiple stacked occluded objects) [5]. Specifically in Qiu and Di [34], VLMs classify the hidden objects and extract fine details from occluded items. CAPTURE, however, presents a unique category of patterned amodal counting which requires inferring fully occluded objects based on a
|
| 231 |
+
|
| 232 |
+
pattern rather than inferring occluded object wholes based on object parts. In other words, previous work has only attempted tasks that require amodal completion for one object at a time [31, 38, 46], whereas CAPTURE handles multiple objects. Multi-object amodal completion is crucial because in cluttered scenes, entire groups of objects are often occluded. Moreover, the output space of CAPTURE is language (rather than filling pixels).
|
| 233 |
+
|
| 234 |
+
Counting with vision-and-language models. Within the task of counting, the most similar application to CAPTURE is dense counting, where the objects to be counted occlude each other. There are many practical applications of such a task, like counting cells on a crowded slide [8], determining crop yields from densely-packed fields [43], or crowd counting [14, 44, 48]. Liang et al. [23] improved crowd counting with an augmented CLIP [35], i.e. also using VLMs for counting. Additionally, Jenkins et al. [18] introduced an amodal counting benchmark, presenting an occluded 3D counting task where models must count objects on retail shelves. However, our work differs in many ways, as Jenkins et al. [18] only counts retail shelves and uses Li-DAR input. More broadly, dense counting focuses on overlapping objects rather than on counting objects arranged into patterns, which is the focus of CAPTURE.
|
| 235 |
+
|
| 236 |
+
# 6. Conclusion
|
| 237 |
+
|
| 238 |
+
We introduced CAPTURE, a novel benchmark for amodal counting that measures spatial reasoning capabilities under occlusion. CAPTURE is designed to assess VLMs’ ability to form a robust world model and use that model for visual reasoning skills under occlusion. By testing counting, we cast the problem as a measurable task with an objective correct answer that also has real-world utility as VLMs become more broadly adopted. Our results suggest that VLMs struggle to combine reasoning, counting, and world modeling with low performance on occluded and unoccluded images. Our analysis indicates that models improve with oracle information about visible objects (simplifying the reasoning/counting tasks) and predicted information about the occluded objects (also simplifying world modeling), pointing to directions of model improvement.
|
| 239 |
+
|
| 240 |
+
# Acknowledgments
|
| 241 |
+
|
| 242 |
+
This work was supported by DARPA ECOLE Program No. HR00112390060, NSF-CAREER Award 1846185, NSF-AI Engage Institute DRL-2112635, DARPA Machine Commonsense (MCS) Grant N66001-19-2-4031, ARO Award W911NF2110220, ONR Grant N00014-23-1-2356, Microsoft Accelerate Foundation Models Research (AFMR) grant program, and a Bloomberg Data Science PhD Fellowship. The views contained in this article are those of the authors and not of the funding agency.
|
| 243 |
+
|
| 244 |
+
# References
|
| 245 |
+
|
| 246 |
+
[1] AI@Meta. Llama 3.1 model card. Github Model Card, 2024. 4
|
| 247 |
+
[2] Haider Al-Tahan, Quentin Garrido, Randall Balestriero, Diane Bouchacourt, Caner Hazirbas, and Mark Ibrahim. Unibench: Visual reasoning requires rethinking visionlanguage beyond scaling. arXiv preprint arXiv:2408.04810, 2024. 8
|
| 248 |
+
[3] Niki Amini-Naieni, Tengda Han, and Andrew Zisserman. Countgd: Multi-modal open-world counting. arXiv preprint arXiv:2407.04619, 2024. 2, 4, 5
|
| 249 |
+
[4] Stanislaw Antol, Aishwarya Agrawal, Jiasen Lu, Margaret Mitchell, Dhruv Batra, C Lawrence Zitnick, and Devi Parikh. Vqa: Visual question answering. In Proceedings of the IEEE international conference on computer vision, pages 2425– 2433, 2015. 8
|
| 250 |
+
[5] Jiayang Ao, Qiuhong Ke, and Krista A Ehinger. Image amodal completion: A survey. Computer Vision and Image Understanding, 229:103661, 2023. 1, 8
|
| 251 |
+
[6] Jiayang Ao, Yanbei Jiang, Qiuhong Ke, and Krista A Ehinger. Open-world amodal appearance completion. arXiv preprint arXiv:2411.13019, 2024. 8
|
| 252 |
+
[7] Artificial Analysis. Text to image model arena, 2025. Accessed: April 10, 2025. 7
|
| 253 |
+
[8] Soumen Bera. Partially occluded object detection and counting. In Proceedings of the 2015 Third International Conference on Computer, Communication, Control and Information Technology (C3IT), pages 1–6. IEEE, 2015. 8
|
| 254 |
+
[9] Zhe Chen, Jiannan Wu, Wenhai Wang, Weijie Su, Guo Chen, Sen Xing, Muyan Zhong, Qinglong Zhang, Xizhou Zhu, Lewei Lu, Bin Li, Ping Luo, Tong Lu, Yu Qiao, and Jifeng Dai. Internvl: Scaling up vision foundation models and aligning for generic visual-linguistic tasks. arXiv preprint arXiv:2312.14238, 2023. 4
|
| 255 |
+
[10] Zhe Chen, Weiyun Wang, Hao Tian, Shenglong Ye, Zhangwei Gao, Erfei Cui, Wenwen Tong, Kongzhi Hu, Jiapeng Luo, Zheng Ma, et al. How far are we to gpt-4v? closing the gap to commercial multimodal models with open-source suites. arXiv preprint arXiv:2404.16821, 2024. 4
|
| 256 |
+
[11] Davide Chicco, Matthijs J Warrens, and Giuseppe Jurman. The coefficient of determination r-squared is more informative than smape, mae, mape, mse and rmse in regression analysis evaluation. Peerj computer science, 7:e623, 2021. 11
|
| 257 |
+
[12] Nikolas Coupland. How frequent are numbers? Language & Communication, 31(1):27–37, 2011. 13
|
| 258 |
+
[13] Matt Deitke, Christopher Clark, Sangho Lee, Rohun Tripathi, Yue Yang, Jae Sung Park, Mohammadreza Salehi, Niklas Muennighoff, Kyle Lo, Luca Soldaini, et al. Molmo and pixmo: Open weights and open data for state-of-the-art multimodal models. arXiv preprint arXiv:2409.17146, 2024. 4
|
| 259 |
+
[14] Zheyi Fan, Zihao Song, Di Wu, and Yixuan Zhu. Multibranch segmentation-guided attention network for crowd counting. Journal of Visual Communication and Image Representation, 97:103964, 2023. 8
|
| 260 |
+
[15] Benito E Flores. A pragmatic view of accuracy measurement in forecasting. Omega, 14(2):93–98, 1986. 11
|
| 261 |
+
|
| 262 |
+
[16] Yash Goyal, Tejas Khot, Douglas Summers-Stay, Dhruv Batra, and Devi Parikh. Making the v in vqa matter: Elevating the role of image understanding in visual question answering. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 6904–6913, 2017. 8
|
| 263 |
+
[17] David Ha and Jurgen Schmidhuber. Recurrent world models ¨ facilitate policy evolution. Advances in neural information processing systems, 31, 2018. 1
|
| 264 |
+
[18] Porter Jenkins, Kyle Armstrong, Stephen Nelson, Siddhesh Gotad, J Stockton Jenkins, Wade Wilkey, and Tanner Watts. Countnet3d: A 3d computer vision approach to infer counts of occluded objects. In Proceedings of the IEEE/CVF Winter Conference on Applications of Computer Vision, pages 3008–3017, 2023. 8
|
| 265 |
+
[19] Gaetano Kanizsa, Paolo Legrenzi, and Paolo Bozzi. Organization in vision : essays on gestalt perception. Praeger, 1979.
|
| 266 |
+
[20] Kaleb Kassaw, Francesco Luzi, Leslie M Collins, and Jordan M Malof. Are deep learning models robust to partial object occlusion in visual recognition tasks? arXiv preprint arXiv:2409.10775, 2024. 2
|
| 267 |
+
[21] Black Forest Labs. Flux. https://github.com/ black-forest-labs/flux, 2024. 7
|
| 268 |
+
[22] Baiqi Li, Zhiqiu Lin, Wenxuan Peng, Jean de Dieu Nyandwi, Daniel Jiang, Zixian Ma, Simran Khanuja, Ranjay Krishna, Graham Neubig, and Deva Ramanan. Naturalbench: Evaluating vision-language models on natural adversarial samples. arXiv preprint arXiv:2410.14669, 2024. 2
|
| 269 |
+
[23] Dingkang Liang, Jiahao Xie, Zhikang Zou, Xiaoqing Ye, Wei Xu, and Xiang Bai. Crowdclip: Unsupervised crowd counting via vision-language model. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2893–2903, 2023. 8
|
| 270 |
+
[24] Fangyu Liu, Guy Edward Toh Emerson, and Nigel Collier. Visual spatial reasoning. Transactions of the Association for Computational Linguistics, 2023. 8
|
| 271 |
+
[25] Baraka Jacob Maiseli. Optimum design of chamfer masks using symmetric mean absolute percentage error. EURASIP Journal on Image and Video Processing, 2019(1):74, 2019. 11
|
| 272 |
+
[26] Roshanak Mirzaee and Hossein Rajaby. Spartqa: A textual question answering benchmark for spatial reasoning. In The 2021 Annual Conference of the North American Chapter of the Association for Computational Linguistics (NAACL-2021), 2021. 8
|
| 273 |
+
[27] Ingrid R Olson, J Christopher Gatenby, Hoi-Chung Leung, Pawel Skudlarski, and John C Gore. Neuronal representation of occluded objects in the human brain. Neuropsychologia, 42(1):95–104, 2004. 1, 2
|
| 274 |
+
[28] OpenAI. Hello gpt-4o, 2024. 4
|
| 275 |
+
[29] OpenCompass Team. Openvlm leaderboard. https:// huggingface.co/spaces/opencompass/open vlm_leaderboard, 2024. Accessed: 2024-11-13. 4
|
| 276 |
+
[30] Yumiko OTSUKA, So KANAZAWA, and Masami K YAM-AGUCHI. Development of modal and amodal completion in infants. Perception (London. Print), 35(9):1251–1264, 2006. 1, 2
|
| 277 |
+
|
| 278 |
+
[31] Ege Ozguroglu, Ruoshi Liu, D´ıdac Sur´ıs, Dian Chen, Achal Dave, Pavel Tokmakov, and Carl Vondrick. pix2gestalt: Amodal segmentation by synthesizing wholes. In 2024 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pages 3931–3940. IEEE Computer Society, 2024. 8
|
| 279 |
+
[32] Max Peeperkorn, Tom Kouwenhoven, Dan Brown, and Anna Jordanous. Is temperature the creativity parameter of large language models? arXiv preprint arXiv:2405.00492, 2024. 12
|
| 280 |
+
[33] Muhammad Fetrat Qharabagh, Mohammadreza Ghofrani, and Kimon Fountoulakis. Lvlm-count: Enhancing the counting ability of large vision-language models. arXiv preprint arXiv:2412.00686, 2024. 2
|
| 281 |
+
[34] Wenmo Qiu and Xinhan Di. Occ-mllm: Empowering multimodal large language model for the understanding of occluded objects. arXiv preprint arXiv:2410.01261, 2024. 8
|
| 282 |
+
[35] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pages 8748–8763. PmLR, 2021. 8
|
| 283 |
+
[36] Navid Rajabi and Jana Kosecka. Gsr-bench: A benchmark for grounded spatial reasoning evaluation via multimodal llms. arXiv preprint arXiv:2406.13246, 2024. 8
|
| 284 |
+
[37] Viresh Ranjan, Udbhav Sharma, Thu Nguyen, and Minh Hoai. Learning to count everything. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3394–3403, 2021. 3
|
| 285 |
+
[38] Kaziwa Saleh, Sandor Sz´ en´ asi, and Zolt´ an V´ amossy. Mask´ guided gated convolution for amodal content completion. In 2024 IEEE 22nd Jubilee International Symposium on Intelligent Systems and Informatics (SISY), pages 000321–000326. IEEE, 2024. 8
|
| 286 |
+
[39] Alane Suhr, Mike Lewis, James Yeh, and Yoav Artzi. A corpus of natural language for visual reasoning. In Proceedings of the 55th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers), pages 217– 223, Vancouver, Canada, 2017. Association for Computational Linguistics. 8
|
| 287 |
+
[40] Kimi Team, Angang Du, Bohong Yin, Bowei Xing, Bowen Qu, Bowen Wang, Cheng Chen, Chenlin Zhang, Chenzhuang Du, Chu Wei, Congcong Wang, Dehao Zhang, Dikang Du, Dongliang Wang, Enming Yuan, Enzhe Lu, Fang Li, Flood Sung, Guangda Wei, Guokun Lai, Han Zhu, Hao Ding, Hao Hu, Hao Yang, Hao Zhang, Haoning Wu, Haotian Yao, Haoyu Lu, Heng Wang, Hongcheng Gao, Huabin Zheng, Jiaming Li, Jianlin Su, Jianzhou Wang, Jiaqi Deng, Jiezhong Qiu, Jin Xie, Jinhong Wang, Jingyuan Liu, Junjie Yan, Kun Ouyang, Liang Chen, Lin Sui, Longhui Yu, Mengfan Dong, Mengnan Dong, Nuo Xu, Pengyu Cheng, Qizheng Gu, Runjie Zhou, Shaowei Liu, Sihan Cao, Tao Yu, Tianhui Song, Tongtong Bai, Wei Song, Weiran He, Weixiao Huang, Weixin Xu, Xiaokun Yuan, Xingcheng Yao, Xingzhe Wu, Xinxing Zu, Xinyu Zhou, Xinyuan Wang, Y. Charles, Yan Zhong, Yang Li, Yangyang Hu, Yanru Chen, Yejie Wang, Yibo Liu, Yibo Miao, Yidao Qin, Yimin Chen,
|
| 288 |
+
|
| 289 |
+
Yiping Bao, Yiqin Wang, Yongsheng Kang, Yuanxin Liu, Yulun Du, Yuxin Wu, Yuzhi Wang, Yuzi Yan, Zaida Zhou, Zhaowei Li, Zhejun Jiang, Zheng Zhang, Zhilin Yang, Zhiqi Huang, Zihao Huang, Zijia Zhao, and Ziwei Chen. Kimi-VL technical report, 2025. 4
|
| 290 |
+
[41] Peng Wang, Shuai Bai, Sinan Tan, Shijie Wang, Zhihao Fan, Jinze Bai, Keqin Chen, Xuejing Liu, Jialin Wang, Wenbin Ge, Yang Fan, Kai Dang, Mengfei Du, Xuancheng Ren, Rui Men, Dayiheng Liu, Chang Zhou, Jingren Zhou, and Junyang Lin. Qwen2-vl: Enhancing vision-language model’s perception of the world at any resolution. arXiv preprint arXiv:2409.12191, 2024. 4
|
| 291 |
+
[42] Wei-Yao Wang, Zhao Wang, Helen Suzuki, and Yoshiyuki Kobayashi. Seeing is understanding: Unlocking causal attention into modality-mutual attention for multimodal llms. arXiv preprint arXiv:2503.02597, 2025. 2
|
| 292 |
+
[43] Yiding Wang, Yuxin Qin, and Jiali Cui. Occlusion robust wheat ear counting algorithm based on deep learning. Frontiers in Plant Science, 12:645899, 2021. 8
|
| 293 |
+
[44] Yongjie Wang, Feng Wang, and Dongyang Huang. Dualbranch counting method for dense crowd based on selfattention mechanism. Expert Systems with Applications, 236:121272, 2024. 8
|
| 294 |
+
[45] Karen Wynn. Children’s understanding of counting. Cognition, 36(2):155–193, 1990. 1, 2
|
| 295 |
+
[46] Katherine Xu, Lingzhi Zhang, and Jianbo Shi. Amodal completion via progressive mixed context diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9099–9109, 2024. 8
|
| 296 |
+
[47] Yuan Yao, Tianyu Yu, Ao Zhang, Chongyi Wang, Junbo Cui, Hongji Zhu, Tianchi Cai, Haoyu Li, Weilin Zhao, Zhihui He, et al. Minicpm-v: A gpt-4v level mllm on your phone. arXiv preprint arXiv:2408.01800, 2024. 4
|
| 297 |
+
[48] Lifang Zhou, Songlin Rao, Weisheng Li, Bo Hu, and Bo Sun. Multi-branch progressive embedding network for crowd counting. Image and Vision Computing, page 105140, 2024. 8
|
| 298 |
+
|
| 299 |
+
# Appendix
|
| 300 |
+
|
| 301 |
+
# A. Implementation Details
|
| 302 |
+
|
| 303 |
+
# A.1. Metric Details
|
| 304 |
+
|
| 305 |
+
We use symmetric mean percent error (sMAPE) as the primary metric for our benchmarks due to its resistance to bias for under/over predictions and small/large ground truths [25]. The standard metric for a counting benchmark is mean average error (MAE). MAE is popular, but heavily penalizes predictions that deviate by a small margin from big ground truths, highlighting the necessity for a metric that gives equal weighting to all questions. Mean average percent error (MAPE) initially seems appealing but is disproportionally inflated for small ground truths and is biased towards overpredictions. Mean square error (MSE) and root mean square error (RMSE) are also commonly used but are very sensitive to outliers because they square the error. Intuitively, performing well on almost all questions and poorly on a small subset should score better than consistently being wrong. Among commonly-used metrics, sMAPE is the only metric that evaluates performance in relation to the distribution of ground truth elements [11]. There are two common definitions [15] for sMAPE, but we use the one that scales to $100 \%$ . sMAPE is given by:
|
| 306 |
+
|
| 307 |
+
$$
|
| 308 |
+
\mathrm {s M A P E} = 1 0 0 \cdot \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {\left| y _ {i} - \hat {y} _ {i} \right|}{\left| y _ {i} \right| + \left| \hat {y} _ {i} \right|} \tag {2}
|
| 309 |
+
$$
|
| 310 |
+
|
| 311 |
+
where $y _ { i }$ represents the actual values, $\hat { y } _ { i }$ represents the predicted values, and $n$ is the number of observations. sMAPE is capped at $100 \%$ , providing a finite scoring range. This feature is ideal for challenging tasks like ours, as it penalizes model responses that fail to produce an answer.
|
| 312 |
+
|
| 313 |
+
# A.2. Output Tokens
|
| 314 |
+
|
| 315 |
+
To maximize the VLM’s chance at success, we allocate a high number of output tokens to generate a rationale and output. This varies per model. We give 4000 tokens to InternVL2, 2000 tokens to Molmo, and 8192 tokens to Qwen2VL, following their max output lengths. For GPT-4o, we use the default of 4096 tokens.
|
| 316 |
+
|
| 317 |
+
# B. CAPTURE Dataset Creation Details
|
| 318 |
+
|
| 319 |
+
The following expands upon Sec. 2.2. While FSC-147, a diverse counting dataset with manual annotations, is a strong starting point, it cannot immediately be adapted to our task. To make the task of amodal counting solvable, our dataset requires images with patterns in them. A person (or model) can infer how the pattern would continue and thus accurately predict the total number. For questions to be answerable, the dataset’s images must be filtered down to represent patterns a model or person could recognize.
|
| 320 |
+
|
| 321 |
+
Our filtering process follows two stages. First, we prompt GPT-4o to determine whether the objects were arranged in a pattern. Second, if the model responded with “no”, the images were immediately discarded. If the model output was “yes”, the log probability of the token is stored. Empirically, we found that higher log probability values (i.e. higher confidence scores) corresponded to more welldefined patterns in the image. Thus, we use the log probabilities for filtering.
|
| 322 |
+
|
| 323 |
+
Specifically, let $P _ { \mathrm { y e s } }$ be the log probability of the “yes” token and $T$ denote the threshold for determining how welldefined a pattern is.2 To filter the images based on pattern rigidity, we apply the following condition: $e ^ { P _ { \mathrm { y e s } } } \geq T$ . This inequality yields 991 images from the original dataset $( 1 6 . 1 2 \% )$ . Next, we manually filter each of the selected images to ensure that they indeed contain patterns and feature a countable number of objects, excluding 34 images. Afterward, we manually place a “fair” occluding box in each image, i.e. a box that leaves sufficient portions of the pattern visible, such that the pattern can still be inferred from the unoccluded portions of the image. Occluding boxes were also chosen with varying positions and sizes in the image.
|
| 324 |
+
|
| 325 |
+
# C. Additional Analysis
|
| 326 |
+
|
| 327 |
+
Here we provide additional experiments that attempt to either increase model performance on CAPTURE or dissect the reasons behind poor model performance. Chainof-Thought inhibits model performance, while temperature backoff slightly improves performance. Additionally, we find that models struggle at counting just occluded objects, are overconfident in occluded settings, and are biased to predict specific numbers.
|
| 328 |
+
|
| 329 |
+
# C.1. Chain-of-Thought reduces model performance
|
| 330 |
+
|
| 331 |
+
Table 6. CoT experiments (metric: sMAPE).
|
| 332 |
+
|
| 333 |
+
<table><tr><td>Method</td><td>CAPTUREreal</td><td>CAPTUREsynthetic</td></tr><tr><td>GPT-4o</td><td>14.75</td><td>9.71</td></tr><tr><td>GPT-4o w/ CoT</td><td>14.94</td><td>7.73</td></tr><tr><td>Qwen2</td><td>29.33</td><td>11.74</td></tr><tr><td>Qwen2 w/ CoT</td><td>31.57</td><td>37.81</td></tr></table>
|
| 334 |
+
|
| 335 |
+
During development, we experimented with several common strategies including CoT. In Tab. 6, we find that CoT reduces model performance except in the occluded synthetic scenario, most likely because the included examples are very similar to the test prompt.
|
| 336 |
+
|
| 337 |
+
Table 7. Comparison of models on CAPTURE across four scenarios (CAPTUREreal vs. CAPTUREsynthetic, Unoccluded vs. Occluded). “Original” indicates no backoff; “w/ backoff” indicates applying backoff, with \Delta = (w/ backoff ) − (Original). Negative $\Delta$ values indicate an improvement.
|
| 338 |
+
|
| 339 |
+
<table><tr><td rowspan="4">Model</td><td colspan="9">Error (%) (↓)</td></tr><tr><td colspan="4">Real</td><td colspan="5">Synthetic</td></tr><tr><td colspan="2">Unoccluded</td><td colspan="2">Occluded</td><td colspan="2">Unoccluded</td><td colspan="3">Occluded</td></tr><tr><td>Original</td><td>w/ backoff (Δ)</td><td>Original</td><td>w/ backoff (Δ)</td><td>Original</td><td>w/ backoff (Δ)</td><td>Original</td><td colspan="2">w/ backoff (Δ)</td></tr><tr><td>GPT-4o</td><td>13.34</td><td>12.57 (−0.77)</td><td>14.75</td><td>14.39 (−0.36)</td><td>5.90</td><td>5.93 (+0.03)</td><td>9.71</td><td colspan="2">9.23 (−0.48)</td></tr><tr><td>InternVL2</td><td>26.17</td><td>27.09 (+0.92)</td><td>32.90</td><td>32.37 (−0.53)</td><td>16.44</td><td>15.59 (−0.85)</td><td>17.57</td><td colspan="2">16.24 (−1.33)</td></tr><tr><td>Molmo</td><td>25.90</td><td>21.23 (−4.67)</td><td>32.49</td><td>28.17 (−4.32)</td><td>8.40</td><td>2.88 (−5.52)</td><td>17.73</td><td colspan="2">15.85 (−1.88)</td></tr><tr><td>Qwen2VL</td><td>18.96</td><td>19.40 (+0.44)</td><td>29.33</td><td>28.47 (−0.86)</td><td>6.63</td><td>6.66 (+0.03)</td><td>11.74</td><td colspan="2">11.51 (−0.23)</td></tr><tr><td>Avg. of 4 VLMs</td><td>21.09</td><td>20.07 (−1.02)</td><td>27.37</td><td>25.85 (−1.52)</td><td>9.34</td><td>7.76 (−1.58)</td><td>14.19</td><td colspan="2">13.21 (−0.98)</td></tr></table>
|
| 340 |
+
|
| 341 |
+
# C.2. Temperature backoff slightly improves model performance
|
| 342 |
+
|
| 343 |
+
To improve VLM performance on CAPTURE, we address a trend we established during early testing. Most of the time, the VLM fails by reaching an incorrect answer. Sometimes, however, our benchmark can cause VLMs to produce a long and irrelevant response that strays from the original prompt, leading to the worst possible sMAPE score $( 1 0 0 \% )$ .
|
| 344 |
+
|
| 345 |
+
To reduce the number of skipped questions, we experiment with temperature backoff, which iteratively decreases the sampling temperature. Because the answer extractor can immediately identify an incoherent output, we can regenerate the response with a lower temperature to get the model to answer the task properly. Consistent with our findings, Peeperkorn et al. [32] also finds that lower temperatures increase coherence in VLMs, thereby enhancing their chances of maintaining relevance to the prompt. Therefore, temperature backoff gives VLMs a better chance of achieving higher scores. Each time the answer extractor returns an empty answer because the VLMs produced an incoherent answer, we reduce the temperature by 0.1 (starting from 1.0) until it reaches 0.0, at which point the example is skipped.
|
| 346 |
+
|
| 347 |
+
Models perform slightly better with temperature backoff. We introduced temperature backoff to reduce model incoherence, and it performed fairly well. As shown in Tab. 7 (bottom), this method slightly improves performance across each model, resulting in an average error reduction of $5 . 7 8 \%$ in CAPTUREreal and $5 . 4 5 \%$ in CAPTUREsynthetic. Temperature backoff essentially allows the model to reattempt the question if it fails to respond to the prompt. Similar to previous results, positive results from reattempts highlight VLMs’ weak reasoning abilities.
|
| 348 |
+
|
| 349 |
+
Table 8. VLM sMAPE for counting all objects and counting only the occluded objects in CAPTUREreal. Metric: sMAPE (lower is better).
|
| 350 |
+
|
| 351 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">Error (%) [↓]</td></tr><tr><td>All Objects</td><td>Only Occluded</td></tr><tr><td>GPT-4o</td><td>14.75</td><td>26.13 (+11.38)</td></tr><tr><td>InternVL2</td><td>32.90</td><td>75.82 (+42.92)</td></tr><tr><td>Molmo</td><td>32.49</td><td>96.79 (+64.30)</td></tr><tr><td>Qwen2VL</td><td>29.33</td><td>32.89 (+3.56)</td></tr><tr><td>Avg. of 4 VLMs</td><td>27.37</td><td>57.91 (+30.54)</td></tr></table>
|
| 352 |
+
|
| 353 |
+
# C.3. Models struggle at counting just occluded objects
|
| 354 |
+
|
| 355 |
+
We separately test whether models can count only the occluded objects (not including the visible objects) in an image. Here, as Tab. 8 demonstrates, the models perform especially poorly in this task, with high error rates across all models. Therefore, we can conclude that occlusion and counting are uniquely difficult for the VLMs, and that the drop in performance between unoccluded and occluded settings in Tab. 2 is likely due to a poor ability to count occluded objects.
|
| 356 |
+
|
| 357 |
+
# C.4. Models are overconfident in occluded settings
|
| 358 |
+
|
| 359 |
+
We test the uncertainty with two different methods of obtaining confidence on Qwen2VL. In the first method, we prompt Qwen2VL for its confidence in the answer. For the second method, we generate 20 responses for every question in our VQA and calculate the confidence as the percentage of times the most common answer was generated. These results can be seen in Fig. 9 and Fig. 10 respectively. In both reliability curves, there is a slight trend that the model’s confidence is negatively correlated with the error, which is the desired outcome. In CAPTUREreal, how-
|
| 360 |
+
|
| 361 |
+
ever, the correlation is much stronger. While the models are somewhat calibrated (with generally lower confidence on higher-error examples, there are still outliers in prompted confidence for CAPTUREreal occluded and sampled confidence for CAPTUREsynthetic occluded. This indicates that not only do the models perform worse under occlusion, but they can also be overconfident.
|
| 362 |
+
|
| 363 |
+

|
| 364 |
+
Figure 9. Reliability curve of prompting model for confidence vs. sMAPE.
|
| 365 |
+
|
| 366 |
+

|
| 367 |
+
Figure 10. Reliability curve of sampling model for confidence vs. sMAPE.
|
| 368 |
+
|
| 369 |
+
# C.5. Models are biased to predict specific numbers.
|
| 370 |
+
|
| 371 |
+
To examine where models frequently err, we generated a confusion matrix for every model based on CAP-TUREsynthetic results (shown in Appendix C.5). The y-axis represents the ground truth values and the x-axis represents the model’s answers. We find that models often over-predict
|
| 372 |
+
|
| 373 |
+
numbers associated with common counts in real life: GPT-4o tends to predict numbers like 8, 9, 10, and 12, which are all non-prime numbers (i.e. can be arranged into a grid) and common groupings of objects. For example, 12 is a common grouping (dozens) and allows arrangements into 3x4 or 2x6 grids. InternVL and Qwen2VL over-predict 5 and 10, aligning with how humans conceptualize numbers. Indeed, Coupland [12] found that numbers 5, 10, 20, and other round numbers appear disproportionally more in online texts. Molmo has no correlation with these factors, possibly due to its unique “point and count” ability.
|
| 374 |
+
|
| 375 |
+
# D. VLM Prompts
|
| 376 |
+
|
| 377 |
+
We use a 100-example validation set for each setting to select the best prompt, which we report below.
|
| 378 |
+
|
| 379 |
+
# Prompt for GPT-4o on CAPTUREreal unoccluded split.
|
| 380 |
+
|
| 381 |
+
Count the exact number of [object] in the image. Assume the pattern of [object] continues behind any black box. Provide the total number of [object] as if the black box were not there.
|
| 382 |
+
|
| 383 |
+
# Prompt for InternVL2 on CAPTUREreal unoccluded split.
|
| 384 |
+
|
| 385 |
+
Your task is to count objects in the image. First, state what the pattern is, then give your final count.
|
| 386 |
+
|
| 387 |
+
# Prompt for Molmo on CAPTUREreal unoccluded split.
|
| 388 |
+
|
| 389 |
+
Count the exact number of [object] in the image. Only count [object] that are visible within the frame. If [object] are partially in the frame (i.e. if any part of [object] are visible), count it.
|
| 390 |
+
|
| 391 |
+
# Prompt for Qwen2VL on CAPTUREreal unoccluded split.
|
| 392 |
+
|
| 393 |
+
Count the exact number of [object] in the image. Assume the pattern of [object] continues behind any black box. Provide the total number of [object] as if the black box were not there. Only count [object] that are visible within the frame (or would be visible without the occluding box). If [object] are partially in the frame (i.e. if any part of [object] are visible), count it. If the [object] would be partially in the frame without the occluding box, count it.
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
|
| 399 |
+

|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
Figure 11. Confusion matrix: predicted vs. ground truth counts for CAPTUREreal’s occluded split.
|
| 403 |
+
|
| 404 |
+
# Prompt for GPT-4o, InternVL2, and Qwen2VL on CAPTUREreal occluded split.
|
| 405 |
+
|
| 406 |
+
Count the exact number of [object] in the image. Assume the pattern of [object] continues behind any black box. Provide the total number of [object] as if the black box were not there. Only count [object] that are visible within the frame (or would be visible without the occluding box). If [object] are partially in the frame (i.e. if any part of [object] are visible), count it. If the [object] would be partially in the frame without the occluding box, count it. Molmo: Your task is to count objects in the image. Assume the pattern of [object] continues behind the black box. First, state what the pattern is, then give your final count.
|
| 407 |
+
|
| 408 |
+
# Prompt for Molmo on CAPTUREreal occluded split.
|
| 409 |
+
|
| 410 |
+
Your task is to count objects in the image. Assume the pattern of [object] continues behind the black box. First, state what the pattern is, then give your final count.
|
| 411 |
+
|
| 412 |
+
# Prompt for GPT-4o on CAPTUREsynthetic unoccluded split.
|
| 413 |
+
|
| 414 |
+
Your task is to count objects in the image. First, state what the pattern is, then give your final count.
|
| 415 |
+
|
| 416 |
+
# Prompt for InternVL2 on CAPTUREsynthetic unoccluded split.
|
| 417 |
+
|
| 418 |
+
Count the exact number of [dot shape]s in the image. Only count [dot shape]s that are visible within the frame. If [dot shape]s are partially in the frame (i.e. if any part of [dot shape]s are visible), count it.
|
| 419 |
+
|
| 420 |
+
# Prompt for Molmo on CAPTUREsynthetic unoccluded split.
|
| 421 |
+
|
| 422 |
+
Count the exact number of [dot shape]s in the image. Only count [dot shape]s that are visible within the frame.
|
| 423 |
+
|
| 424 |
+
# Prompt for Qwen2VL on CAPTUREsynthetic unoccluded split.
|
| 425 |
+
|
| 426 |
+
Count the exact number of [dot shape]s in the image. Assume the pattern of [dot shape]s continues behind any black box. Provide the total number of [dot shape]s as if the black box were not there. Only count [dot shape]s that are visible within the frame (or would be visible without the occluding box). If [dot shape]s are partially in the frame (i.e. if any part of [dot shape]s are visible), count it. If the [dot shape]s would be partially in the frame without the occluding box, count it.
|
| 427 |
+
|
| 428 |
+
# Prompt for GPT-4o and Molmo on CAP-TUREsynthetic occluded split.
|
| 429 |
+
|
| 430 |
+
Your task is to count objects in the image. Assume the pattern of [dot shape]s continues behind the black box. First, state what the pattern is, then give your final count.
|
| 431 |
+
|
| 432 |
+
# Prompt for InternVL2 and Qwen2VL on CAP-TUREsynthetic occluded split.
|
| 433 |
+
|
| 434 |
+
Count the exact number of [dot shape]s in the image. Assume the pattern of [dot shape]s continues behind any black box. Provide the total number of [dot shape]s as if the black box were not there. Only count [dot shape]s that are visible within the frame (or would be visible without the occluding box). If [dot shape]s are partially in the frame (i.e. if any part of [dot shape]s are visible), count it. If the [dot shape]s would be partially in the frame without the occluding box, count it.
|
paper_markdowns/bamboo-02051.md
ADDED
|
@@ -0,0 +1,565 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# VisRL: Intention-Driven Visual Perception via Reinforced Reasoning
|
| 2 |
+
|
| 3 |
+
Zhangquan Chen1* Xufang Luo2† Dongsheng Li2
|
| 4 |
+
|
| 5 |
+
1Tsinghua University, Beijing, China 2 Microsoft Research Asia, Shanghai, China
|
| 6 |
+
|
| 7 |
+
# Abstract
|
| 8 |
+
|
| 9 |
+
Visual understanding is inherently intention-driven—humans selectively focus on different regions of a scene based on their goals. Recent advances in large multimodal models (LMMs) enable flexible expression of such intentions through natural language, allowing queries to guide visual reasoning processes. Frameworks like Visual Chain-of-Thought have demonstrated the benefit of incorporating explicit reasoning steps, where the model predicts a focus region before answering a query. However, existing approaches rely heavily on supervised training with annotated intermediate bounding boxes, which severely limits scalability due to the combinatorial explosion of intention-region pairs. To overcome this limitation, we propose VisRL, the first framework that applies reinforcement learning (RL) to the problem of intention-driven visual perception. VisRL optimizes the entire visual reasoning process using only reward signals. By treating intermediate focus selection as an internal decision optimized through trial-and-error, our method eliminates the need for costly region annotations while aligning more closely with how humans learn to perceive the world. Extensive experiments across multiple benchmarks show that VisRL consistently outperforms strong baselines, demonstrating both its effectiveness and its strong generalization across different LMMs. Our code is available at https://github.com/zhangquanchen/VisRL.
|
| 10 |
+
|
| 11 |
+
# 1. Introduction
|
| 12 |
+
|
| 13 |
+
Visual understanding is a fundamental problem in computer vision, enabling machines to interpret and interact with their surroundings [25, 54, 78]. Traditional methods of visual perception often process entire scenes uniformly [11, 13, 30, 61, 91], without considering the intent behind a given task. However, human perception is inherently intention-driven — people focus on different aspects of a scene depending on their goals. For example, when entering a room, a person searching for a television remote will
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1. Illustration of using RL to optimize the visual reasoning process. SFT trains with densely annotated training data for several epochs. VisRL leverages self-generated data and self-provided rewards to iteratively update the model using step-level DPO. This RL process removes the need for bounding box annotations, enabling a more human-like, intention-driven visual perception.
|
| 17 |
+
|
| 18 |
+
scan tables and couches, while someone checking the time will look at the walls for a clock. This context-dependent approach to visual perception suggests that intelligent models should also adapt their focus based on the task at hand. This leads to the problem of intention-driven visual perception, where the goal is to dynamically determine the most relevant regions of an image based on a given query or task [67].
|
| 19 |
+
|
| 20 |
+
With the advent of large multimodal models, the intention in perception tasks can now be expressed in a highly flexible way, which is natural language. Common LMMs, such as LLaVA [43] and Qwen-VL [75], first encode visual signals into tokens, and then both visual and text tokens are jointly processed by the large language models to produce final outputs. Despite showing powerful ability in many tasks [14, 15, 33, 39, 76, 90, 92], this kind of one-pass endto-end LMMs still suffer from hallucinations [23] and do not explicitly address the intention-driven visual perception problem. Further extending this paradigm, instead of treating the entire process as a single black-box inference, recent works have proposed frameworks like Visual Chain-of-Thought (Visual CoT [62]). These methods introduce an explicit reasoning step where the model first predicts a bounding box
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Figure 2. The schematic illustration of our VisRL framework. VisRL first utilizes a small amount of data for SFT warm-up, but in the subsequent RL training phase, it can leverage large-scale data without bounding box annotations. The RL phase of VisRL consists of iterative cycles of data generation and optimization, and $k$ in the figure indicates the iteration index. The data generation process does not rely on external models or annotations; instead, it employs the model itself for data synthesis and scoring. The optimization step adopts step-level DPO to ensure the model learns each step of the reasoning process. In summary, VisRL enables intention-driven visual perception by leveraging RL to learn from task rewards without requiring annotations and external helps.
|
| 24 |
+
|
| 25 |
+
representing the critical region to focus on, crops the image to extract this region, and then feeds the cropped visual input back to the multimodal model. By conditioning the final answer on both the query and the selected focus area, this approach not only improves interpretability but also helps leverage the multi-turn in-context learning capabilities of the underlying LMM.
|
| 26 |
+
|
| 27 |
+
However, despite the advantages brought by methods like Visual CoT, these approaches also impose extremely high requirements on training data. Existing methods rely on supervised learning to teach models to produce intermediate reasoning steps. Specifically, for each intention or query, the training process requires corresponding bounding box annotations to guide the model in identifying the correct focus area. This dependence on exhaustive annotation is impractical, as the same image can correspond to vastly different regions depending on the request. As a result, the annotation complexity grows combinatorially with the diversity of queries, making it impossible to cover all potential cases in a scalable manner.
|
| 28 |
+
|
| 29 |
+
In this work, we propose a novel learning framework VisRL that optimizes the entire reasoning process based solely on rewards and feedback from the task itself, rather than dense annotations (shown in Figure 1). Specifically, we treat the success or failure of the task as a reward signal and apply reinforcement learning (RL) to train the model. Our approach requires no bounding box annotations, thereby addressing the scalability challenge posed by annotation requirements. Furthermore, this learning paradigm aligns more closely with how humans acquire perceptual skills — humans do not learn to focus on specific regions through meticulously annotated training data for each task, but rather through trial-and-error interaction with the environment, gradually developing the ability to adaptively zoom into relevant regions. By leveraging this reward-driven learning strategy, our framework enables intention-driven visual per-
|
| 30 |
+
|
| 31 |
+
ception in a more flexible, scalable, and human-like manner.
|
| 32 |
+
|
| 33 |
+
VisRL adopts an iterative DPO framework to complete the RL process for visual reasoning. This framework consists of multiple cycles of data generation and model optimization. During the data generation phase, we introduce a diversity controller to ensure that the generated bounding boxes cover a wide variety of potential focus regions. Additionally, we apply a filtering mechanism to select questions with appropriate difficulty levels for the current model and to identify the most effective preference pairs associated with each question. During the model optimization phase, we apply a step-level DPO algorithm, ensuring that the model learns to optimize every step of the visual reasoning process.
|
| 34 |
+
|
| 35 |
+
Our contributions can be summarized as follows.
|
| 36 |
+
|
| 37 |
+
• We present VisRL, the first framework to apply RL to the problem of intention-driven visual perception. By addressing the data annotation bottleneck, VisRL establishes a learning process that is much closer to human-like visual understanding.
|
| 38 |
+
• We design a tailored data generation pipeline for VisRL, incorporating both a diversity controller to enhance visual exploration and further use a step-level DPO algorithm to fully exploit the collected data.
|
| 39 |
+
• Extensive experiments across multiple benchmarks demonstrate that VisRL consistently outperforms strong baselines. Moreover, our results show that the effectiveness of VisRL generalizes well across different multimodal models, highlighting its broad applicability.
|
| 40 |
+
|
| 41 |
+
# 2. Related Work
|
| 42 |
+
|
| 43 |
+
Multi-modal Large Language Models With the advancement of large language models (LLMs) [1, 2, 4, 6, 7, 20, 22, 29, 56, 57, 68, 70, 71, 86, 93], multi-modal large language models which integrate vision and language modalities have also experienced rapid development. This progress
|
| 44 |
+
|
| 45 |
+
enables AI systems to better perceive and understand the real-world interplay between visual and textual information. Notable methods like LLaVA [43] aligns image tokens with pre-trained LLMs by training a projector, while other approaches utilize a Q-Former [36, 37] to learn image embeddings via learnable queries after extracting image features. These LMMs provide strong base models for VisRL, as they have the capability to process both visual and language data simultaneously, enabling the completion of the reasoning process.
|
| 46 |
+
|
| 47 |
+
Intention-Driven Visual Models Recently, several methods have attempted to enhance models’ intention-driven visual perception capabilities. VisCoT [62] employs a multiturn interpretable processing mechanism with bounding boxes that dynamically focus on visual inputs. Similarly, SpatialCoT [47] achieves spatial grounding through spatial coordinates, while SegLLM [77] leverages mask-labeled data to enable reasoning about complex user segmentation intentions. ${ \mathrm { V } } ^ { * }$ (SEAL) [80] provides an LLM-guided search mechanism for efficient visual querying. Besides, both MLLM-TPO [85] and VisionLLM v2 [79] achieve intention-driven perception by training decoders for specific downstream tasks. Additionally, MVoT [35]introduces a text-image-text reasoning paradigm by training on interleaved data. These methods generally follow the supervised learning (SL) paradigm, therefore heavily relying on dense-labeled data (e.g., bounding boxes, spatial coordinates, masks, multi-round reasoning conversations), which constrains their ability to scale further. Instead, VisRL uses rewards as learning supervision and gets rid of the requirement on dense annotations. On the other hand, several methods employ tool-usage for enhancement. Specifically, AU-RORA [5] leverages specialized detection models, while Plug-and-Play [9] adopts a multi-agent framework. Besides, ViRReq [67] leverages the knowledge base to decompose visual recognition. However, these approaches rely on external models or knowledge, but not focusing on enhancing the intrinsic capabilities of the models themselves, while VisRL tries to completing the task via learning to reasoning by the model itself.
|
| 48 |
+
|
| 49 |
+
Multimodal Models with Chain-of-Thoughts Chain-of-Thought (CoT) reasoning plays an important role for LMMs. The methods can be broadly categorized into two types. (1) Text-thought methods [12, 18, 28, 69, 82] elicit textual CoT reasoning of LLMs in visual reasoning tasks by introducing text thinking tokens inspired by [24], guiding towards the final response. Differently, VisRL emphasizes that visual information should be involved in the reasoning process to fully leverage the strengths of multimodal models, rather than relying solely on language tokens for reasoning. (2) Multi-modal-thought methods involves multimodal informa-
|
| 50 |
+
|
| 51 |
+
tion in the reasoning process. The Mind’s Eye [81] elicits spatial reasoning of LLMs by visualizing their reasoning traces. Additionally, [47, 62, 77] first generate visual marks (e.g. bounding boxes, spatial coordinates, masks), and subsequently perform CoT reasoning based on these fine-grained visual marks. These works still uses SL for optimization while VisRL first explores RL in this direction. Besides, recent repositories [48, 63] also tried to enhance the bounding boxes (bboxes) generation through RL, but they uses ground truth bboxes to give rewards, which is still limited by dense annotation data.
|
| 52 |
+
|
| 53 |
+
# 3. Methodology
|
| 54 |
+
|
| 55 |
+
Preliminary. Reinforcement Learning [17] stands out as a highly effective method for significantly bolstering the robustness, factual accuracy, and safety of large language models [53]. The method consists of two key training stages, namely the reward model training and the policy model training. To avoid this complex training pipeline, [59] proposed Direct Preference Optimization (DPO). DPO streamlines the process by directly leveraging pair-wise preference data to optimize the policy model with an equivalent optimization objective. Specifically, given an input prompt $x$ , and a preference data pair $\left( y _ { w i n } , y _ { l o s e } \right)$ , DPO aims to maximize the probability of the preferred output $y _ { w i n }$ and minimize that of the undesirable output $y _ { l o s e }$ . The optimization objective is formulated as:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
\mathcal {L} _ {D P O} (\theta) = - \mathbb {E} _ {(x, y _ {\text {w i n}}, y _ {\text {l o s e}}) \sim D} (P (\theta)), \tag {1}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
where $D$ is the pair-wise preference dataset, and $P _ { \theta }$ is:
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
P (\theta) = \log \sigma \left(\beta \log \frac {\pi_ {\theta} \left(y _ {w i n} \mid x\right)}{\pi_ {r e f} \left(y _ {w i n} \mid x\right)} - \beta \log \frac {\pi_ {\theta} \left(y _ {l o s e} \mid x\right)}{\pi_ {r e f} \left(y _ {l o s e} \mid x\right)}\right). \tag {2}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
$\sigma$ is the sigmoid function, $\pi _ { \theta } ( \cdot \mid x )$ is the policy model to be optimized, $\pi _ { r e f } ( \cdot \mid x )$ is the reference model kept unchanged during training, and the hyperparameter $\beta$ serves to regulate the proximity of the policy model to the reference model.
|
| 68 |
+
|
| 69 |
+
Method overview. As shown in Figure 2, VisRL adopts DPO to optimize the entire visual reasoning process due to its simplicity. Our method leverages the final task success or failure as the outcome reward, and the grades of intermediate steps as the process reward, guiding the model to gradually refine its reasoning process through reinforcement learning. This reasoning process is divided into two steps. In the first step, the model generates a bounding box $B$ representing the focused area based on the given query or question $Q$ and the original image $I$ . In the second step, the cropped region $I ^ { s }$ corresponding to the bounding box, together with the original image and the question, is fed into the multimodal model to produce the final response $R$ .
|
| 70 |
+
|
| 71 |
+
In Section 3.1, we will describe the data generation process required to support this two-stage reasoning pipeline. In Section 3.2, we will introduce the optimization strategy, explaining how stepwise DPO is applied to enable the model to aquire intention-driven visual perception ability.
|
| 72 |
+
|
| 73 |
+
Notably, this data generation and optimization process will be iterated multiple times. The improved model can collect better data, and the better data will further refine the model. The initial model before RL training is denoted with $\mathcal { M } _ { R L } ^ { 0 }$ , and the model which is updated with $k$ iterations is RLdenoted with $\mathcal { M } _ { R L } ^ { k }$ .
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 3. The schematic illustration of our data generation pipeline. Here $\mathcal { M } _ { R L } ^ { k }$ denotes the model updated with $k$ iterations of data generation and optimization, and $\mathcal { M } _ { o r g }$ is the original model. VisRL uses $\mathcal { M } _ { R L } ^ { k }$ to generate samples, and use $\mathcal { M } _ { o r g }$ to provide rewards. Hence, different versions of a single model are used in this selfevolution data generation process, and no bounding box annotations and external models are introduced in this process.
|
| 77 |
+
|
| 78 |
+
# 3.1. Data Generation
|
| 79 |
+
|
| 80 |
+
Before RL training, we use SFT as a warm-up stage. This stage changes the original model $\mathcal { M } _ { o r g }$ into $\mathcal { M } _ { S F T }$ , so $\mathcal { M } _ { S F T }$ is $\mathcal { M } _ { R L } ^ { 0 }$ . This stage requires bounding box annotations, so we directly use samples from VisCoT dataset [62]. Our intent here is just to make the model have the basic ability to generate bounding boxes in specific format. Therefore, the used data amount is relatively small here (30k in ours and $4 3 8 \mathrm { k }$ in VisCoT). The second part of our source datasets consists of question-answer pairs from nine source datasets that span five distinct domains, with the majority of them being Visual Question Answering (VQA) and Image Captioning datasets. These are specifically used for constructing preference data for RL training, therefore requiring no bounding box annotations. We use an additional 180k data here. Then, we explain how we construct preference data based on our source datasets in details.
|
| 81 |
+
|
| 82 |
+
Self-evolution. The critical parts for enabling effective RL learning is generating CoT data, and providing reward signals. Unlike previous manual annotation methods, which is infeasible for providing widely enough coverage for all possible cases, or approaches that rely on more powerful external models, which is more like distillation rather than allowing the model to learn on its own, we adopt a strategy that does
|
| 83 |
+
|
| 84 |
+
not depend on external capabilities—instead, leveraging the model’s own self-evolution. To achieve this, we sample from $\mathcal { M } _ { S F T }$ multiple times to generate CoT data with as much diversity as possible, while use $\mathcal { M } _ { o r g }$ to provide criticism. This approach not only showcases the intrinsic capabilities of the model, but also facilitates a more effective adjustment of the predicted probability distribution toward a stable state through self-generated data.
|
| 85 |
+
|
| 86 |
+
Sample generation and rewarding. For each input question and image $( Q , I )$ , we first sample from $\mathcal { M } _ { S F T }$ twice to obtain the bounding boxes $B _ { 1 }$ and $B _ { 2 }$ , respectively. Then, we introduce a diversity controller to ensure diversity of bounding boxes. Specifically, we update $B _ { 2 }$ according to the Intersection over Union (IoU) and the rejecting threshold value $\tau$ between $B _ { 1 }$ and $B _ { 2 }$ , which is formulated as:
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\hat {B} _ {2} = \left\{ \begin{array}{l l} B _ {2}, & \operatorname {I o U} \left(B _ {1}, B _ {2}\right) < \mathcal {T} \\ \mathcal {R} _ {\mathcal {S}} \left(\mathcal {U} _ {\mathcal {I}} \left(B _ {1}\right)\right), & \operatorname {I o U} \left(B _ {1}, B _ {2}\right) \geq \mathcal {T} \end{array} , \right. \tag {3}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $\mathcal { U } _ { \mathcal { I } } ( B _ { 1 } )$ is a set of bounding boxes that are outside of $B _ { 1 }$ but within image $I$ . The operator $\mathcal { R } _ { \mathcal { S } } ( \cdot )$ represents a random selection from the set $\mathcal { U } _ { \mathcal { I } } ( B _ { 1 } )$ , and have an area differing by no more than $S$ compared to $B _ { 1 }$ .
|
| 93 |
+
|
| 94 |
+
Based on the bounding boxes $B _ { 1 }$ and $\hat { B _ { 2 } }$ , we crop the sub-image $I _ { 1 } ^ { s }$ and $I _ { 2 } ^ { s }$ from $I$ , respectively. Then, we input $( Q , I , I _ { 1 } ^ { s } )$ and $\left( Q , I , I _ { 2 } ^ { s } \right)$ to the model to obtain final responses $R _ { 1 }$ and $R _ { 2 }$ , separately. At this point, we have completed the sampling of two distinct CoT reasoning paths.
|
| 95 |
+
|
| 96 |
+
Then, we should evaluate whether the paths are good or not. VisRL uses the original model before SFT stage $\mathcal { M } _ { o r g }$ as a critic to score the pairs $B _ { 1 } , B _ { 2 }$ and $R _ { 1 } , R _ { 2 }$ . Scores for the bounding boxes and the final responses are denoted with $s _ { 1 } ^ { b } , s _ { 2 } ^ { b }$ and $s _ { 1 } ^ { r } , s _ { 2 } ^ { r }$ , respectively. For more details including prompt designs, please refer to Sec. C in the Supp. Mat..
|
| 97 |
+
|
| 98 |
+
Data filtering. For each input question and image, repeating the above data generation process $N$ times, we will obtain a set of $2 N$ candidates $P = \{ p _ { 1 } , p _ { 2 } , . . . , p _ { 2 N } \}$ , where each $p$ contains original question, image, one bounding box, cropped sub-image, the final response and two scores, i.e., $p _ { i } = ( Q , I , B _ { i } , I _ { i } ^ { s } , R _ { i } , s _ { i } ^ { b } , s _ { i } ^ { r } )$ .
|
| 99 |
+
|
| 100 |
+
Moreover, to ensure the validity of preference data pairs in the candidate set $P$ , we apply filtering by setting win and lose thresholds, $\mathcal { T } _ { m a x } ^ { b }$ and $ { T _ { m i n } } ^ { b }$ for bounding boxes, $\mathcal { T } _ { m a x } ^ { r }$ and $\mathcal { T } _ { m i n } ^ { r }$ for responses:
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
P _ {w i n} = \left\{p _ {i} \mid s _ {i} ^ {b} \geq \mathcal {T} _ {\max } ^ {b} \text {a n d} s _ {i} ^ {r} \geq \mathcal {T} _ {\max } ^ {r} \right\} \tag {4}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
P _ {l o s e} = \left\{p _ {i} \mid s _ {i} ^ {b} < \mathcal {T} _ {\min } ^ {b} \text {a n d} s _ {i} ^ {r} < \mathcal {T} _ {\min } ^ {r} \right\}.
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
For the current question and image $( Q , I )$ , if the win set and the loss set are not empty, this question and image and its corresponding generated data are preserved. The intuition here is that we apply a filter to the questions in the dataset, selecting those with a difficulty level suitable for the current model. Questions that are too difficult will prevent the model
|
| 111 |
+
|
| 112 |
+
from generating meaningful answers, while questions that are too easy will result in the model producing correct answers across the board. Both of these types of questions will be filtered out during the current training round. However, as the model’s capabilities are updated and strengthened, less data are filtered in the next iteration, as indicated by Data Num. of VisRL-Full vs. VisRL-Full-Iter1 in Tab. 6.
|
| 113 |
+
|
| 114 |
+
Then, for each preserved question, we select the most representative path from each set to obtain the win-lose preference pairs, denoted as $\begin{array} { r l } { ( p _ { w i n } , p _ { l o s e } ) } & { { } = } \end{array}$ $( { \mathcal { C } } _ { m a x } ( P _ { w i n } ) , { \mathcal { C } } _ { m i n } ( P _ { l o s e } ) )$ . In the case of $\mathcal { C } _ { m a x }$ , it is required that both $s ^ { b }$ and $s ^ { r }$ of $p _ { i }$ are the maximum over the other elements in the set $P _ { w i n }$ . Conversely, $\mathcal { C } _ { m i n }$ requires that both scores are the minimum in the set $P _ { l o s e }$ . If the condition of being simultaneously maximum/minimum on both $s ^ { b }$ and $s ^ { r }$ is not met, the data point will also be discarded. Finally, we obtain the preference dataset $D _ { P } = \{ ( p _ { w i n _ { 1 } } , p _ { l o s e _ { 1 } } ) , ( p _ { w i n _ { 2 } } , p _ { l o s e _ { 2 } } ) . . . \}$
|
| 115 |
+
|
| 116 |
+
# 3.2. Reinforced Visual Reasoning
|
| 117 |
+
|
| 118 |
+
Similar with [34], VisRL uses a step-level DPO method. It is divided into two stages. Stage 1 involves optimizing the bounding box, while stage 2 focuses on the joint optimization of the bounding box and the final response. For stage 1, given the input question-image $x = ( Q , I )$ , the objective is:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathcal {L} _ {s t a g e 1} (\theta) = - \mathbb {E} _ {(x, B _ {w i n}, B _ {l o s e}) \sim D _ {P}} \left(P _ {B} (\theta)\right), \tag {5}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where each pair-wise preference paths in $D _ { P }$ consists of bouding boxes $B _ { w i n }$ and $B _ { l o s e }$ , the formulation of bounding box preference probability is:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
P _ {B} (\theta) = \log \sigma \left(\beta_ {1} \log \frac {\pi_ {\theta} \left(B _ {w i n} \mid x\right)}{\pi_ {r e f} \left(B _ {w i n} \mid x\right)} - \beta_ {1} \log \frac {\pi_ {\theta} \left(B _ {l o s e} \mid x\right)}{\pi_ {r e f} \left(B _ {l o s e} \mid x\right)}\right) \tag {6}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
After stage1, the policy model updated from $\pi _ { \theta }$ to $\pi _ { \hat { \theta } }$ , while the reference model is updated to $\pi _ { r \hat { e } f }$ . Then, for stage2, we further consider the cropped-image from $B _ { w i n }$ to make CoT inference, that is $\hat { x } = ( Q , I , I _ { w i n } ^ { s } )$ , then the formulation of response preference probability is:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
P _ {R} (\hat {\theta}) = \log \sigma \left(\beta_ {2} \log \frac {\pi_ {\hat {\theta}} \left(R _ {w i n} \mid \hat {x}\right)}{\pi_ {r \hat {e f}} \left(R _ {w i n} \mid \hat {x}\right)} - \beta_ {2} \log \frac {\pi_ {\hat {\theta}} \left(R _ {l o s e} \mid \hat {x}\right)}{\pi_ {r \hat {e f}} \left(R _ {l o s e} \mid \hat {x}\right)}\right) \tag {7}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where $R _ { w i n }$ and $R _ { l o s e }$ are the final preference responses in $D _ { P }$ . Based on Eq. 6 and Eq. 7, the objective for jointly optimizing the bounding boxes and the responses in stage 2 can be formulated as:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\mathcal {L} _ {\text {s t a g e} 2} (\hat {\theta}) = - \left(\lambda_ {B} \mathcal {L} _ {B} (\hat {\theta}) + \lambda_ {R} \mathcal {L} _ {R} (\hat {\theta})\right), \tag {8}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathcal {L} _ {B} (\hat {\theta}) = \mathbb {E} _ {(x, B _ {w i n}, B _ {l o s e}) \sim D _ {P}} \left(P _ {B} (\hat {\theta})\right), \tag {9}
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
$$
|
| 149 |
+
\mathcal {L} _ {R} (\hat {\theta}) = \mathbb {E} _ {(\hat {x}, R _ {w i n}, R _ {l o s e}) \sim D _ {P}} \left(P _ {R} (\hat {\theta})\right). \tag {10}
|
| 150 |
+
$$
|
| 151 |
+
|
| 152 |
+
# 4. Experiments
|
| 153 |
+
|
| 154 |
+
# 4.1. Comparisons with Baselines
|
| 155 |
+
|
| 156 |
+
We evaluate our method with several state-of-the-art methods on an array of different categories as follows. More details are in Supp. Mat.. As shown in Tab. 1, we categorize methods into three groups based on the types of LLM and vision encoder, then evaluate them on comprehensive benchmarks (MME, MMBench) as well as hallucination benchmarks (POPE). In all cases, our method achieves either the best or second-best performance, demonstrating the robust and wellrounded improvement over the baseline. In contrast, other methods exhibit performance drops on specific benchmarks (e.g., SEAL on MMBench, VisCoT on MME). We attribute this phenomenon to the limitations inherent in their training approaches – data-driven SFT struggles to generalize effectively, while tool-usage methods suffer from intrinsic shortcomings on certain datasets. Notably, our approach achieves highly comprehensive and promising results while using only 30k dense-labeled (w. bounding boxes) samples – significantly fewer than other methods, and without relying on any external capabilities. In particular, under Vicuna-7B and CLIP-ViT-L-14-336, our method outperforms VisCoT across all benchmarks – the representative data-driven SFT approach. Specifically, our method outperforms VisCoT by $5 . 0 0 \%$ (1526.3 vs. 1453.6) on MME and by $1 . 7 4 \%$ (87.5 vs. 86.0) on the hallucination benchmark POPE. Moreover, after 1 iteration (Base Model + VisRL– Iter1), VisRL improves performance by $1 \%$ to $4 \%$ across all benchmarks.
|
| 157 |
+
|
| 158 |
+
# 4.2. Results on Visual CoT Benchmark
|
| 159 |
+
|
| 160 |
+
. In this section, we comprehensively investigate different training phases in VisRL across various base LMMs. We use Visual CoT benchmark here, which primarily focuses on scenarios where the LMM needs to concentrate on specific regions within a complete image.
|
| 161 |
+
|
| 162 |
+
Settings. For SFT, the objective is to regularize the model with the capability of outputting bounding box, while RL is to enhance the model’s visual perception capabilities via rewards. To train the LMM with outputting bounding box in SFT phase, we add a CoT prompt (“Please first provide the bounding box coordinate of the region, then refer to the corresponding sub-image to answer the question better.”) to the question, asking the model to identify the most informative region of the image. As shown in Tab. 3, we found that the model has already been capable of outputting bounding boxes under SFT with the dataset of 30k. Then, we sequentially proceed with further training using stage1 (RL1) and stage2 (RL2) as described in Sec. 3.2.
|
| 163 |
+
|
| 164 |
+
Results. Tab. 2 indicates that after SFT, there is still a decline on some datasets even with the use of visual CoT (e.g. InfogVQA), which further corroborates the validity of our revised SFT strategy. Besides, we found that the difference in
|
| 165 |
+
|
| 166 |
+
Table 1. The evaluation of different baselines on MME [21], MMBench [46], and POPE [38] datasets. Datasets marked with [D] are dense-labeled datasets (e.g., CoT data). In different methods, [B] denotes the base model, [D] represents data-driven SFT methods, and [T] refers to tool-usage methods (e.g., agents). The best is highlighted and the second-best is underlined. Remark: the data number considered here includes only the data used to enhance specific model capabilities and pretraining data, excluding general instruction-tuning dataset.
|
| 167 |
+
|
| 168 |
+
<table><tr><td>Method</td><td>LLM</td><td>Vision Encoder</td><td>MME</td><td>MMBench</td><td>POPE</td><td>Dataset Num.</td></tr><tr><td>LLaVA [B] [43]</td><td>Vicuna-7B [16]</td><td>CLIP-ViT-L-14-224 [58]</td><td>1051.2</td><td>34.4</td><td>76.5</td><td>558K</td></tr><tr><td>SEAL [D] [80]</td><td>Vicuna-7B</td><td>CLIP-ViT-L-14-224</td><td>1128.9</td><td>33.1</td><td>82.4</td><td>558K + 387K [D]</td></tr><tr><td>LLaVA + P2G [T] [9]</td><td>Vicuna-7B</td><td>CLIP-ViT-L-14-224</td><td>1223.0</td><td>—</td><td>—</td><td>558K + 427K [D]</td></tr><tr><td>LLaVA + VIsRL</td><td>Vicuna-7B</td><td>CLIP-ViT-L-14-224</td><td>1183.8</td><td>37.5</td><td>78.2</td><td>558K + 30K [D] + 180K</td></tr><tr><td>LLaVA + VIsRL-Iter1</td><td>Vicuna-7B</td><td>CLIP-ViT-L-14-224</td><td>1238.3</td><td>38.6</td><td>80.4</td><td>180K</td></tr><tr><td>LLaVA-1.5 [B] [42]</td><td>Vicuna-7B</td><td>CLIP-ViT-L-14-336</td><td>1510.7</td><td>64.3</td><td>85.8</td><td>558K</td></tr><tr><td>VisCoT [D] [62]</td><td>Vicuna-7B</td><td>CLIP-ViT-L-14-336</td><td>1453.6</td><td>67.9</td><td>86.0</td><td>558K + 376K [D]</td></tr><tr><td>LLaVA-1.5 + VIsRL</td><td>Vicuna-7B</td><td>CLIP-ViT-L-14-336</td><td>1526.3</td><td>70.1</td><td>87.5</td><td>558K + 30K [D] + 180K</td></tr><tr><td>LLaVA-1.5 + VIsRL-Iter1</td><td>Vicuna-7B</td><td>CLIP-ViT-L-14-336</td><td>1560.0</td><td>71.7</td><td>88.8</td><td>180K</td></tr><tr><td>LLaVA-NeXT [B] [44]</td><td>Vicuna-7B-1.5 [94]</td><td>CLIP-ViT-L-14-336</td><td>1611.1</td><td>72.3</td><td>—</td><td>558K</td></tr><tr><td>VisionLLM v2 [D] [79]</td><td>Vicuna-7B-1.5</td><td>CLIP-ViT-L-14-336</td><td>1512.5</td><td>77.1</td><td>87.5</td><td>892K</td></tr><tr><td>Insight-V-LLaVA [T] [18]</td><td>Vicuna-7B-1.5</td><td>CLIP-ViT-L-14-336</td><td>1583.9</td><td>81.7</td><td>—</td><td>558K + 215K [D]</td></tr><tr><td>LLaVA-NeXT + VIsRL</td><td>Vicuna-7B-1.5</td><td>CLIP-ViT-L-14-336</td><td>1619.2</td><td>78.8</td><td>88.4</td><td>558K + 30K [D] + 180K</td></tr><tr><td>LLaVA-NeXT + VIsRL-Iter1</td><td>Vicuna-7B-1.5</td><td>CLIP-ViT-L-14-336</td><td>1637.0</td><td>80.0</td><td>89.3</td><td>180K</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 2. Performance on the different benchmarks. The amount of dense-labeled CoT data with bounding box annotations used is indicated in []. The best results from different LMMs are highlighted.
|
| 171 |
+
|
| 172 |
+
<table><tr><td rowspan="2">LMM</td><td rowspan="2">Training Phase</td><td colspan="5">Doc/Text</td><td>Chart</td><td>General VQA</td><td colspan="2">Relation Reasoning</td><td colspan="2">Fine-grained</td><td></td></tr><tr><td>DocVQA</td><td>TextCaps</td><td>TextVQA</td><td>DUDE</td><td>SROIE</td><td>InfogVQA</td><td>Flickr30k</td><td>GQA</td><td>Open images</td><td>VSR</td><td>CUB</td><td>Avg</td></tr><tr><td rowspan="5">LLaVA-1.5-7B [42]</td><td>Base (w/o CoT)</td><td>0.244</td><td>0.597</td><td>0.588</td><td>0.290</td><td>0.136</td><td>0.400</td><td>0.581</td><td>0.534</td><td>0.412</td><td>0.572</td><td>0.530</td><td>0.444</td></tr><tr><td>VisCoT [438k] [62]</td><td>0.355</td><td>0.610</td><td>0.719</td><td>0.279</td><td>0.341</td><td>0.356</td><td>0.671</td><td>0.616</td><td>0.833</td><td>0.682</td><td>0.556</td><td>0.547</td></tr><tr><td>SFT [30k]</td><td>0.336</td><td>0.597</td><td>0.715</td><td>0.270</td><td>0.308</td><td>0.336</td><td>0.671</td><td>0.617</td><td>0.833</td><td>0.676</td><td>0.559</td><td>0.538</td></tr><tr><td>SFT+RL1</td><td>0.382</td><td>0.612</td><td>0.724</td><td>0.300</td><td>0.378</td><td>0.406</td><td>0.674</td><td>0.639</td><td>0.838</td><td>0.715</td><td>0.579</td><td>0.568</td></tr><tr><td>SFT+RL1+RL2</td><td>0.419</td><td>0.641</td><td>0.759</td><td>0.394</td><td>0.411</td><td>0.497</td><td>0.675</td><td>0.666</td><td>0.848</td><td>0.748</td><td>0.598</td><td>0.605</td></tr><tr><td rowspan="4">LLaVA-NeXT-7B [44]</td><td>Base (w/o CoT)</td><td>0.431</td><td>0.586</td><td>0.570</td><td>0.332</td><td>0.114</td><td>0.361</td><td>0.525</td><td>0.559</td><td>0.462</td><td>0.594</td><td>0.520</td><td>0.459</td></tr><tr><td>SFT [30k]</td><td>0.423</td><td>0.580</td><td>0.722</td><td>0.330</td><td>0.293</td><td>0.356</td><td>0.589</td><td>0.684</td><td>0.821</td><td>0.767</td><td>0.551</td><td>0.556</td></tr><tr><td>SFT+RL1</td><td>0.474</td><td>0.611</td><td>0.728</td><td>0.373</td><td>0.350</td><td>0.447</td><td>0.592</td><td>0.707</td><td>0.826</td><td>0.837</td><td>0.573</td><td>0.593</td></tr><tr><td>SFT+RL1+RL2</td><td>0.508</td><td>0.655</td><td>0.743</td><td>0.474</td><td>0.379</td><td>0.525</td><td>0.592</td><td>0.738</td><td>0.837</td><td>0.871</td><td>0.587</td><td>0.628</td></tr><tr><td rowspan="4">Llama-3.2-V-11B [52]</td><td>Base (w/o CoT)</td><td>0.797</td><td>0.771</td><td>0.879</td><td>0.588</td><td>0.629</td><td>0.637</td><td>0.601</td><td>0.484</td><td>0.335</td><td>0.589</td><td>0.674</td><td>0.635</td></tr><tr><td>SFT [30k]</td><td>0.776</td><td>0.762</td><td>0.880</td><td>0.584</td><td>0.634</td><td>0.633</td><td>0.712</td><td>0.683</td><td>0.728</td><td>0.720</td><td>0.855</td><td>0.724</td></tr><tr><td>SFT+RL1</td><td>0.811</td><td>0.791</td><td>0.890</td><td>0.599</td><td>0.698</td><td>0.688</td><td>0.724</td><td>0.707</td><td>0.731</td><td>0.738</td><td>0.864</td><td>0.749</td></tr><tr><td>SFT+RL1+RL2</td><td>0.844</td><td>0.835</td><td>0.897</td><td>0.638</td><td>0.733</td><td>0.714</td><td>0.731</td><td>0.757</td><td>0.794</td><td>0.822</td><td>0.884</td><td>0.786</td></tr><tr><td rowspan="4">MiniCPM-o-2.6-8B [87]</td><td>Base (w/o CoT)</td><td>0.528</td><td>0.504</td><td>0.548</td><td>0.125</td><td>0.114</td><td>0.220</td><td>0.534</td><td>0.561</td><td>0.462</td><td>0.585</td><td>0.529</td><td>0.428</td></tr><tr><td>SFT [30k]</td><td>0.518</td><td>0.498</td><td>0.551</td><td>0.134</td><td>0.133</td><td>0.239</td><td>0.615</td><td>0.727</td><td>0.789</td><td>0.787</td><td>0.715</td><td>0.519</td></tr><tr><td>SFT+RL1</td><td>0.551</td><td>0.533</td><td>0.561</td><td>0.150</td><td>0.182</td><td>0.286</td><td>0.630</td><td>0.737</td><td>0.799</td><td>0.824</td><td>0.734</td><td>0.544</td></tr><tr><td>SFT+RL1+RL2</td><td>0.596</td><td>0.600</td><td>0.565</td><td>0.209</td><td>0.251</td><td>0.353</td><td>0.639</td><td>0.793</td><td>0.870</td><td>0.864</td><td>0.756</td><td>0.591</td></tr><tr><td rowspan="4">PaliGemma2-10B [66]</td><td>Base (w/o CoT)</td><td>0.017</td><td>0.498</td><td>0.536</td><td>0.129</td><td>0.114</td><td>0.197</td><td>0.529</td><td>0.558</td><td>0.486</td><td>0.543</td><td>0.541</td><td>0.377</td></tr><tr><td>SFT [30k]</td><td>0.110</td><td>0.498</td><td>0.544</td><td>0.134</td><td>0.133</td><td>0.225</td><td>0.611</td><td>0.718</td><td>0.800</td><td>0.770</td><td>0.724</td><td>0.479</td></tr><tr><td>SFT+RL1</td><td>0.169</td><td>0.527</td><td>0.549</td><td>0.163</td><td>0.179</td><td>0.272</td><td>0.621</td><td>0.731</td><td>0.811</td><td>0.822</td><td>0.736</td><td>0.507</td></tr><tr><td>SFT+RL1+RL2</td><td>0.303</td><td>0.585</td><td>0.560</td><td>0.229</td><td>0.248</td><td>0.336</td><td>0.639</td><td>0.789</td><td>0.884</td><td>0.847</td><td>0.764</td><td>0.562</td></tr><tr><td rowspan="4">Yi-VL-6B [89]</td><td>Base (w/o CoT)</td><td>0.115</td><td>0.522</td><td>0.551</td><td>0.130</td><td>0.122</td><td>0.205</td><td>0.522</td><td>0.561</td><td>0.468</td><td>0.587</td><td>0.497</td><td>0.389</td></tr><tr><td>SFT [30k]</td><td>0.168</td><td>0.521</td><td>0.598</td><td>0.139</td><td>0.152</td><td>0.247</td><td>0.606</td><td>0.721</td><td>0.772</td><td>0.792</td><td>0.695</td><td>0.492</td></tr><tr><td>SFT+RL1</td><td>0.208</td><td>0.564</td><td>0.610</td><td>0.174</td><td>0.182</td><td>0.294</td><td>0.613</td><td>0.747</td><td>0.799</td><td>0.844</td><td>0.713</td><td>0.523</td></tr><tr><td>SFT+RL1+RL2</td><td>0.318</td><td>0.611</td><td>0.627</td><td>0.234</td><td>0.280</td><td>0.358</td><td>0.620</td><td>0.804</td><td>0.853</td><td>0.871</td><td>0.726</td><td>0.573</td></tr><tr><td rowspan="4">Qwen2.5-VL-7B [3]</td><td>Base (w/o CoT)</td><td>0.836</td><td>0.760</td><td>0.847</td><td>0.606</td><td>0.789</td><td>0.685</td><td>0.601</td><td>0.467</td><td>0.289</td><td>0.581</td><td>0.583</td><td>0.640</td></tr><tr><td>SFT [30k]</td><td>0.807</td><td>0.720</td><td>0.886</td><td>0.580</td><td>0.719</td><td>0.635</td><td>0.630</td><td>0.626</td><td>0.764</td><td>0.782</td><td>0.876</td><td>0.730</td></tr><tr><td>SFT+RL1</td><td>0.842</td><td>0.768</td><td>0.895</td><td>0.600</td><td>0.784</td><td>0.692</td><td>0.642</td><td>0.669</td><td>0.788</td><td>0.822</td><td>0.888</td><td>0.763</td></tr><tr><td>SFT+RL1+RL2</td><td>0.874</td><td>0.819</td><td>0.897</td><td>0.640</td><td>0.829</td><td>0.753</td><td>0.675</td><td>0.700</td><td>0.814</td><td>0.864</td><td>0.892</td><td>0.796</td></tr></table>
|
| 173 |
+
|
| 174 |
+
results obtained from SFT with 30k or 438k is not significant (i.e. VisCoT vs. LLaVA-1.5-7B-Ours-SFT). These suggests that: on the one hand, the improvement in model capability is more attributed to the introduction of CoT rather than the SFT memory. On the other hand, the model’s capability has already achieved saturated in a data-driven SFT manner and fails to further generalize, which is also the reason why Visual CoT fails in some OOD scenarios. However, our RL method can achieve comprehensive enhancement, with the promising improvement of up to $4 9 . 0 7 \%$ (PaliGemma2-10B: 0.377 vs. 0.562), and the minimum improvement of $2 3 . 7 8 \%$ (Llama-3.2-Vision-11B: 0.635 vs. 0.786). Meanwhile, we does not rely on a large amount of dense-labeled data (i.e. with boundingbox annotation), but still has learned more
|
| 175 |
+
|
| 176 |
+
# essential visual perception.
|
| 177 |
+
|
| 178 |
+
Detection Ability. Our approach is grounded in CoT for visual reasoning, thereby placing significant emphasis on the accuracy of intermediate bounding boxes. To substantiate the enhancement in bounding box precision following the implementation of our RL method, we present the detection performance in Tab. 4. Specifically, we compute the IoU between the predicted CoT bounding boxes and the corresponding GT bounding boxes, deeming a prediction correct if the IoU value surpasses 0.5. It is evident that, when using the same base model – LLaVA-1.5-7B, the performance after our SFT with 30k data is somewhat inferior to that of Visual CoT which leverages $4 3 8 \mathrm { k }$ data. However, during the RL phase, we get rid of bounding box annotation
|
| 179 |
+
|
| 180 |
+
Table 3. Ratio of successful bounding box outputs of different SFT data number in terms of Qwen2.5-VL-7B. We evaluate on Visual CoT benchmark with 8281 data.
|
| 181 |
+
|
| 182 |
+
<table><tr><td>SFT Data Num.</td><td>10k</td><td>20k</td><td>30k</td><td>50k</td><td>100k</td></tr><tr><td>Ratio</td><td>28.14%</td><td>95.48%</td><td>99.87%</td><td>99.87%</td><td>99.87%</td></tr></table>
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 4. Performance of our VisRL over multiple iterations, attributing to the intertwined improvement of data quality and model capability during the iterative process. The accuracy is calculated as the average value over the 11 datasets listed in Tab. 2.
|
| 186 |
+
|
| 187 |
+
data and exclusively utilized 180k simple question-answer pairs (further processed via our data generation pipeline in Sec. 3.1 to construct preference data), thereby achieving an accuracy improvement of $1 5 . 6 1 \%$ (0.437 vs. 0.378) over Visual CoT. Moreover, even with only RL1, we still attained an approximate $8 . 4 7 \%$ (0.410 vs. 0.378) improvement. Notably, on the DocVQA dataset (which was not included in the RL training phase), RL1 achieved a remarkable $3 9 . 7 1 \%$ (0.190 vs. 0.136) improvement, while RL2 accomplished an impressive $7 3 . 6 8 \%$ (0.231 vs. 0.136) improvement. We attribute these substantial gains to the robust generalization capability of our RL method.
|
| 188 |
+
|
| 189 |
+
# 4.3. Performance across Multiple RL Iterations
|
| 190 |
+
|
| 191 |
+
Fig. 4 illustrates the performance variation curves of our method over multiple iterations on LLava-1.5-7B and Qwen2.5-VL-7B. It can be observed that after each iteration (i.e., data is regenerated and VisRL training is reconducted), performance improves significantly, regardless of whether only RL1 is applied or the full process of $\mathrm { R L 1 + R L 2 }$ is used. The performance gains range from a minimum of $0 . 3 \%$ to a maximum of $1 . 8 \%$ . Since Qwen2.5-VL-7B is closer to the performance upper bound, its growth is relatively slower. Notably, after 4 iterations, LLava-1.5-7B even surpasses Llama-3.2-Vision-11B, as indicated by the blue curve. This further validates the promising potential of our method and lays the experimental foundation for future optimizations in online algorithms.
|
| 192 |
+
|
| 193 |
+
# 4.4. Visualization
|
| 194 |
+
|
| 195 |
+
This section presents the qualitative performance of our VisRL in Fig. 5, highlighting the accuracy of our method
|
| 196 |
+
|
| 197 |
+
in identifying critical regions within images and then aid in CoT reasoning. Compared to VisCoT (red), our VisRL (green) demonstrates greater performance in both localizing the regions of interest and generating the final response, as evidenced by the ground truth (GT) comparison (blue).
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Question: What piece of furniture is to the right of the curtains?
|
| 201 |
+
GT Answer: bed
|
| 202 |
+
LLaVA-1.5 Answer [score: 0.0]: Chair
|
| 203 |
+
VisCoT Answer[score: 0.0]: Chair
|
| 204 |
+
VisRL Answer[score:1.0]:bed
|
| 205 |
+
|
| 206 |
+

|
| 207 |
+
Question: what names are on the ad? GTAnswer:klaviarabend wilhelm ba wolfgang amadeus mozart, franz schu johannes brahms,ludwig van beethov
|
| 208 |
+
LLaVA-1.5 Answer [score: 0.2]: Wilhelm Backhaus. VisCoT Answer [score:0.4]: The names on the ad are Wilhelm Backhaus and Johannes Brahms. VisRL Answer [score: 1.0]: franz schubert,johannes mozart,ludwig van beethoven
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
|
| 212 |
+
Question: What is providing shade for the man in the image? GT Answer:Themanis sittig undera giant umbrella that is providing shade.
|
| 213 |
+
LLaVA-1.5Answerscore:0.0]:Theman in the image issiting undera awning.
|
| 214 |
+
VisCoTAnswer[score:0.0]: The manisitingunderalargeawing which is providing shade for him.
|
| 215 |
+
VisRL Answer [score: 1.0]: The man is standing under an umbrella, which
|
| 216 |
+
Figure 5. Visualization of LLaVa-1.5 vs. VisCoT vs. VisRL (based on LLaVa-1.5). GT bounding boxes are shown in blue, VisCoTgenerated bounding boxes are shown in red, while Ours-generated bounding boxes are in green. The scores are evaluated by the GPT-4o. Our method consistently delivers the best results across various benchmarks. More visualizations are in the Supp. Mat..
|
| 217 |
+
|
| 218 |
+
# 4.5. Ablation Study
|
| 219 |
+
|
| 220 |
+
Different stages. In Tab. 2, we have conducted the ablation study on the usage of different training stages (SFT, $\mathrm { S F T } { + } \mathrm { R L } 1$ , $\mathtt { S F T + R L 1 + R L 2 }$ ), demonstrating a consistent performance improvement from SFT to RL1 and then to RL2. Furthermore, in Tab. 5, we present the results of training with RL2-Only after SFT with bounding boxes. As observed, applying RL2-Only training already yields a promising improvement compared to SFT-then-CoT (0.759 vs. 0.730). However, it still results in significant performance drops on certain benchmarks compared to the original model – Qwen2.5-VL-7B (e.g., DocVQA, DUDE, InfogVQA). This suggests that directly optimizing both bounding-box detection and response generation in a joint manner poses certain challenges. Therefore, introducing RL1 first to optimize bounding-box detection separately is necessary.
|
| 221 |
+
|
| 222 |
+
Different training strategy. We attempted to directly learn the final response in Tab. 5, i.e., without the CoT setting. In this experiment, we used the same 30k dataset $D _ { P }$ . Specifically, SFT was trained solely on the chosen response (w/o bounding box); DPO [59] was trained on the win/lose preference response; Kahneman-Tversky Optimisation (KTO) [19] assigned ”true” and ”false” labels to ”win” and ”lose” response, respectively; and Proximal Policy Optimization
|
| 223 |
+
|
| 224 |
+
Table 4. Detection performance (Top-1 Accuracy $@ 0 . 5$ ) on the various benchmark, where both ”Ours” and ”Visual-CoT” similarly utilize LLaVA-1.5-7B as the base model. The amount of dense-labeled data with bounding box annotations is indicated in []. The best is highlighted.
|
| 225 |
+
|
| 226 |
+
<table><tr><td rowspan="2">Method</td><td colspan="5">Doc/Text</td><td>Chart</td><td>General VQA</td><td colspan="3">Relation Reasoning</td><td colspan="2">Fine-grained</td></tr><tr><td>DocVQA</td><td>TextCaps</td><td>TextVQA</td><td>DUDE</td><td>SROIE</td><td>InfogVQA</td><td>Flickr30k</td><td>GQA</td><td>Open images</td><td>VSR</td><td>CUB</td><td>Avg</td></tr><tr><td>VisCoT [438k] [62]</td><td>0.136</td><td>0.413</td><td>0.468</td><td>0.050</td><td>0.157</td><td>0.072</td><td>0.496</td><td>0.420</td><td>0.576</td><td>0.696</td><td>0.670</td><td>0.378</td></tr><tr><td>VisRL-SFT [30k]</td><td>0.133</td><td>0.406</td><td>0.460</td><td>0.048</td><td>0.146</td><td>0.069</td><td>0.495</td><td>0.421</td><td>0.575</td><td>0.691</td><td>0.673</td><td>0.374</td></tr><tr><td>VisRL-SFT+RL1</td><td>0.190</td><td>0.433</td><td>0.471</td><td>0.081</td><td>0.216</td><td>0.133</td><td>0.518</td><td>0.450</td><td>0.581</td><td>0.733</td><td>0.701</td><td>0.410</td></tr><tr><td>VisRL-SFT+RL1+RL2</td><td>0.231</td><td>0.464</td><td>0.504</td><td>0.124</td><td>0.252</td><td>0.172</td><td>0.519</td><td>0.487</td><td>0.590</td><td>0.745</td><td>0.715</td><td>0.437</td></tr></table>
|
| 227 |
+
|
| 228 |
+
Table 5. Different training strategies for directly fitting the final response in terms of Qwen2.5-VL-7B. Besides, we also ablated on RL2-Only. The red background indicates a decline in performance compared to the original model, while the best is highlighted.
|
| 229 |
+
|
| 230 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Doc/VQA</td><td colspan="2">Doc/Text</td><td rowspan="2">Doc/VQA</td><td rowspan="2">DUDE</td><td rowspan="2">SROIE</td><td rowspan="2">Chart InfogVQA</td><td rowspan="2">General VQA Flickr30k</td><td colspan="3">Relation Reasoning</td><td colspan="2">Fine-grained</td></tr><tr><td>TextCaps</td><td>TextVQA</td><td>GQA</td><td>Open images</td><td>VSR</td><td>CUB</td><td>Avg</td></tr><tr><td>Ori</td><td>0.836</td><td>0.760</td><td>0.847</td><td>0.606</td><td>0.789</td><td>0.685</td><td>0.601</td><td>0.467</td><td>0.289</td><td>0.581</td><td>0.583</td><td>0.640</td><td></td></tr><tr><td>SFT</td><td>0.778</td><td>0.751</td><td>0.856</td><td>0.566</td><td>0.713</td><td>0.631</td><td>0.627</td><td>0.524</td><td>0.345</td><td>0.626</td><td>0.736</td><td>0.650</td><td></td></tr><tr><td>DPO [59]</td><td>0.791</td><td>0.793</td><td>0.837</td><td>0.599</td><td>0.776</td><td>0.678</td><td>0.670</td><td>0.470</td><td>0.298</td><td>0.594</td><td>0.707</td><td>0.656</td><td></td></tr><tr><td>KTO [19]</td><td>0.797</td><td>0.790</td><td>0.833</td><td>0.597</td><td>0.780</td><td>0.694</td><td>0.671</td><td>0.469</td><td>0.299</td><td>0.599</td><td>0.707</td><td>0.658</td><td></td></tr><tr><td>PPO [60]</td><td>0.794</td><td>0.791</td><td>0.837</td><td>0.597</td><td>0.787</td><td>0.700</td><td>0.672</td><td>0.472</td><td>0.302</td><td>0.606</td><td>0.713</td><td>0.661</td><td></td></tr><tr><td>VisRL-RL2-Only</td><td>0.816</td><td>0.769</td><td>0.897</td><td>0.602</td><td>0.800</td><td>0.681</td><td>0.637</td><td>0.652</td><td>0.786</td><td>0.827</td><td>0.882</td><td>0.759</td><td></td></tr><tr><td>VisRL-Full</td><td>0.874</td><td>0.819</td><td>0.897</td><td>0.640</td><td>0.829</td><td>0.753</td><td>0.675</td><td>0.700</td><td>0.814</td><td>0.864</td><td>0.892</td><td>0.796</td><td></td></tr></table>
|
| 231 |
+
|
| 232 |
+
(PPO) [60] sampled $1 5 \mathrm { k }$ preference data to train the reward model, while the remaining 15k data were used to train PPO. The results indicate that both previous RL and SFT methods exhibit limited effectiveness in directly fitting the final response, with some benchmarks even showing performance degradation (e.g. DocVQA, DUDE, etc.). In contrast, our training approach shown in Tab. 2, which incorporates the CoT reasoning in RL method, consistently improves model performance across all benchmarks.
|
| 233 |
+
|
| 234 |
+
Data Generation Pipeline. Our data generation process follows a self-evolution paradigm and adopts an actor-critics framework, where the actor is the SFTed model and the critics refer to the pre-SFT model. In this study, we conduct ablation experiments on several modules within the pipeline. As shown in Tab. 6, our objective is to maximize the proportion of positive instances in the constructed preference dataset, specifically WP-LN (win-positive, losenegative), while minimizing the proportion of negative instances, WN-LP (win-negative, lose-positive). Experimental results indicate that under our pipeline, the proportion of positive instances is $6 4 . 6 4 \%$ . After the first and second iterations – where the model undergoes full VisRL training and then participates in data construction again – this proportion increases by $3 . 1 8 \%$ and $2 . 3 0 \%$ , respectively. Besides, the number of valid data increases from $3 0 \mathrm { k }$ to $3 3 \mathrm { k }$ to 35k. This is because, through iterative training, the model’s capability improves to overcome bottlenecks where obtaining the correct answer was previously outside of its ability. Specifically, some questions are inherently too difficult for model previously, meaning that no matter how many times the model responds, the answer remains incorrect, making it impossible to construct win/lose preference.
|
| 235 |
+
|
| 236 |
+
When replacing the critics with GPT-4o, the proportion of positive instances remains largely unchanged $6 4 . 6 4 \%$ vs. $6 5 . 3 1 \%$ , but this comes at the cost of increased token consumption and reduced response speed. Conversely,
|
| 237 |
+
|
| 238 |
+
Table 6. Ablation of our data generation pipeline in terms of Qwen2.5-VL-7B. We evaluate the data quality by comparing the IoU (Top-1 Accuracy $@ 0 . 5$ ) between the annotated preference data’s bounding boxes and the GT bounding boxes. ”W” and ”L” represent the win and loss in the data annotation, respectively, while ”P” and ”N” indicate positive or negative. Ideally, we expect WP-LN to be as large as possible, as highlighted in green.
|
| 239 |
+
|
| 240 |
+
<table><tr><td></td><td>WP-LP</td><td>WP-LN</td><td>WN-LP</td><td>WN-LN</td><td>Data Num.</td></tr><tr><td>w GPT-4o-2024-11-20</td><td>0.00%</td><td>65.31%</td><td>1.32%</td><td>33.37%</td><td>47k</td></tr><tr><td>w SFTed Model</td><td>0.00%</td><td>54.68%</td><td>0.00%</td><td>45.32%</td><td>3k</td></tr><tr><td>w/o Bounding Box Critics</td><td>5.42%</td><td>31.02%</td><td>10.04%</td><td>53.51%</td><td>86k</td></tr><tr><td>w/o Diversity Controller</td><td>4.53%</td><td>52.02%</td><td>4.68%</td><td>38.77%</td><td>19k</td></tr><tr><td>VisRL-Full</td><td>0.43%</td><td>64.64%</td><td>1.64%</td><td>33.29%</td><td>30k</td></tr><tr><td>VisRL-Full-Iter1</td><td>0.45%</td><td>67.82%</td><td>0.82%</td><td>30.91%</td><td>33k</td></tr><tr><td>VisRL-Full-Iter2</td><td>0.47%</td><td>70.12%</td><td>0.00%</td><td>29.41%</td><td>35k</td></tr></table>
|
| 241 |
+
|
| 242 |
+
when substituting the critics with the SFTed model itself, the data volume decreases to 1/10 of the original (3k vs. 30k), accompanied by a $9 . 9 6 \%$ reduction in the proportion of positive instances. Furthermore, omitting the evaluation of the generated bounding boxes results in a $3 3 . 6 2 \%$ drop in the proportion of positive instances, while the absence of the diversity controller leads to a $1 2 . 6 2 \%$ reduction. Considering these factors, we adopt the approach described in Sec. 3.1.
|
| 243 |
+
|
| 244 |
+
# 5. Conclusion
|
| 245 |
+
|
| 246 |
+
In this paper, we propose VisRL, a framework for learning intention-driven visual perception abilities from task feedback. This approach enables the model to undergo RL through self-evolution when trained on simple data with only final responses. Specifically, we introduce a novel pipeline for generating CoT preference data based on the model’s own actor-critic process, eliminating the need for external models or human annotations. Using these self-constructed data, we further optimize visual perception in two RL stages: (1) independently optimizing generated bounding box; (2) jointly optimizing both generated bounding box and response. Extensive experiments on various benchmarks and LMMs demonstrate the effectiveness of the proposed framework, establishing a solid foundation for future exploration.
|
| 247 |
+
|
| 248 |
+
# References
|
| 249 |
+
|
| 250 |
+
[1] Ebtesam Almazrouei, Ruxandra Cojocaru, Michele Baldo, Quentin Malartic, Hamza Alobeidli, Daniele Mazzotta, Guilherme Penedo, Giulia Campesan, Mugariya Farooq, Maitha Alhammadi, et al. Alghafa evaluation benchmark for arabic language models. In Proceedings of ArabicNLP 2023, pages 244–275, 2023. 2
|
| 251 |
+
[2] Jinze Bai, Shuai Bai, Yunfei Chu, Zeyu Cui, Kai Dang, Xiaodong Deng, Yang Fan, Wenbin Ge, Yu Han, Fei Huang, et al. Qwen technical report. arXiv preprint arXiv:2309.16609, 2023. 2, 14
|
| 252 |
+
[3] Shuai Bai, Keqin Chen, Xuejing Liu, Jialin Wang, Wenbin Ge, Sibo Song, Kai Dang, Peng Wang, Shijie Wang, Jun Tang, et al. Qwen2. 5-vl technical report. arXiv preprint arXiv:2502.13923, 2025. 6
|
| 253 |
+
[4] Xiao Bi, Deli Chen, Guanting Chen, Shanhuang Chen, Damai Dai, Chengqi Deng, Honghui Ding, Kai Dong, Qiushi Du, Zhe Fu, et al. Deepseek llm: Scaling open-source language models with longtermism. arXiv preprint arXiv:2401.02954, 2024. 2
|
| 254 |
+
[5] Mahtab Bigverdi, Zelun Luo, Cheng-Yu Hsieh, Ethan Shen, Dongping Chen, Linda G Shapiro, and Ranjay Krishna. Perception tokens enhance visual reasoning in multimodal language models. arXiv preprint arXiv:2412.03548, 2024. 3
|
| 255 |
+
[6] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020. 2
|
| 256 |
+
[7] Zheng Cai, Maosong Cao, Haojiong Chen, Kai Chen, Keyu Chen, Xin Chen, Xun Chen, Zehui Chen, Zhi Chen, Pei Chu, et al. Internlm2 technical report. arXiv preprint arXiv:2403.17297, 2024. 2
|
| 257 |
+
[8] Jun Chen, Deyao Zhu, Xiaoqian Shen, Xiang Li, Zechun Liu, Pengchuan Zhang, Raghuraman Krishnamoorthi, Vikas Chandra, Yunyang Xiong, and Mohamed Elhoseiny. Minigpt-v2: large language model as a unified interface for vision-language multi-task learning. arXiv preprint arXiv:2310.09478, 2023. 14
|
| 258 |
+
[9] Jiaxing Chen, Yuxuan Liu, Dehu Li, Xiang An, Weimo Deng, Ziyong Feng, Yongle Zhao, and Yin Xie. Plug-and-play grounding of reasoning in multimodal large language models. arXiv preprint arXiv:2403.19322, 2024. 3, 6
|
| 259 |
+
[10] Keqin Chen, Zhao Zhang, Weili Zeng, Richong Zhang, Feng Zhu, and Rui Zhao. Shikra: Unleashing multimodal llm’s referential dialogue magic. arXiv preprint arXiv:2306.15195, 2023. 14
|
| 260 |
+
[11] Lin Chen, Jinsong Li, Xiaoyi Dong, Pan Zhang, Conghui He, Jiaqi Wang, Feng Zhao, and Dahua Lin. Sharegpt4v: Improving large multi-modal models with better captions. In European Conference on Computer Vision, pages 370–387. Springer, 2024. 1
|
| 261 |
+
[12] Liang Chen, Lei Li, Haozhe Zhao, Yifan Song, and Vinci. R1- v: Reinforcing super generalization ability in vision-language
|
| 262 |
+
|
| 263 |
+
models with less than $\$ 3$ . https://github.com/Deep-Agent/R1-V, 2025. Accessed: 2025-02-02. 3
|
| 264 |
+
[13] Lin Chen, Xilin Wei, Jinsong Li, Xiaoyi Dong, Pan Zhang, Yuhang Zang, Zehui Chen, Haodong Duan, Zhenyu Tang, Li Yuan, et al. Sharegpt4video: Improving video understanding and generation with better captions. Advances in Neural Information Processing Systems, 37:19472–19495, 2025. 1
|
| 265 |
+
[14] Yukang Chen, Shengju Qian, Haotian Tang, Xin Lai, Zhijian Liu, Song Han, and Jiaya Jia. Longlora: Efficient finetuning of long-context large language models. arXiv preprint arXiv:2309.12307, 2023. 1
|
| 266 |
+
[15] Zhangquan Chen, Chunjiang Liu, and Haobin Duan. A threephases sft hybrid model integrated strong prior module and data overlap estimation in the eduation context. arXiv preprint arXiv:2403.15426, 2024. 1
|
| 267 |
+
[16] Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E Gonzalez, et al. Vicuna: An open-source chatbot impressing gpt-4 with $9 0 \% ^ { \ast }$ chatgpt quality, march 2023. URL https://lmsys. org/blog/2023-03-30-vicuna, 3(5), 2023. 6
|
| 268 |
+
[17] Paul F Christiano, Jan Leike, Tom Brown, Miljan Martic, Shane Legg, and Dario Amodei. Deep reinforcement learning from human preferences. Advances in neural information processing systems, 30, 2017. 3
|
| 269 |
+
[18] Yuhao Dong, Zuyan Liu, Hai-Long Sun, Jingkang Yang, Winston Hu, Yongming Rao, and Ziwei Liu. Insight-v: Exploring long-chain visual reasoning with multimodal large language models. arXiv preprint arXiv:2411.14432, 2024. 3, 6
|
| 270 |
+
[19] Kawin Ethayarajh, Winnie Xu, Niklas Muennighoff, Dan Jurafsky, and Douwe Kiela. Kto: Model alignment as prospect theoretic optimization. arXiv preprint arXiv:2402.01306, 2024. 7, 8
|
| 271 |
+
[20] Luciano Floridi and Massimo Chiriatti. Gpt-3: Its nature, scope, limits, and consequences. Minds and Machines, 30: 681–694, 2020. 2
|
| 272 |
+
[21] Chaoyou Fu, Peixian Chen, Yunhang Shen, Yulei Qin, Mengdan Zhang, Xu Lin, Jinrui Yang, Xiawu Zheng, Ke Li, Xing Sun, Yunsheng Wu, and Rongrong Ji. Mme: A comprehensive evaluation benchmark for multimodal large language models, 2024. 6, 13
|
| 273 |
+
[22] Team GLM, Aohan Zeng, Bin Xu, Bowen Wang, Chenhui Zhang, Da Yin, Dan Zhang, Diego Rojas, Guanyu Feng, Hanlin Zhao, et al. Chatglm: A family of large language models from glm-130b to glm-4 all tools. arXiv preprint arXiv:2406.12793, 2024. 2
|
| 274 |
+
[23] Anisha Gunjal, Jihan Yin, and Erhan Bas. Detecting and preventing hallucinations in large vision language models. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 18135–18143, 2024. 1
|
| 275 |
+
[24] Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, Shirong Ma, Peiyi Wang, Xiao Bi, et al. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning. arXiv preprint arXiv:2501.12948, 2025. 3
|
| 276 |
+
[25] Yanming Guo, Yu Liu, Ard Oerlemans, Songyang Lao, Song Wu, and Michael S Lew. Deep learning for visual understanding: A review. Neurocomputing, 187:27–48, 2016. 1
|
| 277 |
+
|
| 278 |
+
[26] Zheng Huang, Kai Chen, Jianhua He, Xiang Bai, Dimosthenis Karatzas, Shijian Lu, and CV Jawahar. Icdar2019 competition on scanned receipt ocr and information extraction. In 2019 International Conference on Document Analysis and Recognition (ICDAR), pages 1516–1520. IEEE, 2019. 13
|
| 279 |
+
[27] Drew A Hudson and Christopher D Manning. Gqa: A new dataset for real-world visual reasoning and compositional question answering. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 6700–6709, 2019. 13, 14
|
| 280 |
+
[28] Jiaming Ji, Jiayi Zhou, Hantao Lou, Boyuan Chen, Donghai Hong, Xuyao Wang, Wenqi Chen, Kaile Wang, Rui Pan, Jiahao Li, Mohan Wang, Josef Dai, Tianyi Qiu, Hua Xu, Dong Li, Weipeng Chen, Jun Song, Bo Zheng, and Yaodong Yang. Align anything: Training all-modality models to follow instructions with language feedback. 2024. 3
|
| 281 |
+
[29] Fengqing Jiang. Identifying and mitigating vulnerabilities in llm-integrated applications. Master’s thesis, University of Washington, 2024. 2
|
| 282 |
+
[30] Yang Jiao, Shaoxiang Chen, Zequn Jie, Jingjing Chen, Lin Ma, and Yu-Gang Jiang. Lumen: Unleashing versatile visioncentric capabilities of large multimodal models. Advances in Neural Information Processing Systems, 37:81461–81488, 2025. 1
|
| 283 |
+
[31] Sahar Kazemzadeh, Vicente Ordonez, Mark Matten, and Tamara Berg. Referitgame: Referring to objects in photographs of natural scenes. In Proceedings of the 2014 conference on empirical methods in natural language processing (EMNLP), pages 787–798, 2014. 13, 14
|
| 284 |
+
[32] Alina Kuznetsova, Hassan Rom, Neil Alldrin, Jasper Uijlings, Ivan Krasin, Jordi Pont-Tuset, Shahab Kamali, Stefan Popov, Matteo Malloci, Alexander Kolesnikov, et al. The open images dataset v4: Unified image classification, object detection, and visual relationship detection at scale. International journal of computer vision, 128(7):1956–1981, 2020. 13, 14
|
| 285 |
+
[33] Xin Lai, Zhuotao Tian, Yukang Chen, Yanwei Li, Yuhui Yuan, Shu Liu, and Jiaya Jia. Lisa: Reasoning segmentation via large language model. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 9579–9589, 2024. 1
|
| 286 |
+
[34] Xin Lai, Zhuotao Tian, Yukang Chen, Senqiao Yang, Xiangru Peng, and Jiaya Jia. Step-dpo: Step-wise preference optimization for long-chain reasoning of llms. arXiv preprint arXiv:2406.18629, 2024. 5
|
| 287 |
+
[35] Chengzu Li, Wenshan Wu, Huanyu Zhang, Yan Xia, Shaoguang Mao, Li Dong, Ivan Vulic, and Furu Wei. Imag- ´ ine while reasoning in space: Multimodal visualization-ofthought. arXiv preprint arXiv:2501.07542, 2025. 3
|
| 288 |
+
[36] Junnan Li, Dongxu Li, Caiming Xiong, and Steven Hoi. Blip: Bootstrapping language-image pre-training for unified visionlanguage understanding and generation. In International conference on machine learning, pages 12888–12900. PMLR, 2022. 3
|
| 289 |
+
[37] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. In International conference on machine learning, pages 19730–19742. PMLR, 2023. 3
|
| 290 |
+
|
| 291 |
+
[38] Yifan Li, Yifan Du, Kun Zhou, Jinpeng Wang, Wayne Xin Zhao, and Ji-Rong Wen. Evaluating object hallucination in large vision-language models. arXiv preprint arXiv:2305.10355, 2023. 6, 13
|
| 292 |
+
[39] Yanwei Li, Chengyao Wang, and Jiaya Jia. Llama-vid: An image is worth 2 tokens in large language models. In European Conference on Computer Vision, pages 323–340. Springer, 2024. 1
|
| 293 |
+
[40] Ziyi Lin, Chris Liu, Renrui Zhang, Peng Gao, Longtian Qiu, Han Xiao, Han Qiu, Chen Lin, Wenqi Shao, Keqin Chen, et al. Sphinx: The joint mixing of weights, tasks, and visual embeddings for multi-modal large language models. arXiv preprint arXiv:2311.07575, 2023. 14
|
| 294 |
+
[41] Fangyu Liu, Guy Emerson, and Nigel Collier. Visual spatial reasoning. Transactions of the Association for Computational Linguistics, 11:635–651, 2023. 13, 14
|
| 295 |
+
[42] Haotian Liu, Chunyuan Li, Yuheng Li, and Yong Jae Lee. Improved baselines with visual instruction tuning, 2023. 6, 14
|
| 296 |
+
[43] Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning, 2023. 1, 3, 6
|
| 297 |
+
[44] Haotian Liu, Chunyuan Li, Yuheng Li, Bo Li, Yuanhan Zhang, Sheng Shen, and Yong Jae Lee. Llava-next: Improved reasoning, ocr, and world knowledge, 2024. 6
|
| 298 |
+
[45] Shilong Liu, Zhaoyang Zeng, Tianhe Ren, Feng Li, Hao Zhang, Jie Yang, Qing Jiang, Chunyuan Li, Jianwei Yang, Hang Su, et al. Grounding dino: Marrying dino with grounded pre-training for open-set object detection. In European Conference on Computer Vision, pages 38–55. Springer, 2024. 13, 14
|
| 299 |
+
[46] Yuan Liu, Haodong Duan, Yuanhan Zhang, Bo Li, Songyang Zhang, Wangbo Zhao, Yike Yuan, Jiaqi Wang, Conghui He, Ziwei Liu, et al. Mmbench: Is your multi-modal model an allaround player? In European conference on computer vision, pages 216–233. Springer, 2024. 6, 13
|
| 300 |
+
[47] Yuecheng Liu, Dafeng Chi, Shiguang Wu, Zhanguang Zhang, Yaochen Hu, Lingfeng Zhang, Yingxue Zhang, Shuang Wu, Tongtong Cao, Guowei Huang, et al. Spatialcot: Advancing spatial reasoning through coordinate alignment and chain-of-thought for embodied task planning. arXiv preprint arXiv:2501.10074, 2025. 3
|
| 301 |
+
[48] Ziyu Liu, Zeyi Sun, Yuhang Zang, Xiaoyi Dong, Yuhang Cao, Haodong Duan, Dahua Lin, and Jiaqi Wang. Visual-rft: Visual reinforcement fine-tuning. arXiv preprint arXiv:2503.01785, 2025. 3
|
| 302 |
+
[49] Junhua Mao, Jonathan Huang, Alexander Toshev, Oana Camburu, Alan L Yuille, and Kevin Murphy. Generation and comprehension of unambiguous object descriptions. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 11–20, 2016. 13, 14
|
| 303 |
+
[50] Minesh Mathew, Dimosthenis Karatzas, and CV Jawahar. Docvqa: A dataset for vqa on document images. In Proceedings of the IEEE/CVF winter conference on applications of computer vision, pages 2200–2209, 2021. 13
|
| 304 |
+
[51] Minesh Mathew, Viraj Bagal, Ruben Tito, Dimosthenis ` Karatzas, Ernest Valveny, and CV Jawahar. Infographicvqa. In Proceedings of the IEEE/CVF Winter Conference
|
| 305 |
+
|
| 306 |
+
on Applications of Computer Vision, pages 1697–1706, 2022. 13, 14
|
| 307 |
+
[52] Llama Meta. 3.2: Revolutionizing edge ai and vision with open, customizable models, 2024. URL: https://ai. meta. com/blog/llama-3-2-connect-2024-vision-edge-mobile-devices. 6
|
| 308 |
+
[53] Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35:27730–27744, 2022. 3
|
| 309 |
+
[54] Thomas J Palmeri and Isabel Gauthier. Visual object understanding. Nature Reviews Neuroscience, 5(4):291–303, 2004.
|
| 310 |
+
[55] Bryan A Plummer, Liwei Wang, Chris M Cervantes, Juan C Caicedo, Julia Hockenmaier, and Svetlana Lazebnik. Flickr30k entities: Collecting region-to-phrase correspondences for richer image-to-sentence models. In Proceedings of the IEEE international conference on computer vision, pages 2641–2649, 2015. 13, 14
|
| 311 |
+
[56] Alec Radford, Karthik Narasimhan, Tim Salimans, Ilya Sutskever, et al. Improving language understanding by generative pre-training. 2018. 2
|
| 312 |
+
[57] Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019. 2
|
| 313 |
+
[58] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pages 8748–8763. PmLR, 2021. 6
|
| 314 |
+
[59] Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. Direct preference optimization: Your language model is secretly a reward model. Advances in Neural Information Processing Systems, 36, 2024. 3, 7, 8
|
| 315 |
+
[60] John Schulman, Filip Wolski, Prafulla Dhariwal, Alec Radford, and Oleg Klimov. Proximal policy optimization algorithms. arXiv preprint arXiv:1707.06347, 2017. 8
|
| 316 |
+
[61] Hao Shao, Yuxuan Hu, Letian Wang, Guanglu Song, Steven L Waslander, Yu Liu, and Hongsheng Li. Lmdrive: Closedloop end-to-end driving with large language models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15120–15130, 2024. 1
|
| 317 |
+
[62] Hao Shao, Shengju Qian, Han Xiao, Guanglu Song, Zhuofan Zong, Letian Wang, Yu Liu, and Hongsheng Li. Visual cot: Unleashing chain-of-thought reasoning in multi-modal language models, 2024. 1, 3, 4, 6, 8, 13, 14
|
| 318 |
+
[63] Haozhan Shen, Zilun Zhang, Qianqian Zhang, Ruochen Xu, and Tiancheng Zhao. Vlm-r1: A stable and generalizable r1-style large vision-language model. https://github. com/om-ai-lab/VLM-R1, 2025. Accessed: 2025-02-15. 3
|
| 319 |
+
[64] Oleksii Sidorov, Ronghang Hu, Marcus Rohrbach, and Amanpreet Singh. Textcaps: a dataset for image captioning with
|
| 320 |
+
|
| 321 |
+
reading comprehension. In Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part II 16, pages 742–758. Springer, 2020. 13, 14
|
| 322 |
+
[65] Amanpreet Singh, Vivek Natarajan, Meet Shah, Yu Jiang, Xinlei Chen, Dhruv Batra, Devi Parikh, and Marcus Rohrbach. Towards vqa models that can read. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 8317–8326, 2019. 13, 14
|
| 323 |
+
[66] Andreas Steiner, Andre Susano Pinto, Michael Tschannen, ´ Daniel Keysers, Xiao Wang, Yonatan Bitton, Alexey Gritsenko, Matthias Minderer, Anthony Sherbondy, Shangbang Long, et al. Paligemma 2: A family of versatile vlms for transfer. arXiv preprint arXiv:2412.03555, 2024. 6
|
| 324 |
+
[67] Chufeng Tang, Lingxi Xie, Xiaopeng Zhang, Xiaolin Hu, and Qi Tian. Visual recognition by request. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15265–15274, 2023. 1, 3
|
| 325 |
+
[68] InternLM Team. Internlm: A multilingual language model with progressively enhanced capabilities, 2023. 2
|
| 326 |
+
[69] Omkar Thawakar, Dinura Dissanayake, Ketan More, Ritesh Thawkar, Ahmed Heakl, Noor Ahsan, Yuhao Li, Mohammed Zumri, Jean Lahoud, Rao Muhammad Anwer, Hisham Cholakkal, Ivan Laptev, Mubarak Shah, Fahad Shahbaz Khan, and Salman Khan. Llamav-o1: Rethinking step-by-step visual reasoning in llms, 2025. 3
|
| 327 |
+
[70] Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste´ Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, et al.` Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023. 2
|
| 328 |
+
[71] Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023. 2
|
| 329 |
+
[72] Jordy Van Landeghem, Ruben Tito, ` Łukasz Borchmann, Michał Pietruszka, Pawel Joziak, Rafal Powalski, Dawid Jurkiewicz, Mickael Coustaty, Bertrand Anckaert, Ernest¨ Valveny, et al. Document understanding dataset and evaluation (dude). In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 19528–19540, 2023. 13
|
| 330 |
+
[73] Catherine Wah, Steve Branson, Peter Welinder, Pietro Perona, and Serge Belongie. The caltech-ucsd birds-200-2011 dataset. 2011. 13, 14
|
| 331 |
+
[74] Peng Wang, An Yang, Rui Men, Junyang Lin, Shuai Bai, Zhikang Li, Jianxin Ma, Chang Zhou, Jingren Zhou, and Hongxia Yang. Ofa: Unifying architectures, tasks, and modalities through a simple sequence-to-sequence learning framework. In International conference on machine learning, pages 23318–23340. PMLR, 2022. 14
|
| 332 |
+
[75] Peng Wang, Shuai Bai, Sinan Tan, Shijie Wang, Zhihao Fan, Jinze Bai, Keqin Chen, Xuejing Liu, Jialin Wang, Wenbin Ge, et al. Qwen2-vl: Enhancing vision-language model’s perception of the world at any resolution. arXiv preprint arXiv:2409.12191, 2024. 1
|
| 333 |
+
|
| 334 |
+
[76] Wenhai Wang, Zhe Chen, Xiaokang Chen, Jiannan Wu, Xizhou Zhu, Gang Zeng, Ping Luo, Tong Lu, Jie Zhou, Yu Qiao, et al. Visionllm: Large language model is also an openended decoder for vision-centric tasks. Advances in Neural Information Processing Systems, 36:61501–61513, 2023. 1
|
| 335 |
+
[77] XuDong Wang, Shaolun Zhang, Shufan Li, Konstantinos Kallidromitis, Kehan Li, Yusuke Kato, Kazuki Kozuka, and Trevor Darrell. Segllm: Multi-round reasoning segmentation. arXiv preprint arXiv:2410.18923, 2024. 3
|
| 336 |
+
[78] Jeremy M Wolfe and Todd S Horowitz. Five factors that guide attention in visual search. Nature human behaviour, 1 (3):0058, 2017. 1
|
| 337 |
+
[79] Jiannan Wu, Muyan Zhong, Sen Xing, Zeqiang Lai, Zhaoyang Liu, Zhe Chen, Wenhai Wang, Xizhou Zhu, Lewei Lu, Tong Lu, et al. Visionllm v2: An end-to-end generalist multimodal large language model for hundreds of vision-language tasks. Advances in Neural Information Processing Systems, 37:69925–69975, 2025. 3, 6
|
| 338 |
+
[80] Penghao Wu and Saining Xie. V?: Guided visual search as a core mechanism in multimodal llms. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13084–13094, 2024. 3, 6
|
| 339 |
+
[81] Wenshan Wu, Shaoguang Mao, Yadong Zhang, Yan Xia, Li Dong, Lei Cui, and Furu Wei. Mind’s eye of llms: visualization-of-thought elicits spatial reasoning in large language models. Advances in Neural Information Processing Systems, 37:90277–90317, 2025. 3
|
| 340 |
+
[82] Xueqing Wu, Yuheng Ding, Bingxuan Li, Pan Lu, Da Yin, Kai-Wei Chang, and Nanyun Peng. Visco: Benchmarking fine-grained critique and correction towards self-improvement in visual reasoning. arXiv preprint arXiv:2412.02172, 2024. 3
|
| 341 |
+
[83] Jinjin Xu, Liwu Xu, Yuzhe Yang, Xiang Li, Fanyi Wang, Yanchun Xie, Yi-Jie Huang, and Yaqian Li. u-llava: Unifying multi-modal tasks via large language model. arXiv preprint arXiv:2311.05348, 2023. 14
|
| 342 |
+
[84] Bin Yan, Yi Jiang, Jiannan Wu, Dong Wang, Ping Luo, Zehuan Yuan, and Huchuan Lu. Universal instance perception as object discovery and retrieval. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 15325–15336, 2023. 13, 14
|
| 343 |
+
[85] Ziang Yan, Zhilin Li, Yinan He, Chenting Wang, Kunchang Li, Xinhao Li, Xiangyu Zeng, Zilei Wang, Yali Wang, Yu Qiao, et al. Task preference optimization: Improving multimodal large language models with vision task alignment. arXiv preprint arXiv:2412.19326, 2024. 3
|
| 344 |
+
[86] Aiyuan Yang, Bin Xiao, Bingning Wang, Borong Zhang, Ce Bian, Chao Yin, Chenxu Lv, Da Pan, Dian Wang, Dong Yan, et al. Baichuan 2: Open large-scale language models. arXiv preprint arXiv:2309.10305, 2023. 2
|
| 345 |
+
[87] Yuan Yao, Tianyu Yu, Ao Zhang, Chongyi Wang, Junbo Cui, Hongji Zhu, Tianchi Cai, Haoyu Li, Weilin Zhao, Zhihui He, et al. Minicpm-v: A gpt-4v level mllm on your phone. arXiv preprint arXiv:2408.01800, 2024. 6
|
| 346 |
+
[88] Haoxuan You, Haotian Zhang, Zhe Gan, Xianzhi Du, Bowen Zhang, Zirui Wang, Liangliang Cao, Shih-Fu Chang, and Yinfei Yang. Ferret: Refer and ground anything anywhere at any granularity. arXiv preprint arXiv:2310.07704, 2023. 14
|
| 347 |
+
|
| 348 |
+
[89] Alex Young, Bei Chen, Chao Li, Chengen Huang, Ge Zhang, Guanwei Zhang, Guoyin Wang, Heng Li, Jiangcheng Zhu, Jianqun Chen, et al. Yi: Open foundation models by 01. ai. arXiv preprint arXiv:2403.04652, 2024. 6
|
| 349 |
+
[90] Hang Zhang, Xin Li, and Lidong Bing. Video-llama: An instruction-tuned audio-visual language model for video understanding. arXiv preprint arXiv:2306.02858, 2023. 1
|
| 350 |
+
[91] Jiacheng Zhang, Yang Jiao, Shaoxiang Chen, Jingjing Chen, and Yu-Gang Jiang. Eventhallusion: Diagnosing event hallucinations in video llms. arXiv preprint arXiv:2409.16597, 2024. 1
|
| 351 |
+
[92] Shilong Zhang, Peize Sun, Shoufa Chen, Minn Xiao, Wenqi Shao, Wenwei Zhang, Yu Liu, Kai Chen, and Ping Luo. Gpt4roi: Instruction tuning large language model on regionofinterest, 2024. In URL https://openreview. net/forum.
|
| 352 |
+
[93] Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuohui Chen, Christopher Dewan, Mona Diab, Xian Li, Xi Victoria Lin, et al. Opt: Open pre-trained transformer language models. arXiv preprint arXiv:2205.01068, 2022. 2
|
| 353 |
+
[94] Lianmin Zheng, Wei-Lin Chiang, Ying Sheng, Siyuan Zhuang, Zhanghao Wu, Yonghao Zhuang, Zi Lin, Zhuohan Li, Dacheng Li, Eric Xing, et al. Judging llm-as-a-judge with mt-bench and chatbot arena. Advances in Neural Information Processing Systems, 36:46595–46623, 2023. 6
|
| 354 |
+
[95] Yuke Zhu, Oliver Groth, Michael Bernstein, and Li Fei-Fei. Visual7w: Grounded question answering in images. In Proceedings of the IEEE conference on computer vision and pattern recognition, pages 4995–5004, 2016. 13, 14
|
| 355 |
+
|
| 356 |
+
In this supplementary material, we provide more technical details and experimental results, including 1) Detailed descriptions of dataset used in Sec. A and Tab. 7; 2) Visual grounding ability tested on REC benchmarks in Sec. B and Tab. 8; 3) Our prompr designed for critics of data generation pipeline in Sec. C; as well as 4): More visualization of different datasets from VisualCoT benchmarks in Sec. D.
|
| 357 |
+
|
| 358 |
+
# A. Dataset
|
| 359 |
+
|
| 360 |
+
# A.1. VisCoT Dataset
|
| 361 |
+
|
| 362 |
+
We utilize the data from VisCoT [62] and follow its predefined training/testing split. Specifically, a subset of the training set is selected for training our VisRL model, as shown in Tab. 7. Besides, the test set remains consistent with VisCoT, as presented in Tab. 1, Tab. 2, Tab. 4 in the main text, etc..
|
| 363 |
+
|
| 364 |
+
Text/Doc: There are five text-related datasets—TextVQA [65], DocVQA [50], DUDE [72], TextCaps [64], and SROIE [26], covering text recognition and comprehension in various images and documents.
|
| 365 |
+
|
| 366 |
+
Fine-Grained Understanding: The Birds-200-2011 dataset (CUB) [73] is a widely used benchmark for fine-grained visual categorization. It includes rich visual data, detailed annotations of bird parts and attributes, and bounding boxes. To leverage this better for LMM, [62] design questions that challenge the model to identify specific bird characteristics, testing its ability to recognize fine-grained details.
|
| 367 |
+
|
| 368 |
+
General VQA: Flickr30k [55] and Visual7W [95] are used for general VQA tasks. Specifically, Flickr30k provides five captions per image and bounding boxes for most mentioned objects. [62] further use GPT-4 to generate questions focusing on small objects, while Visual7W has already included question-answer pairs with object-level grounding annotations.
|
| 369 |
+
|
| 370 |
+
Charts: InfographicsVQA [51] dataset features highresolution infographics, to train LMMs in locating answers precisely.
|
| 371 |
+
|
| 372 |
+
Relation Reasoning: The Visual Spatial Reasoning (VSR) [41], GQA [27], and Open Images [32] datasets, which are rich in spatial relational information among image objects, are used for relation-reasoning tasks.
|
| 373 |
+
|
| 374 |
+
# A.2. Comprehensive Benchmarks
|
| 375 |
+
|
| 376 |
+
We conducted evaluations on three further benchmarks as shown in Tab. 1 in the main text: MME [21], which comprehensively assesses perception and cognitive abilities across 14 sub-tasks; MMBench [46], a systematically designed objective benchmark for the robust and holistic evaluation, covering 20 capability dimensions; and POPE [38], which reframes hallucination evaluation as a series of binary questions requiring the model to determine the presence of objects in an image.
|
| 377 |
+
|
| 378 |
+
# B. Visual Grounding
|
| 379 |
+
|
| 380 |
+
Furthermore, we conducted additional evaluations of our VisRL on REC benchmarks. Specifically, we tested different methods on RefCOCO [31] and $\operatorname { R e f C O C O + }$ [49], both of which were collected in an interactive gaming interface and follow the validation/test-A/test-B split. In these two datasets, test-A always consists of images containing multiple people, whereas test-B includes all other objects. Additionally, compared to RefCOCO, queries in RefCOCO+ do not contain absolute spatial terms, such as references to an object’s location within the image (e.g., ”on the right side”). RefCOCOg [49] was another dataset collected in a non-interactive setting, and its queries are generally longer than those in RefCOCO and RefCOCO+.
|
| 381 |
+
|
| 382 |
+
As shown in Tab. 8, VisRL surpasses all previous generalist models, even outperforming models with significantly larger parameters. Moreover, in most of cases, our method exceeds the performance of previous state-of-the-art specialist models, e.g. G-DINO-L [45] and UNINEXT [84]. This demonstrates the exceptional capability of our approach in accurately predicting bounding boxes. Notably, our model achieves improvements of $1 \%$ to $5 \%$ to VisCoT. ”Top-1 Accuracy $@ 0 . 5$ ,” refers to the accuracy of a model in correctly predicting the bounding box as the top-ranked output when the IoU between the predicted and GT bounding boxes is at least $50 \%$ .
|
| 383 |
+
|
| 384 |
+
# C. Instruction for Critics
|
| 385 |
+
|
| 386 |
+
# C.1. Evaluation of Generated Bounding Box
|
| 387 |
+
|
| 388 |
+
Fig. 6 illustrates how we design the instruction to evaluate the bounding boxes generated by $\mathcal { M } _ { S F T }$ based on $\mathcal { M } _ { o r g }$ . Specifically, given the VQA data $( Q , I , R _ { G T } )$ , $\mathcal { M } _ { S F T }$ first outputs the bounding box based on $Q$ and $I$ , which is then used to crop the sub-images $I ^ { s }$ . Subsequently, we assess the correlation between the generated bounding box and the GT response by prompting $( Q , R _ { G T } , I ^ { s } )$ to $\mathcal { M } _ { o r g }$ (shown in Fig. 6). Thus, we achieve the evaluated score of bounding box solely based on the GT response, without the need for extra bounding box annotations.
|
| 389 |
+
|
| 390 |
+
# C.2. Evaluation of Generated Response
|
| 391 |
+
|
| 392 |
+
Fig. 7 presents the evaluation of responses along the sampled paths. Specifically, we prompt the model $\mathcal { M } _ { o r g }$ to assess the generated response with GT response based on the given question/image, and assigning the score accordingly.
|
| 393 |
+
|
| 394 |
+
# D. More visualization
|
| 395 |
+
|
| 396 |
+
In Fig. 8, 9, 10 and 11, we provide more visualization results of our VisRL compared with VisCoT, while using the same base model – LLaVA-1.5-7B.
|
| 397 |
+
|
| 398 |
+
Table 7. We detail the number of samples used on each dataset during the SFT and RL training stages in terms of Qwen2.5-VL-7B. Specifically, SFT is trained on data with bounding box labels, while RL utilizes only the image-question-answer pairs without any additional annotations. After our preference dataset construction, the RL data is distilled from 180k to 30k samples. Moreover, the datasets used for SFT and RL are independent (no overlap), while RL1 and RL2 share the same training dataset.
|
| 399 |
+
|
| 400 |
+
<table><tr><td>Dataset</td><td>Category</td><td>SFT (w. bounding box CoT)</td><td>RL (w/o bounding box label)</td><td>RL (after data generation)</td></tr><tr><td>Flickr30k [55]</td><td>General VQA</td><td>4000</td><td>32500</td><td>4626</td></tr><tr><td>GQA [27]</td><td>Relation Reasoning</td><td>4000</td><td>30000</td><td>5173</td></tr><tr><td>InfographicsVQA [51]</td><td>Charts</td><td>4055</td><td>11000</td><td>2358</td></tr><tr><td>Open Images [32]</td><td>Relation Reasoning</td><td>3053</td><td>40000</td><td>5019</td></tr><tr><td>TextCaps [64]</td><td>Text/Doc</td><td>4152</td><td>28000</td><td>4869</td></tr><tr><td>TextVQA [65]</td><td>Text/Doc</td><td>3524</td><td>15000</td><td>2458</td></tr><tr><td>VSR [41]</td><td>Relation Reasoning</td><td>1876</td><td>1500</td><td>998</td></tr><tr><td>CUB [73]</td><td>Fine-Grained Understanding</td><td>1987</td><td>2000</td><td>1278</td></tr><tr><td>Visual7W [95]</td><td>General VQA</td><td>4000</td><td>20000</td><td>3267</td></tr><tr><td>Total</td><td></td><td>30647</td><td>180000</td><td>30046</td></tr></table>
|
| 401 |
+
|
| 402 |
+
Table 8. Performance (Top-1 Accuracy $@ 0 . 5 )$ on Referring Expression Comprehension (REC) tasks. [S] refers to specialist models, while [G] refers to generalist models. The best is highlighted, while the second-best is underlined.
|
| 403 |
+
|
| 404 |
+
<table><tr><td rowspan="2">Method</td><td rowspan="2">Res.</td><td colspan="3">RefCOCO [31]</td><td colspan="3">RefCOCO+ [49]</td><td colspan="2">RefCOCOg [49]</td></tr><tr><td>val</td><td>test-A</td><td>test-B</td><td>val</td><td>test-A</td><td>test-B</td><td>val-u</td><td>test-u</td></tr><tr><td>UNINEXT [S] [84]</td><td>6402</td><td>92.64</td><td>94.33</td><td>91.46</td><td>85.24</td><td>89.63</td><td>79.79</td><td>88.73</td><td>89.37</td></tr><tr><td>G-DINO-L [S] [45]</td><td>3842</td><td>90.56</td><td>93.19</td><td>88.24</td><td>82.75</td><td>88.95</td><td>75.92</td><td>86.13</td><td>87.02</td></tr><tr><td>OFA-L [G] [74]</td><td>4802</td><td>79.96</td><td>83.67</td><td>76.39</td><td>68.29</td><td>76.00</td><td>61.75</td><td>67.57</td><td>67.58</td></tr><tr><td>Shikra 7B [G] [10]</td><td>2242</td><td>87.01</td><td>90.61</td><td>80.24</td><td>81.60</td><td>87.36</td><td>72.12</td><td>82.27</td><td>82.19</td></tr><tr><td>MiniGPT-v2-7B [G] [8]</td><td>4482</td><td>88.69</td><td>91.65</td><td>85.33</td><td>79.97</td><td>85.12</td><td>74.45</td><td>84.44</td><td>84.66</td></tr><tr><td>Qwen-VL-7B [G] [2]</td><td>4482</td><td>89.36</td><td>92.26</td><td>85.34</td><td>83.12</td><td>88.25</td><td>77.21</td><td>85.58</td><td>85.48</td></tr><tr><td>Ferret-7B [G] [88]</td><td>3362</td><td>87.49</td><td>91.35</td><td>82.45</td><td>80.78</td><td>87.38</td><td>73.14</td><td>83.93</td><td>84.76</td></tr><tr><td>u-LLaVA-7B [G] [83]</td><td>2242</td><td>80.41</td><td>82.73</td><td>77.82</td><td>72.21</td><td>76.61</td><td>66.79</td><td>74.77</td><td>75.63</td></tr><tr><td>SPHINX-13B [G] [40]</td><td>2242</td><td>89.15</td><td>91.37</td><td>85.13</td><td>82.77</td><td>87.29</td><td>76.85</td><td>84.87</td><td>83.65</td></tr><tr><td>VisCoT-7B [62]</td><td>3362</td><td>91.77</td><td>94.25</td><td>87.46</td><td>87.46</td><td>92.05</td><td>81.18</td><td>88.38</td><td>88.34</td></tr><tr><td>LLaVA-1.5-7B [42] + VIsRL</td><td>3362</td><td>92.72</td><td>96.18</td><td>90.21</td><td>90.23</td><td>94.10</td><td>85.77</td><td>91.17</td><td>89.28</td></tr></table>
|
| 405 |
+
|
| 406 |
+
You are responsible for verifying the relevance of the image based on the provided question and standard answer, you need to assess whether the image aligns with the standard answer.
|
| 407 |
+
|
| 408 |
+
The full score is 1 point and the minimum score is 0 points. Please directly provide the score in JSON format, for example, $\left. \lbrace \ " \mathrm { s c o r e " : } 0 . 8 \rbrace \right.$ , without showing the intermediate process.
|
| 409 |
+
|
| 410 |
+
The evaluation criteria is that, the higher score will be if the image effectively encompasses the information provided in the standard answer based on question.
|
| 411 |
+
|
| 412 |
+
Question: {Question}
|
| 413 |
+
|
| 414 |
+
Standard answer: {GT_Response}
|
| 415 |
+
|
| 416 |
+
You are responsible for proofreading the answers, you need to give the score to the model's answer by referring to the standard answer, based on the given question and image.
|
| 417 |
+
|
| 418 |
+
The full score is 1 point and the minimum score is 0 points. Please directly provide the score in JSON format, for example,{{"score": 0.8}, without showing the intermediate process.
|
| 419 |
+
|
| 420 |
+
The evaluation criteria require that the closer the model's answer is to the standard answer, the higher the score.
|
| 421 |
+
|
| 422 |
+
Question: {Question}
|
| 423 |
+
|
| 424 |
+
Standard answer: {GT_Response}
|
| 425 |
+
|
| 426 |
+
Model's answer: {Response}
|
| 427 |
+
|
| 428 |
+
Figure 6. Prompt for the bounding box critics.
|
| 429 |
+
|
| 430 |
+
Figure 7. Prompt for the response critics.
|
| 431 |
+
|
| 432 |
+
- Dataset: visual7w
|
| 433 |
+
- Image Path: v7w_2360495.jpg
|
| 434 |
+
- Query: Where is the tree?
|
| 435 |
+
- GT-Boundingbox: [0.206, 0.192, 0.792, 0.644]
|
| 436 |
+
- VisCoT-Boundingbox: [0.218, 0.524, 0.784, 0.998]
|
| 437 |
+
- Ours-Boundingbox: [0.218, 0.192, 0.780, 0.682]
|
| 438 |
+
- GT-Answer: Next to the buildings.
|
| 439 |
+
- VisCoT-Answer: Roof
|
| 440 |
+
- LLava-Answer: Roof
|
| 441 |
+
- Ours-Answer: Behind the building.
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
|
| 445 |
+

|
| 446 |
+
|
| 447 |
+
- Dataset: textcap
|
| 448 |
+
- Image Path: 5d411d97c0f033c7.jpg
|
| 449 |
+
- Query: What is the only visible word on the flag with a blue background?
|
| 450 |
+
- GT-Boundingbox: [0.893, 0.573, 0.975, 0.638]
|
| 451 |
+
- VisCoT-Boundingbox: [0.739, 0.391, 0.789, 0.420]
|
| 452 |
+
- Ours-Boundingbox: [0.894, 0.566, 0.982, 0.641]
|
| 453 |
+
- GT-Answer: COMMAND
|
| 454 |
+
- VisCoT-Answer: The only visible word on the flag with a blue background is "air".
|
| 455 |
+
- LLava-Answer: The only visible word on the flag with a blue background is "air".
|
| 456 |
+
- Ours-Answer: COMMAND
|
| 457 |
+
|
| 458 |
+

|
| 459 |
+
|
| 460 |
+

|
| 461 |
+
Figure 8. More visualization results of LLaVa-1.5 vs. VisCoT vs. VisRL (based on LLaVa-1.5). Ground truth (GT) bounding boxes are shown in blue, VisCoT-generated bounding boxes are shown in red, while Ours-generated bounding boxes are in green.
|
| 462 |
+
|
| 463 |
+
- Dataset: cub
|
| 464 |
+
- Image Path: Rhinoceros_Auklet_0004_797541.jpg
|
| 465 |
+
- Query: Does the bird in the picture have rufous belly and white leg?
|
| 466 |
+
- GT-Boundingbox: [0.038, 0.222, 0.750, 0.824]
|
| 467 |
+
- VisCoT-Boundingbox: [0.312, 0.574, 0.572, 0.820]
|
| 468 |
+
- Ours-Boundingbox: [0.046, 0.230, 0.752, 0.810]
|
| 469 |
+
- GT-Answer: No
|
| 470 |
+
- VisCoT-Answer: Yes, the bird in the picture has a rufous belly and white legs.
|
| 471 |
+
- LLava-Answer: Yes, the bird in the picture has a rufous belly and white legs.
|
| 472 |
+
- Ours-Answer: No
|
| 473 |
+
|
| 474 |
+

|
| 475 |
+
|
| 476 |
+

|
| 477 |
+
|
| 478 |
+
- Dataset: cub
|
| 479 |
+
- Image Path: Least_Auklet_0055_795106.jpg
|
| 480 |
+
- Query: Does the bird in the picture have red upper and buff eye?
|
| 481 |
+
- GT-Boundingbox: [0.104, 0.112, 0.850, 0.854]
|
| 482 |
+
- VisCoT-Boundingbox: [0.230, 0.174, 0.268, 0.208]
|
| 483 |
+
- Ours-Boundingbox: [0.106, 0.130, 0.848, 0.838]
|
| 484 |
+
- GT-Answer: No
|
| 485 |
+
- VisCoT-Answer: Yes, the bird in the picture has red upper and buff eye.
|
| 486 |
+
- LLava-Answer: Yes, the bird in the picture has red upper and buff eye.
|
| 487 |
+
- Ours-Answer: No
|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
|
| 491 |
+

|
| 492 |
+
Figure 9. More visualization results of LLaVa-1.5 vs. VisCoT vs. VisRL (based on LLaVa-1.5). Ground truth (GT) bounding boxes are shown in blue, VisCoT-generated bounding boxes are shown in red, while Ours-generated bounding boxes are in green.
|
| 493 |
+
|
| 494 |
+
- Dataset: gqa
|
| 495 |
+
- Image Path: 2351017.jpg
|
| 496 |
+
- Query: What is the food to the left of the meat with the eggs?
|
| 497 |
+
- GT-Boundingbox: [0.230, 0.384, 0.658, 0.620]
|
| 498 |
+
- VisCoT-Boundingbox: [0.394, 0.254, 0.580, 0.370]
|
| 499 |
+
- Ours-Boundingbox: [0.210, 0.380, 0.644, 0.620]
|
| 500 |
+
- GT-Answer: fries
|
| 501 |
+
- VisCoT-Answer: Soup
|
| 502 |
+
- LLava-Answer: Soup
|
| 503 |
+
- Ours-Answer: potatoes
|
| 504 |
+
|
| 505 |
+

|
| 506 |
+
|
| 507 |
+

|
| 508 |
+
|
| 509 |
+
- Dataset: gqa
|
| 510 |
+
- Image Path: 2384863.jpg
|
| 511 |
+
|
| 512 |
+
- Query: What type of furniture is to the right of the desk that the phone is on top of?
|
| 513 |
+
|
| 514 |
+
- GT-Boundingbox: [0.646, 0.478, 0.922, 0.758]
|
| 515 |
+
- VisCoT-Boundingbox: [0.276, 0.600, 0.566, 0.874]
|
| 516 |
+
- Ours-Boundingbox: [0.640, 0.476, 0.898, 0.780]
|
| 517 |
+
- GT-Answer: dresser
|
| 518 |
+
- VisCoT-Answer: Drawer
|
| 519 |
+
- LLava-Answer: Drawer
|
| 520 |
+
- Ours-Answer: dresser
|
| 521 |
+
|
| 522 |
+

|
| 523 |
+
|
| 524 |
+

|
| 525 |
+
Figure 10. More visualization results of LLaVa-1.5 vs. VisCoT vs. VisRL (based on LLaVa-1.5). Ground truth (GT) bounding boxes are shown in blue, VisCoT-generated bounding boxes are shown in red, while Ours-generated bounding boxes are in green.
|
| 526 |
+
|
| 527 |
+
- Dataset: cub
|
| 528 |
+
- Image Path: Lazuli_Bunting_0042_14820.jpg
|
| 529 |
+
- Query: Does the bird in the picture have brown throat and grey underparts?
|
| 530 |
+
- GT-Boundingbox: [0.118, 0.154, 0.986, 0.946]
|
| 531 |
+
- VisCoT-Boundingbox: [0.170, 0.398, 0.340, 0.630]
|
| 532 |
+
- Ours-Boundingbox: [0.114, 0.150, 0.978, 0.940]
|
| 533 |
+
- GT-Answer: No
|
| 534 |
+
- VisCoT-Answer: Yes, the bird in the picture has a brown throat and grey underparts.
|
| 535 |
+
- LLava-Answer: Yes, the bird in the picture has a brown throat and grey underparts.
|
| 536 |
+
- Ours-Answer: No
|
| 537 |
+
|
| 538 |
+

|
| 539 |
+
|
| 540 |
+

|
| 541 |
+
|
| 542 |
+
- Dataset: infographicsvqa
|
| 543 |
+
- Image Path: 37029.jpeg
|
| 544 |
+
- Query: Which social media platform has $47 \%$ mobile only users?
|
| 545 |
+
- GT-Boundingbox: [0.269, 0.067, 0.760, 0.361]
|
| 546 |
+
- VisCoT-Boundingbox: [0.242, 0.420, 0.349, 0.439]
|
| 547 |
+
- Ours-Boundingbox: [0.230, 0.071, 0.768, 0.333]
|
| 548 |
+
- GT-Answer: facebook
|
| 549 |
+
- VisCoT-Answer: Twitter
|
| 550 |
+
- LLava-Answer: Twitter
|
| 551 |
+
- Ours-Answer: Facebook
|
| 552 |
+
|
| 553 |
+

|
| 554 |
+
nmp.|Social Mediain Numbers
|
| 555 |
+
|
| 556 |
+

|
| 557 |
+
|
| 558 |
+

|
| 559 |
+
|
| 560 |
+

|
| 561 |
+
|
| 562 |
+

|
| 563 |
+
|
| 564 |
+

|
| 565 |
+
Figure 11. More visualization results of LLaVa-1.5 vs. VisCoT vs. VisRL (based on LLaVa-1.5). Ground truth (GT) bounding boxes are shown in blue, VisCoT-generated bounding boxes are shown in red, while Ours-generated bounding boxes are in green.
|
paper_markdowns/bamboo-02060.md
ADDED
|
@@ -0,0 +1,572 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# When Large Vision-Language Model Meets Large Remote Sensing Imagery: Coarse-to-Fine Text-Guided Token Pruning
|
| 2 |
+
|
| 3 |
+
Junwei Luo1*, Yingying Zhang2, Xue Yang3, Kang $\mathbf { W } \mathbf { u } ^ { 1 : }$ *, Qi Zhu2, Lei Liang2, Jingdong Chen2, Yansheng Li1†
|
| 4 |
+
|
| 5 |
+
1Wuhan University 2Ant Group 3SAIS, Shanghai Jiao Tong University
|
| 6 |
+
|
| 7 |
+
{luojunwei,kangwu,yansheng.li}@whu.edu.cn yangxue-2019-sjtu@sjtu.edu.cn
|
| 8 |
+
|
| 9 |
+
https://github.com/VisionXLab/LRS-VQA
|
| 10 |
+
|
| 11 |
+
# Abstract
|
| 12 |
+
|
| 13 |
+
Efficient vision-language understanding of large Remote Sensing Images (RSIs) is meaningful but challenging. Current Large Vision-Language Models (LVLMs) typically employ limited pre-defined grids to process images, leading to information loss when handling gigapixel RSIs. Conversely, using unlimited grids significantly increases computational costs. To preserve image details while reducing computational complexity, we propose a text-guided token pruning method with Dynamic Image Pyramid (DIP) integration. Our method introduces: (i) a Region Focus Module (RFM) that leverages text-aware region localization capability to identify critical vision tokens, and (ii) a coarse-to-fine image tile selection and vision token pruning strategy based on DIP, which is guided by RFM outputs and avoids directly processing the entire large imagery. Additionally, existing benchmarks for evaluating LVLMs’ perception ability on large RSI suffer from limited question diversity and constrained image sizes. We construct a new benchmark named LRS-VQA, which contains 7,333 QA pairs across 8 categories, with image length up to 27,328 pixels. Our method outperforms existing high-resolution strategies on four datasets using the same data. Moreover, compared to existing token reduction methods, our approach demonstrates higher efficiency under high-resolution settings.
|
| 14 |
+
|
| 15 |
+
# 1. Introduction
|
| 16 |
+
|
| 17 |
+
Benefiting from the rapid advancement of Large Language Models (LLMs) [2, 11, 14, 17, 75], Large Visual-Language Models (LVLMs) have demonstrated strong capabilities in perceiving and understanding visual information in textbased multimodal interactions [9, 29, 41, 65]. Currently, LVLMs have been extensively studied and applied across various fields like remote sensing (RS) intelligent interpre-
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
LargeRSI
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Text Instruction
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
Text-Related Key Region
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
(a)
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
(b)
|
| 35 |
+
|
| 36 |
+

|
| 37 |
+
Unlimited Grids: w/oVis.Compression:
|
| 38 |
+
Blurred Detail Vision Part Speed LLM Part Speed
|
| 39 |
+
w/Vis.Compression:
|
| 40 |
+
Blurred Detail Vision Part Speed LLMPart Speed
|
| 41 |
+
Dynamic ImageTiles: Blurred Detail Vision Part Speed LLMPart Speed
|
| 42 |
+
Figure 1. High-resolution strategy comparison for modular LVLMs. (a) and (b) show that existing grid-based cropping methods face challenges when processing large RSIs. (c) The proposed dynamic pyramid-based token pruning strategy can dynamically select image tiles of key regions related to the input text, balancing image detail and computational cost.
|
| 43 |
+
|
| 44 |
+
tation [12, 32, 53, 73, 87, 94].
|
| 45 |
+
|
| 46 |
+
Advances in satellite imaging technology allow for the acquisition of large remote sensing images (RSIs) that cover extensive ground areas and contain detailed land use information [18, 38]. Therefore, language-based intelligent analysis of large RSIs is valuable for applications such as complex scene understanding [37, 50], urban planning [35, 64], infrastructure development [70], and monitoring [93].
|
| 47 |
+
|
| 48 |
+
Some RS LVLMs handle high-resolution input through position embedding interpolation [27, 86]. Additionally, various dynamic high-resolution strategies designed for general LVLMs [33, 41, 80] can be adapted to RS LVLMs, such as EarthDial [61] (based on InternVL1.5 [10])
|
| 49 |
+
|
| 50 |
+
and GeoPixel[57] (using InternLM-XComposer2.5 [84]). However, these approaches for high-resolution image processing are limited when handling large RSIs exceeding $1 0 , 0 0 0 \times 1 0 , 0 0 0$ pixels. As depicted in Fig. 1, these methods typically employ limited pre-defined grid partitions, leading to detail loss when large RSIs are excessively downsampled. Conversely, unlimited grids suffer from prohibitive time and memory costs (e.g., over 5 million vision tokens for a large RSI in LLaVA-1.5 [41]). This necessitates balancing resolution and computational efficiency when processing large RSI.
|
| 51 |
+
|
| 52 |
+
To overcome the above limitations of existing strategies in handling large RSIs, we propose a text-guided token pruning strategy that consists of two key components: a Region Focus Module (RFM) and a Dynamic Image Pyramid (DIP). The RFM identifies text-relevant key vision tokens by leveraging the capability distilled from the LLM component. Based on the RFM’s output, we select critical image tiles and conduct token pruning in a coarse-to-fine manner within the DIP. This enables the LVLM to focus and zoom in key areas, avoiding to process all visual tokens, thereby facilitating flexible and efficient inference.
|
| 53 |
+
|
| 54 |
+
Moreover, benchmarks for LVLMs in understanding large RSIs remain insufficiently developed. Although MME-Realworld [91] includes large RSIs with high-quality manually annotated questions, its RS subset suffers from limited question diversity and image sizes. To more comprehensively characterize the challenges of large RSI perception, we construct a new benchmark called LRS-VQA (Large Remote Sensing image Visual Question Answering). LRS-VQA features larger size images with lengths up to 27,328 pixels and 8 distinct question types. Our key contributions are as follows:
|
| 55 |
+
|
| 56 |
+
• We introduce a Region Focus Module (RFM) that distills the ability from LLM part of LVLM to efficiently identify text-related key vision tokens.
|
| 57 |
+
• Based on RFM and DIP, we propose an efficient coarseto-fine inference strategy for large RSIs, which achieves a balance between resolution and efficiency through key tile selection and vision token pruning.
|
| 58 |
+
• We construct a new benchmark named LRS-VQA, featuring larger image sizes and more diverse question types than existing benchmarks, to reflect the challenges of large RSIs perception.
|
| 59 |
+
• The proposed method is architecture-agnostic and shows performance improvements and efficiency gains.
|
| 60 |
+
|
| 61 |
+
# 2. Related Work
|
| 62 |
+
|
| 63 |
+
# 2.1. LVLMs for High-Resolution Comprehension
|
| 64 |
+
|
| 65 |
+
Numerous LVLMs designed for high-resolution image or video perception have recently emerged. They can be primarily categorized into the following paradigms:
|
| 66 |
+
|
| 67 |
+
Methods that carefully design image cropping and padding strategy. Methods like [10, 19, 29, 39, 41, 45, 80, 90] traverse pre-defined partition grids and obtain the most suitable grid, to divide the high-resolution image into image tiles. These methods encounter limitations when processing large RSIs as in Fig. 1.
|
| 68 |
+
|
| 69 |
+
Methods based on multiple visual branches. These approach [34, 49, 63] employ additional high-resolution visual encoders like SAM [25] encoder or ConvNext [46] to process images with higher input resolution.
|
| 70 |
+
|
| 71 |
+
Visual chain-of-thoughts methods. These approaches utilize a search-and-focus strategy [59, 60, 66, 69] or external RAG pipeline [92] to identify text-related key image regions. However, such pipelines require multiple LVLM inferences, making them more complex and cumbersome.
|
| 72 |
+
|
| 73 |
+
# 2.2. Vision Token Reduction in LVLMs
|
| 74 |
+
|
| 75 |
+
Visual token pruning for transformers has been a classic research topic, it aims to accelerate computation by dynamically reducing less important tokens. It has been extensively studied in both natural language processing [24, 79] and computer vision domains [16, 26, 51, 56, 68].
|
| 76 |
+
|
| 77 |
+
Recently, a variety of token pruning methods have been proposed for LVLMs, which can be categorized into three main types: token pruning conducted in the vision encoder [5, 33, 58, 67, 77, 78], token pruning performed in the LLM component [8, 20, 21, 72, 81, 88], and collaborative approaches that integrate both [6, 30, 31, 36, 74, 82, 85]. Moreover, adaptive token segmentation methods [1, 7, 28] also offer a promising approach for token reduction.
|
| 78 |
+
|
| 79 |
+
Although vision-part pruning methods efficiently reduce vision tokens, when processing large images, it’s highly time-consuming to traverse pre-defined grids and handle numerous image tiles with the vision encoder. Moreover, the absence of language guidance makes it hard to identify foreground regions in complex RSIs. The LLM-part pruning methods require feeding all vision tokens into the LLM. Therefore, long visual sequences from large images may exceed LLM length limits and incur high computational costs for attention score ranking.
|
| 80 |
+
|
| 81 |
+
Among the collaborative approaches, the methods most closely related to ours are LLaVA-Mini [85] and FlexAttention [31]. The former employs modality pre-fusion to compress visual information; however, its LLM-like pre-fusion module still struggles with handling extremely long vision sequences. The latter integrates text-guided high-resolution features within the LLM component. Nevertheless, the allowable image size for its high-resolution view remains limited, and it can only index high-resolution features once.
|
| 82 |
+
|
| 83 |
+
# 3. Preliminaries
|
| 84 |
+
|
| 85 |
+
In this section, we present the foundational concepts of text-image attention within the LLM component of
|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 2. The pipeline of the proposed method. The entire process iterates in a coarse-to-fine manner, dynamically retrieving highresolution features from the next DIP level (leftward orange arrow) or performing token pruning at the current level (rightward orange arrow) based on the output of the RFM module at each iteration. During training, the RFM distillation text-related attention from the LLM; during inference, RFM generates the attention scores for the input vision tokens. GSD means ground sample distance.
|
| 91 |
+
|
| 92 |
+
LVLMs. Mainstream modular LVLMs include three components [48]: a pre-trained vision encoder, a projector, and a pre-trained decoder-only LLM. Conventional highresolution strategies [10, 19] process the original image $I _ { i m g }$ into a thumbnail view $I _ { \mathrm { t h u m b } }$ and a set of image tiles $I _ { \mathrm { t i l e s } }$ . Then the vision encoder and the projector transforms $I _ { \mathrm { t h u m b } }$ and $I _ { \mathrm { t i l e s } }$ into vision token embeddings $T _ { v i s } =$ $[ T _ { v i s } ^ { l r } , T _ { v i s } ^ { h r } ]$ , which contain low-resolution tokens $T _ { v i s } ^ { l r }$ from the $I _ { \mathrm { t h u m b } }$ and higher-resolution $T _ { v i s } ^ { h r }$ from the $I _ { \mathrm { t i l e s } }$ . $T _ { v i s }$ are concatenated with text token embeddings $T _ { t x t }$ from the tokenized text instruction, forming a multimodal token sequence $\textit { T } = \ [ T _ { v i s } , T _ { t x t } ]$ . The LVLM processes $T$ via transformer-based decoder layers with causal self-attention, where the attention score $A$ can be represented as:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
A = \operatorname {A t t e n t i o n} (Q, K) = \operatorname {S o f t m a x} \left(\frac {Q K ^ {\top}}{\sqrt {d}}\right), \tag {1}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $A \in \mathbb { R } ^ { n \times n }$ is the self-attention map, $Q , K \in \mathbb { R } ^ { n \times d }$ are the query and key matrices derived from the input embeddings through linear transformations, $n$ is the input sequence length, and $d$ is the feature dimension. As $A$ determines the weight each token assigns to the former tokens in the sequence, by analyzing the attention from text tokens to vision tokens, we can identify text-related important vision
|
| 99 |
+
|
| 100 |
+
tokens. Some studies [23, 81] observe that in the deep layers of LLM part in LVLMs, attention is predominantly allocated to text-related vision tokens compared to other vision tokens. This insight inspired us to design a coarse-to-fine mechanism to focus on key image regions.
|
| 101 |
+
|
| 102 |
+
# 4. Method and Benchmark
|
| 103 |
+
|
| 104 |
+
# 4.1. Method
|
| 105 |
+
|
| 106 |
+
To achieve efficient understanding of ultra-high-resolution images, our core idea is coarse-to-fine focusing: we first gain a low-resolution overview, then iteratively zoom into text-related regions for details, as shown in Fig. 2. Implementing this necessitates a multi-resolution representation. Therefore, we first introduce the Dynamic Image Pyramid (DIP) in Sec. 4.1.1. Then we need to identify where to focus next. To solve this, we propose the Region Focus Module (RFM) to provide attention distribution for input vision tokens (Sec. 4.1.2). Finally, these components are integrated into an iterative refinement process (Sec. 4.1.3).
|
| 107 |
+
|
| 108 |
+
# 4.1.1. The Construction of Dynamic Image Pyramid
|
| 109 |
+
|
| 110 |
+
As established, our coarse-to-fine strategy requires a multiresolution representation of the image $I _ { i m g }$ . We realize this through the DIP, a structure designed to provide image tiles
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Figure 3. The proposed RFM and attention distillation strategy. The left part indicates our core idea: distill accurate text-related key region localization ability from the LLM part of the LVLM. The right part shows the distillation details. We only select specific layer pairs for distillation to avoid hidden state discontinuities. “sys token” represents the tokens from the system prompt.
|
| 116 |
+
|
| 117 |
+
at various ground sample distances (GSDs).
|
| 118 |
+
|
| 119 |
+
First, we iteratively downsample $I _ { i m g }$ by a factor of 2, generating a series of images $\{ I _ { i n i t } ^ { 1 } , I _ { i n i t } ^ { 2 } , \ldots , I _ { i n i t } ^ { P } \}$ until the shorter side reaches a pre-defined minimum length. Let a basic image tile size be $B \times B$ (e.g., $3 3 6 \times 3 3 6$ for CLIP-L14), for the $p$ -th scaled image $I _ { i n i t } ^ { p }$ , we calculate the number of image tiles along the height and width as follows:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
N _ {h} ^ {p} = \lceil H _ {p} / B \rceil , \quad N _ {w} ^ {p} = \lceil W _ {p} / B \rceil , \qquad \qquad (2)
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
where $H _ { p } , W _ { p }$ are the height and width of $I _ { i n i t } ^ { p }$ Ipinit, respectively. For proper tiling, we compute a scale factor $r _ { p }$ as:
|
| 126 |
+
|
| 127 |
+
$$
|
| 128 |
+
r _ {p} = \min \left(\frac {N _ {h} ^ {p} \times B}{H _ {p}}, \frac {N _ {w} ^ {p} \times B}{W _ {p}}\right). \tag {3}
|
| 129 |
+
$$
|
| 130 |
+
|
| 131 |
+
The image I p $I _ { i n i t } ^ { p }$ is then resized to $I ^ { p }$ using $r _ { p }$ , followed by padsizing, $I ^ { p }$ g to preserve the original aspect ratiis partitioned into non-overlap tiles $I _ { \mathrm { t i l e s } } ^ { p }$ fter re-. Tiles from all scaled images are combined in reverse order, and integrated with the thumbnail view $I _ { \mathrm { t h u m b } }$ to form the final pyramid: $I _ { D I P } = \{ I _ { \mathrm { t h u m b } } , I _ { \mathrm { t i l e s } } ^ { 1 } , I _ { \mathrm { t i l e s } } ^ { 2 } , \ldots , I _ { \mathrm { t i l e s } } ^ { \mathrm { P } } \}$ , which consists of $P + 1$ layers with progressively increasing resolutions. During training, we select the thumbnail $I _ { \mathrm { t h u m b } }$ and $I _ { \mathrm { t i l e s } } ^ { 1 }$ as visual inputs for computational efficiency. During inference, all pyramid layers become accessible to enable multi-scale inference, as in the left part of Fig. 2.
|
| 132 |
+
|
| 133 |
+
# 4.1.2. Attention Distillation for Key Region Focus
|
| 134 |
+
|
| 135 |
+
With the DIP established, the central challenge becomes generating a reliable guidance signal to determine where to focus next. While a sliding-window similarity map from
|
| 136 |
+
|
| 137 |
+
VLMs like CLIP is a straightforward baseline, we posit that the attention maps from the LVLM’s LLM part provide a superior localization signal. This is inspired by prior work [23, 72, 81] where LLM attention tends to converge on key visual tokens. To support this, we quantitatively validate that LLM attention significantly outperforms the CLIP/RemoteCLIP baselines by offering more accurate, text-related localization signals in Tab. 7.
|
| 138 |
+
|
| 139 |
+
To harness this high-quality guidance efficiently, we introduce the Region Focus Module (RFM), a lightweight module trained via attention distillation to mimic the textguided localization capability of the LLM teacher, as shown in Fig. 3. After distillation, the trained RFM can guide the selection of key image tiles and prune irrelevant vision tokens before the main LLM computation.
|
| 140 |
+
|
| 141 |
+
Specifically, assuming the LLM has $M$ layers $l _ { 1 } , l _ { 2 } , \dots , l _ { M }$ , the proposed RFM adopts the same architecture with $R$ layers $r _ { 1 } , r _ { 2 } , \ldots , r _ { R }$ , where $R { < } M$ . Each RFM layer $r _ { i }$ is initialized from a selected LLM layer $l _ { m _ { i } }$ , where $\{ m _ { 1 } , m _ { 2 } , \dots , m _ { R } \}$ forms a sparse subset of LLM layer indices. For layer-wise distillation, we select $K$ pairs $( K { < } R )$ from RFM and LLM as student-teacher pairs, represented as $\{ ( r _ { k } , l _ { m _ { k } } ) \ | \ k = 1 , 2 , \ldots , K \}$ . This strategy avoids rigidly aligning each $r _ { i }$ with $l _ { m _ { i } }$ , which would neglect the non-teacher layers in the LLM, resulting in inconsistency between adjacent RFM layers.
|
| 142 |
+
|
| 143 |
+
As depicted in the right part of Fig. 3, the concatenated multimodal tokens $T \mathrm { ~ = ~ } \left[ T _ { v i s } , T _ { t x t } \right]$ are fed into both the RFM and the LLM during training. For the $k$ -th studentteacher layer pair $( r _ { k } , l _ { m _ { k } } )$ , we extract the attention scores between the last text token and all vision tokens from the
|
| 144 |
+
|
| 145 |
+
multi-head self attention (MHSA). For the $h$ -th head, the self-attention is represented as Ak,hstu , Ak,htea $A _ { \mathrm { s t u } } ^ { \dot { k } , h } , A _ { \mathrm { t e a } } ^ { k , h } \in \mathbb R ^ { j \times n _ { v } }$ , where $j$ is the number of dialogue turns for multi-turn instruction and $n _ { v }$ is the length of vision tokens. We apply the Kullback-Leibler (KL) divergence loss for distillation:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\mathcal {L} _ {\mathrm {k l}} ^ {h} = \sum_ {k = 1} ^ {K} \left[ D _ {\mathrm {K L}} \left(A _ {\mathrm {t e a}} ^ {k, h} \| A _ {\mathrm {s t u}} ^ {k, h}\right) + \lambda_ {\mathrm {h r}} D _ {\mathrm {K L}} \left(A _ {\mathrm {t e a}} ^ {k, h, \mathrm {h r}} \| A _ {\mathrm {s t u}} ^ {k, h, \mathrm {h r}}\right) \right], \tag {4}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where $A _ { \mathrm { t e a } } ^ { k , h , \mathrm { h r } } , A _ { \mathrm { s t u } } ^ { k , h , \mathrm { h r } }$ denote attention corresponding to $T _ { v i s } ^ { h r }$ , and $\lambda _ { \mathrm { h r } }$ is the weighting factor. Additionally, we enforce stronger alignment constraints to the attention of $T _ { v i s } ^ { h r }$ by using an additional Mean Squared Error (MSE) loss:
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\mathcal {L} _ {\mathrm {m s e}} ^ {h} = \sum_ {k = 1} ^ {K} \mathrm {M S E} \left(A _ {\mathrm {s t u}} ^ {k, h, \mathrm {h r}}, A _ {\mathrm {t e a}} ^ {k, h, \mathrm {h r}}\right). \tag {5}
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
The total distillation loss is computed as:
|
| 158 |
+
|
| 159 |
+
$$
|
| 160 |
+
\mathcal {L} _ {\text {d i s t i l l}} = \frac {1}{K H} \sum_ {h = 1} ^ {H} \left(\lambda_ {\mathrm {m s e}} \mathcal {L} _ {\mathrm {m s e}} ^ {h} + \lambda_ {\mathrm {k l}} \mathcal {L} _ {\mathrm {k l}} ^ {h}\right), \tag {6}
|
| 161 |
+
$$
|
| 162 |
+
|
| 163 |
+
where $K$ is the number of selected student-teacher layer pairs, $H$ is the number of attention heads, and $\lambda _ { \mathrm { m s e } } , \lambda _ { \mathrm { k l } }$ are hyperparameters. For the flash-attention [13], we employ a specialized value matrix to extract attention maps like [88] to ensure compatibility.
|
| 164 |
+
|
| 165 |
+
# 4.1.3. Text-Guided Token Pruning with Pyramid
|
| 166 |
+
|
| 167 |
+
Having introduced the DIP and the RFM, this section details how they are integrated into a cohesive, iterative process. This process achieves our coarse-to-fine strategy by selectively retrieving high-resolution tiles and pruning irrelevant tokens, as illustrated in Fig. 2.
|
| 168 |
+
|
| 169 |
+
The specific inference procedure, detailed in Alg. 1, is as follows. For simplicity, the tokens from the system prompt omitted. We initializeto generate the initial $I _ { \mathrm { t h u m b } }$ $I _ { \mathrm { t i l e s } } ^ { p }$ Itiles $T _ { v i s } = [ T _ { v i s } ^ { l r } , \bar { T } _ { v i s } ^ { p , h r } ]$ $p = 1$ then the concatenated tokens $T$ are fed into the RFM. From the last layer of the RFM, we compute the average attention scores from all heads in the MHSA, and extract the attention scores $A _ { \mathrm { s t u } } ^ { K , h r }$ of $T _ { \mathrm { v i s } } ^ { p , h r }$ . By selecting the top- $\lambda$ proportion from $A _ { \mathrm { s t u } } ^ { K , \bar { h r } }$ vis , we identify the indices of key tokens and map their coordinates to image tile-level coordinates, to select key image tiles $I _ { \mathrm { k e y } } ^ { p + 1 }$ p+1 Ikey from $I _ { \mathrm { t i l e s } } ^ { p + 1 }$ . Based on the number of p+1 $I _ { \mathrm { k e y } } ^ { p + 1 }$ ne whetheion tokens is obtaine e the fromile sel $T _ { \mathrm { v i s } } ^ { p , h r }$ directly orr-resolution process is $T _ { \mathrm { v i s } } ^ { p + 1 , h r }$ $T _ { \mathrm { v i s } } ^ { p + 1 , h r }$ repeated recursively until the last layer of DIP is reached. This approach enables LVLM to focus only on processing a few high-resolution image tiles in a coarse-to-fine manner, thereby reducing computational complexity while preserving critical text-related image details.
|
| 170 |
+
|
| 171 |
+
# 4.2. The Construction of LRS-VQA Benchmark
|
| 172 |
+
|
| 173 |
+
Considering the limitations of existing benchmarks for evaluating LVLMs’ perception of RSIs in terms of question di-
|
| 174 |
+
|
| 175 |
+
Algorithm 1 Coarse-to-Fine Token Pruning with DIP
|
| 176 |
+
Require: $\{I_{\mathrm{tiles}}^1,I_{\mathrm{tiles}}^2,\dots,I_{\mathrm{tiles}}^{\mathrm{P}}\}$ in $I_{\mathrm{DIP}}$ $K$ -layer RFM, initial multimodal tokens $T$ , vision encoder and projector $\mathcal{V}(\cdot)$ , token saving ratio $\alpha$ , tile number threshold $N_{\mathrm{max}}$ Ensure: Retained tokens $T_{\mathrm{vis}}^{\mathrm{retain}}$ 1: Definition: Top- $\alpha (X)$ selects elements in $X$ with values in the top $\alpha$ proportion.
|
| 177 |
+
2: for $p = 1$ to $P$ do
|
| 178 |
+
3: Compute attention: $A_{\mathrm{stu}}^{K,hr}\gets \mathrm{RFM}(T)[T_{\mathrm{vis}}^{p,hr}]$ 4:Normalize:
|
| 179 |
+
5:Identify key positions: $\mathcal{P}_{\mathrm{key}}^{K,hr}\gets \mathrm{Top - }\alpha (A_{\mathrm{stu}}^{K,hr})$ 6:if $p < P$ then
|
| 180 |
+
7:Map coordinates and select key tiles: $I_{\mathrm{key}}^{p + 1}\gets \{t\in$ $I_{\mathrm{tiles}}^{p + 1}\mid$ mapped from $\mathcal{P}_{\mathrm{key}}^{K,hr}\}$ 8:if $|I_{\mathrm{key}}^{p + 1}| > N_{\mathrm{max}}$ then
|
| 181 |
+
9:Prune tokens: $T_{\mathrm{vis}}^{\mathrm{retain}}\gets \{t\in T_{\mathrm{vis}}^{p,hr}\mid \mathcal{P}_{\mathrm{key}}^{K,hr}\}$ 10: break
|
| 182 |
+
11: else
|
| 183 |
+
12:Encode selected tiles: $T_{\mathrm{vis}}^{p + 1,hr}\gets \mathcal{V}(I_{\mathrm{key}}^{p + 1})$ 13:Update $T\gets [T_{\mathrm{vis}}^{\mathrm{lr}},T_{\mathrm{vis}}^{p + 1,hr},T_{\mathrm{txt}}]$ 14:end if
|
| 184 |
+
15:else
|
| 185 |
+
16:Prune tokens at final layer: $T_{\mathrm{vis}}^{\mathrm{retain}}\gets \{t\in T_{\mathrm{vis}}^{p,hr}\mid$ $\mathcal{P}_{\mathrm{key}}^{K,hr}\}$ 17:end if
|
| 186 |
+
18:end for
|
| 187 |
+
19:return $T_{\mathrm{vis}}^{\mathrm{retain}}$
|
| 188 |
+
|
| 189 |
+
versity and image size, we propose a new benchmark for more comprehensive evaluation.
|
| 190 |
+
|
| 191 |
+
# 4.2.1. Annotation Pipeline
|
| 192 |
+
|
| 193 |
+
The annotation pipeline of LRS-VQA is illustrated in Fig. 4. We collect 3 publicly remote sensing datasets: FAIR1M-1.0 [62], GLH-Bridge [35], and STAR [37], and identify all unique targets based on the object detection labels to generate unique references from them (e.g., “the top-most ship” and “the largest dock”). Subsequently, we crop the region with the unique target from the original image, and feed it, along with a prompt containing the unique reference, into GPT-4V [54] to generate question-answer pairs about the target’s color, shape, status, etc. Details of the overall construction process are provided in the Appendix A.
|
| 194 |
+
|
| 195 |
+
# 4.2.2. Visual-Centric Quality Check and Refinement
|
| 196 |
+
|
| 197 |
+
To ensure the quality of the generated question-answer pairs, we employ powerful Qwen2-VL [65] for quality assessment. Qwen2-VL supports manual adjustment of the maximum pixel resolution, allowing us to evaluate whether increased resolution improves accuracy while keeping the LLM unchanged. Using this approach, we filter out ques-
|
| 198 |
+
|
| 199 |
+
Table 1. Comparison of existing benchmarks for evaluating LVLMs’ perception capabilities in large RSIs.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Dataset</td><td>Image Size</td><td>Image Num</td><td>Ques. Cate.</td><td>Ques. Num</td><td>QS Format</td></tr><tr><td>MME-RealWorld-RS [91]</td><td>689-11500</td><td>1298</td><td>3</td><td>3738</td><td>Single-choice</td></tr><tr><td>LRS-VQA (Ours)</td><td>1024-27328</td><td>1657</td><td>8</td><td>7333</td><td>Open-end</td></tr></table>
|
| 202 |
+
|
| 203 |
+

|
| 204 |
+
Figure 4. The construction pipeline of the proposed LRS-VQA dataset. The visual prompt (red box) is inspired by SoM [76].
|
| 205 |
+
|
| 206 |
+
tion types where accuracy can not improve with resolution. Through iterative filtering, manual review, and prompt refinement, we obtain the LRS-VQA dataset, which could effectively assess the large RSI perception capability of LVLMs, as shown in Fig. 5. LRS-VQA contains eight question-answer types: count, color, category, shape, status, reasoning, rural/urban classification, and target background. It features greater diversity in question types and larger image sizes than MME-Realworld-RS as in Tab. 1, highlighting the complexities of large RSI perception.
|
| 207 |
+
|
| 208 |
+
# 5. Experiments
|
| 209 |
+
|
| 210 |
+
# 5.1. Experimental Details
|
| 211 |
+
|
| 212 |
+
Data. Our pre-training (PT) phase is the same as LLaVA-1.5 [42] (using 558K data). For the SFT phase, we collect 484K samples, including 300K sampled from LLaVA-1.5-665K, 146K sampled from RSVQA-HR [47], and 38K template-based samples from three RS datasets [15, 35, 37] using their labels. Within this 38k data, some images share the same source with LRS-VQA, but there is no overlap be-
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure 5. The accuracy trends of Qwen2-VL across varying input maximum pixels. This demonstrates that accuracy on both the manually annotated MME-RealWorld-RS and our proposed LRS-VQA exhibit a positive correlation with resolution improvement, proving the effectiveness of LRS-VQA in evaluating LVLM’s high-resolution RSI perception capabilities.
|
| 216 |
+
|
| 217 |
+
tween them. Details can be found in the Appendix B.1.
|
| 218 |
+
|
| 219 |
+
Benchmarks and evaluation metrics: i) MME-RealWorld-RS: the RS part of MME-Realworld [91], containing 1,298 RSIs with expert-annotated questions in three types: color, count, and position. We follow the official evaluation script but modify the prompt by removing “The best answer is:” to address Vicuna-1.5-based models’ tendency to respond with only option A. ii) LRS-VQA: it consists of 3 parts: LRS-FAIR, LRS-Bridge, and LRS-STAR, containing 2,272, 1,062, and 3,999 QA pairs, respectively. For the short open-ended format, we adopt a structured evaluation metric following [22, 71], using WordNet [52], with a semantic similarity threshold of 0.8.
|
| 220 |
+
|
| 221 |
+
Experimental settings. We evaluate existing LVLMs using their official weights or APIs. For fair comparison, we also re-implement some methods on our 484k SFT dataset. Our approach is built upon the LLaVA-1.5 codebase, where we integrate the anyres strategy and Qwen2 language model. All experiments are conducted on 4 A100 80GB GPUs. For our method, the minimum length for DIP is 1,008 pixels. The $N _ { \mathrm { m a x } }$ is set to 40 and 80 for Vicuna-1.5 and Qwen2, respectively. The vision token saving ratio $\alpha$ is 0.25, $\lambda _ { \mathrm { h r } } , \lambda _ { \mathrm { m s e } } , \lambda _ { \mathrm { k l } }$ are set to 2.0, 1.0, 1.0. The RFM-LLM layer pairs are [1, 5, 11, 14] with distillation applied to the first and last pairs. Additional experimental details are provided in Appendix B.2.
|
| 222 |
+
|
| 223 |
+
<table><tr><td>Leaderboard</td><td>Data</td><td>Vis. Encoder</td><td>LLM</td><td>Max Size</td><td>MME-RW-RS</td><td>LRS-FAIR</td><td>LRS-Bridge</td><td>LRS-STAR</td><td>Avg. Acc</td></tr><tr><td>Qwen2-VL [65]</td><td>-</td><td>QwenViT</td><td>Qwen2-7B</td><td>3,333×3,333</td><td>49.73</td><td>23.80</td><td>38.12</td><td>27.87</td><td>34.88</td></tr><tr><td>LLaVA-OV [29]</td><td>4.8M</td><td>SigLip</td><td>Qwen2-7B</td><td>2,304×2,304</td><td>53.53</td><td>20.61</td><td>35.11</td><td>26.08</td><td>33.83</td></tr><tr><td>IXC-2.5 [84]</td><td>-</td><td>CLIP-L14</td><td>InternLM2-7B</td><td>4,096×4,096</td><td>36.12</td><td>25.25</td><td>38.41</td><td>27.30</td><td>31.77</td></tr><tr><td>LLaVA-UHD-v2 [89]</td><td>1.42M</td><td>CLIP-L14+JBU</td><td>Vicuna-1.5-7B</td><td>672×1,008</td><td>40.77</td><td>22.82</td><td>32.57</td><td>26.08</td><td>30.56</td></tr><tr><td>LLaVA-FlexAttn [31]</td><td>1.22M</td><td>CLIP-L14</td><td>Vicuna-1.5-7B</td><td>1,008×1,008</td><td>37.75</td><td>19.57</td><td>29.99</td><td>22.76</td><td>27.52</td></tr><tr><td>SEAL [69]</td><td>0.95M</td><td>CLIP-L14</td><td>Vicuna-1.5-7B</td><td>-</td><td>30.55</td><td>21.29</td><td>34.75</td><td>21.29</td><td>26.97</td></tr><tr><td>MGM-HD [34]</td><td>3.0M</td><td>Mixed</td><td>Vicuna-1.5-7B</td><td>1,536×1,536</td><td>31.51</td><td>17.90</td><td>35.92</td><td>20.13</td><td>26.36</td></tr><tr><td>SliME [90]</td><td>2.0M</td><td>CLIP-L14</td><td>Vicuna-1.5-7B</td><td>672×1,008</td><td>28.54</td><td>17.11</td><td>32.09</td><td>22.99</td><td>25.18</td></tr><tr><td>LLaVA-1.5 [41]</td><td>1.22M</td><td>CLIP-L14</td><td>Vicuna-1.5-7B</td><td>336×336</td><td>26.38</td><td>18.76</td><td>30.70</td><td>22.63</td><td>24.62</td></tr><tr><td>RSUniVLM [44]</td><td>1.2M</td><td>SigLIP</td><td>Qwen2-0.5B</td><td>336×336</td><td>25.39</td><td>21.02</td><td>32.61</td><td>24.72</td><td>25.93</td></tr><tr><td>Geochat [27]</td><td>1.53M</td><td>CLIP-L14</td><td>Vicuna-1.5-7B</td><td>504×504</td><td>28.62</td><td>20.18</td><td>24.54</td><td>13.75</td><td>21.77</td></tr><tr><td>GPT-4o [3]</td><td>-</td><td>-</td><td>-</td><td>-</td><td>28.92</td><td>22.15</td><td>31.84</td><td>27.40</td><td>27.58</td></tr><tr><td>GPT-4o-mini [3]</td><td>-</td><td>-</td><td>-</td><td>-</td><td>6.69</td><td>18.67</td><td>31.99</td><td>25.85</td><td>20.80</td></tr><tr><td>Claude-3.5-Sonnet [4]</td><td>-</td><td>-</td><td>-</td><td>-</td><td>25.74</td><td>12.95</td><td>26.69</td><td>13.29</td><td>19.67</td></tr></table>
|
| 224 |
+
|
| 225 |
+
Table 2. Leaderboard and performance comparison on LRS-VQA and MME-RealWorld-RS. “MME-RW-RS” indicates the MME-RealWorld-RS. “Data” refers to the total instruction data used during PT and SFT. $\ ' X '$ indicates the max number is $X$ for the pre-defined grids. “method*” indicates we reproduce the SFT stage of existing methods using the $4 8 4 \mathrm { k }$ instruction data.
|
| 226 |
+
|
| 227 |
+
<table><tr><td>Comparison</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr><tr><td>LLaVA-1.5*</td><td rowspan="6">1.04M</td><td>CLIP-L14</td><td rowspan="5">Vicuna-1.5-7B</td><td>336×336</td><td>34.40</td><td>18.24</td><td>32.28</td><td>24.17</td></tr><tr><td>LLaVA-1.5-p4*</td><td>CLIP-L14</td><td>672×672</td><td>38.20</td><td>19.18</td><td>35.43</td><td>26.50</td></tr><tr><td>Geochat*</td><td>CLIP-L14</td><td>504×504</td><td>33.68</td><td>21.51</td><td>35.97</td><td>25.86</td></tr><tr><td>SLiME*</td><td>CLIP-L14</td><td>672×1,008</td><td>34.56</td><td>21.98</td><td>33.20</td><td>25.10</td></tr><tr><td>LLaVA-UHD-v2*</td><td>CLIP-L14+JBU</td><td>672×1,008</td><td>38.55</td><td>20.77</td><td>36.57</td><td>25.79</td></tr><tr><td>Ours (LLaVA-1.5)</td><td>CLIP-L14</td><td>Dynamic</td><td>39.04</td><td>22.97</td><td>36.89</td><td>27.48</td><td>31.59</td></tr><tr><td>LLaVA-Next-p4*</td><td rowspan="3">1.04M</td><td rowspan="3">CLIP-L14</td><td rowspan="3">Qwen2-7B</td><td>672×672</td><td>39.12</td><td>21.06</td><td>36.27</td><td>25.80</td></tr><tr><td>LLaVA-Next-p9*</td><td>1,008×1,008</td><td>40.35</td><td>21.14</td><td>37.25</td><td>26.10</td></tr><tr><td>LLaVA-Next-p25*</td><td>1,680×1,680</td><td>39.65</td><td>20.99</td><td>36.38</td><td>26.18</td></tr><tr><td>Ours (LLaVA-Next)</td><td></td><td></td><td>Dynamic</td><td>41.89</td><td>21.85</td><td>38.24</td><td>26.67</td><td>32.16</td></tr></table>
|
| 228 |
+
|
| 229 |
+
<table><tr><td>Setting</td><td>Color</td><td>Count</td><td>Position</td><td>Acc</td><td>FPS</td></tr><tr><td>anyres-p25</td><td>41.56</td><td>31.05</td><td>46.14</td><td>39.65</td><td>0.188</td></tr><tr><td>w/ PruMerge++ [58]</td><td>43.27</td><td>28.38</td><td>32.78</td><td>34.86</td><td>0.152</td></tr><tr><td>w/ VisionZip [77]</td><td>42.71</td><td>24.55</td><td>34.55</td><td>33.98</td><td>0.183</td></tr><tr><td>w/ FastV [8]</td><td>39.52</td><td>30.10</td><td>43.99</td><td>37.93</td><td>0.192</td></tr><tr><td>w/ PDrop [72]</td><td>41.00</td><td>30.54</td><td>47.77</td><td>39.85</td><td>0.184</td></tr><tr><td>w/ prune (CLIP)</td><td>37.80</td><td>27.65</td><td>44.90</td><td>36.86</td><td>0.171</td></tr><tr><td>w/ prune (RemoteCLIP)</td><td>39.40</td><td>29.83</td><td>47.45</td><td>38.77</td><td>0.148</td></tr><tr><td>w/ prune (Ours)</td><td>43.98</td><td>30.42</td><td>49.16</td><td>41.28</td><td>0.165</td></tr><tr><td>DIP-3layer</td><td>44.08</td><td>30.94</td><td>49.26</td><td>41.31</td><td>0.267</td></tr><tr><td>w/ prune (Ours)</td><td></td><td></td><td></td><td></td><td></td></tr></table>
|
| 230 |
+
|
| 231 |
+
Table 3. Comparison with different token reduction methods based on LLaVA-Next-Qwen2. The “anyres- $\cdot { \mathsf { p } } 2 5 ^ { \mathsf { , , } }$ setting means the maximum number of pre-defined grids is 25 $1 6 8 0 \times 1 6 8 0$ pixels). FPS is computed based on the inference time for continuous 800 images from MME-Realworld-RS.
|
| 232 |
+
|
| 233 |
+
# 5.2. Leaderboard and Comparison
|
| 234 |
+
|
| 235 |
+
Leaderboard on LRS-VQA. We evaluate a total of 11 open-source LVLMs, including methods for high-resolution [31, 42, 84, 90], chain-of-thought reasoning [69], multiple visual encoders [34], and RS LVLMs [27, 44]. We also evaluate 3 closed-source MLLMs. Results in Tab. 2 indicate that LRS-VQA is more challenging than MME-RealWorld-
|
| 236 |
+
|
| 237 |
+
Table 4. Comparison of computational efficiency with different token reduction methods based on LLaVA-Next-Qwen2. We assume inferring a $4 0 0 0 { \times } 4 0 0 0$ pixel image (anyres-p144) and report the theoretical TFLOPs of vision tokens after the vision projector.
|
| 238 |
+
|
| 239 |
+
<table><tr><td>Setting</td><td>Vis. Tokens (Total)</td><td>Vis. Tokens (to LLM)</td><td>TFLOPs (B)</td></tr><tr><td>anyres-p144</td><td>83520</td><td>21312</td><td>243.37</td></tr><tr><td>w/ PruMerge++ [58]</td><td>83520</td><td>5328</td><td>43.75</td></tr><tr><td>w/ VisionZip [77]</td><td>83520</td><td>9280</td><td>83.56</td></tr><tr><td>w/ FastV [8]</td><td>83520</td><td>21312</td><td>109.21</td></tr><tr><td>w/ PDrop [72]</td><td>83520</td><td>21312</td><td>101.62</td></tr><tr><td>w/ prune (Ours)</td><td>83520</td><td>5760</td><td>82.56</td></tr><tr><td>DIP-4layer</td><td>55296</td><td>2376</td><td>36.61</td></tr><tr><td>w/ prune (Ours)</td><td></td><td></td><td></td></tr></table>
|
| 240 |
+
|
| 241 |
+
RS on average, reflecting the complexities of large RSIs.
|
| 242 |
+
|
| 243 |
+
Comparison with high-resolution methods. As shown in Tab. 2, we select 5 different high resolution strategies, performing SFT on the same dataset for comparison. Our method performs better across all 4 datasets.
|
| 244 |
+
|
| 245 |
+
Comparison with token reduction methods. We reproduce 4 plug-and-play methods and establish 2 key baselines for comparison on the MME-RealWorld-RS. These baselines utilize sliding-window similarity maps generated
|
| 246 |
+
|
| 247 |
+
Table 5. Ablation study on different prune ratios with LLaVA-Next-Qwen2, when pruning vision tokens based on RFM results without DIP. This table demonstrates that pruning irrelevant tokens in high-resolution RSIs can improve performance.
|
| 248 |
+
|
| 249 |
+
<table><tr><td>Method</td><td>Drop Ratio</td><td>Color</td><td>Count</td><td>Pos</td><td>Acc</td></tr><tr><td rowspan="2">anyres-p25</td><td>0%</td><td>41.56</td><td>31.05</td><td>46.14</td><td>39.65</td></tr><tr><td>25%</td><td>42.47</td><td>31.08</td><td>47.41</td><td>40.40</td></tr><tr><td rowspan="3">w/prune (Ours)</td><td>50%</td><td>42.39</td><td>31.24</td><td>48.45</td><td>40.77</td></tr><tr><td>75%</td><td>43.98</td><td>30.42</td><td>49.16</td><td>41.28</td></tr><tr><td>90%</td><td>41.51</td><td>29.77</td><td>46.70</td><td>39.41</td></tr></table>
|
| 250 |
+
|
| 251 |
+
Table 6. Ablation study on fixing the number of DIP layers reached in inference with LLaVA-Next-Qwen2. Rows 1-4 correspond to fixing the number of DIP layers being 2-5, respectively.
|
| 252 |
+
|
| 253 |
+
<table><tr><td>Max Size</td><td>Color</td><td>Count</td><td>Pos</td><td>Acc</td><td>FPS</td></tr><tr><td>1,008×1,008</td><td>42.87</td><td>29.85</td><td>47.89</td><td>40.29</td><td>0.271</td></tr><tr><td>2,016×2,016</td><td>44.08</td><td>30.94</td><td>49.26</td><td>41.31</td><td>0.267</td></tr><tr><td>4,032×4,032</td><td>44.86</td><td>29.85</td><td>47.18</td><td>40.72</td><td>0.221</td></tr><tr><td>8,064×8,064</td><td>43.98</td><td>30.42</td><td>45.11</td><td>39.91</td><td>0.204</td></tr><tr><td>Dynamic</td><td>44.70</td><td>31.00</td><td>49.72</td><td>41.89</td><td>0.238</td></tr></table>
|
| 254 |
+
|
| 255 |
+
by CLIP-L14 [55] and RemoteCLIP-L14 [40], respectively. More details are in the Appendix B.2. As shown in Tab. 3, our method achieves the best performance under the fixed anyres-p25 resolution. It also secures the highest accuracy and FPS in the 3-layer DIP setting (up to $2 , 0 1 6 { \times } 2 , 0 1 6$ pixels). For Tab. 4, we report the average number of tiles selected by our dynamic method for images of similar sizes. These results suggest that existing methods often incur high computational costs when processing numerous textirrelevant image tiles in large images.
|
| 256 |
+
|
| 257 |
+
# 5.3. Ablation Results
|
| 258 |
+
|
| 259 |
+
Different ratios for RFM-based pruning. As shown in Tab. 5, a key finding is that in large RSIs, the complex background and the small foreground regions enable high pruning rates to deliver performance benefits.
|
| 260 |
+
|
| 261 |
+
Fixed DIP layers for inference. As shown in Tab. 6, we fix the number of DIP layers reached during inference. If an image’s DIP is shallower than the specified number, the last layer is used. Results show that forcing traversal to higher resolutions can degrade performance since not all questions require image details. Therefore, our strategy dynamically selects the termination DIP layer based on the input text, balancing accuracy and efficiency.
|
| 262 |
+
|
| 263 |
+
Attention Localization validation. We select LRS-VQA (using boxes of cropped regions) and two referringbased datasets, DIOR-RSVG [83] and RRSIS-D [43] for localization accuracy evaluation, using a recall metric: a prediction is considered successful if the vision tokens retained
|
| 264 |
+
|
| 265 |
+
Table 7. Localization recall $( \% )$ of different pruning guidance.
|
| 266 |
+
|
| 267 |
+
<table><tr><td>Pruning Guidance</td><td>LRS-VQA</td><td>DIOR-RSVG</td><td>RRSIS-D</td></tr><tr><td>Teacher LLM Attn.</td><td>56.14</td><td>74.81</td><td>73.88</td></tr><tr><td>CLIP Sim.</td><td>20.14</td><td>29.10</td><td>27.53</td></tr><tr><td>RemoteCLIP Sim.</td><td>30.41</td><td>43.12</td><td>41.81</td></tr><tr><td>RFM Attn. (Ours)</td><td>47.99</td><td>64.76</td><td>61.17</td></tr></table>
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Large-Size RSI 4005×2919 pixels
|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
Question:What is the color of the largestrunway in the image? Answer: Grey.
|
| 274 |
+
|
| 275 |
+

|
| 276 |
+
Question:Where is the largest parking lot in the image? Answer: Bottom-left.
|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Large-Size RSI 5448×4076 pixels
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
Question:What is the shape of theparking lotin the image? Answer:Oval.
|
| 283 |
+
|
| 284 |
+

|
| 285 |
+
Question: How many branches doestheroundabout have? Answer:5.
|
| 286 |
+
Figure 6. Text-related visual attention localization in the last layer if trained RFM under LLaVA-Next-Qwen2.
|
| 287 |
+
|
| 288 |
+
after pruning cover more than $50 \%$ of the ground-truth region. The results in Tab. 7 demonstrate that at a $2 5 \%$ token retention ratio, both the teacher LLM’s attention and our student RFM achieve higher localization accuracy than the CLIP-L14 and RemoteCLIP-L14 baselines (also based on sliding-window similarity maps). This confirms that LLM attention provides a reliable localization signal and our distillation is effective.
|
| 289 |
+
|
| 290 |
+
Visualization results. In Fig. 6, we visualize the attention maps generated by the trained RFM for vision tokens from initial input image tiles. The results demonstrate that text references to targets effectively guide the RFM’s attention output, supporting our coarse-to-fine inference.
|
| 291 |
+
|
| 292 |
+
# 6. Conclusion
|
| 293 |
+
|
| 294 |
+
This paper presents a text-guided token pruning method tailored for efficiently processing large remote sensing images (RSIs). To address the limitations of existing high-resolution approaches when handling large RSIs, our method integrates the Region Focus Module (RFM) and Dynamic Image Pyramid (DIP) to focus on text-relevant key vision tokens while reducing computational overhead. Furthermore, we introduce a new benchmark, LRS-VQA, with 7,333 QA pairs covering 8 question types, and features larger image sizes and a diverse range of question types.
|
| 295 |
+
|
| 296 |
+
Future work. Vision-language understanding of large RSIs remains a challenging task. Investigating approaches such as long-context transfer from LLMs to LVLMs, or chain-of-thought reasoning, is also meaningful.
|
| 297 |
+
|
| 298 |
+
# Acknowledgment
|
| 299 |
+
|
| 300 |
+
The authors would like to thank the anonymous reviewers for their valuable comments. This work was supported by the National Natural Science Foundation of China under Grants 42371321, 424B2006, and the Natural Science Foundation of Shanghai under Grant No. 25ZR1402268.
|
| 301 |
+
|
| 302 |
+
# References
|
| 303 |
+
|
| 304 |
+
[1] Marius Aasan, Odd Kolbjørnsen, Anne Schistad Solberg, and Ad´ın Ramirez Rivera. A spitting image: Modular superpixel tokenization in vision transformers. In European Conference on Computer Vision, pages 124–142. Springer, 2024. 2
|
| 305 |
+
[2] Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023. 1
|
| 306 |
+
[3] Open AI. Hello gpt-4o. 2024. 7
|
| 307 |
+
[4] AI Anthropic. Claude 3.5 sonnet model card addendum. page 3, 2024. 7
|
| 308 |
+
[5] Kazi Hasan Ibn Arif, JinYi Yoon, Dimitrios S. Nikolopoulos, Hans Vandierendonck, Deepu John, and Bo Ji. Hired: Attention-guided token dropping for efficient inference of high-resolution vision-language models, 2024. 2
|
| 309 |
+
[6] Jinze Bai, Shuai Bai, Shusheng Yang, Shijie Wang, Sinan Tan, Peng Wang, Junyang Lin, Chang Zhou, and Jingren Zhou. Qwen-vl: A frontier large vision-language model with versatile abilities. arXiv preprint arXiv:2308.12966, 2023. 2
|
| 310 |
+
[7] Delong Chen, Samuel Cahyawijaya, Jianfeng Liu, Baoyuan Wang, and Pascale Fung. Subobject-level image tokenization. CoRR, abs/2402.14327, 2024. 2
|
| 311 |
+
[8] Liang Chen, Haozhe Zhao, Tianyu Liu, Shuai Bai, Junyang Lin, Chang Zhou, and Baobao Chang. An image is worth 1/2 tokens after layer 2: Plug-and-play inference acceleration for large vision-language models. In European Conference on Computer Vision, pages 19–35. Springer, 2024. 2, 7
|
| 312 |
+
[9] Zhe Chen, Weiyun Wang, Yue Cao, Yangzhou Liu, Zhangwei Gao, Erfei Cui, Jinguo Zhu, Shenglong Ye, Hao Tian, Zhaoyang Liu, et al. Expanding performance boundaries of open-source multimodal models with model, data, and testtime scaling. arXiv preprint arXiv:2412.05271, 2024. 1
|
| 313 |
+
[10] Zhe Chen, Weiyun Wang, Hao Tian, Shenglong Ye, Zhangwei Gao, Erfei Cui, Wenwen Tong, Kongzhi Hu, Jiapeng Luo, Zheng Ma, et al. How far are we to gpt-4v? closing the gap to commercial multimodal models with open-source suites. Science China Information Sciences, 67(12):220101, 2024. 1, 2, 3
|
| 314 |
+
[11] Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An open-source chatbot impressing gpt-4 with $9 0 \% *$ chatgpt quality, 2023. 1
|
| 315 |
+
[12] Muhammad Sohail Danish, Muhammad Akhtar Munir, Syed Roshaan Ali Shah, Kartik Kuckreja, Fahad Shahbaz Khan,
|
| 316 |
+
|
| 317 |
+
Paolo Fraccaro, Alexandre Lacoste, and Salman Khan. Geobench-vlm: Benchmarking vision-language models for geospatial tasks. arXiv preprint arXiv:2411.19325, 2024. 1
|
| 318 |
+
[13] Tri Dao, Dan Fu, Stefano Ermon, Atri Rudra, and Christopher Re. Flashattention: Fast and memory-efficient exact ´ attention with io-awareness. Advances in neural information processing systems, 35:16344–16359, 2022. 5
|
| 319 |
+
[14] DeepSeek-AI, Daya Guo, Dejian Yang, Haowei Zhang, Junxiao Song, Ruoyu Zhang, Runxin Xu, Qihao Zhu, et al. Deepseek-r1: Incentivizing reasoning capability in llms via reinforcement learning, 2025. 1
|
| 320 |
+
[15] Jian Ding, Nan Xue, Gui-Song Xia, Xiang Bai, Wen Yang, Michael Ying Yang, Serge Belongie, Jiebo Luo, Mihai Datcu, Marcello Pelillo, et al. Object detection in aerial images: A large-scale benchmark and challenges. IEEE transactions on pattern analysis and machine intelligence, 44(11): 7778–7796, 2021. 6
|
| 321 |
+
[16] Peiyan Dong, Mengshu Sun, Alec Lu, Yanyue Xie, Kenneth Liu, Zhenglun Kong, Xin Meng, Zhengang Li, Xue Lin, Zhenman Fang, et al. Heatvit: Hardware-efficient adaptive token pruning for vision transformers. In 2023 IEEE International Symposium on High-Performance Computer Architecture (HPCA), pages 442–455. IEEE, 2023. 2
|
| 322 |
+
[17] Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024. 1
|
| 323 |
+
[18] Xin Guo, Jiangwei Lao, Bo Dang, Yingying Zhang, Lei Yu, Lixiang Ru, Liheng Zhong, Ziyuan Huang, Kang Wu, Dingxiang Hu, et al. Skysense: A multi-modal remote sensing foundation model towards universal interpretation for earth observation imagery. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 27672–27683, 2024. 1
|
| 324 |
+
[19] Zonghao Guo, Ruyi Xu, Yuan Yao, Junbo Cui, Zanlin Ni, Chunjiang Ge, Tat-Seng Chua, Zhiyuan Liu, and Gao Huang. Llava-uhd: an lmm perceiving any aspect ratio and highresolution images. In European Conference on Computer Vision, pages 390–406. Springer, 2025. 2, 3
|
| 325 |
+
[20] Yuhang Han, Xuyang Liu, Pengxiang Ding, Donglin Wang, Honggang Chen, Qingsen Yan, and Siteng Huang. Rethinking token reduction in mllms: Towards a unified paradigm for training-free acceleration. arXiv preprint arXiv:2411.17686, 2024. 2
|
| 326 |
+
[21] Runhui Huang, Xinpeng Ding, Chunwei Wang, Jianhua Han, Yulong Liu, Hengshuang Zhao, Hang Xu, Lu Hou, Wei Zhang, and Xiaodan Liang. Hires-llava: Restoring fragmentation input in high-resolution large vision-language models. arXiv preprint arXiv:2407.08706, 2024. 2
|
| 327 |
+
[22] Drew A Hudson and Christopher D Manning. Gqa: A new dataset for real-world visual reasoning and compositional question answering. In Proceedings of the IEEE/CVF conference on Computer Vision and Pattern Recognition, pages 6700–6709, 2019. 6
|
| 328 |
+
[23] Omri Kaduri, Shai Bagon, and Tali Dekel. What’s in the image? a deep-dive into the vision of vision language models. arXiv preprint arXiv:2411.17491, 2024. 3, 4
|
| 329 |
+
|
| 330 |
+
[24] Sehoon Kim, Sheng Shen, David Thorsley, Amir Gholami, Woosuk Kwon, Joseph Hassoun, and Kurt Keutzer. Learned token pruning for transformers. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pages 784–794, 2022. 2
|
| 331 |
+
[25] Alexander Kirillov, Eric Mintun, Nikhila Ravi, Hanzi Mao, Chloe Rolland, Laura Gustafson, Tete Xiao, Spencer Whitehead, Alexander C Berg, Wan-Yen Lo, et al. Segment anything. In Proceedings of the IEEE/CVF international conference on computer vision, pages 4015–4026, 2023. 2
|
| 332 |
+
[26] Zhenglun Kong, Peiyan Dong, Xiaolong Ma, Xin Meng, Wei Niu, Mengshu Sun, Xuan Shen, Geng Yuan, Bin Ren, Hao Tang, et al. Spvit: Enabling faster vision transformers via latency-aware soft token pruning. In European conference on computer vision, pages 620–640. Springer, 2022. 2
|
| 333 |
+
[27] Kartik Kuckreja, Muhammad Sohail Danish, Muzammal Naseer, Abhijit Das, Salman Khan, and Fahad Shahbaz Khan. Geochat: Grounded large vision-language model for remote sensing. Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, 2024. 1, 7
|
| 334 |
+
[28] Jaihyun Lew, Soohyuk Jang, Jaehoon Lee, Seungryong Yoo, Eunji Kim, Saehyung Lee, Jisoo Mok, Siwon Kim, and Sungroh Yoon. Superpixel tokenization for vision transformers: Preserving semantic integrity in visual tokens. arXiv preprint arXiv:2412.04680, 2024. 2
|
| 335 |
+
[29] Bo Li, Yuanhan Zhang, Dong Guo, Renrui Zhang, Feng Li, Hao Zhang, Kaichen Zhang, Peiyuan Zhang, Yanwei Li, Ziwei Liu, et al. Llava-onevision: Easy visual task transfer. arXiv preprint arXiv:2408.03326, 2024. 1, 2, 7
|
| 336 |
+
[30] Junnan Li, Dongxu Li, Silvio Savarese, and Steven Hoi. Blip-2: Bootstrapping language-image pre-training with frozen image encoders and large language models. In International conference on machine learning, pages 19730– 19742. PMLR, 2023. 2
|
| 337 |
+
[31] Junyan Li, Delin Chen, Tianle Cai, Peihao Chen, Yining Hong, Zhenfang Chen, Yikang Shen, and Chuang Gan. Flexattention for efficient high-resolution vision-language models. In European Conference on Computer Vision, pages 286–302. Springer, 2024. 2, 7
|
| 338 |
+
[32] Qingyun Li, Yushi Chen, Xinya Shu, Dong Chen, Xin He, Yu Yi, and Xue Yang. A simple aerial detection baseline of multimodal language models. arXiv preprint arXiv:2501.09720, 2025. 1
|
| 339 |
+
[33] Wentong Li, Yuqian Yuan, Jian Liu, Dongqi Tang, Song Wang, Jie Qin, Jianke Zhu, and Lei Zhang. Tokenpacker: Efficient visual projector for multimodal llm. arXiv preprint arXiv:2407.02392, 2024. 1, 2
|
| 340 |
+
[34] Yanwei Li, Yuechen Zhang, Chengyao Wang, Zhisheng Zhong, Yixin Chen, Ruihang Chu, Shaoteng Liu, and Jiaya Jia. Mini-gemini: Mining the potential of multi-modality vision language models. arXiv:2403.18814, 2023. 2, 7
|
| 341 |
+
[35] Yansheng Li, Junwei Luo, Yongjun Zhang, Yihua Tan, Jin-Gang Yu, and Song Bai. Learning to holistically detect bridges from large-size vhr remote sensing imagery. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024. 1, 5, 6
|
| 342 |
+
[36] Yanwei Li, Chengyao Wang, and Jiaya Jia. Llama-vid: An image is worth 2 tokens in large language models. 2024. 2
|
| 343 |
+
|
| 344 |
+
[37] Yansheng Li, Linlin Wang, Tingzhu Wang, Xue Yang, Junwei Luo, Qi Wang, Youming Deng, Wenbin Wang, Xian Sun, Haifeng Li, Bo Dang, Yongjun Zhang, Yi Yu, and Yan Junchi. Star: A first-ever dataset and a large-scale benchmark for scene graph generation in large-size satellite imagery. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2024. 1, 5, 6
|
| 345 |
+
[38] Yansheng Li, Yuning Wu, Gong Cheng, Chao Tao, Bo Dang, Yu Wang, Jiahao Zhang, Chuge Zhang, Yiting Liu, Xu Tang, et al. Meet: A million-scale dataset for fine-grained geospatial scene classification with zoom-free remote sensing imagery. IEEE/CAA Journal of Automatica Sinica, 12(5):1004– 1023, 2025. 1
|
| 346 |
+
[39] Zhang Li, Biao Yang, Qiang Liu, Zhiyin Ma, Shuo Zhang, Jingxu Yang, Yabo Sun, Yuliang Liu, and Xiang Bai. Monkey: Image resolution and text label are important things for large multi-modal models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 26763–26773, 2024. 2
|
| 347 |
+
[40] Fan Liu, Delong Chen, Zhangqingyun Guan, Xiaocong Zhou, Jiale Zhu, Qiaolin Ye, Liyong Fu, and Jun Zhou. Remoteclip: A vision language foundation model for remote sensing. IEEE Transactions on Geoscience and Remote Sensing, 2024. 8
|
| 348 |
+
[41] Haotian Liu, Chunyuan Li, Yuheng Li, and Yong Jae Lee. Improved baselines with visual instruction tuning. arXiv preprint arXiv:2310.03744, 2023. 1, 2, 7
|
| 349 |
+
[42] Haotian Liu, Chunyuan Li, Qingyang Wu, and Yong Jae Lee. Visual instruction tuning. Advances in Neural Information Processing Systems, 36, 2024. 6, 7
|
| 350 |
+
[43] Sihan Liu, Yiwei Ma, Xiaoqing Zhang, Haowei Wang, Jiayi Ji, Xiaoshuai Sun, and Rongrong Ji. Rotated multi-scale interaction network for referring remote sensing image segmentation. In CVPR, 2024. 8
|
| 351 |
+
[44] Xu Liu and Zhouhui Lian. Rsunivlm: A unified vision language model for remote sensing via granularity-oriented mixture of experts. arXiv preprint arXiv:2412.05679, 2024. 7
|
| 352 |
+
[45] Yuliang Liu, Biao Yang, Qiang Liu, Zhang Li, Zhiyin Ma, Shuo Zhang, and Xiang Bai. Textmonkey: An ocr-free large multimodal model for understanding document. arXiv preprint arXiv:2403.04473, 2024. 2
|
| 353 |
+
[46] Zhuang Liu, Hanzi Mao, Chao-Yuan Wu, Christoph Feichtenhofer, Trevor Darrell, and Saining Xie. A convnet for the 2020s. Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022. 2
|
| 354 |
+
[47] Sylvain Lobry, Diego Marcos, Jesse Murray, and Devis Tuia. Rsvqa: Visual question answering for remote sensing data. IEEE Transactions on Geoscience and Remote Sensing, 58 (12):8555–8566, 2020. 6
|
| 355 |
+
[48] Gen Luo, Xue Yang, Wenhan Dou, Zhaokai Wang, Jiawen Liu, Jifeng Dai, Yu Qiao, and Xizhou Zhu. Mono-internvl: Pushing the boundaries of monolithic multimodal large language models with endogenous visual pre-training. arXiv preprint arXiv:2410.08202, 2024. 3
|
| 356 |
+
[49] Gen Luo, Yiyi Zhou, Yuxin Zhang, Xiawu Zheng, Xiaoshuai Sun, and Rongrong Ji. Feast your eyes: Mixture-of-
|
| 357 |
+
|
| 358 |
+
resolution adaptation for multimodal large language models. arXiv preprint arXiv:2403.03003, 2024. 2
|
| 359 |
+
[50] Junwei Luo, Zhen Pang, Yongjun Zhang, Tingzhu Wang, Linlin Wang, Bo Dang, Jiangwei Lao, Jian Wang, Jingdong Chen, Yihua Tan, et al. Skysensegpt: A fine-grained instruction tuning dataset and model for remote sensing visionlanguage understanding. arXiv preprint arXiv:2406.10100, 2024. 1
|
| 360 |
+
[51] Lingchen Meng, Hengduo Li, Bor-Chun Chen, Shiyi Lan, Zuxuan Wu, Yu-Gang Jiang, and Ser-Nam Lim. Adavit: Adaptive vision transformers for efficient image recognition. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 12309–12318, 2022. 2
|
| 361 |
+
[52] George A Miller. Wordnet: a lexical database for english. Communications of the ACM, 38(11):39–41, 1995. 6
|
| 362 |
+
[53] Dilxat Muhtar, Zhenshi Li, Feng Gu, Xueliang Zhang, and Pengfeng Xiao. Lhrs-bot: Empowering remote sensing with vgi-enhanced large multimodal language model. In European Conference on Computer Vision, pages 440–457. Springer, 2024. 1
|
| 363 |
+
[54] OpenAI. Gpt-4v(ision) system card. 2023. 5
|
| 364 |
+
[55] Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning, pages 8748–8763. PMLR, 2021. 8
|
| 365 |
+
[56] Yongming Rao, Wenliang Zhao, Benlin Liu, Jiwen Lu, Jie Zhou, and Cho-Jui Hsieh. Dynamicvit: Efficient vision transformers with dynamic token sparsification. Advances in neural information processing systems, 34:13937–13949, 2021. 2
|
| 366 |
+
[57] Akashah Shabbir, Mohammed Zumri, Mohammed Bennamoun, Fahad S Khan, and Salman Khan. Geopixel: Pixel grounding large multimodal model in remote sensing. arXiv preprint arXiv:2501.13925, 2025. 2
|
| 367 |
+
[58] Yuzhang Shang, Mu Cai, Bingxin Xu, Yong Jae Lee, and Yan Yan. Llava-prumerge: Adaptive token reduction for efficient large multimodal models. arXiv preprint arXiv:2403.15388, 2024. 2, 7
|
| 368 |
+
[59] Hao Shao, Shengju Qian, Han Xiao, Guanglu Song, Zhuofan Zong, Letian Wang, Yu Liu, and Hongsheng Li. Visual cot: Advancing multi-modal language models with a comprehensive dataset and benchmark for chain-of-thought reasoning. Advances in Neural Information Processing Systems, 37:8612–8642, 2025. 2
|
| 369 |
+
[60] Haozhan Shen, Kangjia Zhao, Tiancheng Zhao, Ruochen Xu, Zilun Zhang, Mingwei Zhu, and Jianwei Yin. Zoomeye: Enhancing multimodal llms with human-like zooming capabilities through tree-based image exploration. arXiv preprint arXiv:2411.16044, 2024. 2
|
| 370 |
+
[61] Sagar Soni, Akshay Dudhane, Hiyam Debary, Mustansar Fiaz, Muhammad Akhtar Munir, Muhammad Sohail Danish, Paolo Fraccaro, Campbell D Watson, Levente J Klein, Fahad Shahbaz Khan, et al. Earthdial: Turning multi-sensory earth observations to interactive dialogues. arXiv preprint arXiv:2412.15190, 2024. 1
|
| 371 |
+
|
| 372 |
+
[62] Xian Sun, Peijin Wang, Zhiyuan Yan, Feng Xu, Ruiping Wang, Wenhui Diao, Jin Chen, Jihao Li, Yingchao Feng, Tao Xu, et al. Fair1m: A benchmark dataset for finegrained object recognition in high-resolution remote sensing imagery. ISPRS Journal of Photogrammetry and Remote Sensing, 184:116–130, 2022. 5, 1
|
| 373 |
+
[63] Peter Tong, Ellis Brown, Penghao Wu, Sanghyun Woo, Adithya Jairam Vedagiri IYER, Sai Charitha Akula, Shusheng Yang, Jihan Yang, Manoj Middepogu, Ziteng Wang, et al. Cambrian-1: A fully open, vision-centric exploration of multimodal llms. Advances in Neural Information Processing Systems, 37:87310–87356, 2025. 2
|
| 374 |
+
[64] Junjue Wang, Zhuo Zheng, Zihang Chen, Ailong Ma, and Yanfei Zhong. Earthvqa: Towards queryable earth via relational reasoning-based remote sensing visual question answering. In Proceedings of the AAAI Conference on Artificial Intelligence, pages 5481–5489, 2024. 1
|
| 375 |
+
[65] Peng Wang, Shuai Bai, Sinan Tan, Shijie Wang, Zhihao Fan, Jinze Bai, Keqin Chen, Xuejing Liu, Jialin Wang, Wenbin Ge, et al. Qwen2-vl: Enhancing vision-language model’s perception of the world at any resolution. arXiv preprint arXiv:2409.12191, 2024. 1, 5, 7
|
| 376 |
+
[66] Wenbin Wang, Liang Ding, Minyan Zeng, Xiabin Zhou, Li Shen, Yong Luo, and Dacheng Tao. Divide, conquer and combine: A training-free framework for high-resolution image perception in multimodal large language models. arXiv preprint, 2024. 2
|
| 377 |
+
[67] Xidong Wang, Dingjie Song, Shunian Chen, Chen Zhang, and Benyou Wang. Longllava: Scaling multi-modal llms to 1000 images efficiently via a hybrid architecture. arXiv preprint arXiv:2409.02889, 2024. 2
|
| 378 |
+
[68] Siyuan Wei, Tianzhu Ye, Shen Zhang, Yao Tang, and Jiajun Liang. Joint token pruning and squeezing towards more aggressive compression of vision transformers. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 2092–2101, 2023. 2
|
| 379 |
+
[69] Penghao Wu and Saining Xie. V*: Guided visual search as a core mechanism in multimodal llms. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 13084–13094, 2024. 2, 7
|
| 380 |
+
[70] Aoran Xiao, Weihao Xuan, Junjue Wang, Jiaxing Huang, Dacheng Tao, Shijian Lu, and Naoto Yokoya. Foundation models for remote sensing and earth observation: A survey. arXiv preprint arXiv:2410.16602, 2024. 1
|
| 381 |
+
[71] Junbin Xiao, Xindi Shang, Angela Yao, and Tat-Seng Chua. Next-qa: Next phase of question-answering to explaining temporal actions. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 9777–9786, 2021. 6
|
| 382 |
+
[72] Long Xing, Qidong Huang, Xiaoyi Dong, Jiajie Lu, Pan Zhang, Yuhang Zang, Yuhang Cao, Conghui He, Jiaqi Wang, Feng Wu, et al. Pyramiddrop: Accelerating your large vision-language models via pyramid visual redundancy reduction. arXiv preprint arXiv:2410.17247, 2024. 2, 4, 7
|
| 383 |
+
[73] Xizhe Xue, Guoting Wei, Hao Chen, Haokui Zhang, Feng Lin, Chunhua Shen, and Xiao Xiang Zhu. Reo-vlm: Transforming vlm to meet regression challenges in earth observation. arXiv preprint arXiv:2412.16583, 2024. 1
|
| 384 |
+
|
| 385 |
+
[74] Dawei Yan, Pengcheng Li, Yang Li, Hao Chen, Qingguo Chen, Weihua Luo, Wei Dong, Qingsen Yan, Haokui Zhang, and Chunhua Shen. Tg-llava: Text guided llava via learnable latent embeddings. arXiv preprint arXiv:2409.09564, 2024. 2
|
| 386 |
+
[75] An Yang, Baosong Yang, Beichen Zhang, Binyuan Hui, Bo Zheng, Bowen Yu, Chengyuan Li, Dayiheng Liu, Fei Huang, Haoran Wei, Huan Lin, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Yang, Jiaxi Yang, Jingren Zhou, Junyang Lin, Kai Dang, Keming Lu, Keqin Bao, Kexin Yang, Le Yu, Mei Li, Mingfeng Xue, Pei Zhang, Qin Zhu, Rui Men, Runji Lin, Tianhao Li, Tingyu Xia, Xingzhang Ren, Xuancheng Ren, Yang Fan, Yang Su, Yichang Zhang, Yu Wan, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, and Zihan Qiu. Qwen2.5 technical report. arXiv preprint arXiv:2412.15115, 2024. 1
|
| 387 |
+
[76] Jianwei Yang, Hao Zhang, Feng Li, Xueyan Zou, Chunyuan Li, and Jianfeng Gao. Set-of-mark prompting unleashes extraordinary visual grounding in gpt-4v, 2023. 6
|
| 388 |
+
[77] Senqiao Yang, Yukang Chen, Zhuotao Tian, Chengyao Wang, Jingyao Li, Bei Yu, and Jiaya Jia. Visionzip: Longer is better but not necessary in vision language models. arXiv preprint arXiv:2412.04467, 2024. 2, 7
|
| 389 |
+
[78] Linli Yao, Lei Li, Shuhuai Ren, Lean Wang, Yuanxin Liu, Xu Sun, and Lu Hou. Deco: Decoupling token compression from semantic abstraction in multimodal large language models. arXiv preprint arXiv:2405.20985, 2024. 2
|
| 390 |
+
[79] Deming Ye, Yankai Lin, Yufei Huang, and Maosong Sun. Tr-bert: Dynamic token reduction for accelerating bert inference. arXiv preprint arXiv:2105.11618, 2021. 2
|
| 391 |
+
[80] Jiabo Ye, Anwen Hu, Haiyang Xu, Qinghao Ye, Ming Yan, Guohai Xu, Chenliang Li, Junfeng Tian, Qi Qian, Ji Zhang, et al. Ureader: Universal ocr-free visually-situated language understanding with multimodal large language model. In The 2023 Conference on Empirical Methods in Natural Language Processing, 2023. 1, 2
|
| 392 |
+
[81] Weihao Ye, Qiong Wu, Wenhao Lin, and Yiyi Zhou. Fit and prune: Fast and training-free visual token pruning for multi-modal large language models. arXiv preprint arXiv:2409.10197, 2024. 2, 3, 4
|
| 393 |
+
[82] Xubing Ye, Yukang Gan, Xiaoke Huang, Yixiao Ge, Ying Shan, and Yansong Tang. Voco-llama: Towards vision compression with large language models. arXiv preprint arXiv:2406.12275, 2024. 2
|
| 394 |
+
[83] Yang Zhan, Zhitong Xiong, and Yuan Yuan. Rsvg: Exploring data and models for visual grounding on remote sensing data. IEEE TGRS, 2023. 8
|
| 395 |
+
[84] Pan Zhang, Xiaoyi Dong, Yuhang Zang, Yuhang Cao, Rui Qian, Lin Chen, Qipeng Guo, Haodong Duan, Bin Wang, Linke Ouyang, Songyang Zhang, Wenwei Zhang, Yining Li, Yang Gao, Peng Sun, Xinyue Zhang, Wei Li, Jingwen Li, Wenhai Wang, Hang Yan, Conghui He, Xingcheng Zhang, Kai Chen, Jifeng Dai, Yu Qiao, Dahua Lin, and Jiaqi Wang. Internlm-xcomposer-2.5: A versatile large vision language model supporting long-contextual input and output. arXiv preprint arXiv:2407.03320, 2024. 2, 7
|
| 396 |
+
[85] Shaolei Zhang, Qingkai Fang, Zhe Yang, and Yang Feng. Llava-mini: Efficient image and video large mul-
|
| 397 |
+
|
| 398 |
+
timodal models with one vision token. arXiv preprint arXiv:2501.03895, 2025. 2
|
| 399 |
+
[86] Wei Zhang, Miaoxin Cai, Tong Zhang, Yin Zhuang, Jun Li, and Xuerui Mao. Earthmarker: A visual prompting multimodal large language model for remote sensing. IEEE Transactions on Geoscience and Remote Sensing, 2024. 1
|
| 400 |
+
[87] Wei Zhang, Miaoxin Cai, Tong Zhang, Yin Zhuang, and Xuerui Mao. Earthgpt: A universal multi-modal large language model for multi-sensor image comprehension in remote sensing domain. arXiv preprint arXiv:2401.16822, 2024. 1
|
| 401 |
+
[88] Yuan Zhang, Chun-Kai Fan, Junpeng Ma, Wenzhao Zheng, Tao Huang, Kuan Cheng, Denis Gudovskiy, Tomoyuki Okuno, Yohei Nakata, Kurt Keutzer, et al. Sparsevlm: Visual token sparsification for efficient vision-language model inference. arXiv preprint arXiv:2410.04417, 2024. 2, 5
|
| 402 |
+
[89] Yipeng Zhang, Yifan Liu, Zonghao Guo, Yidan Zhang, Xuesong Yang, Chi Chen, Jun Song, Bo Zheng, Yuan Yao, Zhiyuan Liu, et al. Llava-uhd v2: an mllm integrating highresolution feature pyramid via hierarchical window transformer. arXiv preprint arXiv:2412.13871, 2024. 7
|
| 403 |
+
[90] Yi-Fan Zhang, Qingsong Wen, Chaoyou Fu, Xue Wang, Zhang Zhang, Liang Wang, and Rong Jin. Beyond llava-hd: Diving into high-resolution large multimodal models. arXiv preprint arXiv:2406.08487, 2024. 2, 7
|
| 404 |
+
[91] Yi-Fan Zhang, Huanyu Zhang, Haochen Tian, Chaoyou Fu, Shuangqing Zhang, Junfei Wu, Feng Li, Kun Wang, Qingsong Wen, Zhang Zhang, et al. Mme-realworld: Could your multimodal llm challenge high-resolution real-world scenarios that are difficult for humans? arXiv preprint arXiv:2408.13257, 2024. 2, 6
|
| 405 |
+
[92] Zilun Zhang, Haozhan Shen, Tiancheng Zhao, Yuhao Wang, Bin Chen, Yuxiang Cai, Yongheng Shang, and Jianwei Yin. Enhancing ultra high resolution remote sensing imagery analysis with imagerag. arXiv preprint arXiv:2411.07688, 2024. 2
|
| 406 |
+
[93] Yue Zhou, Litong Feng, Yiping Ke, Xue Jiang, Junchi Yan, Xue Yang, and Wayne Zhang. Towards visionlanguage geo-foundation models: A survey. arXiv preprint arXiv:2406.09385, 2024. 1
|
| 407 |
+
[94] Qi Zhu, Jiangwei Lao, Deyi Ji, Junwei Luo, Kang Wu, Yingying Zhang, Lixiang Ru, Jian Wang, Jingdong Chen, Ming Yang, et al. Skysense-o: Towards open-world remote sensing interpretation with vision-centric visual-language modeling. In Proceedings of the Computer Vision and Pattern Recognition Conference, pages 14733–14744, 2025. 1
|
| 408 |
+
|
| 409 |
+
# When Large Vision-Language Model Meets Large Remote Sensing Imagery: Coarse-to-Fine Text-Guided Token Pruning
|
| 410 |
+
|
| 411 |
+
Supplementary Material
|
| 412 |
+
|
| 413 |
+
# A. Detailed Construction Process of LRS-VQA
|
| 414 |
+
|
| 415 |
+
In this section, we describe the construction process of LRS-VQA in detail, including data collection and filtering, label creation, and quality assurance.
|
| 416 |
+
|
| 417 |
+
# A.1. Unique Object Extraction
|
| 418 |
+
|
| 419 |
+
Given the challenge of precisely referring to a specific unique object in large Remote Sensing Images (RSIs) (e.g., identifying a particular ship among hundreds of ships parking on the same harbor), we perform rule-based unique object extraction using object detection labels from our collected RS datasets [35, 37, 62]. The process is detailed below:
|
| 420 |
+
|
| 421 |
+
(i) We first filter out small images and calculate the total number of instances for each category in the image and remove categories with more than 40 instances per image.
|
| 422 |
+
|
| 423 |
+
(ii) For the remaining categories, we extract attributes like absolute position, absolute size, relative position and relative size within the same category. Based on this information, we determine whether an object is unique and create unique reference (e.g., “the top-most airplane” or “the only storehouse in the bottom-left corner of the image”). Note that multiple thresholds are set during this process. For example, a target is labeled as the distinguishable “largest” only if its area exceeds that of the second-largest target in the same category by more than $2 0 \%$ . Similarly, a target is marked as “right-most” within its category only if it is located farthest to the right and its offset distance from the next closest target is greater than 20 pixels.
|
| 424 |
+
|
| 425 |
+
(iii) Based on the above results, we crop the region containing the unique targets from the large RSI and draw a red box around the object as the visual prompt. For small targets, if the longer side of the target is less than 400 pixels, the cropping area is expanded by 400 pixels. For larger targets, we apply appropriate scaling to ensure that the longer side does not exceed 1400 pixels.
|
| 426 |
+
|
| 427 |
+
Finally, for each large RSI, we obtain local image patches containing unique targets, along with their corresponding unique references.
|
| 428 |
+
|
| 429 |
+
# A.2. Question-Answer Pair Generation
|
| 430 |
+
|
| 431 |
+
Based on the above information, we additionally filter out extremely small objects (smaller than $1 6 \times 1 6$ pixels). Then we design prompts as in Tab. 1 to instruct GPT-4V to generate a diverse set of question-answer pairs. We carefully design the prompt to avoid generating questions about the entire image (e.g., counting targets across the whole image).
|
| 432 |
+
|
| 433 |
+
Questions involving whole-image counting for specific categories are separately generated based on object detection labels.
|
| 434 |
+
|
| 435 |
+
During the initial generation of the VQA corpus, we observed that the answers to VQA questions were predominantly “yes” or “no”. This could lead to the LVLM achieving high accuracy even without visual input. To address this issue, we carefully refine the prompts to guide GPT-4V in generating diverse and informative responses, constrained to a length of 1 to 3 words, while ensuring the responses are provided in an open-ended format. For the final version filtered by Qwen2-VL, we then conduct expert spot-checking and correction.
|
| 436 |
+
|
| 437 |
+
Additionally, during the Qwen2-VL-based quality inspection process and manual check, we observed that GPT-4V exhibits limitations in handling certain types of questions specific to remote sensing scenarios, such as object orientation. This indicates that even state-of-the-art LVLMs still need improvement when interpreting RSI.
|
| 438 |
+
|
| 439 |
+
# B. More Experiment Details
|
| 440 |
+
|
| 441 |
+
# B.1. Training Data Construction
|
| 442 |
+
|
| 443 |
+
We first filter out excessively large images from three RS datasets, as the DIP has a fixed 2-layer structure during training. To ensure the GSD range during training covers the dynamic range in inference, we apply different downsampling factors to maintain varied image sizes and construct multi-GSD inputs.
|
| 444 |
+
|
| 445 |
+
Subsequently, we create two types of questions: counttype questions based on object detection labels and relationbased questions using scene graph annotations. For counttype questions, we avoid querying categories with excessively high counts and control the proportion of samples where the answer is “1”. For relation-based questions, we ask whether a specific relationship exists between any two categories in the image, with answers provided as “yes” or “no”.
|
| 446 |
+
|
| 447 |
+
# B.2. Implementation Details
|
| 448 |
+
|
| 449 |
+
Training setting. During training, we follow the same experimental setup of the SFT stage as LLaVA-1.5 and LLaVA-Next, with a global batch size of 128 and a learning rate of 2e-5. Additionally, the maximum length of Vicuna-1.5 and Qwen2 are 2048 and 16384, respectively. The overall SFT process is largely consistent with that of LLaVA-1.5, as our RFM is a plug-and-play module that can be
|
| 450 |
+
|
| 451 |
+
messages = [ {"role":"system", "content": f“““You are an AI visual assistant tasked with analyzing remote sensing images. Given the visual input (a part of a large image) and corresponding object information, your job is to create a list of question-answer pairs around the target object and its surroundings. Each sentence should unambiguously refer to the object based on the ‘why unique’ information.
|
| 452 |
+
|
| 453 |
+
Finally, you need to return [‘qa-pairs’: [‘ques-id’: question id, ‘question’: question, ‘type’: question type, ‘answer’: answer]] in JSON format. Do not return any notes after the JSON. The target object is highlighted by a red rectangle in the given image patch, and the ‘why-unique’ provides how to refer it in the original large image, you need to rely on this information to ask questions.
|
| 454 |
+
|
| 455 |
+
1. Based on all visible elements and object information, ask 5-10 questions of various types, including object existence, object relation, complex reasoning, and object status. Avoid questions about color, object shape and object orientation. Additionally, questions requiring reasoning should involve multifaceted analytical thought processes (e.g., analyzing object distribution patterns) based on the target object and its surroundings. Possibly include objects that are not provided, such as houses, roads, water and trees if they are obvious and non-ambiguous.
|
| 456 |
+
2. Ensure each question has a definite answer without any ambiguity, and answer each question using a single word or phrase, no more than 3 words.
|
| 457 |
+
3. Only ask questions about clear answers; avoid uncertainties or unclear elements, such as unknown, uncertain, some, or several.
|
| 458 |
+
4.Avoid question formats that only allow for two options or overly simplistic responses (e.g., ‘Yes’ or ‘No’).
|
| 459 |
+
5. Do not mention the red highlight box or asking about the target object’s category—consider it known.
|
| 460 |
+
6. Use complete information from ‘why-unique’ to ensure unique reference.
|
| 461 |
+
|
| 462 |
+
Follow the above guidelines and ensure consistency with the provided category.”””}
|
| 463 |
+
|
| 464 |
+
] messages.append({"role":"user", "content":‘\n’.join(query)})
|
| 465 |
+
|
| 466 |
+
Table 1. The prompt to GPT-4V for generating question-answer pairs about the unique objects in the large-size RSIs.
|
| 467 |
+
|
| 468 |
+
seamlessly integrated into the SFT process of any modular LVLM.
|
| 469 |
+
|
| 470 |
+
More details about coarse-to-fine token pruning. Our method involves stopping at a specific layer $p$ of the DIP during traversal, pruning based on the RFM output of that layer, and then concatenating the pruned vision tokens with the vision tokens from the thumbnail view, along with text instructions, to form the multimodal input for the LLM. Although only a subset of image tiles is selected when traversing the DIP, we pad the unselected image tiles after the vision encoder and then add the “image newline” delimiter along with global position embeddings. Subsequently, we extract the vision tokens corresponding to $I _ { \mathrm { k e y } } ^ { p + 1 }$ and the “image newline” positions from the fully padded tensor, which serve as $T _ { \mathrm { v i s } } ^ { p + 1 , \bar { h } r }$ . The definitions of these symbols are consistent with those in the main paper.
|
| 471 |
+
|
| 472 |
+
Maximum sequence length of LLM. For Vicuna-1.5, due to the limitations of its pre-trained weights, it is challenging to train its long-context processing capability from scratch. Additionally, its performance often degrades when extrapolating to longer sequences. As for Qwen2, we have not yet explored the impact of extending the maximum sequence length to cover all vision tokens from original resolution imagery, primarily due to the significant time and
|
| 473 |
+
|
| 474 |
+
resource costs. Moreover, our method does not rely on enhancing long-sequence processing capabilities to handle large images but rather serves as a strategy to improve the perception performance of existing modular LVLMs.
|
| 475 |
+
|
| 476 |
+
# More details of comparison methods.
|
| 477 |
+
|
| 478 |
+
During the comparison of token reduction methods, we strive to maintain consistency or make necessary adaptations due to the differing principles of each approach. Specifically, for PruneMerge++ [58], CLIP-based pruning, RemoteCLIP-based pruning, and our RFM-based pruning, we set the token retain ratio to $2 5 \%$ . For VisionZip [77], the number of retained tokens is set to 64. For Pyramid-Drop [72] under the Qwen2 backbone, the pruning layers are configured to [7, 14, 21]. For all other settings of FastV [8] and PyramidDrop, we adhere to their original implementations.
|
| 479 |
+
|
| 480 |
+
# B.3. Flash Attention and Multi-Turn Support
|
| 481 |
+
|
| 482 |
+
Our method follows existing token pruning approaches [72, 88] and is compatible with the use of flash attention as well as multi-turn dialogue
|
| 483 |
+
|
| 484 |
+
For flash attention, following SparseVLM [88], we introduce an additional forward pass that incorporates a specially designed value matrix. This allows us to extract the
|
| 485 |
+
|
| 486 |
+
mean value of the processed attention map without explicitly computing the full attention map.
|
| 487 |
+
|
| 488 |
+
For multi-turn conversations, our method offers advantages over existing grid-based dynamic high-resolution approaches. These methods typically rely on pre-defined grids to partition and store all corresponding image tiles, which can be memory-intensive. In contrast, our approach only caches the features from the first two layers of the DIP (i.e., the vision tokens from the thumbnail view and the first group of image tiles). For higher-resolution image tiles, we maintain a dynamic selection strategy, extracting features only for text-related key tiles. This significantly reduces memory overhead while preserving efficiency in multi-turn scenarios.
|
| 489 |
+
|
| 490 |
+
# C. Detailed Efficiency Calculation
|
| 491 |
+
|
| 492 |
+
Detailed calculation of vision tokens. For vision tokens number calculation, a $4 { , } 0 0 0 { \times } 4 { , } 0 0 0$ image generates thumbnail view and 144 image tiles after processing with anyresp144, resulting in $( 1 4 4 + 1 ) \times 5 7 6 = 8 3 , 5 2 0$ vision tokens. Among these, the tokens from the image tiles are downsampled using bilinear interpolation in the anyres strategy, ultimately yielding $1 4 4 \times 1 4 4 + 5 7 6 = 2 1 , 3 1 2$ that are fed into the LLM. This accounts for the number of vision tokens reported for anyres-p144, FastV, and PyramidDrop. For Prun-Merge $^ { + + }$ and VisionZip, we calculate the number of vision tokens based on their respective compression strategies.
|
| 493 |
+
|
| 494 |
+
For our method, we fix a 4-layer pyramid for the $4 { , } 0 0 0 { \times } 4 { , } 0 0 0$ input. Assuming that the thumbnail view and image tiles of the first three layers are fully utilized, this generates $( 1 + 9 + 3 6 ) \times 5 7 6 = 2 6 , 4 9 6$ vision tokens. For the fourth layer of the DIP, as our strategy dynamically selects image tiles based on the output of the RFM, we computed the average number of image tiles generated in the fourth layer for all images close to $4 { , } 0 0 0 { \times } 4 { , } 0 0 0$ in the datasets. This average is 50, resulting in $5 0 \times 5 7 6 = 2 8 , 8 0 0$ vision tokens. Therefore, the total number of vision tokens processed by the vision encoder in our method is $2 6 , 4 9 6 \textrm { + }$ 28, $8 0 0 = 5 5$ , 296. After token pruning with the ratio 0.25, the token number to LLM is $5 0 \times 1 4 4 \times 0 . 2 5 + 5 7 6 = 2 , 3 7 6$ .
|
| 495 |
+
|
| 496 |
+
Detailed calculation of TFLOPs. We follow Pyramid-Drop to calculate the TFLOPs during inference. For PyramidDrop and FastV, we compute the TFLOPs by adapting the formulas provided in their respective papers, adjusting the number of vision tokens accordingly.
|
| 497 |
+
|
| 498 |
+
For our method, we account for the 4 layers in RFM and the 28 layers in Qwen2-7B. The FLOPs of the multi-head attention and the feedforward network modules are represented as $4 n d ^ { 2 } + 2 n ^ { 2 } d + 2 n d m$ , where $n$ is the number of vision tokens fed into the LLM, and $d , m$ are 3584 and 18944 in Qwen2-7B, respectively. The number of vision tokens input to RFM in DIP is calculated as $9 \times 1 4 4 + 5 7 6 =$ 1, 872 (layers 1-2), $3 6 \times 1 4 4 + 5 7 6 = 5 , 7 6 0$ (layer 3), and
|
| 499 |
+
|
| 500 |
+
$5 0 \times 1 4 4 + 5 7 6 = 7 , 7 7 6$ (layer 4), respectively. Based on these values, the FLOPs $\mathcal { F }$ of our method is computed as follows:
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
\begin{array}{l} \mathcal {F} = 4 \cdot \left(4 \cdot 1 8 7 2 \cdot d ^ {2} + 2 \cdot 1 8 7 2 ^ {2} \cdot d + 3 \cdot 1 8 7 2 \cdot d \cdot m\right) \\ + 4 \cdot \left(4 \cdot 5 7 6 0 \cdot d ^ {2} + 2 \cdot 5 7 6 0 ^ {2} \cdot d + 3 \cdot 5 7 6 0 \cdot d \cdot m\right) \\ + 4 \cdot \left(4 \cdot 7 7 7 6 \cdot d ^ {2} + 2 \cdot 7 7 7 6 ^ {2} \cdot d + 3 \cdot 7 7 7 6 \cdot d \cdot m\right) \\ + 2 8 \cdot \left(4 \cdot 2 3 7 6 \cdot d ^ {2} + 2 \cdot 2 3 7 6 ^ {2} \cdot d + 3 \cdot 2 3 7 6 \cdot d \cdot m\right) \\ = 3 6. 6 1 T \tag {1} \\ \end{array}
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
# D. More Experimental Results
|
| 507 |
+
|
| 508 |
+
Different distillation losses. We explored different combinations of distillation losses, as shown in Tab. 2. It can be observed that the KL loss plays a crucial role, while the MSE loss applied to the high-resolution vision tokens also contributes to performance improvement.
|
| 509 |
+
|
| 510 |
+
Table 2. Ablation study on different losses used in attention distillation, under LLaVA-Next-Qwen2.
|
| 511 |
+
|
| 512 |
+
<table><tr><td>KL</td><td>MSE</td><td>Color</td><td>Count</td><td>Pos</td><td>Acc</td></tr><tr><td>✓</td><td></td><td>44.70</td><td>29.04</td><td>49.56</td><td>41.20</td></tr><tr><td></td><td>✓</td><td>42.07</td><td>30.75</td><td>46.14</td><td>39.73</td></tr><tr><td>✓</td><td>✓</td><td>44.70</td><td>31.00</td><td>49.72</td><td>41.89</td></tr></table>
|
| 513 |
+
|
| 514 |
+
Different pruning ratios. As shown in Tab. 3, we employ multiple higher-resolution grids under the anyres strategy: anyres-p36 and anyres-p49. Then we conduct experiments with different pruning rates based on RFM-based pruning. The results indicate that the performance of the anyres baseline degrades as the supported image size increases, whereas our pruning method achieves consistent improvements. We attribute this to the fact that larger image sizes introduce more irrelevant background information, while our method effectively drops unnecessary vision tokens.
|
| 515 |
+
|
| 516 |
+
Different high-resolution vision token process. Additionally, for the DIP layers that have already been traversed (i.e., the layers before the final pruning layer), we attempt to prune their vision tokens as well. Specifically, we concatenate the pruned vision tokens from all traversed DIP layers, as shown in Tab. 4, the performance slightly decreases, possibly due to interference caused by the mixed resolutions of vision tokens across multiple hierarchical DIP levels.
|
| 517 |
+
|
| 518 |
+
Training with pruning. We further explore the effects of directly applying pruning during the SFT stage, as shown in Tab. 5. During training, the pruning ratio is set to 0.75, and the LLM observes the pruned vision tokens. Additionally, we experiment with feeding the text portion (i.e., fusion text) of the hidden states output by the RFM to the
|
| 519 |
+
|
| 520 |
+
Table 3. Ablation study on different prune ratios with LLaVA-Next-Qwen2 with larger resolutions, when pruning vision tokens based on RFM results without DIP. “pX” indicates the max number is X for the pre-defined grids.
|
| 521 |
+
|
| 522 |
+
<table><tr><td>Method</td><td>Drop Ratio</td><td>Color</td><td>Count</td><td>Pos</td><td>Acc</td></tr><tr><td rowspan="2">anyres-p36</td><td>0%</td><td>42.31</td><td>29.77</td><td>44.71</td><td>39.00</td></tr><tr><td>25%</td><td>42.71</td><td>30.10</td><td>45.19</td><td>39.41</td></tr><tr><td rowspan="2">w/prune (Ours)</td><td>50%</td><td>42.79</td><td>31.40</td><td>47.49</td><td>40.64</td></tr><tr><td>75%</td><td>41.75</td><td>30.91</td><td>48.45</td><td>40.45</td></tr><tr><td rowspan="2">anyres-p49</td><td>0%</td><td>40.00</td><td>30.34</td><td>44.95</td><td>38.50</td></tr><tr><td>25%</td><td>40.72</td><td>30.91</td><td>46.38</td><td>39.41</td></tr><tr><td rowspan="2">w/prune (Ours)</td><td>50%</td><td>40.64</td><td>31.65</td><td>48.61</td><td>40.37</td></tr><tr><td>75%</td><td>41.75</td><td>30.51</td><td>48.37</td><td>40.29</td></tr></table>
|
| 523 |
+
|
| 524 |
+
<table><tr><td>Setting</td><td>Color</td><td>Count</td><td>Pos</td><td>Acc</td></tr><tr><td>concat</td><td>44.22</td><td>31.48</td><td>48.21</td><td>41.39</td></tr><tr><td>select</td><td>44.70</td><td>31.00</td><td>49.72</td><td>41.89</td></tr></table>
|
| 525 |
+
|
| 526 |
+
Table 4. Ablation study on different high-resolution vision token processing, under LLaVA-Next-Qwen2. “concat” means concatenating all pruned vision tokens from all traversed DIP layers as high-resolution part. “select” means selecting the pruned tokens of the final pruning layer as high-resolution part, which is employed in the main paper.
|
| 527 |
+
Table 5. Ablation study on training with vision token pruning and text fusion. “Fus. Text” refers to replacing the original text tokens with the text portion (i.e., fusion text) output by the RFM when feeding into the LLM.
|
| 528 |
+
|
| 529 |
+
<table><tr><td>Prune</td><td>Fus. Text</td><td>Color</td><td>Count</td><td>Pos</td><td>Acc</td></tr><tr><td>✓</td><td>×</td><td>41.91</td><td>26.02</td><td>49.01</td><td>39.09</td></tr><tr><td>✓</td><td>✓</td><td>40.96</td><td>31.97</td><td>44.63</td><td>39.25</td></tr><tr><td>×</td><td>×</td><td>44.70</td><td>31.00</td><td>49.72</td><td>41.89</td></tr></table>
|
| 530 |
+
|
| 531 |
+
LLM, represented as “Fus. Text” in Tab. 5. The results indicate that introducing token pruning during training leads to a performance drop. We think this is because the model lacks access to complete image information, which impairs its ability to accurately perform text-aware region localization, resulting in inferior performance compared to standard SFT.
|
| 532 |
+
|
| 533 |
+
It is important to note that our method cannot utilize the fusion text setting in Tab. 5. Because under such a setting, during training, the LLM receives fusion text along with full vision tokens as input, whereas during inference, the LLM receives fusion text along with pruned vision tokens. This creates an inconsistency between training and inference.
|
| 534 |
+
|
| 535 |
+
Different layer-pairs in distillation. We explore the impact of different RFM-LLM layer-pairs used for distillation, as shown in Tab. 6. Specifically, for the 28-layer Qwen2-
|
| 536 |
+
|
| 537 |
+
Table 6. Ablation study on different RFM-LLM layer-pair configurations in MME-RealWorld-RS, with LLaVA-Next-Qwen2. “RFM Layers” means the number of layers in RFM.
|
| 538 |
+
|
| 539 |
+
<table><tr><td>RFMLayers</td><td>LLMLayers</td><td>Color</td><td>Count</td><td>Pos</td><td>Acc</td></tr><tr><td>3</td><td>[1,8,14]</td><td>41.35</td><td>28.30</td><td>47.89</td><td>39.27</td></tr><tr><td>4</td><td>[1,5,11,14]</td><td>44.70</td><td>31.00</td><td>49.72</td><td>41.89</td></tr><tr><td>4</td><td>[1,7,13,18]</td><td>40.88</td><td>32.63</td><td>49.48</td><td>41.06</td></tr><tr><td>4</td><td>[1,7,14,20]</td><td>41.83</td><td>28.22</td><td>47.89</td><td>39.41</td></tr><tr><td>5</td><td>[1,5,10,12,14]</td><td>43.98</td><td>29.36</td><td>48.13</td><td>40.58</td></tr><tr><td>6</td><td>[1,3,6,9,12,14]</td><td>42.31</td><td>31.08</td><td>47.18</td><td>40.26</td></tr><tr><td>6</td><td>[1,4,8,12,16,20]</td><td>43.75</td><td>30.51</td><td>48.13</td><td>40.88</td></tr><tr><td>6</td><td>[1,5,10,15,20,24]</td><td>42.31</td><td>31.08</td><td>47.18</td><td>40.26</td></tr></table>
|
| 540 |
+
|
| 541 |
+
7B, we observed that the text-related attention localization is most accurate in its deep layers (approximately layers 14–24) when answering questions about both the global content and local details of the large RSIs.
|
| 542 |
+
|
| 543 |
+
From Tab. 6, it can be observed that as the number of LLM layers for distillation increases, it becomes more challenging for the RFM to learn precise text-aware localization capabilities. Although increasing the number of layers in the RFM can enhance its learning ability, it also raises the cost of training and inference. Moreover, the RFM doesn’t need to possess highly accurate localization capabilities in the shallow layers of DIP, it only needs to provide rough positions to index image tiles of the next DIP layer. Additionally, when used for pruning, the vision tokens from key image tiles already narrow down the scope, making it sufficient to recognize general background information. Furthermore, retaining a certain number of context tokens can actually be beneficial for certain types of questions.
|
| 544 |
+
|
| 545 |
+
Detailed comparison with baselines. We provide a more comprehensive comparison with two simple but vital baselines: CLIP-L14 and RemoteCLIP-L14. Specifically, under identical anyres or DIP settings, we partition the image using a sliding-window approach ( $3 3 6 \times 3 3 6$ for CLIP and $2 2 4 \times 2 2 4$ for RemoteCLIP). Then we compute the similarity map between the input text and the image features for each image tile, which are subsequently stitched together to form a complete heatmap that guides the token pruning.
|
| 546 |
+
|
| 547 |
+
Tab. 7 presents a comparison of localization accuracy against these baselines across three datasets. While conceptually simpler, these baselines struggle due to their limited capacity to understand complex referring expressions and the lack of global perception inherent in the slidingwindow mechanism. This highlights the importance of distilling knowledge from the LLM’s attention, which enables our RFM to grasp complex semantics.
|
| 548 |
+
|
| 549 |
+
Furthermore, Tab. 8 shows the performance and FPS comparison under the same pruning setting (LLaVA-Nextp25). The accuracy trends observed here are largely con-
|
| 550 |
+
|
| 551 |
+
Table 7. Localisation recall $( \% )$ of different pruning guidance.
|
| 552 |
+
|
| 553 |
+
<table><tr><td>Pruning Guidance</td><td>LRS-FAIR</td><td>LRS-Bridge</td><td>LRS-STAR</td><td>DIOR-RSVG</td><td>RRSIS-D</td></tr><tr><td>Teacher LLM Attn.</td><td>53.03</td><td>58.66</td><td>56.73</td><td>74.81</td><td>73.88</td></tr><tr><td>CLIP Sim.</td><td>23.87</td><td>16.73</td><td>19.82</td><td>29.10</td><td>27.53</td></tr><tr><td>RemoteCLIP Sim.</td><td>37.04</td><td>22.99</td><td>32.21</td><td>43.12</td><td>41.81</td></tr><tr><td>RFM Attn. (Ours)</td><td>47.89</td><td>49.08</td><td>47.01</td><td>64.76</td><td>61.17</td></tr></table>
|
| 554 |
+
|
| 555 |
+
Table 8. VQA accuracy $( \% )$ and FPS with different token pruning guidance methods. FPS on LRS-VQA averaged across 3 datasets.
|
| 556 |
+
|
| 557 |
+
<table><tr><td>Setting</td><td>MME-RW-RS</td><td>FPS</td><td>LRS-FAIR</td><td>LRS-Bridge</td><td>LRS-STAR</td><td>FPS</td></tr><tr><td>LLaVA-Next-p25</td><td>39.65</td><td>0.188</td><td>20.99</td><td>36.38</td><td>26.18</td><td>0.176</td></tr><tr><td>w/ CLIP Sim.</td><td>36.86</td><td>0.171</td><td>18.12</td><td>32.30</td><td>24.46</td><td>0.162</td></tr><tr><td>w/ RemoteCLIP Sim.</td><td>38.77</td><td>0.148</td><td>20.36</td><td>34.24</td><td>25.32</td><td>0.139</td></tr><tr><td>w/ RFM (Ours)</td><td>41.28</td><td>0.165</td><td>21.65</td><td>37.55</td><td>26.83</td><td>0.157</td></tr></table>
|
| 558 |
+
|
| 559 |
+
sistent with the localization accuracy results. It is worth noting that although RemoteCLIP enhances performance on remote sensing imagery, its smaller input size of $2 2 4 \times 2 2 4$ necessitates partitioning the image into more tiles, which adversely affects inference speed on large images.
|
| 560 |
+
|
| 561 |
+
Detailed results on LRS-VQA. The complete leaderboards on the three parts of LRS-VQA are shown in Tab. 9, Tab. 10 and Tab. 11, respectively. Notably, on questions that require more global-scale perception capabilities, such as rural/urban classification, high-resolution LVLMs do not necessarily outperform low-resolution LVLMs. Additionally, the language preference inherent in the LVLM itself can influence its performance when answering open-ended questions, as it must precisely describe the corresponding vocabulary or its synonyms. Overall, LVLMs like Qwen2- VL, LLaVA-OV, and IXC-2.5, which are trained on large datasets and utilize higher resolutions, also demonstrate strong performance in large RSI perception tasks.
|
| 562 |
+
|
| 563 |
+
<table><tr><td>Method</td><td>Max Res.</td><td>count</td><td>category</td><td>shape</td><td>status</td><td>reasoning</td><td>rural/urban</td><td>OverAll</td></tr><tr><td>LLaVA1.5</td><td>336×336</td><td>10.50</td><td>13.44</td><td>7.37</td><td>7.75</td><td>25.25</td><td>48.25</td><td>18.76</td></tr><tr><td>SLiME</td><td>672×1,008</td><td>14.25</td><td>9.82</td><td>8.07</td><td>9.25</td><td>24.50</td><td>36.75</td><td>17.11</td></tr><tr><td>SEAL</td><td>-</td><td>7.00</td><td>12.50</td><td>3.50</td><td>20.50</td><td>28.75</td><td>55.50</td><td>21.29</td></tr><tr><td>LLaVA-FlexAttn</td><td>1,008×1,008</td><td>9.50</td><td>10.59</td><td>6.32</td><td>20.75</td><td>24.00</td><td>46.25</td><td>19.57</td></tr><tr><td>MGM-HD</td><td>1,536×1,536</td><td>15.50</td><td>12.66</td><td>9.47</td><td>6.00</td><td>23.75</td><td>40.00</td><td>17.90</td></tr><tr><td>LLaVA-UHD-v2</td><td>672×1,008</td><td>17.50</td><td>11.63</td><td>9.04</td><td>23.00</td><td>26.25</td><td>49.50</td><td>22.82</td></tr><tr><td>IXC-2.5</td><td>4,096×4,096</td><td>22.75</td><td>15.25</td><td>15.50</td><td>22.00</td><td>26.50</td><td>49.50</td><td>25.25</td></tr><tr><td>LLaVA-OV</td><td>2,304×2,304</td><td>16.25</td><td>19.90</td><td>8.77</td><td>12.75</td><td>27.25</td><td>38.75</td><td>20.61</td></tr><tr><td>Qwen2-VL</td><td>3,333×3,333</td><td>22.50</td><td>15.25</td><td>12.28</td><td>10.00</td><td>24.25</td><td>58.50</td><td>23.80</td></tr><tr><td>Geochat</td><td>504×504</td><td>13.50</td><td>8.01</td><td>14.04</td><td>3.50</td><td>19.75</td><td>62.25</td><td>20.18</td></tr><tr><td>RSUniVLM</td><td>336×336</td><td>21.00</td><td>11.37</td><td>15.98</td><td>2.00</td><td>25.00</td><td>50.75</td><td>21.02</td></tr><tr><td>Claude-3.5-Sonnet</td><td>-</td><td>11.75</td><td>4.12</td><td>16.84</td><td>1.50</td><td>15.00</td><td>28.50</td><td>12.95</td></tr><tr><td>Gpt-4o-mini</td><td>-</td><td>12.75</td><td>11.37</td><td>11.37</td><td>12.50</td><td>19.75</td><td>44.25</td><td>18.67</td></tr><tr><td>Gpt-4o</td><td>-</td><td>16.00</td><td>13.44</td><td>14.98</td><td>18.00</td><td>24.00</td><td>46.50</td><td>22.15</td></tr></table>
|
| 564 |
+
|
| 565 |
+
Table 9. Detailed results on LRS-FAIR.
|
| 566 |
+
|
| 567 |
+
<table><tr><td>Method</td><td>Max Res.</td><td>count</td><td>background</td><td>color</td><td>rural/urban</td><td>OverAll</td></tr><tr><td>LLaVA1.5</td><td>336×336</td><td>6.50</td><td>18.37</td><td>38.79</td><td>59.13</td><td>30.70</td></tr><tr><td>SLiME</td><td>672×1,008</td><td>13.50</td><td>18.78</td><td>34.55</td><td>61.51</td><td>32.09</td></tr><tr><td>SEAL</td><td>-</td><td>0.00</td><td>31.50</td><td>36.00</td><td>71.50</td><td>34.75</td></tr><tr><td>LLaVA-FlexAttn</td><td>1,008×1,008</td><td>4.50</td><td>17.96</td><td>37.58</td><td>59.92</td><td>29.99</td></tr><tr><td>MGM-HD</td><td>1,536×1,536</td><td>12.25</td><td>18.78</td><td>52.73</td><td>59.92</td><td>35.92</td></tr><tr><td>LLaVA-UHD-v2</td><td>672×1,008</td><td>5.00</td><td>17.55</td><td>44.24</td><td>63.49</td><td>32.57</td></tr><tr><td>IXC-2.5</td><td>4,096×4,096</td><td>14.50</td><td>20.30</td><td>55.34</td><td>63.49</td><td>38.41</td></tr><tr><td>LLaVA-OV</td><td>2,304×2,304</td><td>4.50</td><td>20.82</td><td>57.58</td><td>57.54</td><td>35.11</td></tr><tr><td>Qwen2-VL</td><td>3,333×3,333</td><td>15.50</td><td>20.41</td><td>57.58</td><td>59.00</td><td>38.12</td></tr><tr><td>Geochat</td><td>504×504</td><td>8.75</td><td>11.84</td><td>22.42</td><td>55.16</td><td>24.54</td></tr><tr><td>RSUniVLM</td><td>336×336</td><td>10.25</td><td>13.06</td><td>43.64</td><td>63.49</td><td>32.61</td></tr><tr><td>Claude-3.5-Sonnet</td><td>-</td><td>5.25</td><td>11.43</td><td>33.33</td><td>56.75</td><td>26.69</td></tr><tr><td>Gpt-4o-mini</td><td>-</td><td>4.75</td><td>17.96</td><td>50.97</td><td>54.29</td><td>31.99</td></tr><tr><td>Gpt-4o</td><td>-</td><td>14.75</td><td>18.37</td><td>43.03</td><td>51.19</td><td>31.84</td></tr></table>
|
| 568 |
+
|
| 569 |
+
Table 10. Detailed results on LRS-Bridge.
|
| 570 |
+
Table 11. Detailed results on LRS-STAR.
|
| 571 |
+
|
| 572 |
+
<table><tr><td>Method</td><td>Max Res.</td><td>count</td><td>category</td><td>color</td><td>shape</td><td>status</td><td>reasoning</td><td>rural/urban</td><td>OverAll</td></tr><tr><td>LLaVA1.5</td><td>336×336</td><td>10.75</td><td>18.67</td><td>36.50</td><td>10.00</td><td>11.33</td><td>15.67</td><td>55.50</td><td>22.63</td></tr><tr><td>SLiME</td><td>672×1,008</td><td>12.75</td><td>18.33</td><td>41.50</td><td>10.50</td><td>12.67</td><td>16.00</td><td>49.17</td><td>22.99</td></tr><tr><td>SEAL</td><td>-</td><td>0.25</td><td>20.50</td><td>33.50</td><td>10.00</td><td>10.50</td><td>17.75</td><td>56.50</td><td>21.29</td></tr><tr><td>LLaVA-FlexAttn</td><td>1,008×1,008</td><td>11.50</td><td>17.00</td><td>36.17</td><td>8.67</td><td>13.33</td><td>14.83</td><td>57.83</td><td>22.76</td></tr><tr><td>MGM-HD</td><td>1,536×1,536</td><td>15.50</td><td>12.66</td><td>49.50</td><td>18.75</td><td>10.30</td><td>10.18</td><td>24.00</td><td>20.13</td></tr><tr><td>LLaVA-UHD-v2</td><td>672×1,008</td><td>16.25</td><td>18.67</td><td>43.50</td><td>15.67</td><td>14.83</td><td>16.17</td><td>57.50</td><td>26.08</td></tr><tr><td>IXC-2.5</td><td>4,096×4,096</td><td>15.75</td><td>23.50</td><td>48.00</td><td>16.50</td><td>13.33</td><td>17.50</td><td>56.50</td><td>27.30</td></tr><tr><td>LLaVA-OV</td><td>2,304×2,304</td><td>9.75</td><td>25.33</td><td>51.00</td><td>14.00</td><td>10.17</td><td>18.83</td><td>53.50</td><td>26.08</td></tr><tr><td>Qwen2-VL</td><td>3,333×3,333</td><td>19.25</td><td>22.83</td><td>46.50</td><td>11.17</td><td>13.00</td><td>18.33</td><td>64.00</td><td>27.87</td></tr><tr><td>Geochat</td><td>504×504</td><td>13.50</td><td>8.01</td><td>24.75</td><td>10.75</td><td>5.42</td><td>14.04</td><td>19.75</td><td>13.75</td></tr><tr><td>RSUniVLM</td><td>336×336</td><td>8.00</td><td>13.50</td><td>51.67</td><td>25.17</td><td>4.50</td><td>14.00</td><td>56.17</td><td>24.72</td></tr><tr><td>Claude-3.5-Sonnet</td><td>-</td><td>6.34</td><td>6.00</td><td>41.67</td><td>1.67</td><td>12.33</td><td>3.00</td><td>22.00</td><td>13.29</td></tr><tr><td>Gpt-4o-mini</td><td>-</td><td>10.78</td><td>20.67</td><td>40.67</td><td>15.17</td><td>14.50</td><td>20.33</td><td>58.83</td><td>25.85</td></tr><tr><td>Gpt-4o</td><td>-</td><td>11.78</td><td>21.50</td><td>48.17</td><td>23.83</td><td>12.50</td><td>20.50</td><td>53.50</td><td>27.40</td></tr></table>
|
paper_markdowns/bamboo-02244.md
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CATCH: CHANNEL-AWARE MULTIVARIATE TIME SERIES ANOMALY DETECTION VIA FREQUENCY PATCHING
|
| 2 |
+
|
| 3 |
+
Xingjian $\mathbf { W } \mathbf { u } ^ { 1 }$ , Xiangfei $\mathbf { Q i u } ^ { 1 }$ , Zhengyu $\mathbf { L i } ^ { 1 }$ , Yihang Wang1, Jilin $\mathbf { H } \mathbf { u } ^ { 1 }$ , Chenjuan Guo1, Hui Xiong2, Bin Yang1∗
|
| 4 |
+
|
| 5 |
+
1East China Normal University
|
| 6 |
+
2The Hong Kong University of Science and Technology (Guangzhou)
|
| 7 |
+
|
| 8 |
+
{xjwu,xfqiu,lizhengyu,yhwang}@stu.ecnu.edu.cn,
|
| 9 |
+
|
| 10 |
+
{jlhu,cjguo,byang}@dase.ecnu.edu.cn, xionghui@ust.hk
|
| 11 |
+
|
| 12 |
+
# ABSTRACT
|
| 13 |
+
|
| 14 |
+
Anomaly detection in multivariate time series is challenging as heterogeneous subsequence anomalies may occur. Reconstruction-based methods, which focus on learning normal patterns in the frequency domain to detect diverse abnormal subsequences, achieve promising results, while still falling short on capturing finegrained frequency characteristics and channel correlations. To contend with the limitations, we introduce CATCH, a framework based on frequency patching. We propose to patchify the frequency domain into frequency bands, which enhances its ability to capture fine-grained frequency characteristics. To perceive appropriate channel correlations, we propose a Channel Fusion Module (CFM), which features a patch-wise mask generator and a masked-attention mechanism. Driven by a bi-level multi-objective optimization algorithm, the CFM is encouraged to iteratively discover appropriate patch-wise channel correlations, and to cluster relevant channels while isolating adverse effects from irrelevant channels. Extensive experiments on 12 real-world datasets and 12 synthetic datasets demonstrate that CATCH achieves state-of-the-art performance. We make our code and datasets available at https://github.com/decisionintelligence/CATCH.
|
| 15 |
+
|
| 16 |
+
# 1 INTRODUCTION
|
| 17 |
+
|
| 18 |
+
Modern cyber physical systems are often monitored by multiple sensors, which produce sucessive multivariate time series data (Wang et al., 2024f; Dai et al., 2024; Sun et al., 2025; Tian et al., 2025; Guo et al., 2014). In recent years, there has been significant progress in multivariate time series analysis, with key tasks such as forecasting (Qiu et al., 2025c; Yu et al., 2023; Wu et al., 2024b; Liu et al., 2024a; Huang et al., 2024; Chen et al., 2024), classification (Yao et al., 2024b; Campos et al., 2023), and imputation (Gao et al., 2024; Wang et al., 2024c;b), among others (Huang et al., 2023; Yao et al., 2024a; Liu et al., 2025), gaining attention. Among these, Multivariate Time Series Anomaly Detection (MTSAD), which focuses on identifying abnormal data in multivariate time series, stands out as a critical studied task. It is applied widely including but not limited to financial fraud detection, medical disease identification, and cybersecurity threat detection (Wen et al., 2022; Yang et al., 2023a; Kieu et al., 2018; 2019; Wu et al., 2024c; Shentu et al., 2024; Yang et al., 2021).
|
| 19 |
+
|
| 20 |
+
Time series anomalies are typically classified into point anomalies and subsequence anomalies. The point anomalies can be further classified as contextual or global anomalies (Lai et al., 2021). Recent reconstruction-based methods show strong capability of detecting point anomalies, which are characterized by specific values that significantly deviate from the normal range of the probability distribution. However, subsequence anomalies consist of values that fall within the probability distribution, making them much harder to detect (Paparrizos et al., 2022b; Nam et al., 2024). According to the behavior-driven taxonomy (Lai et al., 2021), the subsequence anomalies can be further divided
|
| 21 |
+
|
| 22 |
+
into seasonal, shapelet, and trend anomalies–see Figure 1a. A promising approach is to transform the time series into the frequency domain to better derive the subsequence anomalies.
|
| 23 |
+
|
| 24 |
+
When transformed into the frequency domain, distinct subsequence anomalies also show prominent differences against the normal series in different frequency bands (Figure 1a). In this case, shapelet anomalies mainly affect the third frequency band while seasonal anomalies affect the first two frequency bands. However, the frequency domain features a long-tailed distribution that most information centralizes in the low frequency bands. Coarse-grained reconstructionbased methods may neglect the details in the high frequency bands (Guo et al., 2023; Piao et al., 2024; Park & Kim, 2022; Wang et al., 2022), thus failing to detect correspond anomalies, which calls for fine-grained modeling in each frequency band to precisely reconstruct the normal patterns, so that heterogeneous subsequence anomalies can be detected. Moreover, considering the relationships among channels also promotes better reconstruction for normal patterns.
|
| 25 |
+
|
| 26 |
+
Figure 1b shows a multivariate time series with three channels, and we observe the varying channel associations in different frequency bands, where Channel 1 and Channel 2 are similar in the third band but dissimilar to Channel 3, and all channels are similar in the fourth band but show dissimilarity in the fifth. However, the commonly-used Channel-Independent (CI) and Channel-Dependent (CD) strategies exhibit polarization effects, rendering them inadequate for this task. CI uses the same model across different channels and overlooks potential channel correlations, which offers robustness (Nie et al., 2023; Qiu et al., 2025a) but lacks generalizability and capacity. CD considers all channels simultaneously with larger capacity, but may be susceptible to noise from irrelevant channels, thus lacking robustness (Han et al., 2024; Qiu et al., 2025a). This calls for flexibly adapting the distinct channel interrelationships in different frequency bands.
|
| 27 |
+
|
| 28 |
+
Inspired by the above observations, we propose CATCH, a Channel-Aware MTSAD framework via frequency patching. Technically, we utilize Fourier Transformation to stretch across time and frequency domains to facilitate the detection of both point and subsequence anomalies, of which the latter can be improved by patching in the frequency domain for finegrained modeling. To flexibly utilize the channel correlations in frequency bands, we propose a Channel Fusion Module (CFM) that incorporates a Channel Correlation Discovering mechanism and utilizes masked attention through a bi-level multi-objective optimization process. Specifically, we utilize a patch-wise mask generator to adaptively discover channel correla-
|
| 29 |
+
|
| 30 |
+
tion for each frequency band. The discovered channel correlation is between CI and CD, providing both the capacity and robustness by clustering relevant channels while isolating the adverse effects from irrelevant channels. The contributions are summarized as follows:
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
(a) Different subsequence anomalies.
|
| 36 |
+
(b) Varying correlations among channels.
|
| 37 |
+
Figure 1: The frequency domain is partitioned into five frequency bands with the high-frequency bands zoomed in for clarity. (a) Shows a normal time series and its variations after being injected seasonal, shapelet, trend and mixture subsequence anomalies. In the time domain, anomalies are highlighted in red, while the affected frequency bands in the frequency domain are emphasized in gray. (b) Shows the frequency bands of a multivariate time series with three channels. These channels exhibit varying correlations across different frequency bands, where Channels 1 and 2 exhibit similar behavior in the third frequency band and are therefore marked in red, while Channel 3 exhibits distinct characteristics and is marked in yellow. In the fourth frequency band, all channels behave similarly and are marked in green, while in the fifth band, they exhibit distinct characteristics and are marked in different colors.
|
| 38 |
+
|
| 39 |
+
• We propose a general framework called CATCH, which enables simultaneous detection of heterogeneous point and subsequence anomalies via frequency patch learning. The framework enhances subsequence anomaly detection through frequency-domain patching and integrates fine-grained adaptive channel correlations across frequency bands.
|
| 40 |
+
|
| 41 |
+
• We design the CFM to fully utilize the fine-grained channel correlations. Driven by a bi-level multi-objective optimization algorithm, the CFM is able to iteratively discover appropriate channel correlations and facilitate the isolation of irrelevant channels and the clustering of relevant channels, which provides both the capacity and robustness.
|
| 42 |
+
• We conduct extensive experiments on 24 multivariate datasets. The results show that CATCH outperforms state-of-the-art baselines.
|
| 43 |
+
|
| 44 |
+
# 2 RELATED WORK
|
| 45 |
+
|
| 46 |
+
# 2.1 MULTIVARIATE TIME-SERIES ANOMALY DETECTION
|
| 47 |
+
|
| 48 |
+
Traditional MTSAD methods can be classified into non-learning (Breunig et al., 2000; Goldstein & Dengel, 2012; Yeh et al., 2016; Li et al., 2024a) and machine learning (Liu et al., 2008; Ramaswamy et al., 2000). Recently, deep learning has made impressive progress in natural language processing (He et al., 2025b; Wang et al., 2024e; Wu et al., 2024a; 2025a), computer vision (Wu et al., 2025b; Li et al., 2025a;b; Yu et al., 2024b), and other aspects (Yi et al., 2025; He et al., 2025a; Li et al., 2023). Studies have shown that learned features may perform better than human-designed features (Yu et al., 2025; 2024a). Therefore, many deep learning-based MTSAD methods have been proposed and have received substantial extensive attention (Liu et al., 2024b; Liu & Paparrizos, 2024; Hu et al., 2024; Wang et al., 2023; Li et al., 2021; Wang et al., $2 0 2 4 \mathrm { a } ; \mathrm { g } ,$ ). They can be classified into forecasting-based, reconstruction-based and contrastive-based methods. GDN (Deng & Hooi, 2021) is a forecasting-based model that uses a graph structure to learn topology and a graph attention network to encode input series, with anomaly detection based on the maximum forecast error among channel variables. Anomaly Transformer is a reconstructive approach that combines series and prior association to make anomalies distinctive (Xu et al., 2021). DCdetector uses contrastive learning in anomaly detection to create an embedding space where normal data samples are close together and anomalies are farther apart (Yang et al., 2023b).
|
| 49 |
+
|
| 50 |
+
# 2.2 CHANNEL STRATEGIES IN MTSAD
|
| 51 |
+
|
| 52 |
+
A channel refers to a variable in MTSAD, while a channel strategy refers to how these channel correlations are effectively considered during the modeling process. CATCH employs a reconstructionbased MTSAD algorithm, using reconstruction error as the anomaly score, making reconstruction quality crucial for anomaly detection accuracy. Since the channels in multivariate time series often exhibit complex dependencies, explicitly modeling these correlations enables a more comprehensive capture of global features, thereby improving reconstruction capabilities and anomaly detection performance. There are mainly two existing approaches that consider relationships among channels. Channel-Independent (CI) based methods such as: PatchTST (Nie et al., 2023) and SparseTSF (Lin et al., 2024) impose the constraint of using the same model across different channels. While it offers robustness, it overlooks potential interactions among channels and can be limited in generalizability and capacity for unseen channels (Han et al., 2024). Previous studies have shown that correlation discovery in data is crucial for time series anomaly detection (Song et al., 2018). Channel-Dependent (CD) based methods such as: MSCRED (Zhang et al., 2019) uses a convolutional-LSTM network with attention and a loss function to reconstruct correlation matrices among channels in multivariate time series input. MTAD-GAT (Zhao et al., 2020) treats each univariate time series as a feature and uses two parallel graph attention layers to capture dependencies across both temporal and channel dimensions. The existing methods could not adequately extract interrelationships, they may be susceptible to noise from irrelevant channels, reducing the model’s robustness.
|
| 53 |
+
|
| 54 |
+
# 2.3 FREQUENCY DOMAIN ANALYSIS FOR TSAD
|
| 55 |
+
|
| 56 |
+
Frequency domain analysis can uncover subsequence anomalies that are challenging to detect in the time domain, such as anomalies in periodic fluctuations or oscillation patterns, significantly enhancing detection accuracy (Zhang et al., 2022). Conse-
|
| 57 |
+
|
| 58 |
+
Table 1: Comparison of existing TSAD methods.
|
| 59 |
+
|
| 60 |
+
<table><tr><td>Property</td><td>Mmultivariate time
|
| 61 |
+
serie anomaly detection</td><td>Time-frequency
|
| 62 |
+
granularity alignment</td><td>Handle high-frequency
|
| 63 |
+
information</td><td>Capture channel
|
| 64 |
+
correlations</td></tr><tr><td>SR-CNN</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>PFT</td><td>X</td><td>X</td><td>X</td><td>X</td></tr><tr><td>TFAD</td><td>✓</td><td>X</td><td>X</td><td>X</td></tr><tr><td>Dual-TF</td><td>✓</td><td>✓</td><td>X</td><td>X</td></tr><tr><td>CATCH</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td></tr></table>
|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Figure 2: CATCH architecture. (1) Forward Module normalizes the input data, patchifies the frequency domain, and then projects it into the hidden space. (2) Channel Fusion Module captures channel interrelationships in each frequency band with a Channel-Masked Transformer (CMT) Layer, where the mask matrix (channel correlation) is generated by Mask Generator (MG). During training, MG and CMT are optimized by Channel Correlation Discovering (CCD) for more appropriate channel correlations. (3) Time-Frequency Reconstruction Module obtains the frequency reconstruction through Flatten & Linear Head Layer, and obtains the time reconstruction after iFFT.
|
| 68 |
+
|
| 69 |
+
quently, frequency-based time series anomaly detection models have garnered widespread attention in recent years. SR-CNN (Ren et al., 2019), the first method to leverage the frequency domain for TSAD, employs a frequency-based approach to generate saliency maps for identifying anomalies, and PFT (Zhang et al., 2022) built on this foundation by introducing partial Fourier transform to achieve substantial acceleration. However, both methods are confined to univariate time series and fail to address the complexities of multivariate scenarios. TFAD (Zhang et al., 2022) emerges as the first approach to integrate time-domain and frequency-domain analyses for MTSAD, yet it lacks time-frequency granularity alignment. Dual-TF (Nam et al., 2024), the most recent algorithm for MTSAD using time-frequency analysis, partially addresses the time-frequency granularity alignment issue but lacks a tailored backbone, instead relying directly on the Anomaly Transformer (Xu et al., 2021). While TFAD and Dual-TF represent progress in this area, they still exhibit the following limitations: i) Frequency-domain modeling methods have inherent biases, often overlooking high-frequency information; 2) Insufficient exploration and utilization of channel correlations in multivariate time series.
|
| 70 |
+
|
| 71 |
+
# 3 CATCH
|
| 72 |
+
|
| 73 |
+
In the context of time series anomaly detection, $\mathrm { X } \in \mathbb { R } ^ { N \times T }$ denotes a time series with $N$ channels and length $T$ . For clear delineation, we separate dimensions with commas and use this format throughout this paper. For example, we denote $\mathrm { X } _ { i , j }$ as the $i$ -th channel at the $j$ -th timestamp, $\mathrm { X } _ { n , \astrosun }$ ,: ∈ $\mathbb { R } ^ { T }$ as the time series of $n$ -th channel, where $n = 1 , 2 , \cdots , N$ . The multivariate time series anomaly detection problem is to determine whether $\mathrm { X } _ { : , t }$ is anomaly or not.
|
| 74 |
+
|
| 75 |
+
# 3.1 STRUCTURE OVERVIEW
|
| 76 |
+
|
| 77 |
+
Figure 2 shows the overall architecture of the CATCH, which consists of three main modules: 1) the Forward Module, 2) the Channel Fusion Module (CFM), and 3) the Time-Frequency Reconstruction Module (TFRM). Specifically, the input multivariate time series is firstly processed via the Forward Module, consisting of the Instance Norm Layer, FFT&Patching Layer, and Projection Layer.
|
| 78 |
+
|
| 79 |
+
The Instance Norm Layer is firstly to mitigate the distributional shifts between the training and testing data caused by varying statistical properties, enhancing the model’s generalization in reconstructing the testing data. Then, the FFT&Patching Layer is to perform fine-grained modeling in each frequency band (patch). Specifically, we utilize the efficient FFT (Brigham & Morrow, 1967) to transform time series into orthogonal trigonometric signals in the frequency domain, where we keep
|
| 80 |
+
|
| 81 |
+
both the real and imaginary parts through $\mathrm { X } ^ { R }$ $\mathrm { X } ^ { R } , \mathrm { X } ^ { I } = \mathrm { F F T } ( \mathrm { X } )$ for maximum information retention, where X, XR, $\mathbf { X } ^ { I } \in \bar { \mathbb { R } } ^ { N \times T }$ . Next, we apply the frequency patching operation to create fine-grained frequency bands (patches), which can be formalized as follows.
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\left\{\mathrm {P} ^ {R _ {1}}, \mathrm {P} ^ {R _ {2}}, \dots , \mathrm {P} ^ {R _ {L}} \right\} = \operatorname {P a t c h i n g} \left(\mathrm {X} ^ {R}\right), \left\{\mathrm {P} ^ {I _ {1}}, \mathrm {P} ^ {I _ {2}}, \dots , \mathrm {P} ^ {I _ {L}} \right\} = \operatorname {P a t c h i n g} \left(\mathrm {X} ^ {I}\right), \tag {1}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
where $\mathrm { P } ^ { R _ { i } } , \mathrm { P } ^ { I _ { i } } \in \mathbb { R } ^ { N \times p }$ denote the $i$ -th patch of $\mathrm { X } ^ { R }$ and $\mathrm { X } ^ { I }$ . $L = [ T - p ] / s + 1$ is the total patch number, where $p$ is the patch size and $s$ is the patch stride.
|
| 88 |
+
|
| 89 |
+
We then concat each pair of $\mathrm { P } ^ { R _ { i } }$ and $\mathrm { P } ^ { I _ { i } }$ into $\mathrm { P } ^ { i } \in \mathbb { R } ^ { N \times { 2 p } }$ , as the $i$ -th frequency patch. After patching in the frequency domain, the frequency patches are then projected into the high-dimensional hidden space through the Projection Layer: $\bar { \mathrm { P } ^ { \prime } } ^ { i } = \mathrm { P r o j e c t i o n } ( \bar { \mathrm { P } ^ { i } } )$ .
|
| 90 |
+
|
| 91 |
+
After the Forward Module, the processed time series is fed into the Channel Fusion Module (CFM) to dynamically model the channel correlations in each fine-grained frequency band.
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\left\{\tilde {\mathrm {P}} ^ {1}, \tilde {\mathrm {P}} ^ {2}, \dots , \tilde {\mathrm {P}} ^ {L} \right\} = \operatorname {C F M} \left(\left\{\mathrm {P} ^ {\prime 1}, \mathrm {P} ^ {\prime 2}, \dots , \mathrm {P} ^ {\prime L} \right\}\right), \tag {2}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
where $\mathrm { P } ^ { \prime } { } ^ { i } , \tilde { \mathrm { P } } ^ { i } \in \mathbb { R } ^ { N \times d }$ , $N$ is the number of channels and $d$ is the hidden dimension in attention blocks. The CFM parallels in a patch-wise way to model the frequency patches simultaneously. We further introduce the details of CFM in Section 3.2.
|
| 98 |
+
|
| 99 |
+
Next, we utilize the Time-Frequency Reconstruction Module (TFRM) to reconstruct all frequency spectrums for real and imaginary patches and simultaneously obtain their temporal reconstruction:
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\mathrm {X} ^ {\prime}, \mathrm {X} ^ {\prime R}, \mathrm {X} ^ {\prime I} = \mathrm {T F R M} \left(\left\{\tilde {\mathrm {P}} ^ {R _ {1}}, \tilde {\mathrm {P}} ^ {R _ {2}}, \dots , \tilde {\mathrm {P}} ^ {R _ {L}} \right\}, \left\{\tilde {\mathrm {P}} ^ {I _ {1}}, \tilde {\mathrm {P}} ^ {I _ {2}}, \dots , \tilde {\mathrm {P}} ^ {I _ {L}} \right\}\right), \tag {3}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\mathrm { X } ^ { \prime }$ is the temporal reconstruction, and $\mathrm { X ^ { \prime } } ^ { R } , \mathrm { X ^ { \prime } } ^ { I } \in \mathbb { R } ^ { N \times T }$ are the frequency reconstruction. Finally, we integrate the reconstruction error in both time and frequency domains as anomaly score.
|
| 106 |
+
|
| 107 |
+
# 3.2 CHANNEL FUSION MODULE
|
| 108 |
+
|
| 109 |
+
The Channel Fusion Module (CFM) contains the following three components: 1) the Mask Generator (MG), 2) the Channel-Masked Transformer Layer (CMT), and 3) the Channel Correlation Discovering (CCD) mechanism. Specifically, the MG is to perceive and generate the mask matrices (channel correlations) in different frequency bands and guide the masked attention in CMT. The CMT aims to model the appropriate patch-wise channel correlations. And the CCD is to guide the MG and CMT to explore better channel correlations during optimization.
|
| 110 |
+
|
| 111 |
+
Mask Generator. Inspired by Selective State Space Models such as Mamba (Dao & Gu, 2024), which utilizes Linear projections to flexibly update the hidden states based on the current data for larger capacity, the patch-wise channel associations can also be treated as a changing hidden state strongly associated with the current patch. Therefore, we devise a Linear-based mask generator to perceive the suitable channel associations for each frequency band by generating binary mask matrices to isolate the adverse effects from irrelevant channels. Note that the binary mask is an intermediate state between CI (identity matrix) and CD (all-ones matrix) strategies. We take the $i$ -th frequency patch as an example:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
\mathcal {D} ^ {i} = \sigma \left(\operatorname {L i n e a r} \left(\mathrm {P} ^ {\prime i}\right)\right), \mathcal {M} ^ {i} = \operatorname {R e s a m p l e} \left(\mathcal {D} ^ {i}\right), \tag {4}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
where $\mathrm { P } ^ { \prime } { } ^ { i } \in \mathbb { R } ^ { N \times d }$ , $\mathcal { D } ^ { i } \in \mathbb { R } ^ { N \times N }$ , and $\mathcal { M } ^ { i } \in \mathbb { R } ^ { N \times N }$ are the hidden representation, the probability matrix, and the binary mask matrix of $i$ -th patch, respectively. $\sigma$ projects the values to probabilities.
|
| 118 |
+
|
| 119 |
+
Since our goal is to filter out the adverse effects of irrelevant channels, we further perform Bernoulli resampling on the probability matrices to obtain binary mask matrix $\mathcal { M } ^ { i }$ with the same shape. Higher probability Dil,m r $\mathcal { \hat { D } } _ { l , m } ^ { i }$ esults in $\mathcal { M } _ { l , m } ^ { i }$ closer to 1, indicating a relationship between channel $l$ and channel $m$ . And we manually keep the diagonal items to 1. To ensure the propagation of gradients, we use the Gumbel Softmax reparameterization trick (Jang et al., 2017) during Bernoulli resampling.
|
| 120 |
+
|
| 121 |
+
Channel-Masked Transformer Layer. After the Mask Generator outputs the mask matrices for frequency bands, we utilize the transformer layer to further capture the fine-grained channel correlations. The Layer Normalization is applied before each attention block to mitigate the over-focusing
|
| 122 |
+
|
| 123 |
+
phenomenon on frequency components with larger amplitudes (Piao et al., 2024):
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\mathrm {P} ^ {* i} = \operatorname {L a y e r N o r m} \left(\mathrm {P} ^ {\prime i}\right) = \left(\mathrm {P} ^ {\prime i} - \operatorname {M e a n} _ {n = 1} ^ {N} \left(\mathrm {P} _ {n,:} ^ {\prime i}\right)\right) / \sqrt {\operatorname {V a r} _ {n = 1} ^ {N} \left(\mathrm {P} _ {n,:} ^ {\prime i}\right)}, \tag {5}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $\mathrm { P } ^ { \prime } { } ^ { i } \in \mathbb { R } ^ { N \times d }$ and $\mathrm { P } ^ { \ast i } \in \mathbb { R } ^ { N \times d }$ are the hidden representation and the normalized representation of $i$ -th patch, respectively. Empirically, we utilize the masked attention mechanism to further model the fine-grained interrelationships among relevant channels and integrate the mask matrix in a calculated way to keep the propagation of gradients:
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\mathrm {Q} ^ {i} = \mathrm {P} ^ {* i} \cdot \mathrm {W} ^ {Q}, \mathrm {K} ^ {i} = \mathrm {P} ^ {* i} \cdot \mathrm {W} ^ {K}, \mathrm {V} ^ {i} = \mathrm {P} ^ {* i} \cdot \mathrm {W} ^ {V}, \tag {6}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
$$
|
| 136 |
+
\mathcal {T} ^ {i} = \mathrm {Q} ^ {i} \cdot \left(\mathrm {K} ^ {\mathrm {i}}\right) ^ {T}, \mathcal {S} ^ {i} = \mathcal {T} ^ {i} \odot \mathcal {M} ^ {i} + \left(1 - \mathcal {M} ^ {i}\right) \odot (- \infty), \tag {7}
|
| 137 |
+
$$
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\text {M a s k e d S c o r e s} ^ {i} = \mathcal {S} ^ {i} / \sqrt {d}, \tilde {\mathrm {P}} ^ {i} = \text {S o f t m a x} \left(\text {M a s k e d S c o r e s} ^ {i}\right) \cdot \mathrm {V} ^ {i}, \tag {8}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
where WQ, WK, $\mathrm { W } ^ { V } \in \mathbb { R } ^ { d \times d }$ . $\mathcal { M } ^ { i } \in \mathbb { R } ^ { N \times N }$ , $\mathcal { T } ^ { i } \in \mathbb { R } ^ { N \times N }$ , $S ^ { i } \in \mathbb { R } ^ { N \times N }$ , and $\tilde { \mathrm { P } } ^ { i } \in \mathbb { R } ^ { N \times d }$ are the binary mask matrix, the attention matrix, the masked attention matrix, and the hidden representation processed by CMT of $i$ -th patch, respectively.
|
| 144 |
+
|
| 145 |
+
We utilize the same Feed-Forward networks and skip connections as the classical transformers (Vaswani et al., 2017). We also apply multi-head mechanism to jointly attend to information from different representational subspaces and the CMT can be stacked multiple times.
|
| 146 |
+
|
| 147 |
+
Channel Correlation Discovering. From an optimization perspective, it is essential to design appropriate optimization objectives to enhance the effectiveness of generated masks. A direct motivation is to explicitly enhance the attention scores between relevant channels defined by the mask, thus aligning the attention mechanism with the currently discovered optimal channel correlation, which helps isloate the adverse effects from irrelevant channels and provides robustness for the attention mechanism. Then we iteratively optimize the Mask Generator to refine the channel correlations, tuning the capacity of attention mechanism in the Channel-Masked Transformer Layer to fully capture the interrelationships between channels. Intuitively, we devise two loss functions to guide the Mask Generator exploring the space of channel correlations (from CI to CD). The proposed loss functions are formalized as:
|
| 148 |
+
|
| 149 |
+
$$
|
| 150 |
+
\text {C l u s t e r i n g L o s s} = - \frac {1}{N} \sum_ {k = 1} ^ {N} \log \left(\frac {\sum_ {m = 1} ^ {N} \exp \left(\mathcal {S} _ {k , m} ^ {i}\right) / \tau}{\sum_ {l = 1} ^ {N} \exp \left(\mathcal {T} _ {k , l} ^ {i}\right) / \tau}\right), \tag {10}
|
| 151 |
+
$$
|
| 152 |
+
|
| 153 |
+
where $\tau$ is the temperature coefficient, $N$ is the number of channels, I is the identity matrix, and $| | \cdot | | _ { F }$ is the Frobenius norm. $\mathcal { T } ^ { i } \in \mathbb { R } ^ { N \times N }$ , $S ^ { i } \in \mathbb { R } ^ { N \times N }$ , and $\mathcal { M } ^ { i } \in \mathbb { R } ^ { N \times N }$ are the attention matrix, the masked attention matrix, and the binary mask matrix for $i$ -th patch, respectively.
|
| 154 |
+
|
| 155 |
+
The ClusteringLoss is similar to the InfoNCE (He et al., 2020) in form but does not fix the number of “positive” pairs. In contrast, it changes its “positive” pairs for different patches based on the current discovered channel correlation $\bar { \mathcal { M } } ^ { i }$ . Theoretically, the similarities between “positive” or “negative” pairs are also calculated through inner product, so we share the calculating results of $S ^ { i }$ and $\overline { { \mathcal { T } } } ^ { i }$ from the attention mechanism to save the computational cost. As shown in Figure 2, we exhibit the “positive” and “negative” pairs in the attention matrix $\tau$ and masked attention matrix $s$ . Specifically, it sets the Query and Key views of relevant channels in a frequency band $( \mathcal { M } _ { l , m } ^ { i } = 1 )$ ) as the “positive” pairs, otherwise $\mathcal { M } _ { l , m } ^ { i } = 0 )$ “negative” pairs, thus encouraging the $\mathrm { W } ^ { Q }$ and $\mathrm { W } ^ { K }$ to cluster the patch-wise relevant channels in the hidden spaces and lead to higher attention scores. However, only a single ClusteringLoss may cause some adverse effects by urging the Mask Generator to output constant ones matrix, so that we add a RegularLoss to mitigate this risk by restricting the number of relevant channels. Equipped with the two optimization objectives, the Mask Generator is encouraged to discover appropriate patch-wise channel correlations between CI and CD, and the attention mechanism is also enchanced by optimizing the $\mathrm { W } ^ { Q }$ and $\mathrm { W } ^ { K }$ to learn fine-grained channel representations in the hidden spaces.
|
| 156 |
+
|
| 157 |
+
# 3.3 TIME FREQUENCY RECONSTRUCTION MODULE
|
| 158 |
+
|
| 159 |
+
The Time-Frequency Reconstruction Module (TFRM) contains the following two components: 1) the Flatten & Linear Head Layer and 2) the iFFT Layer. Specifically, after the CFM fully extract
|
| 160 |
+
|
| 161 |
+
the fine-grained channel correlations, we utilize the TFRM to flatten the patch-wise representations and reconstruct all frequency spectrums with MLP projections separately for real and imaginary patches, and obtain temporal reconstruction through iFFT:
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
\mathrm {X} ^ {\prime R} = \operatorname {P r o j e c t i o n} _ {R} \left(\text {F l a t t e n H e a d} \left(\left\{\tilde {\mathrm {P}} ^ {R _ {1}}, \tilde {\mathrm {P}} ^ {R _ {2}}, \dots , \tilde {\mathrm {P}} ^ {R _ {L}} \right\}\right)\right), \tag {11}
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
$$
|
| 168 |
+
\mathrm {X} ^ {\prime I} = \operatorname {P r o j e c t i o n} _ {I} \left(\text {F l a t t e n H e a d} \left(\left\{\tilde {\mathrm {P}} ^ {I _ {1}}, \tilde {\mathrm {P}} ^ {I _ {2}}, \dots , \tilde {\mathrm {P}} ^ {I _ {L}} \right\}\right)\right), \tag {12}
|
| 169 |
+
$$
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
\mathrm {X} ^ {\prime} = \mathrm {i F F T} \left(\mathrm {X} ^ {\prime R}, \mathrm {X} ^ {\prime I}\right), \tag {13}
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where ${ \mathrm { X } } ^ { \prime } { } ^ { R }$ , $\mathrm { X } ^ { \prime ^ { I } }$ , and $\mathbf { X ^ { \prime } } \in \mathbb { R } ^ { N \times T }$ . We then adopt the reconstruction loss functions both in time and frequency domains to separately enhance the ability of point-to-point and subsequence modeling. The reconstruction functions in time and frequency domains are formalized as:
|
| 176 |
+
|
| 177 |
+
$$
|
| 178 |
+
\operatorname {R e c L o s s} ^ {\text {t i m e}} = \left\| \mathrm {X} - \mathrm {X} ^ {\prime} \right\| _ {F} ^ {2} \quad (1 4) \quad \operatorname {R e c L o s s} ^ {\text {f r e q}} = \left\| \mathrm {X} ^ {R} - \mathrm {X} ^ {\prime R} \right\| _ {1} + \left\| \mathrm {X} ^ {I} - \mathrm {X} ^ {\prime I} \right\| _ {1} \tag {15}
|
| 179 |
+
$$
|
| 180 |
+
|
| 181 |
+
We utilize 2-norm in the time domain and 1-norm in the frequency domain due to the distinct numerical characteristics of time and frequency domains (Wang et al., 2024d).
|
| 182 |
+
|
| 183 |
+
# 3.4 JOINT BI-LEVEL OPTIMIZATION
|
| 184 |
+
|
| 185 |
+
We then design a novel joint bi-level training process to enhance the model’s ability to detect both point anomalies and subsequence anomalies. Our TotalLoss $\mathcal { L }$ mainly consists of reconstruction loss functions in the time (RecLosstime) and frequency (RecLossf req) domains, ClusteringLoss and RegularLoss from the Channel Correlation Discovering mechanism. The reconstruction loss functions are used to enhance model’s ability in both time and frequency domains to detect point and subsequence anomlies. The ClusteringLoss and RegularLoss are used to guide the discovering for fine-grained channel correlations. Specifically, we weightsum these four optimization objectives:
|
| 186 |
+
|
| 187 |
+
$$
|
| 188 |
+
\mathcal {L} = \operatorname {R e c L o s s} ^ {\text {t i m e}} + \lambda_ {1} \cdot \operatorname {R e c L o s s} ^ {\text {f r e q}} + \lambda_ {2} \cdot \text {C l u s t e r i n g L o s s} + \lambda_ {3} \cdot \text {R e g u l a r L o s s}, \tag {16}
|
| 189 |
+
$$
|
| 190 |
+
|
| 191 |
+
where $\lambda _ { 1 } , \lambda _ { 2 }$ , and $\lambda _ { 3 }$ are empircal coefficients. We then utilize a bi-level optimization Algorithm 1 to iteratively update the Mask Generator and other model parameters. Intuitively, the process optimizes model parameters for current channel correlations and then discovers better channel correlations for the optimized model parameters, which facilitates the refinement of channel correlations in a continuous way.
|
| 192 |
+
|
| 193 |
+
# 3.5 ANOMALY SCORING
|
| 194 |
+
|
| 195 |
+
When calculating the anomaly score, the ner by assigning an anomaly score for point anomlies in the time domain.
|
| 196 |
+
|
| 197 |
+
existing methods often consider coarse-grained window-granularity scoring, which adds a frequency anomaly score to each point in the whole input window (Ren et al., 2019; Park et al., 2021; Zhang et al., 2022). However, they fail to know the actual boundaries of subsequence anomalies, thus causing misjudgment or omission. During scoring, we perform the patching operation in the input window with the stride length equal to 1. In Figure 3, the shadow in the Time Series indicates a series of subsequence anomalies. Take the calculation of the
|
| 198 |
+
|
| 199 |
+
convention is to obey the point-to-point maneach timestamp, thus mainly reflecting the To better quantify subsequence anomalies,
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 3: Anomaly Scoring.
|
| 203 |
+
|
| 204 |
+
anomaly score for the red time point in the Time Series as an example, we first calculate the time domain reconstruction error (RecLosstime) between its reconstructed value in the time domain and the true value using Equation 14, and denote the result as the time domain anomaly score (time-score). At the same time, we collect all patches containing the red time point, transform these patches into the frequency domain, and compute the frequency reconstruction error (RecLossf req) between the reconstructed value and the true frequency-domain value using Equation 15. The average frequency reconstruction error of all patches is then taken as the frequency domain anomaly score (freq-score)
|
| 205 |
+
|
| 206 |
+
for this red time point, as the average performs better than the minimum or maximum value (Schmidl et al., 2022). Finally, we weightsum the time-score and freq-score point-to-point to obtain the final anomaly score for the Time Series.
|
| 207 |
+
|
| 208 |
+
$$
|
| 209 |
+
\text {A n o m a l y S c o r e} = \text {t i m e - s c o r e} + \lambda_ {\text {s c o r e}} \cdot \text {f r e q - s c o r e} \tag {17}
|
| 210 |
+
$$
|
| 211 |
+
|
| 212 |
+
For ease of understanding, we provide an efficient implementation version of the calculation of freqscore in Appendix A.6. Obviously, our method can reflect the real surroundings of each point by considering all possible subsequence anomalies around this point, thus achieving the point-granularity alignment and showing strong sensitivity (Nam et al., 2024).
|
| 213 |
+
|
| 214 |
+
# 4 EXPERIMENTS
|
| 215 |
+
|
| 216 |
+
Datasets We conduct experiments using 12 real-world datasets and 12 synthetic datasets (TODS datasets) to assess the performance of CATCH, more details of the benchmark datasets are included in Appendix A.1. The synthetic datasets are generated using the method reported in (Lai et al., 2021). Please refer to Appendix A.7 for specific implementation. We report the results on 12 real-world MTSAD datasets, including MSL, SMAP, PSM, SMD, SWAT, CICIDS, CalIt2, NYC, Creditcard, GECCO, Genesis, and ASD in the main text. We also report the mean results of the 6 types of synthetic anomalies. The complete results can be found in the Appendix C.
|
| 217 |
+
|
| 218 |
+
Baselines We comprehensively compare our model against 15 baselines, including the latest stateof-the-art (SOTA) models. These baselines feature the 2024 SOTA iTransformer (iTrans) (Liu et al., 2024c), ModernTCN (Modern) (Luo & Wang, 2024), and DualTF (Nam et al., 2024), along with the 2023 SOTA Anomaly Transformer (ATrans) (Xu et al., 2021), DCdetector (DC) (Yang et al., 2023b), TimesNet (TsNet) (Wu et al., 2023), PatchTST (Patch) (Nie et al., 2023), DLinear (DLin) (Zeng et al., 2023), NLinear (NLin) (Zeng et al., 2023), TFAD (Zhang et al., 2022), and AutoEncoder (AE) (Sakurada & Yairi, 2014). Additionally, we include non-learning methods such as One-Class SVM (OCSVM)(Schölkopf et al., 1999), Isolation Forest (IF)(Liu et al., 2008), Principal Component Analysis (PCA) (Shyu et al., 2003), and HBOS (Goldstein & Dengel, 2012).
|
| 219 |
+
|
| 220 |
+
Setup To keep consistent with previous works, we adopt Label-based metric: Affiliated-F1- score $( A f f - F )$ (Huet et al., 2022) and Score-based metric: Area under the Receiver Operating Characteristics Curve (ROC ) (Fawcett, 2006) as evaluation metrics. We report the algorithm performance under a total of 16 evaluation metrics in the Appendix C, and the details of the 16 metrics can be found in Appendix A.2. More implementation details are presented in the Appendix A.3.
|
| 221 |
+
|
| 222 |
+
# 4.1 MAIN RESULTS
|
| 223 |
+
|
| 224 |
+
We first evaluate CATCH with 15 competitive baselines on 12 real-world multivariate and 6 types of synthetic multivariate datasets generated by the methods reported in TODS (Lai et al., 2021) as shown in Table 2. It can be seen that our proposed CATCH achieves SOTA results under the widely used Affiliated-F1-score metric in most benchmark datasets. Besides, CATCH has the highest AUC-ROC values on most datasets. It means that our model performs well in the false-positive and true-positive rates under various pre-selected thresholds, which is important for real-world applications. Since the continuous abnormal segments in SWAT exceed the look-back window supported by the reconstruction model, CATCH cannot effectively capture this kind of abnormality. In summary, CATCH effectively handles both point (Contextual, Global) and subsequence (Seasonal, Shapelet, Trend, Mixture) anomalies while showing greater improvement in detecting the subsequence anomalies.
|
| 225 |
+
|
| 226 |
+
# 4.2 MODEL ANALYSIS
|
| 227 |
+
|
| 228 |
+
Ablation study To ascertain the impact of different modules within CATCH, we perform ablation studies focusing on the following components: (1) Substitute the channel correlation discovering mechanism with fixed Channel Strategies. (2) Delete one of the four optimization objectives separately. (3) Remove the patching operation during training process. (4) Replace the Scoring technique with others. (5) Replace the bi-level optimization process with a normal process to optimize the Mask Generator and model simultaneously.
|
| 229 |
+
|
| 230 |
+
Table 2: Average A-R (AUC-ROC) and Aff-F (Affiliated-F1) accuracy measures for 12 real-world datasets and 6 synthetic datasets of different types of anomalies. The best results are highlighted in bold, and the second-best results are underlined.
|
| 231 |
+
|
| 232 |
+
<table><tr><td>Dataset</td><td>Metric</td><td>CATCH</td><td>Modem</td><td>iTrans</td><td>DualTF</td><td>ATrans</td><td>DC</td><td>TsNet</td><td>Patch</td><td>DLin</td><td>NLin</td><td>AE</td><td>Ocsvm</td><td>IF</td><td>PCA</td><td>HBOS</td><td>TFAD</td></tr><tr><td rowspan="2">CICIDS</td><td>Aff-F</td><td>0.787</td><td>0.654</td><td>0.708</td><td>0.692</td><td>0.560</td><td>0.664</td><td>0.657</td><td>0.660</td><td>0.669</td><td>0.669</td><td>0.243</td><td>0.693</td><td>0.604</td><td>0.619</td><td>0.542</td><td>0.579</td></tr><tr><td>A-R</td><td>0.795</td><td>0.697</td><td>0.692</td><td>0.603</td><td>0.528</td><td>0.638</td><td>0.732</td><td>0.716</td><td>0.751</td><td>0.691</td><td>0.629</td><td>0.537</td><td>0.787</td><td>0.601</td><td>0.760</td><td>0.504</td></tr><tr><td rowspan="2">Callt2</td><td>Aff-F</td><td>0.835</td><td>0.780</td><td>0.812</td><td>0.751</td><td>0.729</td><td>0.697</td><td>0.794</td><td>0.793</td><td>0.793</td><td>0.757</td><td>0.587</td><td>0.783</td><td>0.402</td><td>0.768</td><td>0.756</td><td>0.744</td></tr><tr><td>A-R</td><td>0.838</td><td>0.676</td><td>0.791</td><td>0.574</td><td>0.533</td><td>0.527</td><td>0.771</td><td>0.808</td><td>0.752</td><td>0.695</td><td>0.767</td><td>0.804</td><td>0.775</td><td>0.790</td><td>0.798</td><td>0.504</td></tr><tr><td rowspan="2">SWAT</td><td>Aff-F</td><td>0.755</td><td>0.728</td><td>0.718</td><td>0.695</td><td>0.696</td><td>0.696</td><td>0.793</td><td>0.716</td><td>0.736</td><td>0.715</td><td>0.738</td><td>0.703</td><td>0.681</td><td>0.708</td><td>0.650</td><td>0.686</td></tr><tr><td>A-R</td><td>0.345</td><td>0.244</td><td>0.242</td><td>0.567</td><td>0.405</td><td>0.501</td><td>0.288</td><td>0.242</td><td>0.521</td><td>0.231</td><td>0.817</td><td>0.657</td><td>0.346</td><td>0.819</td><td>0.831</td><td>0.500</td></tr><tr><td rowspan="2">Credit</td><td>Aff-F</td><td>0.750</td><td>0.744</td><td>0.713</td><td>0.663</td><td>0.650</td><td>0.632</td><td>0.744</td><td>0.746</td><td>0.738</td><td>0.742</td><td>0.561</td><td>0.714</td><td>0.634</td><td>0.710</td><td>0.695</td><td>0.600</td></tr><tr><td>A-R</td><td>0.958</td><td>0.957</td><td>0.934</td><td>0.703</td><td>0.552</td><td>0.504</td><td>0.957</td><td>0.957</td><td>0.954</td><td>0.948</td><td>0.909</td><td>0.953</td><td>0.860</td><td>0.871</td><td>0.951</td><td>0.500</td></tr><tr><td rowspan="2">GECCO</td><td>Aff-F</td><td>0.908</td><td>0.893</td><td>0.839</td><td>0.701</td><td>0.782</td><td>0.687</td><td>0.894</td><td>0.906</td><td>0.893</td><td>0.882</td><td>0.823</td><td>0.666</td><td>0.424</td><td>0.785</td><td>0.708</td><td>0.627</td></tr><tr><td>A-R</td><td>0.970</td><td>0.952</td><td>0.795</td><td>0.714</td><td>0.516</td><td>0.555</td><td>0.954</td><td>0.949</td><td>0.947</td><td>0.936</td><td>0.769</td><td>0.804</td><td>0.619</td><td>0.711</td><td>0.557</td><td>0.499</td></tr><tr><td rowspan="2">Genesis</td><td>Aff-F</td><td>0.896</td><td>0.833</td><td>0.891</td><td>0.810</td><td>0.856</td><td>0.776</td><td>0.864</td><td>0.856</td><td>0.856</td><td>0.829</td><td>0.854</td><td>0.677</td><td>0.788</td><td>0.814</td><td>0.721</td><td>0.535</td></tr><tr><td>A-R</td><td>0.974</td><td>0.676</td><td>0.690</td><td>0.937</td><td>0.947</td><td>0.659</td><td>0.913</td><td>0.685</td><td>0.696</td><td>0.755</td><td>0.931</td><td>0.733</td><td>0.549</td><td>0.815</td><td>0.897</td><td>0.497</td></tr><tr><td rowspan="2">MSL</td><td>Aff-F</td><td>0.740</td><td>0.726</td><td>0.710</td><td>0.588</td><td>0.692</td><td>0.694</td><td>0.734</td><td>0.724</td><td>0.725</td><td>0.723</td><td>0.625</td><td>0.641</td><td>0.584</td><td>0.678</td><td>0.680</td><td>0.665</td></tr><tr><td>A-R</td><td>0.664</td><td>0.633</td><td>0.611</td><td>0.576</td><td>0.508</td><td>0.507</td><td>0.613</td><td>0.637</td><td>0.624</td><td>0.592</td><td>0.562</td><td>0.524</td><td>0.524</td><td>0.552</td><td>0.574</td><td>0.500</td></tr><tr><td rowspan="2">NYC</td><td>Aff-F</td><td>0.994</td><td>0.769</td><td>0.684</td><td>0.708</td><td>0.853</td><td>0.862</td><td>0.794</td><td>0.776</td><td>0.828</td><td>0.819</td><td>0.689</td><td>0.667</td><td>0.648</td><td>0.680</td><td>0.675</td><td>0.689</td></tr><tr><td>A-R</td><td>0.816</td><td>0.466</td><td>0.640</td><td>0.633</td><td>0.671</td><td>0.549</td><td>0.791</td><td>0.709</td><td>0.768</td><td>0.671</td><td>0.504</td><td>0.456</td><td>0.475</td><td>0.666</td><td>0.446</td><td>0.502</td></tr><tr><td rowspan="2">PSM</td><td>Aff-F</td><td>0.859</td><td>0.825</td><td>0.854</td><td>0.725</td><td>0.710</td><td>0.682</td><td>0.842</td><td>0.831</td><td>0.831</td><td>0.843</td><td>0.707</td><td>0.531</td><td>0.620</td><td>0.702</td><td>0.658</td><td>0.628</td></tr><tr><td>A-R</td><td>0.652</td><td>0.593</td><td>0.592</td><td>0.600</td><td>0.514</td><td>0.501</td><td>0.592</td><td>0.586</td><td>0.580</td><td>0.585</td><td>0.650</td><td>0.619</td><td>0.542</td><td>0.648</td><td>0.620</td><td>0.500</td></tr><tr><td rowspan="2">SMD</td><td>Aff-F</td><td>0.847</td><td>0.840</td><td>0.827</td><td>0.679</td><td>0.724</td><td>0.675</td><td>0.831</td><td>0.845</td><td>0.841</td><td>0.844</td><td>0.439</td><td>0.742</td><td>0.626</td><td>0.738</td><td>0.629</td><td>0.660</td></tr><tr><td>A-R</td><td>0.811</td><td>0.722</td><td>0.745</td><td>0.631</td><td>0.508</td><td>0.502</td><td>0.727</td><td>0.736</td><td>0.728</td><td>0.738</td><td>0.774</td><td>0.602</td><td>0.664</td><td>0.679</td><td>0.626</td><td>0.500</td></tr><tr><td rowspan="2">SMAP</td><td>Aff-F</td><td>0.699</td><td>0.635</td><td>0.587</td><td>0.674</td><td>0.703</td><td>0.701</td><td>0.638</td><td>0.606</td><td>0.616</td><td>0.601</td><td>0.463</td><td>0.503</td><td>0.512</td><td>0.505</td><td>0.509</td><td>0.675</td></tr><tr><td>A-R</td><td>0.504</td><td>0.455</td><td>0.409</td><td>0.478</td><td>0.511</td><td>0.522</td><td>0.453</td><td>0.448</td><td>0.397</td><td>0.434</td><td>0.522</td><td>0.393</td><td>0.487</td><td>0.396</td><td>0.585</td><td>0.500</td></tr><tr><td rowspan="2">ASD</td><td>Aff-F</td><td>0.804</td><td>0.782</td><td>0.780</td><td>0.605</td><td>0.674</td><td>0.702</td><td>0.800</td><td>0.777</td><td>0.782</td><td>0.766</td><td>0.731</td><td>0.617</td><td>0.781</td><td>0.656</td><td>0.669</td><td>0.630</td></tr><tr><td>A-R</td><td>0.824</td><td>0.692</td><td>0.759</td><td>0.579</td><td>0.506</td><td>0.520</td><td>0.805</td><td>0.760</td><td>0.739</td><td>0.690</td><td>0.704</td><td>0.588</td><td>0.618</td><td>0.656</td><td>0.603</td><td>0.502</td></tr><tr><td rowspan="2">Contextual</td><td>Aff-F</td><td>0.823</td><td>0.619</td><td>0.802</td><td>0.635</td><td>0.601</td><td>0.597</td><td>0.666</td><td>0.766</td><td>0.780</td><td>0.700</td><td>0.755</td><td>0.696</td><td>0.679</td><td>0.475</td><td>0.481</td><td>0.569</td></tr><tr><td>A-R</td><td>0.910</td><td>0.562</td><td>0.905</td><td>0.598</td><td>0.546</td><td>0.525</td><td>0.908</td><td>0.854</td><td>0.700</td><td>0.530</td><td>0.896</td><td>0.711</td><td>0.821</td><td>0.538</td><td>0.464</td><td>0.504</td></tr><tr><td rowspan="2">Global</td><td>Aff-F</td><td>0.949</td><td>0.748</td><td>0.922</td><td>0.649</td><td>0.656</td><td>0.567</td><td>0.910</td><td>0.940</td><td>0.928</td><td>0.808</td><td>0.919</td><td>0.849</td><td>0.912</td><td>0.704</td><td>0.528</td><td>0.566</td></tr><tr><td>A-R</td><td>0.997</td><td>0.873</td><td>0.976</td><td>0.595</td><td>0.564</td><td>0.514</td><td>0.989</td><td>0.992</td><td>0.979</td><td>0.675</td><td>0.996</td><td>0.996</td><td>0.938</td><td>0.758</td><td>0.608</td><td>0.500</td></tr><tr><td rowspan="2">Seasonal</td><td>Aff-F</td><td>0.997</td><td>0.681</td><td>0.992</td><td>0.776</td><td>0.788</td><td>0.859</td><td>0.992</td><td>0.989</td><td>0.993</td><td>0.951</td><td>0.927</td><td>0.805</td><td>0.938</td><td>0.637</td><td>0.673</td><td>0.686</td></tr><tr><td>A-R</td><td>0.998</td><td>0.512</td><td>0.946</td><td>0.701</td><td>0.584</td><td>0.644</td><td>0.958</td><td>0.922</td><td>0.823</td><td>0.623</td><td>0.949</td><td>0.829</td><td>0.918</td><td>0.437</td><td>0.516</td><td>0.502</td></tr><tr><td rowspan="2">Shapelet</td><td>Aff-F</td><td>0.985</td><td>0.675</td><td>0.961</td><td>0.699</td><td>0.699</td><td>0.737</td><td>0.941</td><td>0.933</td><td>0.961</td><td>0.759</td><td>0.871</td><td>0.771</td><td>0.887</td><td>0.683</td><td>0.640</td><td>0.684</td></tr><tr><td>A-R</td><td>0.970</td><td>0.522</td><td>0.864</td><td>0.573</td><td>0.519</td><td>0.597</td><td>0.877</td><td>0.818</td><td>0.684</td><td>0.563</td><td>0.865</td><td>0.655</td><td>0.748</td><td>0.517</td><td>0.337</td><td>0.503</td></tr><tr><td rowspan="2">Trend</td><td>Aff-F</td><td>0.916</td><td>0.734</td><td>0.901</td><td>0.677</td><td>0.584</td><td>0.765</td><td>0.897</td><td>0.888</td><td>0.721</td><td>0.830</td><td>0.699</td><td>0.691</td><td>0.914</td><td>0.693</td><td>0.669</td><td>0.642</td></tr><tr><td>A-R</td><td>0.892</td><td>0.612</td><td>0.847</td><td>0.524</td><td>0.500</td><td>0.569</td><td>0.858</td><td>0.835</td><td>0.671</td><td>0.642</td><td>0.482</td><td>0.471</td><td>0.878</td><td>0.484</td><td>0.468</td><td>0.502</td></tr><tr><td rowspan="2">Mixture</td><td>Aff-F</td><td>0.892</td><td>0.856</td><td>0.862</td><td>0.652</td><td>0.641</td><td>0.709</td><td>0.863</td><td>0.879</td><td>0.727</td><td>0.839</td><td>0.673</td><td>0.676</td><td>0.881</td><td>0.676</td><td>0.667</td><td>0.710</td></tr><tr><td>A-R</td><td>0.931</td><td>0.763</td><td>0.854</td><td>0.570</td><td>0.522</td><td>0.516</td><td>0.861</td><td>0.863</td><td>0.767</td><td>0.749</td><td>0.493</td><td>0.475</td><td>0.911</td><td>0.517</td><td>0.531</td><td>0.501</td></tr></table>
|
| 233 |
+
|
| 234 |
+
Table 3 illustrates the unique impact of each module. We have the following observations: 1) Compared to the Channel-Independent (CI) Strategy, considering the relationships between variables using Channel Dependent (CD) Strategy or random masking yields better results, with the random masking performing worse than the CD method. Ours outperforms the CD method, further demonstrating the effectiveness of the channel correlation discovering mechanism. 2) Removing any of the four optimization objectives leads to
|
| 235 |
+
|
| 236 |
+
a decline in model performance, with the most significant drop occurring when the frequency loss is removed. This fully demonstrates the rationality and effectiveness of the four optimization objectives. 3) When the patching operation is removed during training and replaced with a window-based approach to model the relationships between variables, the model performance significantly decreases. This indicates that the patching operation captures fine-grained frequency information, which is more conducive to anomaly detection. 4) When replacing the combination of pointgranularity temporal anomaly scores and patch-wise point-aligned frequency anomaly scores with the combination of point-granularity temporal anomaly scores and window-granularity frequency anomaly scores, or when using only one of them, the model performance decreases in both cases. This indicates our Scoring technique shows stronger sensitivity in detecting anomalies. 5) When using a normal optimization process, the model performance also decreases consistently, which provides empircal evdience for the bi-level optimization.
|
| 237 |
+
|
| 238 |
+
Parameter Sensitivity We also study the parameter sensitivity of the CATCH. Figure 4a shows the performance under different input window sizes. As discussed, a single point can not be taken as an instance in time series. Window segmentation is widely used in the analysis, and window size is a significant parameter. For our primary evaluation, the window size is usually set as 96 or 192. Besides, we adopt the score weight in section 3.5 to trade off the temporal score and the
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
(a) Window size
|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
(b) λscore
|
| 245 |
+
|
| 246 |
+

|
| 247 |
+
(c) Training patch size
|
| 248 |
+
|
| 249 |
+

|
| 250 |
+
(d) Testing patch size
|
| 251 |
+
Figure 4: Parameter sensitivity studies of main hyper-parameters in CATCH.
|
| 252 |
+
|
| 253 |
+
frequency score–see Figure 4b. We find that score weight is mostly stable and easy to tune in the range of 0.01 to 0.1. Figure 4c and Figure 4d present that our model is stable to the Traing patch size and Testing patch size respectively over extensive datasets. Note that a small patch size indicates a larger memory cost and a larger patch number. Especially, only considering the performance, its relationship to the patch size can be determined by the data pattern. For example, our model performs better when the traing patch size is 8 for MSL, the testing patch size is 32 for CICIDS.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 5: Visualization of dual-domain anomaly scores from CATCH for different categories of point and subsequence anomalies using the TODS dataset.
|
| 257 |
+
|
| 258 |
+
Anomaly criterion visualization We show how CATCH works by visualizing different anomalies in Figure 5. This figure showcases CATCH’s performance across five anomaly categories (Lai et al., 2021) on the TODS dataset, with temporal and frequency scores displayed in the second row, and the final anomaly scores in the third row. For point anomalies (first and second columns), the temporal scores exhibit sharp increases at the true anomaly locations, dominating the total scores. In contrast, for subsequence anomalies (third, fourth, and fifth columns), frequency scores remain elevated across the entire anomaly interval, show strong sensitivity to the actual boundaries of subsequence anomalies and compensate for the insensitivity of the temporal scores. Consequently, each domain contributes uniquely, allowing the final anomaly scores to accurately capture both point and subsequence anomalies.
|
| 259 |
+
|
| 260 |
+
# 5 CONCLUSION
|
| 261 |
+
|
| 262 |
+
In this paper, we propose a novel framework, CATCH, capable of simultaneously detecting both point and subsequence anomalies. To sum up, it patchifys the frequency domain for fine-grained insights into frequency bands, flexibly perceives and discovers appropriate channel correlations, optimizes the attention mechanism for both robustness and capacity with a bi-level optimization algorithm. These innovative mechanisms collectively empower CATCH to precisely detect both point and subsequence anomalies. Comprehensive experiments on real-world and synthetic datasets demonstrate that CATCH achieves state-of-the-art performance.
|
| 263 |
+
|
| 264 |
+
# ACKNOWLEDGEMENTS
|
| 265 |
+
|
| 266 |
+
This work was partially supported by National Natural Science Foundation of China (62472174, 62372179). Bin Yang is the corresponding author of the work.
|
| 267 |
+
|
| 268 |
+
# REFERENCES
|
| 269 |
+
|
| 270 |
+
Markus M Breunig, Hans-Peter Kriegel, Raymond T Ng, and Jörg Sander. LOF: identifying densitybased local outliers. In Proceedings of the 2000 ACM SIGMOD international conference on Management of data, pp. 93–104, 2000.
|
| 271 |
+
E Oran Brigham and RE Morrow. The fast fourier transform. IEEE spectrum, 4(12):63–70, 1967.
|
| 272 |
+
David Campos, Miao Zhang, Bin Yang, Tung Kieu, Chenjuan Guo, and Christian S. Jensen. LightTS: Lightweight time series classification with adaptive ensemble distillation. Proc. ACM Manag. Data, 1(2):171:1–171:27, 2023.
|
| 273 |
+
Peng Chen, Yingying Zhang, Yunyao Cheng, Yang Shu, Yihang Wang, Qingsong Wen, Bin Yang, and Chenjuan Guo. Pathformer: Multi-scale transformers with adaptive pathways for time series forecasting. In ICLR, 2024.
|
| 274 |
+
Tao Dai, Beiliang Wu, Peiyuan Liu, Naiqi Li, Jigang Bao, Yong Jiang, and Shu-Tao Xia. Periodicity decoupling framework for long-term series forecasting. In ICLR, 2024.
|
| 275 |
+
Tri Dao and Albert Gu. Transformers are ssms: Generalized models and efficient algorithms through structured state space duality. arXiv preprint arXiv:2405.21060, 2024.
|
| 276 |
+
Jesse Davis and Mark Goadrich. The relationship between precision-recall and roc curves. In Proceedings of the international conference on machine learning, pp. 233–240, 2006.
|
| 277 |
+
Ailin Deng and Bryan Hooi. Graph neural network-based anomaly detection in multivariate time series. In Proceedings of the AAAI conference on artificial intelligence, volume 35, pp. 4027– 4035, 2021.
|
| 278 |
+
Tom Fawcett. An introduction to roc analysis. Pattern recognition letters, 27(8):861–874, 2006.
|
| 279 |
+
Hongfan Gao, Wangmeng Shen, Xiangfei Qiu, Ronghui Xu, Jilin Hu, and Bin Yang. DiffImp: Efficient diffusion model for probabilistic time series imputation with bidirectional mamba backbone. arXiv preprint arXiv:2410.13338, 2024.
|
| 280 |
+
Markus Goldstein and Andreas Dengel. Histogram-based outlier score (hbos): A fast unsupervised anomaly detection algorithm. KI 2012 - German Conference on Artificial Intelligence: poster and demo track, 1:59–63, 2012.
|
| 281 |
+
Chenjuan Guo, Christian S. Jensen, and Bin Yang. Towards total traffic awareness. SIGMOD Record, 43(3):18–23, 2014.
|
| 282 |
+
Xiaojun Guo, Yifei Wang, Tianqi Du, and Yisen Wang. Contranorm: A contrastive learning perspective on oversmoothing and beyond. In The Eleventh International Conference on Learning Representations, 2023.
|
| 283 |
+
Lu Han, Han-Jia Ye, and De-Chuan Zhan. The capacity and robustness trade-off: Revisiting the channel independent strategy for multivariate time series forecasting. IEEE Trans. Knowl. Data Eng., 36(11):7129–7142, 2024.
|
| 284 |
+
Kaiming He, Haoqi Fan, Yuxin Wu, Saining Xie, and Ross Girshick. Momentum contrast for unsupervised visual representation learning. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 9729–9738, 2020.
|
| 285 |
+
Yangfan He, Sida Li, Kun Li, Jianhui Wang, Binxu Li, Tianyu Shi, Jun Yin, Miao Zhang, and Xueqian Wang. Enhancing low-cost video editing with lightweight adaptors and temporal-aware inversion. arXiv preprint arXiv:2501.04606, 2025a.
|
| 286 |
+
|
| 287 |
+
Yangfan He, Jianhui Wang, Kun Li, Yijin Wang, Li Sun, Jun Yin, Miao Zhang, and Xueqian Wang. Enhancing intent understanding for ambiguous prompts through human-machine co-adaptation. arXiv preprint arXiv:2501.15167, 2025b.
|
| 288 |
+
Shiyan Hu, Kai Zhao, Xiangfei Qiu, Yang Shu, Jilin Hu, Bin Yang, and Chenjuan Guo. MultiRC: Joint learning for time series anomaly prediction and detection with multi-scale reconstructive contrast. arXiv preprint arXiv:2410.15997, 2024.
|
| 289 |
+
Qihe Huang, Lei Shen, Ruixin Zhang, Shouhong Ding, Binwu Wang, Zhengyang Zhou, and Yang Wang. CrossGNN: Confronting noisy multivariate time series via cross interaction refinement. In NeurIPS, pp. 46885–46902, 2023.
|
| 290 |
+
Qihe Huang, Lei Shen, Ruixin Zhang, Jiahuan Cheng, Shouhong Ding, Zhengyang Zhou, and Yang Wang. HDMixer: Hierarchical dependency with extendable patch for multivariate time series forecasting. In AAAI, pp. 12608–12616, 2024.
|
| 291 |
+
Alexis Huet, Jose Manuel Navarro, and Dario Rossi. Local evaluation of time series anomaly detection algorithms. In Proceedings of the ACM SIGKDD international conference on knowledge discovery & data mining, pp. 635–645, 2022.
|
| 292 |
+
Eric Jang, Shixiang Gu, and Ben Poole. Categorical reparametrization with gumble-softmax. In International Conference on Learning Representations (ICLR 2017). OpenReview. net, 2017.
|
| 293 |
+
Tung Kieu, Bin Yang, and Christian S Jensen. Outlier detection for multidimensional time series using deep neural networks. In 2018 19th IEEE International Conference on Mobile Data Management (MDM), 2018.
|
| 294 |
+
Tung Kieu, Bin Yang, Chenjuan Guo, and Christian S Jensen. Outlier detection for time series with recurrent autoencoder ensembles. In Proceedings of the Twenty-Eighth International Joint Conference on Artificial Intelligence, 2019.
|
| 295 |
+
Kwei-Herng Lai, Daochen Zha, Junjie Xu, Yue Zhao, Guanchu Wang, and Xia Hu. Revisiting time series outlier detection: Definitions and benchmarks. In Proceedings of the conference on neural information processing systems datasets and benchmarks track (round 1), 2021.
|
| 296 |
+
Xing Li, Qiquan Shi, Gang Hu, Lei Chen, Hui Mao, Yiyuan Yang, Mingxuan Yuan, Jia Zeng, and Zhuo Cheng. Block access pattern discovery via compressed full tensor transformer. In Proceedings of the 30th ACM International Conference on Information & Knowledge Management, pp. 957–966, 2021.
|
| 297 |
+
Yijie Li, Hewei Wang, Zhenqi Li, Shaofan Wang, Soumyabrata Dev, and Guoyu Zuo. Daanet: Dual attention aggregating network for salient object detection. In 2023 IEEE International Conference on Robotics and Biomimetics (ROBIO), pp. 1–7, 2023.
|
| 298 |
+
Yijie Li, Hewei Wang, and Aggelos Katsaggelos. CPDR: Towards Highly-Efficient Salient Object Detection via Crossed Post-decoder Refinement. In 35th British Machine Vision Conference 2024, BMVC 2024, Glasgow, UK, November 25-28, 2024, 2024a.
|
| 299 |
+
Yijie Li, Hewei Wang, Jinfeng Xu, Zixiao Ma, Puzhen Wu, Shaofan Wang, and Soumyabrata Dev. CP2M: Clustered-Patch-Mixed Mosaic Augmentation for Aerial Image Segmentation. arXiv preprint arXiv:2501.15389, 2025a.
|
| 300 |
+
Yijie Li, Hewei Wang, Jinfeng Xu, Puzhen Wu, Yunzhong Xiao, Shaofan Wang, and Soumyabrata Dev. DDUNet: Dual Dynamic U-Net for Highly-Efficient Cloud Segmentation. arXiv preprint arXiv:2501.15385, 2025b.
|
| 301 |
+
Zhe Li, Xiangfei Qiu, Peng Chen, Yihang Wang, Hanyin Cheng, Yang Shu, Jilin Hu, Chenjuan Guo, Aoying Zhou, Qingsong Wen, et al. FoundTS: Comprehensive and unified benchmarking of foundation models for time series forecasting. arXiv preprint arXiv:2410.11802, 2024b.
|
| 302 |
+
Shengsheng Lin, Weiwei Lin, Wentai Wu, Haojun Chen, and Junjie Yang. SparseTSF: Modeling long-term time series forecasting with 1k parameters. In ICML, pp. 30211–30226, 2024.
|
| 303 |
+
|
| 304 |
+
Fei Tony Liu, Kai Ming Ting, and Zhi-Hua Zhou. Isolation forest. In Proceedings of the 2008 IEEE international conference on data mining, pp. 413–422, 2008.
|
| 305 |
+
Peiyuan Liu, Hang Guo, Tao Dai, Naiqi Li, Jigang Bao, Xudong Ren, Yong Jiang, and Shu-Tao Xia. CALF: Aligning llms for time series forecasting via cross-modal fine-tuning. arXiv preprint arXiv:2403.07300, 2024a.
|
| 306 |
+
Qinghua Liu and John Paparrizos. The elephant in the room: Towards a reliable time-series anomaly detection benchmark. In NeurIPS, 2024.
|
| 307 |
+
Qinghua Liu, Paul Boniol, Themis Palpanas, and John Paparrizos. Time-series anomaly detection: Overview and new trends. Proc. VLDB Endow., 17(12):4229–4232, 2024b.
|
| 308 |
+
Sicong Liu, Yang Shu, Chenjuan Guo, and Bin Yang. Learning generalizable skills from offline multi-task data for multi-agent cooperation. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=HR1ujVR0ig.
|
| 309 |
+
Yong Liu, Tengge Hu, Haoran Zhang, Haixu Wu, Shiyu Wang, Lintao Ma, and Mingsheng Long. itransformer: Inverted transformers are effective for time series forecasting. In The Twelfth International Conference on Learning Representations, 2024c.
|
| 310 |
+
Donghao Luo and Xue Wang. Moderntcn: A modern pure convolution structure for general time series analysis. In The Twelfth International Conference on Learning Representations, 2024.
|
| 311 |
+
Youngeun Nam, Susik Yoon, Yooju Shin, Minyoung Bae, Hwanjun Song, Jae-Gil Lee, and Byung Suk Lee. Breaking the time-frequency granularity discrepancy in time-series anomaly detection. In Proceedings of the ACM on Web Conference 2024, pp. 4204–4215, 2024.
|
| 312 |
+
Yuqi Nie, Nam H Nguyen, Phanwadee Sinthong, and Jayant Kalagnanam. A time series is worth 64 words: Long-term forecasting with transformers. In The Eleventh International Conference on Learning Representations, 2023.
|
| 313 |
+
John Paparrizos, Paul Boniol, Themis Palpanas, Ruey S Tsay, Aaron Elmore, and Michael J Franklin. Volume Under the Surface: A New Accuracy Evaluation Measure for Time-Series Anomaly Detection. Proceedings of the VLDB Endowment, 15(11):2774–2787, 2022a.
|
| 314 |
+
John Paparrizos, Yuhao Kang, Paul Boniol, Ruey S Tsay, Themis Palpanas, and Michael J Franklin. Tsb-uad: an end-to-end benchmark suite for univariate time-series anomaly detection. Proceedings of the VLDB Endowment, 15(8):1697–1711, 2022b.
|
| 315 |
+
Namuk Park and Songkuk Kim. How do vision transformers work? In 10th International Conference on Learning Representations, 2022.
|
| 316 |
+
Yong-chan Park, Jun-Gi Jang, and U Kang. Fast and accurate partial fourier transform for time series data. In Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery & Data Mining, pp. 1309–1318, 2021.
|
| 317 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, Alban Desmaison, Andreas Köpf, Edward Z. Yang, Zachary DeVito, Martin Raison, Alykhan Tejani, Sasank Chilamkurthy, Benoit Steiner, Lu Fang, Junjie Bai, and Soumith Chintala. Pytorch: An imperative style, highperformance deep learning library. In NeurIPS, pp. 8024–8035, 2019.
|
| 318 |
+
Xihao Piao, Zheng Chen, Taichi Murayama, Yasuko Matsubara, and Yasushi Sakurai. Fredformer: Frequency debiased transformer for time series forecasting. In Proceedings of the 30th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 2400–2410, 2024.
|
| 319 |
+
Xiangfei Qiu, Jilin Hu, Lekui Zhou, Xingjian Wu, Junyang Du, Buang Zhang, Chenjuan Guo, Aoying Zhou, Christian S. Jensen, Zhenli Sheng, and Bin Yang. TFB: Towards comprehensive and fair benchmarking of time series forecasting methods. Proc. VLDB Endow., 17(9):2363–2377, 2024.
|
| 320 |
+
|
| 321 |
+
Xiangfei Qiu, Hanyin Cheng, Xingjian Wu, Jilin Hu, and Chenjuan Guo. A comprehensive survey of deep learning for multivariate time series forecasting: A channel strategy perspective. arXiv preprint arXiv:2502.10721, 2025a.
|
| 322 |
+
Xiangfei Qiu, Xiuwen Li, Ruiyang Pang, Zhicheng Pan, Xingjian Wu, Liu Yang, Jilin Hu, Yang Shu, Xuesong Lu, Chengcheng Yang, Chenjuan Guo, Aoying Zhou, Christian S. Jensen, and Bin Yang. Easytime: Time series forecasting made easy. In ICDE, 2025b.
|
| 323 |
+
Xiangfei Qiu, Xingjian Wu, Yan Lin, Chenjuan Guo, Jilin Hu, and Bin Yang. DUET: Dual clustering enhanced multivariate time series forecasting. In SIGKDD, 2025c.
|
| 324 |
+
Sridhar Ramaswamy, Rajeev Rastogi, and Kyuseok Shim. Efficient algorithms for mining outliers from large data sets. In Proceedings of the 2000 ACM SIGMOD international conference on management of data, pp. 427–438, 2000.
|
| 325 |
+
Hansheng Ren, Bixiong Xu, Yujing Wang, Chao Yi, Congrui Huang, Xiaoyu Kou, Tony Xing, Mao Yang, Jie Tong, and Qi Zhang. Time-series anomaly detection service at microsoft. In Proceedings of the 25th ACM SIGKDD international conference on knowledge discovery & data mining, pp. 3009–3017, 2019.
|
| 326 |
+
Mayu Sakurada and Takehisa Yairi. Anomaly detection using autoencoders with nonlinear dimensionality reduction. In Proceedings of the MLSDA 2014 2nd workshop on machine learning for sensory data analysis, pp. 4–11, 2014.
|
| 327 |
+
Sebastian Schmidl, Phillip Wenig, and Thorsten Papenbrock. Anomaly detection in time series: a comprehensive evaluation. Proceedings of the VLDB Endowment, 15(9):1779–1797, 2022.
|
| 328 |
+
Bernhard Schölkopf, Robert C Williamson, Alex Smola, John Shawe-Taylor, and John Platt. Support vector method for novelty detection. Advances in neural information processing systems, 12, 1999.
|
| 329 |
+
Qichao Shentu, Beibu Li, Kai Zhao, Yang Shu, Zhongwen Rao, Lujia Pan, Bin Yang, and Chenjuan Guo. Towards a general time series anomaly detector with adaptive bottlenecks and dual adversarial decoders. arXiv preprint arXiv:2405.15273, 2024.
|
| 330 |
+
Mei-Ling Shyu, Shu-Ching Chen, Kanoksri Sarinnapakorn, and LiWu Chang. A novel anomaly detection scheme based on principal component classifier. In Proceedings of the IEEE foundations and new directions of data mining workshop, pp. 172–179, 2003.
|
| 331 |
+
Dongjin Song, Ning Xia, Wei Cheng, Haifeng Chen, and Dacheng Tao. Deep r-th root of rank supervised joint binary embedding for multivariate time series retrieval. In Proceedings of the 24th ACM SIGKDD International Conference on Knowledge Discovery & Data Mining, pp. 2229– 2238, 2018.
|
| 332 |
+
Yanru Sun, Zongxia Xie, Dongyue Chen, Emadeldeen Eldele, and Qinghua Hu. Hierarchical classification auxiliary network for time series forecasting. In AAAI, 2025.
|
| 333 |
+
Nesime Tatbul, Tae Jun Lee, Stan Zdonik, Mejbah Alam, and Justin Gottschlich. Precision and recall for time series. Advances in neural information processing systems, 31, 2018.
|
| 334 |
+
Jindong Tian, Yuxuan Liang, Ronghui Xu, Peng Chen, Chenjuan Guo, Aoying Zhou, Lujia Pan, Zhongwen Rao, and Bin Yang. Air quality prediction with physics-guided dual neural odes in open systems. ICLR, 2025.
|
| 335 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In NeurIPS, pp. 5998–6008, 2017.
|
| 336 |
+
Chengsen Wang, Zirui Zhuang, Qi Qi, Jingyu Wang, Xingyu Wang, Haifeng Sun, and Jianxin Liao. Drift doesn’t matter: Dynamic decomposition with diffusion reconstruction for unstable multivariate time series anomaly detection. In Thirty-seventh Conference on Neural Information Processing Systems, 2023.
|
| 337 |
+
|
| 338 |
+
Chengsen Wang, Qi Qi, Jingyu Wang, Haifeng Sun, Zirui Zhuang, Jinming Wu, and Jianxin Liao. Rethinking the power of timestamps for robust time series forecasting: A global-local fusion perspective. In NeurIPS, 2024a.
|
| 339 |
+
Hao Wang, Zhichao Chen, Zhaoran Liu, Haozhe Li, Degui Yang, Xinggao Liu, and Haoxuan Li. Entire space counterfactual learning for reliable content recommendations. IEEE Trans. Autom. Sci. Eng., pp. 1–12, 2024b.
|
| 340 |
+
Hao Wang, Zhichao Chen, Zhaoran Liu, Licheng Pan, Hu Xu, Yilin Liao, Haozhe Li, and Xinggao Liu. Spot-i: Similarity preserved optimal transport for industrial iot data imputation. IEEE Transactions on Industrial Informatics, 2024c.
|
| 341 |
+
Hao Wang, Licheng Pan, Zhichao Chen, Degui Yang, Sen Zhang, Yifei Yang, Xinggao Liu, Haoxuan Li, and Dacheng Tao. Fredf: Learning to forecast in frequency domain. arXiv preprint arXiv:2402.02399, 2024d.
|
| 342 |
+
Junqiao Wang, Zeng Zhang, Yangfan He, Yuyang Song, Tianyu Shi, Yuchen Li, Hengyuan Xu, Kunyu Wu, Guangwu Qian, Qiuwu Chen, et al. Enhancing code llms with reinforcement learning in code generation. arXiv preprint arXiv:2412.20367, 2024e.
|
| 343 |
+
Peihao Wang, Wenqing Zheng, Tianlong Chen, and Zhangyang Wang. Anti-oversmoothing in deep vision transformers via the fourier domain analysis: From theory to practice. In International Conference on Learning Representations, 2022.
|
| 344 |
+
Yihang Wang, Yuying Qiu, Peng Chen, Kai Zhao, Yang Shu, Zhongwen Rao, Lujia Pan, Bin Yang, and Chenjuan Guo. ROSE: Register assisted general time series forecasting with decomposed frequency learning. arXiv preprint arXiv:2405.17478, 2024f.
|
| 345 |
+
Yuanyi Wang, Haifeng Sun, Chengsen Wang, Mengde Zhu, Jingyu Wang, Wei Tang, Qi Qi, Zirui Zhuang, and Jianxin Liao. Interdependency matters: Graph alignment for multivariate time series anomaly detection. arXiv preprint arXiv:2410.08877, 2024g.
|
| 346 |
+
Qingsong Wen, Linxiao Yang, Tian Zhou, and Liang Sun. Robust time series analysis and applications: An industrial perspective. In Proceedings of the 28th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 4836–4837, 2022.
|
| 347 |
+
Haixu Wu, Tengge Hu, Yong Liu, Hang Zhou, Jianmin Wang, and Mingsheng Long. Timesnet: Temporal 2d-variation modeling for general time series analysis. In ICLR, 2023.
|
| 348 |
+
Wangyu Wu, Xianglin Qiu, Siqi Song, Xiaowei Huang, Fei Ma, and Jimin Xiao. Prompt categories cluster for weakly supervised semantic segmentation. arXiv preprint arXiv:2412.13823, 2024a.
|
| 349 |
+
Wangyu Wu, Tianhong Dai, Zhenhong Chen, Xiaowei Huang, Fei Ma, and Jimin Xiao. Generative prompt controlled diffusion for weakly supervised semantic segmentation. Neurocomputing, pp. 130103, 2025a.
|
| 350 |
+
Wangyu Wu, Siqi Song, Xianglin Qiu, Xiaowei Huang, Fei Ma, and Jimin Xiao. Image fusion for cross-domain sequential recommendation. In Companion Proceedings of the ACM Web Conference 2025, 2025b.
|
| 351 |
+
Xinle Wu, Xingjian Wu, Bin Yang, Lekui Zhou, Chenjuan Guo, Xiangfei Qiu, Jilin Hu, Zhenli Sheng, and Christian S. Jensen. AutoCTS $^ { + + }$ : zero-shot joint neural architecture and hyperparameter search for correlated time series forecasting. VLDB J., 33(5):1743–1770, 2024b.
|
| 352 |
+
Xinle Wu, Xingjian Wu, Dalin Zhang, Miao Zhang, Chenjuan Guo, Bin Yang, and Christian S Jensen. Fully automated correlated time series forecasting in minutes. arXiv preprint arXiv:2411.05833, 2024c.
|
| 353 |
+
Jiehui Xu, Haixu Wu, Jianmin Wang, and Mingsheng Long. Anomaly Transformer: Time series anomaly detection with association discrepancy. In International Conference on Learning Representations, 2021.
|
| 354 |
+
Sean Bin Yang, Chenjuan Guo, Jilin Hu, Jian Tang, and Bin Yang. Unsupervised path representation learning with curriculum negative sampling. In IJCAI, pp. 3286–3292, 2021.
|
| 355 |
+
|
| 356 |
+
Yiyuan Yang, Rongshang Li, Qiquan Shi, Xijun Li, Gang Hu, Xing Li, and Mingxuan Yuan. Sgdp: A stream-graph neural network based data prefetcher. In 2023 International Joint Conference on Neural Networks (IJCNN), pp. 1–8, 2023a.
|
| 357 |
+
Yiyuan Yang, Chaoli Zhang, Tian Zhou, Qingsong Wen, and Liang Sun. Dcdetector: Dual attention contrastive representation learning for time series anomaly detection. In Proceedings of the 29th ACM SIGKDD Conference on Knowledge Discovery and Data Mining, pp. 3033–3045, 2023b.
|
| 358 |
+
Yuanyuan Yao, Shenjia Dai, Yilin Li, Lu Chen, Dimeng Li, Yunjun Gao, and Tianyi Li. A demonstration of TENDS: time series management system based on model selection. Proc. VLDB Endow., 17(12):4357–4360, 2024a.
|
| 359 |
+
Yuanyuan Yao, Hailiang Jie, Lu Chen, Tianyi Li, Yunjun Gao, and Shiting Wen. Tsec: An efficient and effective framework for time series classification. In ICDE, pp. 1394–1406, 2024b.
|
| 360 |
+
Chin-Chia Michael Yeh, Yan Zhu, Liudmila Ulanova, Nurjahan Begum, Yifei Ding, Hoang Anh Dau, Diego Furtado Silva, Abdullah Mueen, and Eamonn Keogh. Matrix profile i: all pairs similarity joins for time series: a unifying view that includes motifs, discords and shapelets. In Proceedings of the 2016 IEEE international conference on data mining, pp. 1317–1322, 2016.
|
| 361 |
+
Qiang Yi, Yangfan He, Jianhui Wang, Xinyuan Song, Shiyao Qian, Miao Zhang, Li Sun, and Tianyu Shi. Score: Story coherence and retrieval enhancement for ai narratives. arXiv preprint arXiv:2503.23512, 2025.
|
| 362 |
+
Chengqing Yu, Fei Wang, Zezhi Shao, Tao Sun, Lin Wu, and Yongjun Xu. DSformer: A double sampling transformer for multivariate time series long-term prediction. In CIKM, pp. 3062–3072, 2023.
|
| 363 |
+
Xinlei Yu, Ahmed Elazab, Ruiquan Ge, Hui Jin, Xinchen Jiang, Gangyong Jia, Qing Wu, Qinglei Shi, and Changmiao Wang. Ich-scnet: Intracerebral hemorrhage segmentation and prognosis classification network using clip-guided sam mechanism. In 2024 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), pp. 2795–2800, 2024a.
|
| 364 |
+
Xinlei Yu, Xinyang Li, Ruiquan Ge, Shibin Wu, Ahmed Elazab, Jichao Zhu, Lingyan Zhang, Gangyong Jia, Taosheng Xu, Xiang Wan, et al. Ichpro: Intracerebral hemorrhage prognosis classification via joint-attention fusion-based 3d cross-modal network. In 2024 IEEE International Symposium on Biomedical Imaging (ISBI), pp. 1–5, 2024b.
|
| 365 |
+
Xinlei Yu, Ahmed Elazab, Ruiquan Ge, Jichao Zhu, Lingyan Zhang, Gangyong Jia, Qing Wu, Xiang Wan, Lihua Li, and Changmiao Wang. Ich-prnet: a cross-modal intracerebral haemorrhage prognostic prediction method using joint-attention interaction mechanism. Neural Networks, 184: 107096, 2025.
|
| 366 |
+
Ailing Zeng, Muxi Chen, Lei Zhang, and Qiang Xu. Are transformers effective for time series forecasting? In Proceedings of the AAAI conference on artificial intelligence, volume 37, pp. 11121–11128, 2023.
|
| 367 |
+
Chaoli Zhang, Tian Zhou, Qingsong Wen, and Liang Sun. Tfad: A decomposition time series anomaly detection architecture with time-frequency analysis. In Proceedings of the 31st ACM International Conference on Information & Knowledge Management, pp. 2497–2507, 2022.
|
| 368 |
+
Chuxu Zhang, Dongjin Song, Yuncong Chen, Xinyang Feng, Cristian Lumezanu, Wei Cheng, Jingchao Ni, Bo Zong, Haifeng Chen, and Nitesh V Chawla. A deep neural network for unsupervised anomaly detection and diagnosis in multivariate time series data. In Proceedings of the AAAI conference on artificial intelligence, volume 33, pp. 1409–1416, 2019.
|
| 369 |
+
Hang Zhao, Yujing Wang, Juanyong Duan, Congrui Huang, Defu Cao, Yunhai Tong, Bixiong Xu, Jing Bai, Jie Tong, and Qi Zhang. Multivariate time-series anomaly detection via graph attention network. In 2020 IEEE international conference on data mining (ICDM), pp. 841–850, 2020.
|
| 370 |
+
|
| 371 |
+
# A EXPERIMENTAL DETAILS
|
| 372 |
+
|
| 373 |
+
# A.1 DATASETS
|
| 374 |
+
|
| 375 |
+
Table 4: Statistics of multivariate datasets (AR: anomaly ratio).
|
| 376 |
+
|
| 377 |
+
<table><tr><td>Dataset</td><td>Domain</td><td>Dim</td><td>AR (%)</td><td>Avg Total Length</td><td>Avg Test Length</td><td>Description</td></tr><tr><td>MSL</td><td>Spacecraft</td><td>55</td><td>5.88</td><td>132,046</td><td>73,729</td><td>Spacecraft incident and anomaly data from the MSL Curiosity rover</td></tr><tr><td>SMAP</td><td>Spacecraft</td><td>25</td><td>9.72</td><td>562,800</td><td>427,617</td><td>Presents the soil samples and telemetry information used by the Mars rover</td></tr><tr><td>PSM</td><td>Server Machine</td><td>25</td><td>11.07</td><td>220,322</td><td>87,841</td><td>A dataset collected from multiple application server nodes at eBay</td></tr><tr><td>SMD</td><td>Server Machine</td><td>38</td><td>2.08</td><td>1,416,825</td><td>708,420</td><td>Telemetry dataset collected from 28 different server machines at a large Internet company</td></tr><tr><td>Creditcard</td><td>Finance</td><td>29</td><td>0.17</td><td>284,807</td><td>142,404</td><td>Credit card dataset includes a subset of online transactions that occurred over two days</td></tr><tr><td>GECCO</td><td>Water treatment</td><td>9</td><td>1.25</td><td>138,521</td><td>69,261</td><td>Water quality dataset published in the GECCO Industrial Challenge</td></tr><tr><td>SWAT</td><td>Water treatment</td><td>51</td><td>5.78</td><td>944,919</td><td>449,919</td><td>Obtained from 51 sensors of the critical infrastructure system under continuous operations</td></tr><tr><td>CICIDS</td><td>Web</td><td>72</td><td>1.28</td><td>170,231</td><td>85,116</td><td>Network traffic data from CICFlowMeter with 80+ features and attack labels</td></tr><tr><td>CallIt2</td><td>Visitors flowrate</td><td>2</td><td>4.09</td><td>5,040</td><td>2,520</td><td>Person flow dataset records the movement of people in and out of a building over 15 days</td></tr><tr><td>Genesis</td><td>Machinery</td><td>18</td><td>0.31</td><td>16,220</td><td>12,616</td><td>A sensor and control signals dataset collected from cyber-physical production systems</td></tr><tr><td>NYC</td><td>Transport</td><td>3</td><td>0.57</td><td>17,520</td><td>4,416</td><td>Transportation dataset provides information on taxi and ride-hailing trips in New York</td></tr><tr><td>ASD</td><td>Application Server</td><td>19</td><td>1.55</td><td>12,848</td><td>4,320</td><td>Application Server Dataset collected from a large Internet company</td></tr><tr><td>TODS</td><td>Synthetic</td><td>5</td><td>6.35</td><td>20,000</td><td>5,000</td><td>Including 6 anomaly types: global, contextual, shapelet, seasonal, trend, and mix anomalies</td></tr></table>
|
| 378 |
+
|
| 379 |
+
In order to comprehensively evaluate the performance of CATCH, we evaluate 12 real-world datasets and 12 synthetic datasets which cover 9 domains. The anomaly ratio vary from $0 . 1 7 \%$ to $1 1 . 0 7 \%$ , the range of feature dimensions varies from 3 to 72, and the sequence length varies from 5,040 to 1,416,825. This substantial diversity of the datasets enables comprehensive studies of MTSAD methods. Table 4 lists statistics of the 24 multivariate time series.
|
| 380 |
+
|
| 381 |
+
# A.2 METRICS
|
| 382 |
+
|
| 383 |
+
The metrics we support can be divided into two categories: Score-based and Label-based. Label-based metrics includes Accuracy $( A c c )$ , Precision $( P )$ , Recall $( R )$ , F1-score $( F \boldsymbol { 1 } )$ , Range-Precision $( R – P )$ , Range-Recall $( R – R )$ , Range-F1-score $( R – F )$ (Tatbul et al., 2018), Precision $@ \mathbf { k }$ , Affiliated-Precision $( A f f - P )$ , Affiliated-Recall $( A f f - R )$ , and Affiliated-F1-score $( A f f - F )$ (Huet et al., 2022). Score-based metrics includes the Area Under the Precision-Recall Curve (A-P) (Davis & Goadrich, 2006), the Area under the Receiver Operating Characteristics Curve (A-R) (Fawcett, 2006), the Range Area Under the Precision-Recall Curve (R-A-P), the Range Area under the Receiver Operating Characteristics Curve (R-A-R) (Paparrizos et al., 2022a), the Volume Under the Surface of Precision-Recall (V -PR), and the Volume Under the Surface of Receiver Operating Characteristic (V -ROC ) (Paparrizos et al., 2022a). As noted earlier, CATCH computes all metrics to provide a complete picture of each method. More implementation details are presented in the Appendix A.3.
|
| 384 |
+
|
| 385 |
+
# A.3 IMPLEMENTATION DETAILS
|
| 386 |
+
|
| 387 |
+
The “Drop Last” issue is reported by several researchers (Qiu et al., 2024; Li et al., 2024b; Qiu et al., 2025b). That is, in some previous works evaluating the model on test set with drop-last=True setting may cause additional errors related to test batch size. In our experiment, to ensure fair comparison in the future, we set the drop last to False for all baselines to avoid this issue.
|
| 388 |
+
|
| 389 |
+
All experiments are conducted using PyTorch (Paszke et al., 2019) in Python 3.8 and execute on an NVIDIA Tesla-A800 GPU. We employ the ADAM optimizer during training. Initially, the batch size is set to 32, with the option to reduce it by half (to a minimum of 8) in case of an Out-Of-Memory (OOM) situation. We do not use the “Drop Last” operation during testing. To ensure reproducibility and facilitate experimentation, datasets and code are available at: https://github.com/decisionintelligence/CATCH.
|
| 390 |
+
|
| 391 |
+
# A.4 MODEL HYPERPARAMETER SETTINGS
|
| 392 |
+
|
| 393 |
+
For each baseline method, we strictly follow the hyperparameter configurations recommended in their original papers. Additionally, we conduct hyperparameter searches on multiple sets and select the optimal configurations based on these evaluations to ensure a comprehensive and fair assessment of each method’s performance.
|
| 394 |
+
|
| 395 |
+
The hyperparameters for the baseline methods are set as follows:
|
| 396 |
+
|
| 397 |
+
• AutoEncoder: The architecture of Autoencoder is selected from (10, 3), (25, 10, 5), (50, 20, 10).
|
| 398 |
+
• One-Class SVM: The RBF kernel is used. The upper bound on the fraction of training errors is set to be 0.5.
|
| 399 |
+
• Isolaion Forest: The number of estimators is selected from 3, 5, 25, 50, 60, 70, 80, 90, 100, 110.
|
| 400 |
+
• Principal Component Analysis: The number of principal components is the smaller of the number of samples and the number of features.
|
| 401 |
+
• HBOS: The number of bins is selected from 3, 5, 10, 20, 30, 40, 50
|
| 402 |
+
• ModernTCN: The dimension of hidden states is 256. The FFN ratio is 2. Patch size is set as 16 and patch stride is set as 8.
|
| 403 |
+
• Anomaly Transformer, DualTF: The number of layers is selected form 1, 2, 3, the channel number of hidden states dmodel is 512, and the number of heads is 8. The loss function hyperparameter lambda for balancing two parts is set as 3.
|
| 404 |
+
• iTransformer, TimesNet, DCdetector, PatchTST: The number of blocks is selected form 1, 2, 3. The dmodel is selected form 8, 64, 128, 256, 512 and the number of heads is 8.
|
| 405 |
+
• DLinear, NLinear: The length of the reconstructed sequence is set to 100.
|
| 406 |
+
• TFAD: The number of layers in the TCN is selected from 5, 6, 7, 8, and the number of kernels is selected from 5, 7.
|
| 407 |
+
|
| 408 |
+
# A.5 BI-LEVEL GRADIENT DESCENT OPTIMIZATION
|
| 409 |
+
|
| 410 |
+
Algorithm 1 Bi-level Gradient Descent Optimization
|
| 411 |
+
1: Input: Model parameters $\theta_{\mathrm{model}}$ , $\theta_{\mathrm{mask}}$ , learning rate $\eta_{\mathrm{model}}$ , $\eta_{\mathrm{mask}}$ , number of iterations $\mathcal{N}_0$ , $\mathcal{N}_I$ , loss function $\mathcal{L} = \mathrm{RecLoss}^{time} + \lambda_1 \cdot \mathrm{RecLoss}^{freq} + \lambda_2 \cdot \mathrm{ClusteringLoss} + \lambda_3 \cdot \mathrm{RegularLoss}$ 2: Initialize: $\theta_{\mathrm{model}} \gets$ initial value, $\theta_{\mathrm{mask}} \gets$ initial value
|
| 412 |
+
3: For $i = 1$ to $\mathcal{N}_0$ 4: Outer Loop: Update the mask generator parameters
|
| 413 |
+
5: $\theta_{\mathrm{mask}} \gets \theta_{\mathrm{mask}} - \eta_{\mathrm{mask}} \cdot \nabla \theta_{\mathrm{mask}} \mathcal{L}(\theta_{\mathrm{model}}, \theta_{\mathrm{mask}})$ 6: For $j = 1$ to $\mathcal{N}_I$ 7: Inner Loop: Update the model parameters
|
| 414 |
+
8: $\theta_{\mathrm{model}} \gets \theta_{\mathrm{model}} - \eta_{\mathrm{model}} \cdot \nabla \theta_{\mathrm{model}} \mathcal{L}(\theta_{\mathrm{model}}, \theta_{\mathrm{mask}})$ 9: EndFor
|
| 415 |
+
10: EndFor
|
| 416 |
+
11: Output: Optimized parameters $\theta_{\mathrm{model}}$ , $\theta_{\mathrm{mask}}$
|
| 417 |
+
|
| 418 |
+
# A.6 IMPLEMENTATION DETAILS OF SCORING
|
| 419 |
+
|
| 420 |
+
We provide an efficient implementation of Frequency-Enhanced Point-Granularity Scoring in Section 3.5. We present the pseudo-code in Algorithm 2. Specifically, we adopt the scatter operation in Pytorch to efficiently parallel the collection of patches to which each point belongs.
|
| 421 |
+
|
| 422 |
+
Algorithm 2 Calculation of freq-score
|
| 423 |
+
from einops import rearrange
|
| 424 |
+
import torch
|
| 425 |
+
class frequency Criterion(torch(nnModule): def__init__(self, configs): super(frequency Criterion, self).__init__() # Define the frequency metric self(metric $=$ frequency_loss(configs, dim $= 1$ , keep_dim $\equiv$ True) self.batch_size $=$ configs.inference_batch_size self.batch_stride $=$ configs.inference_batch_stride self.win_size $=$ configs.seq_len self.batch_num $=$ int((self.win_size - self.batch_size) / self.batch_stride $+1$ ) self(padding_length $=$ self.win_size - (self.batch_size + (self.batch_num - 1) $\star$ self.batch_stride) def forward(self, outputs, batch_y): output_batch $=$ outputsunfold(dimension $= 1$ size $\equiv$ self.batch_size, step $\equiv$ self.batch_stride) b, n, c, p $=$ output_batch_shape output_batch $=$ rearrange(output_batch, $\mathrm{b\_n\_c\_p\_->\_(b\_n\_p\_c')}$ y_batch $=$ batch_yunfold(dimension $= 1$ size $\equiv$ self.batch_size, step $\equiv$ self.batch_stride) y_batch $=$ rearrange(y_batch, $\mathrm{b\_n\_c\_p\_->\_(b\_n\_p\_c')}$ main_part_loss $=$ self(metric(output_batch, y_batch) # Create the patches main_part_loss $=$ main_part_lossrepeat(1, self.batch_size, 1) main_part_loss $=$ rearrange(main_part_loss, $\mathrm{b\_n\_p\_c\_->\_b\_n\_p\_c'}$ , b=b) # Calculate the overlapped indices end_point $=$ self.batch_size $+$ (self.batch_num - 1) $\star$ self.batch_stride - 1 startIndices $=$ np.array(range(0, end_point, self.batch_stride)) endIndices $=$ startIndices $+$ self.batch_size indices $=$ torch.tensor([range(startIndices[i], endIndices[i]) for i in range(n)).unsqueeze(0).unsqueeze(-1) indices $=$ indicesrepeat(b, 1, 1, c).to(main_part_loss_device) # Point-Granularity Alignment main_loss $=$ torch.zeros((b, n, self.win_size - self(padding_length, c)).to(main_part_loss_device) main_lossscatter_(dim $= 2$ , index $\equiv$ indices, src $\equiv$ main_part_loss) non_zero_cnt $=$ torch.count_nonzero(main_loss, dim $= 1$ main_loss $=$ main_loss.sum(1) / non_zero_cnt # Calculate the metric of the remained part if self(padding_length $>0$ padding_loss $=$ self(metric(outputs[(:, -self(padding_length:, :, batch_y[(:, -self(padding_length:, :]) padding_loss $=$ padding_lossrepeat(1, self(padding_length, 1) total_loss $=$ torch.cat([main_loss, padding_loss], dim $= 1$ else: total_loss $=$ main_loss return total_loss
|
| 426 |
+
|
| 427 |
+
# A.7 COMMAND USED FOR GENERATING THE SYNTHETIC DATASETS
|
| 428 |
+
|
| 429 |
+
We use the provided source code (Lai et al., 2021) without alterations as demonstrated below, except for adjusting the length parameter to generate a longer time series, to ensure a fair comparison.
|
| 430 |
+
|
| 431 |
+
Algorithm 3 TODS Synthesis
|
| 432 |
+
```python
|
| 433 |
+
This code is based on the original implementation from the TODS project. Original author: DATA Lab @ Rice University
|
| 434 |
+
Source URL: https://github.com/datamllab/tods
|
| 435 |
+
```
|
| 436 |
+
Set base values and behavior types
|
| 437 |
+
DIM_NUM = 5
|
| 438 |
+
BEHAVIOR = [sine, cosine, sine, cosine, sine]
|
| 439 |
+
CONFIG = {"freq": 0.04, "coef": 1.5, "offset": 0.0, "noise_amp": 0.05}
|
| 440 |
+
VALUES = [0.145, 0.128, 0.094, 0.077, 0.111, 0.145, 0.179, 0.214, 0.214]
|
| 441 |
+
Generate training data
|
| 442 |
+
train_data = MultivariateDataGenerator(dim=DIM_NUM, stream_length=20000, behavior=BEHAVIOR, behavior_config=CONFIG)
|
| 443 |
+
Generate test data
|
| 444 |
+
test_data = MultivariateDataGenerator(dim=DIM_NUM, stream_length=5000, behavior=BEHAVIOR, behavior_config=CONFIG)
|
| 445 |
+
Add anomalies based on the specified anomaly type
|
| 446 |
+
for i in range(DIM_NUM):
|
| 447 |
+
if anomaly_type == "global_anomaly":
|
| 448 |
+
test_data_point_global_outliers(dim_no=i, ratio=0.01, factor=3.5, radius=5)
|
| 449 |
+
elif anomaly_type == "contextual_anomaly":
|
| 450 |
+
test_data_point_contextual_outliers(dim_no=i, ratio=0.01, factor=2.5, radius=5)
|
| 451 |
+
elif anomaly_type == "shapelet_anomaly":
|
| 452 |
+
test_data-collective_global_outliers(dim_no=i, ratio=0.01, radius=5, option='square', coef=1.5, noise_amp=0.03, level=20, freq=0.04, base=VALUES, offset=0.0)
|
| 453 |
+
elif anomaly_type == "seasonal_anomaly":
|
| 454 |
+
test_data-collective_seasonal_outliers(dim_no=i, ratio=0.01, factor=3, radius=5)
|
| 455 |
+
elif anomaly_type == "trend_anomaly":
|
| 456 |
+
test_data-collective_trend_outliers(dim_no=i, ratio=0.01, factor=0.5, radius=5)
|
| 457 |
+
elif anomaly_type == "mixed_subsequence_anomaly":
|
| 458 |
+
test_data-collective_global_outliers(dim_no=i, ratio=0.006, radius=5, option="square", coef=1.5, noise_amp=0.03, level=20, freq=0.04, base=VALUES, offset=0.0)
|
| 459 |
+
test_data-collective_seasonal_outliers(dim_no=i, ratio=0.006, factor=3, radius=5)
|
| 460 |
+
test_data-collective_trend_outliers(dim_no=i, ratio=0.006, factor=0.5, radius=5)
|
| 461 |
+
```
|
| 462 |
+
|
| 463 |
+
|
| 464 |
+
|
| 465 |
+
<!-- [chunk 2/2 failed] -->
|
| 466 |
+
|
paper_markdowns/bamboo-02324.md
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
<!-- [chunk 1/2 failed] -->
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+

|
| 8 |
+
(a) ETTh1 dataset example 1
|
| 9 |
+
|
| 10 |
+

|
| 11 |
+
(b) ETTh1 dataset example 2
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
(c) ETTm1 dataset example 1
|
| 15 |
+
|
| 16 |
+

|
| 17 |
+
(d) ETTm1 dataset example 2
|
| 18 |
+
|
| 19 |
+

|
| 20 |
+
(e) Traffic dataset example 1
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
(f) Traffic dataset example 2
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
(g) Electricity dataset example 1
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
(h) Electricity dataset example 2
|
| 30 |
+
Figure 3: Sequential visualization examples of prediction results on the ETTh1, ETTm1, Electricity, and Traffic datasets are presented, with two examples per dataset. The blue lines represent predictions, while the orange lines indicate ground truth. The visualizations start at x-axis position 512.
|
| 31 |
+
|
| 32 |
+
# E SCHEMATIC DIAGRAM OF THE FRAMEWORK
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
Figure 4: Schematic diagram of the process of Vanilla Context-Alignment (VCA) and Few-Shot Prompting based Context-Alignment (FSCA). The light-colored square sequence represents the finegrained branch; the dark-colored square sequence represents the coarse-grained branch.
|
| 36 |
+
|
| 37 |
+
In this section, we describe our method in greater detail and specificity through a diagram and quantitative examples.
|
| 38 |
+
|
| 39 |
+
The bottom of Fig. 4 features the TS data input. The left subfigure presents the Vanilla Context-Alignment (VCA) process for any TS tasks, where the TS input is tokenized together with the task description prompt to construct the simple graph structure; edges in both coarse-grained and finegrained graphs are built from the TS input directed toward the task prompt. The middle subfigure illustrates Few-Shot Prompting Context-Alignment (FSCA) for forecasting tasks, which is detailed in Sec. 3.3, showing the division of the TS input into subsequences, with the subsequences positioned later serving as the ground truth for earlier ones, thereby forming the edge connections. The right subfigure depicts the classification task using FSCA (detailed in Sec. B.2), differing from forecasting tasks in that, unable to segment the TS input to create examples, we must extract one sample from the training set for each category as the fixed example.
|
| 40 |
+
|
| 41 |
+
Below, we would facilitate the understanding of FSCA for tackling forecasting tasks by detailing a simple example. This could also provide clearer explanations of Eq.5 and Eq.6. The processes VCA and FSCA for classification tasks are similar and would not be reiterated.
|
| 42 |
+
|
| 43 |
+
Assuming we have inputs processed through patching and token embedding, these include TS embeddings of length 8 and task description prompt embeddings of length 2 (the prompt is “Predict future sequences using previous data:” in FSCA for forecasting, here the length is an example):
|
| 44 |
+
|
| 45 |
+
dings are segmented into 2 subsequences, each comprising four embeddings. Thus, Firstly, for the fine-grained branch, consider the scenario in which the input TS embed- $T S _ { s u b } ^ { 1 }$ is $[ e _ { 1 , 1 } , e _ { 1 , 2 } , e _ { 1 , 3 } , e _ { 1 , 4 } ]$ , and ilarly, $T S _ { s u b } ^ { 2 }$ is efe $[ e _ { 2 , 1 } , e _ { 2 , 2 } , e _ { 2 , 3 } , e _ { 2 , 4 } ]$ , where in the $e _ { i , j }$ indicates pt of sub $j$ -th embquence ding in. Here, $z _ { i , j }$ $j$ $i$ $[ z _ { 1 , 1 } , z _ { 1 , 2 } ] = [ z _ { 2 , 1 } , z _ { 2 , 2 } ]$ . Ultimately, Eq.5 is instantiated as:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\left[ \boldsymbol {e} _ {1, 1}, \boldsymbol {e} _ {1, 2}, \boldsymbol {e} _ {1, 3}, \boldsymbol {e} _ {1, 4}, \boldsymbol {z} _ {1, 1}, \boldsymbol {z} _ {1, 2}, \boldsymbol {e} _ {2, 1}, \boldsymbol {e} _ {2, 2}, \boldsymbol {e} _ {2, 3}, \boldsymbol {e} _ {2, 4}, \boldsymbol {z} _ {2, 1}, \boldsymbol {z} _ {2, 2} \right].
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
Secondly, we need to construct a graph structure for this input before it enters LLM. The basic logic for constructing the graph is that $\bar { T } S _ { s u b } ^ { \bar { 2 } }$ serves as the ground truth for $T S _ { s u b } ^ { 1 }$ (The latter subsequence serves as the correct label for the former subsequence). Specifically, starting with all elements in $T S _ { s u b } ^ { 1 }$ sub, construct directed edges to the first item of the corresponding task description, $z _ { 1 , 1 }$ . Subsequently, from the last item of the task description, $z _ { 1 , 2 }$ , construct directed edges to all elements pr in T S2su $T S _ { s u b } ^ { 2 }$ $z _ { 2 , 1 }$ nce all TS subsequences are used to predict fut, needs to establish edge connections with both $T S _ { s u b } ^ { 1 }$ uenand $T S _ { s u b } ^ { 2 }$ first token of the last.
|
| 52 |
+
|
| 53 |
+
Thirdly, for the coarse-grained branch, it is essential to inform the LLM that a time series should be treated as a whole. Thus, $T S _ { s u b } ^ { i }$ must be mapped to individual node embedding by a linear
|
| 54 |
+
|
| 55 |
+
layer. To align the scales, the prompt embeddings are also mapped to a node embedding. Thus, the coarse-grained sequences can be denoted as $[ \tilde { e } _ { 1 } , \tilde { \mathbf { z } } ^ { ( 1 ) } , \tilde { e } _ { 2 } , \tilde { \mathbf { z } } ^ { ( 2 ) } ]$ (instantiation of Eq.6). Additionally, the graph construction logic is consistent with that of the fine-grained branch.
|
| 56 |
+
|
| 57 |
+
# F EXPERIMENTAL ANALYSIS
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
F.1 RANDOMLY REPLACE THE PRE-TRAINED WEIGHTS OF LLM
|
| 61 |
+
(a) ETTh1 dataset
|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
(b) ETTh2 dataset
|
| 65 |
+
Figure 5: Results of random initializing GPT-2 pre-trained weights. The x-axis represents the ratio of GPT-2 pre-trained weights replaced by random initialization, and the y-axis shows the Mean Squared Error (MSE) metric values. We conducted this experiment on GPT4TS, $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { I } \mathbf { P } .$ -LLM and our FSCA.
|
| 66 |
+
|
| 67 |
+
As shown in Fig. 5, we randomly initialize GPT-2 pre-trained weights at varying ratios to demonstrate scenarios involving under-trained and untrained conditions. As the random initialization ratio increases, LLM’s contextual understanding ability decreases, leading to a decline in our model’s performance. When the model’s capability is weak, our results are as poor as those of GPT4TS (the most direct method to utilize LLM for TS tasks) and $\mathbf { S } ^ { \mathrm { 2 } } \mathbf { I } \mathbf { P } .$ -LLM (a token-alignment based method). However, as the LLM’s capability improves, our method significantly outperforms GPT4TS and $\mathsf { S } ^ { 2 } \mathrm { I P }$ -LLM, achieving a lower MSE. These findings demonstrate that our approach more effectively activates the potential of pre-trained LLMs for TS tasks.
|
| 68 |
+
|
| 69 |
+
# F.2 SCALE ANALYSIS
|
| 70 |
+
|
| 71 |
+
We analyze the scaling effect of FSCA in three aspects:
|
| 72 |
+
|
| 73 |
+
Model Size: Ablation experiments on the number of GPT-2 layers (Table 6) show performance declines as the layer count increases, consistent with findings in GPT4TS.
|
| 74 |
+
|
| 75 |
+
Training Data Size: As shown in Table 17, using $5 \%$ , $10 \%$ , $2 5 \%$ , $50 \%$ , $7 5 \%$ and full of the training data reveals continuous performance improvement, particularly significant at the $50 \%$ data point.
|
| 76 |
+
|
| 77 |
+
Few-Shot Prompting Examples’ amount: Table 16 shows that more examples yield modest gains for short prediction lengths (96) but reduce effectiveness for longer ones (336, 720). This likely results from shorter input lengths per example due to divisions of the TS input, creating a mismatch with longer required prediction lengths.
|
| 78 |
+
|
| 79 |
+
# F.3 FULLY TUNING ANALYSIS
|
| 80 |
+
|
| 81 |
+
GPT4TS has demonstrated that fully tuning LLMs for TS tasks, while straightforward, incurs high computational costs and yields suboptimal results by compromising the inherent generic knowledge of LLMs. Instead, our approach, like other pre-trained LLM-based TS methods (e.g., Time-LLM, TEST, $\mathsf { S } ^ { 2 } \mathbf { I } \mathsf { P }$ -LLM), focuses on freezing most LLM components to efficiently harness their potential. As shown in Table 18, we still supplement our results with full tuning, which similarly performed suboptimally.
|
| 82 |
+
|
| 83 |
+
Table 16: Results of different examples amount for the long-term forecasting task. All results are averaged on different prediction horizons: {96, 192, 336, 720}. Bold: best, Underline: second best.
|
| 84 |
+
|
| 85 |
+
<table><tr><td colspan="2">Examples amount</td><td colspan="2">1</td><td colspan="2">2</td><td colspan="2">3</td><td colspan="2">4</td></tr><tr><td colspan="2">Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td rowspan="5">ETh1</td><td>96</td><td>0.349</td><td>0.389</td><td>0.343</td><td>0.385</td><td>0.341</td><td>0.382</td><td>0.356</td><td>0.394</td></tr><tr><td>192</td><td>0.390</td><td>0.415</td><td>0.387</td><td>0.416</td><td>0.393</td><td>0.419</td><td>0.402</td><td>0.428</td></tr><tr><td>336</td><td>0.402</td><td>0.432</td><td>0.407</td><td>0.439</td><td>0.414</td><td>0.445</td><td>0.440</td><td>0.456</td></tr><tr><td>720</td><td>0.433</td><td>0.460</td><td>0.446</td><td>0.471</td><td>0.462</td><td>0.488</td><td>0.485</td><td>0.495</td></tr><tr><td>Avg</td><td>0.394</td><td>0.424</td><td>0.396</td><td>0.428</td><td>0.403</td><td>0.434</td><td>0.421</td><td>0.443</td></tr><tr><td rowspan="5">ETm1</td><td>96</td><td>0.282</td><td>0.343</td><td>0.277</td><td>0.340</td><td>0.275</td><td>0.341</td><td>0.296</td><td>0.352</td></tr><tr><td>192</td><td>0.324</td><td>0.369</td><td>0.326</td><td>0.374</td><td>0.331</td><td>0.385</td><td>0.341</td><td>0.377</td></tr><tr><td>336</td><td>0.356</td><td>0.386</td><td>0.366</td><td>0.391</td><td>0.370</td><td>0.395</td><td>0.391</td><td>0.408</td></tr><tr><td>720</td><td>0.405</td><td>0.417</td><td>0.412</td><td>0.425</td><td>0.428</td><td>0.432</td><td>0.451</td><td>0.438</td></tr><tr><td>Avg</td><td>0.342</td><td>0.378</td><td>0.345</td><td>0.383</td><td>0.351</td><td>0.388</td><td>0.370</td><td>0.394</td></tr></table>
|
| 86 |
+
|
| 87 |
+
Table 17: Results of different training data ratios.
|
| 88 |
+
|
| 89 |
+
<table><tr><td>Training data ratios</td><td>ETTh1</td><td>ETTm1</td></tr><tr><td>5%</td><td>0.575</td><td>0.435</td></tr><tr><td>10%</td><td>0.538</td><td>0.435</td></tr><tr><td>25%</td><td>0.486</td><td>0.411</td></tr><tr><td>50%</td><td>0.409</td><td>0.366</td></tr><tr><td>75%</td><td>0.398</td><td>0.350</td></tr><tr><td>100%</td><td>0.394</td><td>0.342</td></tr></table>
|
| 90 |
+
|
| 91 |
+
# F.4 COMPARISON BETWEEN VCA AND OTHER LLM-BASED METHODS
|
| 92 |
+
|
| 93 |
+
In this section, we focus on comparing VCA with other LLM-based methods. The results show that VCA generally performs second only to FSCA, demonstrating the effectiveness of Context-Alignment, which outperforms Token-Alignment and other LLM-based approaches. Compared to FSCA, the results also validate the enhancing effectiveness of the few-shot prompting technique employed in FSCA. Table 19, Table 20, Table 21, Table 22, Table 23, respectively show the results of long-term forecasting, short-term forecasting, few-shot forecasting, zero-shot forecasting and classification tasks.
|
| 94 |
+
|
| 95 |
+
# F.5 EXPERIMENTAL EFFICIENCY ANALYSIS
|
| 96 |
+
|
| 97 |
+
We incorporate comparisons of experimental efficiency with other LLM-based methods, focusing on the number of parameters and execution speed. As shown in Table 24. Our method ranks just behind GPT4TS, which only incorporates linear layers at the input and output stages of LLMs. In contrast, other popular methods require token-alignment to adapt LLMs for time series data, aligning TS data with word embeddings in the vocabulary. Additionally, these methods often include extra operations. For example, Time-LLM repeatedly generates prompts and retrieves corresponding embeddings each iteration, while $\mathsf { S } ^ { 2 } \mathrm { I P }$ -LLM separates TS inputs and performs prompt retrieval.
|
| 98 |
+
|
| 99 |
+
The computational costs of our FSCA method mainly stem from two aspects. Firstly, the use of dual-scale GNNs introduces two learnable matrices (Eq. 3), which, as shown in the table comparing FSCA with the version without dual-scale GNNs, add a slight increase in computational load. Secondly, the process of constructing coarse-grained inputs necessitates two learnable linear layers to transform fine-grained node embeddings into coarse-grained ones. The input dimension of these layers is dictated by the number of input TS patches, making it the primary contributor to increased overhead.
|
| 100 |
+
|
| 101 |
+
# F.6 COMPARISON OF DIFFERENT PROMPT TYPES
|
| 102 |
+
|
| 103 |
+
We compare our approach with two other types of prompts detailed in Table 25: data domain and input statistics, referencing Time-LLM (Jin et al., 2024). Here are the prompt examples:
|
| 104 |
+
|
| 105 |
+
Table 18: Fully tuning results of FSCA and GPT4TS.
|
| 106 |
+
|
| 107 |
+
<table><tr><td>Method</td><td>ETTh1</td><td>ETTm1</td></tr><tr><td>GPT4TS</td><td>0.427</td><td>0.352</td></tr><tr><td>GPT4TS(Fully tuning)</td><td>0.469</td><td>0.406</td></tr><tr><td>FSCA</td><td>0.394</td><td>0.342</td></tr><tr><td>FSCA(Fully tuning)</td><td>0.457</td><td>0.383</td></tr></table>
|
| 108 |
+
|
| 109 |
+
Table 19: For long-term forecasting tasks, comparison between VCA and other LLM-based methods. All results are averaged on different prediction horizons: {24, 36, $4 8 , 6 0 \}$ for ILI and {96, 192, 336, 720} for others. Bold: best, Underline: second best.
|
| 110 |
+
|
| 111 |
+
<table><tr><td>Methods</td><td colspan="2">FSCA</td><td colspan="2">VCA</td><td colspan="2">S2IP-LLM</td><td colspan="2">Time-LLM</td><td colspan="2">GPT4TS</td></tr><tr><td>Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td>ILI</td><td>1.380</td><td>0.783</td><td>1.428</td><td>0.799</td><td>1.552</td><td>0.826</td><td>1.713</td><td>0.858</td><td>1.925</td><td>0.903</td></tr><tr><td>Weather</td><td>0.224</td><td>0.262</td><td>0.230</td><td>0.268</td><td>0.228</td><td>0.265</td><td>0.237</td><td>0.269</td><td>0.237</td><td>0.270</td></tr><tr><td>ECL</td><td>0.159</td><td>0.252</td><td>0.163</td><td>0.257</td><td>0.166</td><td>0.262</td><td>0.167</td><td>0.264</td><td>0.167</td><td>0.263</td></tr><tr><td>Traffic</td><td>0.386</td><td>0.263</td><td>0.389</td><td>0.271</td><td>0.405</td><td>0.286</td><td>0.407</td><td>0.289</td><td>0.414</td><td>0.294</td></tr><tr><td>ETTh1</td><td>0.394</td><td>0.424</td><td>0.417</td><td>0.432</td><td>0.418</td><td>0.436</td><td>0.426</td><td>0.435</td><td>0.427</td><td>0.426</td></tr><tr><td>ETTh2</td><td>0.316</td><td>0.375</td><td>0.335</td><td>0.382</td><td>0.355</td><td>0.399</td><td>0.361</td><td>0.398</td><td>0.354</td><td>0.394</td></tr><tr><td>ETTm1</td><td>0.342</td><td>0.378</td><td>0.349</td><td>0.380</td><td>0.346</td><td>0.382</td><td>0.354</td><td>0.384</td><td>0.352</td><td>0.383</td></tr><tr><td>ETTm2</td><td>0.250</td><td>0.314</td><td>0.259</td><td>0.318</td><td>0.262</td><td>0.326</td><td>0.275</td><td>0.334</td><td>0.266</td><td>0.326</td></tr><tr><td>Avg</td><td>0.431</td><td>0.381</td><td>0.446</td><td>0.388</td><td>0.466</td><td>0.398</td><td>0.492</td><td>0.404</td><td>0.518</td><td>0.407</td></tr></table>
|
| 112 |
+
|
| 113 |
+
Table 20: For the short-term time series forecasting, comparison between VCA and other LLM-based methods. Bold: best, Underline: second best.
|
| 114 |
+
|
| 115 |
+
<table><tr><td colspan="2">Methods</td><td>FSCA</td><td>VCA</td><td>S2IP-LLM</td><td>Time-LLM</td><td>GPT4TS</td></tr><tr><td rowspan="3">Average</td><td>SMAPE</td><td>11.828</td><td>11.889</td><td>12.021</td><td>12.494</td><td>12.690</td></tr><tr><td>MASE</td><td>1.580</td><td>1.596</td><td>1.612</td><td>1.731</td><td>1.808</td></tr><tr><td>OWA</td><td>0.850</td><td>0.855</td><td>0.857</td><td>0.913</td><td>0.940</td></tr></table>
|
| 116 |
+
|
| 117 |
+
Table 21: For the few-shot learning task on $5 \%$ training data, comparison between VCA and other LLM-based methods. All results are averaged across four different prediction horizons {96, 192, 336, 720}. Bold: best, Underline: second best.
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Methods</td><td colspan="2">FSCA</td><td colspan="2">VCA</td><td colspan="2">S2IP-LLM</td><td colspan="2">Time-LLM</td><td colspan="2">GPT4TS</td></tr><tr><td>Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td>ETTh1</td><td>0.575</td><td>0.508</td><td>0.598</td><td>0.524</td><td>0.650</td><td>0.550</td><td>0.648</td><td>0.549</td><td>0.681</td><td>0.560</td></tr><tr><td>ETTh2</td><td>0.366</td><td>0.397</td><td>0.382</td><td>0.405</td><td>0.380</td><td>0.413</td><td>0.398</td><td>0.426</td><td>0.400</td><td>0.433</td></tr><tr><td>ETTm1</td><td>0.435</td><td>0.429</td><td>0.457</td><td>0.442</td><td>0.455</td><td>0.446</td><td>0.477</td><td>0.451</td><td>0.472</td><td>0.450</td></tr><tr><td>ETTm2</td><td>0.284</td><td>0.332</td><td>0.289</td><td>0.340</td><td>0.296</td><td>0.342</td><td>0.307</td><td>0.348</td><td>0.308</td><td>0.346</td></tr><tr><td>Avg</td><td>0.415</td><td>0.416</td><td>0.432</td><td>0.428</td><td>0.445</td><td>0.438</td><td>0.458</td><td>0.443</td><td>0.465</td><td>0.447</td></tr></table>
|
| 120 |
+
|
| 121 |
+
Table 22: For the zero-shot learning results, comparison between VCA and other LLM-based methods. The first column $\mathbf A \to \mathbf B$ indicates training on dataset A and testing on dataset B. Bold: best, Underline: second best.
|
| 122 |
+
|
| 123 |
+
<table><tr><td>Methods</td><td colspan="2">FSCA</td><td colspan="2">VCA</td><td colspan="2">S2IP-LLM</td><td colspan="2">Time-LLM</td><td colspan="2">GPT4TS</td></tr><tr><td>Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td>ETTh1 → ETTh2</td><td>0.313</td><td>0.369</td><td>0.336</td><td>0.390</td><td>0.403</td><td>0.417</td><td>0.384</td><td>0.409</td><td>0.406</td><td>0.422</td></tr><tr><td>ETTh1 → ETTm2</td><td>0.290</td><td>0.348</td><td>0.303</td><td>0.362</td><td>0.325</td><td>0.360</td><td>0.317</td><td>0.370</td><td>0.325</td><td>0.363</td></tr><tr><td>ETTh2 → ETTh1</td><td>0.527</td><td>0.507</td><td>0.561</td><td>0.534</td><td>0.669</td><td>0.560</td><td>0.663</td><td>0.540</td><td>0.757</td><td>0.578</td></tr><tr><td>ETTh2 → ETTm2</td><td>0.288</td><td>0.347</td><td>0.297</td><td>0.361</td><td>0.327</td><td>0.363</td><td>0.339</td><td>0.371</td><td>0.335</td><td>0.370</td></tr><tr><td>ETTm1 → ETTh2</td><td>0.353</td><td>0.398</td><td>0.372</td><td>0.416</td><td>0.442</td><td>0.439</td><td>0.440</td><td>0.449</td><td>0.433</td><td>0.439</td></tr><tr><td>ETTm1 → ETTm2</td><td>0.264</td><td>0.319</td><td>0.285</td><td>0.333</td><td>0.304</td><td>0.347</td><td>0.311</td><td>0.343</td><td>0.313</td><td>0.348</td></tr><tr><td>ETTm2 → ETTh2</td><td>0.343</td><td>0.393</td><td>0.352</td><td>0.401</td><td>0.406</td><td>0.429</td><td>0.429</td><td>0.448</td><td>0.435</td><td>0.443</td></tr><tr><td>ETTm2 → ETTm1</td><td>0.480</td><td>0.463</td><td>0.514</td><td>0.487</td><td>0.622</td><td>0.532</td><td>0.588</td><td>0.503</td><td>0.769</td><td>0.567</td></tr><tr><td>Average</td><td>0.357</td><td>0.393</td><td>0.378</td><td>0.411</td><td>0.437</td><td>0.431</td><td>0.434</td><td>0.429</td><td>0.472</td><td>0.441</td></tr></table>
|
| 124 |
+
|
| 125 |
+
The original prompt is straightforward: “Predict future sequences using previous data.”
|
| 126 |
+
|
| 127 |
+
The data domain prompt, illustrated using the ETTh dataset, is: “[Data domain:] The Electricity Transformer Temperature (ETT) is crucial for long-term electric power systems management. ETTh1 and ETTh2 represent 1-hour level data. Each data point includes the ‘oil temperature’ and six power load features. [Task:] Predict future sequences using previous data.”
|
| 128 |
+
|
| 129 |
+
The input statistics prompt describes:“[Input statistics:] The input features a minimum value of <min val $>$ , a maximum of <max val>, and a median of <median val>. The overall trend is <upward or downward>. [Task:] Predict future sequences using previous data.”
|
| 130 |
+
|
| 131 |
+
Our results show that the data domain prompt performs nearly the same as the original prompt. The input statistics prompt slightly enhances performance. However, it requires recalculating statistical features and regenerating corresponding embeddings by the LLM tokenizer with each iteration,
|
| 132 |
+
|
| 133 |
+
Table 23: For classification tasks, comparison between VCA and other LLM-based methods. Bold: best, Underline: second best.
|
| 134 |
+
|
| 135 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="5">LLM-based</td></tr><tr><td>GPT4TS</td><td>Time-LLM</td><td>S2IP-LLM</td><td>VCA</td><td>FSCA</td></tr><tr><td>EthanolConcentration</td><td>34.2</td><td>34.6</td><td>35.3</td><td>39.2</td><td>-</td></tr><tr><td>FaceDetection</td><td>69.2</td><td>67.9</td><td>68.5</td><td>69.0</td><td>70.4</td></tr><tr><td>Handwriting</td><td>32.7</td><td>32.0</td><td>33.1</td><td>38.4</td><td>-</td></tr><tr><td>Heartbeat</td><td>77.2</td><td>78.0</td><td>77.5</td><td>78.5</td><td>79.5</td></tr><tr><td>JapaneseVowels</td><td>98.6</td><td>98.1</td><td>98.6</td><td>98.9</td><td>-</td></tr><tr><td>PEMS-SF</td><td>87.9</td><td>87.2</td><td>88.4</td><td>91.3</td><td>-</td></tr><tr><td>SelfRegulationSCP1</td><td>93.2</td><td>92.8</td><td>91.4</td><td>93.1</td><td>94.2</td></tr><tr><td>SelfRegulationSCP2</td><td>59.4</td><td>57.2</td><td>58.3</td><td>60.5</td><td>61.1</td></tr><tr><td>SpokenArabicDigits</td><td>99.2</td><td>99.5</td><td>99.0</td><td>99.8</td><td>-</td></tr><tr><td>UWaveGestureLibrary</td><td>88.1</td><td>89.3</td><td>88.7</td><td>91.3</td><td>-</td></tr><tr><td>Average</td><td>74.0</td><td>73.7</td><td>73.9</td><td>76.0</td><td>-</td></tr></table>
|
| 136 |
+
|
| 137 |
+
Table 24: Comparisons of experimental efficiency with other LLM-based methods.
|
| 138 |
+
|
| 139 |
+
<table><tr><td></td><td>Training Params</td><td>Training Params Percentages</td><td>Training Time for 1 iteration(s)</td><td>Inference Time for 1 iteration(s)</td></tr><tr><td>GPT4TS</td><td>17.33M</td><td>17.6</td><td>0.457</td><td>0.215</td></tr><tr><td>Time-LLM</td><td>70.85M</td><td>46.37</td><td>2.894</td><td>1.723</td></tr><tr><td>S2IP-LLM</td><td>56.95M</td><td>41.25</td><td>2.415</td><td>1.316</td></tr><tr><td>FSCA w/o Coarse Branch</td><td>12.43M</td><td>13.29</td><td>0.348</td><td>0.155</td></tr><tr><td>FSCA w/o Dual-Scale GNNs</td><td>35.83M</td><td>30.6</td><td>0.556</td><td>0.322</td></tr><tr><td>FSCA</td><td>37.02M</td><td>31.3</td><td>0.587</td><td>0.331</td></tr></table>
|
| 140 |
+
|
| 141 |
+
significantly slowing down the process: training time for one iteration increased from 0.587 seconds to 1.431 seconds.
|
| 142 |
+
|
| 143 |
+
Table 25: Comparison of different prompt types.
|
| 144 |
+
|
| 145 |
+
<table><tr><td>Variant</td><td>ETTh1</td><td>ETTm1</td><td>ETTm1</td><td>ETTm2</td></tr><tr><td>FSCA(Original)</td><td>0.394</td><td>0.316</td><td>0.342</td><td>0.250</td></tr><tr><td>FSCA(Domain)</td><td>0.396</td><td>0.316</td><td>0.343</td><td>0.252</td></tr><tr><td>FSCA(Statistics)</td><td>0.392</td><td>0.313</td><td>0.346</td><td>0.246</td></tr></table>
|
| 146 |
+
|
| 147 |
+
# F.7 COMPARISON OF DIFFERENT NETWORK TYPES IMPLEMENTING CONTEXT-ALIGNMENT
|
| 148 |
+
|
| 149 |
+
We replace the GCN module in our dual-scale GNN framework with alternative networks, including MLP, CNNs, and self-attention mechanisms, to demonstrate that graph structures are the optimal choice within the Context-Alignment paradigm. Table 26 confirms that GCN-based methods surpass other network models. The superiority of GNNs stems from their unique ability to model node-edge structures, which allows for a more nuanced representation of structural and logical relationships. In our framework, dual-scale nodes articulate hierarchical structure, while edges represent logical connections. Consequently, this dual-scale GNN framework enhances the alignment of time series data within contexts that LLMs can understand, thereby leveraging pre-trained LLMs’ capabilities for time series tasks. Additionally, we integrate GraphSAGE, another prominent GNN variant, to further confirm the robustness of our framework across different graph networks.
|
| 150 |
+
|
| 151 |
+
Table 26: Results of implementing Context-Alignment paradigm using different network types.
|
| 152 |
+
|
| 153 |
+
<table><tr><td>Variant</td><td>ETTh1</td><td>ETTm1</td><td>ETTm1</td><td>ETTm2</td></tr><tr><td>FSCA(GCN)</td><td>0.394</td><td>0.316</td><td>0.342</td><td>0.250</td></tr><tr><td>FSCA(GraphSAGE)</td><td>0.397</td><td>0.321</td><td>0.337</td><td>0.247</td></tr><tr><td>FSCA(Attention)</td><td>0.435</td><td>0.347</td><td>0.362</td><td>0.271</td></tr><tr><td>FSCA(MLP)</td><td>0.407</td><td>0.334</td><td>0.349</td><td>0.269</td></tr><tr><td>FSCA(CNN)</td><td>0.411</td><td>0.340</td><td>0.354</td><td>0.262</td></tr></table>
|
| 154 |
+
|
| 155 |
+
# F.8 COMPARISON WITH TS FOUNDATION MODELS
|
| 156 |
+
|
| 157 |
+
We include comparative results with pre-trained time series foundation models such as UniTS-ST (Gao et al., 2024), MOMENT (Goswami et al., 2024), and TSMixer (Chen et al., 2023). Table 28, 27 reveal that while UniTS-ST outperforms some LLM-based methods, our approach still shows superior performance. We attribute this advantage to our method’s effective exploitation of the deep logical and structural understanding inherent in LLMs, which better harnesses their capabilities for TS tasks. This underscores the significant potential of LLMs in TS applications.
|
| 158 |
+
|
| 159 |
+
Table 27: For classification tasks, comparison results with time series foundation models.
|
| 160 |
+
|
| 161 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="4">LLM-based Models</td><td colspan="2">TS Foundation Models</td></tr><tr><td>GPT4TS</td><td>Time-LLM</td><td>S2IP-LLM</td><td>FSCA</td><td>UniTS-ST</td><td>MOMENT</td></tr><tr><td>EthanolConcentration</td><td>34.2</td><td>34.6</td><td>35.3</td><td>39.2</td><td>37.6</td><td>35.7</td></tr><tr><td>FaceDetection</td><td>69.2</td><td>67.9</td><td>68.5</td><td>70.4</td><td>70.5</td><td>63.3</td></tr><tr><td>Handwriting</td><td>32.7</td><td>32</td><td>33.1</td><td>38.4</td><td>29.7</td><td>30.8</td></tr><tr><td>Heartbeat</td><td>77.2</td><td>78</td><td>77.5</td><td>79.5</td><td>80.0</td><td>72.2</td></tr><tr><td>JapaneseVowels</td><td>98.6</td><td>98.1</td><td>98.6</td><td>98.9</td><td>97.8</td><td>71.6</td></tr><tr><td>PEMS-SF</td><td>87.9</td><td>87.2</td><td>88.4</td><td>91.3</td><td>93.1</td><td>89.6</td></tr><tr><td>SelfRegulationSCP1</td><td>93.2</td><td>92.8</td><td>91.4</td><td>94.2</td><td>93.9</td><td>84.0</td></tr><tr><td>SelfRegulationSCP2</td><td>59.4</td><td>57.2</td><td>58.3</td><td>61.1</td><td>61.1</td><td>47.8</td></tr><tr><td>SpokenArabicDigits</td><td>99.2</td><td>99.5</td><td>99.0</td><td>99.8</td><td>98.9</td><td>98.1</td></tr><tr><td>UWaveGestureLibrary</td><td>88.1</td><td>89.3</td><td>88.7</td><td>91.3</td><td>87.7</td><td>90.9</td></tr><tr><td>Average</td><td>74</td><td>73.7</td><td>73.9</td><td>76.4</td><td>75.0</td><td>68.4</td></tr></table>
|
| 162 |
+
|
| 163 |
+
Table 28: For long-term forecasting tasks, comparison results with time series foundation models.
|
| 164 |
+
|
| 165 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="8">LLM-based Models</td><td colspan="6">TS Foundation Models</td></tr><tr><td colspan="2">FSCA</td><td colspan="2">S2IP-LLM</td><td colspan="2">Time-LLM</td><td colspan="2">GPT4TS</td><td colspan="2">UniTS-ST</td><td colspan="2">MOMENT</td><td colspan="2">TSMixer</td></tr><tr><td>Metric</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td><td>MSE</td><td>MAE</td></tr><tr><td>Weather</td><td>0.224</td><td>0.262</td><td>0.228</td><td>0.265</td><td>0.237</td><td>0.269</td><td>0.237</td><td>0.270</td><td>0.216</td><td>0.259</td><td>0.228</td><td>0.270</td><td>0.225</td><td>0.264</td></tr><tr><td>ECL</td><td>0.159</td><td>0.252</td><td>0.166</td><td>0.262</td><td>0.167</td><td>0.264</td><td>0.167</td><td>0.263</td><td>0.156</td><td>0.253</td><td>0.165</td><td>0.260</td><td>0.160</td><td>0.257</td></tr><tr><td>Traffic</td><td>0.386</td><td>0.263</td><td>0.405</td><td>0.286</td><td>0.407</td><td>0.289</td><td>0.414</td><td>0.294</td><td>0.409</td><td>0.278</td><td>0.415</td><td>0.293</td><td>0.408</td><td>0.284</td></tr><tr><td>ETTh1</td><td>0.394</td><td>0.424</td><td>0.418</td><td>0.436</td><td>0.426</td><td>0.435</td><td>0.427</td><td>0.426</td><td>0.405</td><td>0.426</td><td>0.418</td><td>0.436</td><td>0.412</td><td>0.428</td></tr><tr><td>ETTh2</td><td>0.316</td><td>0.375</td><td>0.355</td><td>0.399</td><td>0.361</td><td>0.398</td><td>0.354</td><td>0.394</td><td>0.331</td><td>0.387</td><td>0.352</td><td>0.395</td><td>0.355</td><td>0.401</td></tr><tr><td>ETTm1</td><td>0.342</td><td>0.378</td><td>0.346</td><td>0.382</td><td>0.354</td><td>0.384</td><td>0.352</td><td>0.383</td><td>0.337</td><td>0.376</td><td>0.344</td><td>0.379</td><td>0.347</td><td>0.375</td></tr><tr><td>ETTm2</td><td>0.250</td><td>0.314</td><td>0.262</td><td>0.326</td><td>0.275</td><td>0.334</td><td>0.266</td><td>0.326</td><td>0.254</td><td>0.315</td><td>0.382</td><td>0.376</td><td>0.267</td><td>0.322</td></tr><tr><td>Avg.</td><td>0.296</td><td>0.324</td><td>0.311</td><td>0.337</td><td>0.318</td><td>0.339</td><td>0.317</td><td>0.337</td><td>0.301</td><td>0.328</td><td>0.329</td><td>0.344</td><td>0.311</td><td>0.333</td></tr></table>
|
paper_markdowns/bamboo-02343.md
ADDED
|
@@ -0,0 +1,450 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CUT YOUR LOSSES IN LARGE-VOCABULARY LANGUAGE MODELS
|
| 2 |
+
|
| 3 |
+
Erik Wijmans∗ Brody Huval Alexander Hertzberg Vladlen Koltun Philipp Krahenb ¨ uhl ¨ Apple
|
| 4 |
+
|
| 5 |
+
# ABSTRACT
|
| 6 |
+
|
| 7 |
+
As language models grow ever larger, so do their vocabularies. This has shifted the memory footprint of LLMs during training disproportionately to one single layer: the cross-entropy in the loss computation. Cross-entropy builds up a logit matrix with entries for each pair of input tokens and vocabulary items and, for small models, consumes an order of magnitude more memory than the rest of the LLM combined. We propose Cut Cross-Entropy (CCE), a method that computes the cross-entropy loss without materializing the logits for all tokens into global memory. Rather, CCE only computes the logit for the correct token and evaluates the log-sum-exp over all logits on the fly. We implement a custom kernel that performs the matrix multiplications and the log-sum-exp reduction over the vocabulary in flash memory, making global memory consumption for the cross-entropy computation negligible. This has a dramatic effect. Taking the Gemma 2 (2B) model as an example, CCE reduces the memory footprint of the loss computation from 24 GB to 1 MB, and the total training-time memory consumption of the classifier head from 28 GB to 1 GB. To improve the throughput of CCE, we leverage the inherent sparsity of softmax and propose to skip elements of the gradient computation that have a negligible (i.e., below numerical precision) contribution to the gradient. Experiments demonstrate that the dramatic reduction in memory consumption is accomplished without sacrificing training speed or convergence.
|
| 8 |
+
|
| 9 |
+
https://github.com/apple/ml-cross-entropy
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Progress in large language models (LLMs) has been fueled in part by an increase in parameter count, context length, and vocabulary size (the number of tokens that can be used to represent the input). As LLMs grew, so did the associated infrastructure. Large mini-batch gradient descent (Goyal et al., 2017) combined with data-parallelism (Hillis & Steele, 1986) enabled the harnessing of increasing computational power. ZeRO (Rajbhandari et al., 2020) broke the dependence between the number of GPUs and the memory used for model parameters, gradients, and optimizer state. Activation checkpointing (Chen et al., 2016) reduced the amount of memory used for activations, supporting the development of deeper models. FlashAttention (Dao et al., 2022) reduced the memory used in selfattention from $O ( N ^ { 2 } )$ to $O ( N )$ , thereby supporting longer context windows. These improvements gradually shifted the memory consumption of LLM training to one single layer – the cross-entropy loss, whose memory footprint grows with the product of vocabulary size and number of tokens per batch. The cross-entropy loss is responsible for up to $9 0 \%$ of the memory footprint of modern LLM training (see Fig. 1a). The problem grows only more acute with time, since even the largest contemporary vocabularies (e.g., 256K tokens) may benefit from further expansion (Tao et al., 2024).
|
| 14 |
+
|
| 15 |
+
We propose a cross-entropy implementation, Cut Cross-Entropy (CCE), that has a negligible memory footprint and scales to arbitrarily large vocabularies. Our key insight is that computation of the loss and its gradient only depends on a single log-probability, that of the ground-truth label. With an arithmetic reformulation, we decompose the cross-entropy loss into an index matrix multiplication over a single ground-truth label and a log-sum-exp operation over all vocabulary entries for each token. Each operation has small and well-defined inputs – the network embeddings and classifier
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
(a) Regular cross-entropy
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
(b) Cut cross-entropy (ours)
|
| 22 |
+
Figure 1: Memory use and maximum attainable batch size (in millions of tokens) for a variety of frontier models on a 16-GPU (80 GB each) fully-sharded data-parallel setup (Rajbhandari et al., 2020) with activation checkpointing (Chen et al., 2016) and a mixed-precision 16-bit (fp16/bf16) AdamW optimizer (Kingma & Ba, 2015; Loshchilov & Hutter, 2019). For each model, we break its memory use down into weights and optimizer states, activation checkpoints, and the log-probabilities computed by the cross-entropy loss layer. Our Cut Cross-Entropy (CCE) enables increasing the batch size by $1 . 5 \mathrm { x }$ (Llama 2 13B) to 10x (GPT 2, Gemma 2 2B), with no sacrifice in speed or convergence. Exact values in Table A4.
|
| 23 |
+
|
| 24 |
+
matrix – and a single scalar output per token. Both operations do, however, rely on a large intermediate logit matrix that computes the score for each token and potential vocabulary entry. We show that there is no need to materialize this logit matrix in GPU memory. Instead, we compute logits as needed in SRAM in a series of custom CUDA kernels. The result is a cross-entropy computation that has negligible memory footprint, with no detrimental effect on latency or convergence. See Fig. 1b for a breakdown of memory savings and consequent batch size increases afforded by CCE.
|
| 25 |
+
|
| 26 |
+
# 2 RELATED WORK
|
| 27 |
+
|
| 28 |
+
Attention mechanisms. The effectiveness of transformers (Vaswani et al., 2017) in modeling language has drawn attention to their compute and memory requirements. Multiple works have proposed alternatives to scaled dot-product attention that reduce transformers’ computation and memory (Kitaev et al., 2020; Wang et al., 2020; Choromanski et al., 2021). Other model classes, such as structured state-space models (Gu et al., 2022; Gu & Dao, 2023), have also shown promising results. We study a different part of the model – its classifier head – that is not considered in these works.
|
| 29 |
+
|
| 30 |
+
Attention implementations. In addition to alternative attention mechanisms, the community has also tackled the daunting memory consumption of LLMs via efficient implementations. Rabe & Staats (2021) developed a self-attention implementation that makes use of chunking. Chen et al. (2023) proposed an implementation that broke the operation into two stages, reduction and matrix multiplication. This makes efficient use of GPU memory and registers but requires recomputation in the forward pass. FlashAttention (Dao et al., 2022) uses an online softmax (Milakov & Gimelshein, 2018) and, like CCE, materializes blocks of the $N ^ { 2 }$ -sized self-attention matrix in on-chip SRAM rather than slower global DRAM. This is one of the key ideas that CCE builds on to develop a memory-efficient cross-entropy formulation.
|
| 31 |
+
|
| 32 |
+
Vocabulary reduction. One way to minimize the amount of memory used by the log-probabilities over the tokens is to reduce the number of ‘active’ tokens in the vocabulary. Grave et al. (2017) proposed to use a vocabulary with a hierarchical structure, thereby requiring the log-probabilities for only a subset of the vocabulary at any given time. Yu et al. (2023) explore tokenization-free byte-level models that operate on dramatically smaller vocabularies.
|
| 33 |
+
|
| 34 |
+
Sequence and model parallelism. Sequence parallelism (Jacobs et al., 2023; Li et al., 2023) enables training very large models (with large vocabularies) by splitting an individual input sequence across
|
| 35 |
+
|
| 36 |
+
multiple GPUs. Various model parallelism techniques (Huang et al., 2019; Narayanan et al., 2019; Shoeybi et al., 2019) achieve the same goal of training very large models (with large vocabularies) by distributing the computation and memory consumption of different pieces across multiple GPUs.
|
| 37 |
+
|
| 38 |
+
Efficient cross-entropy implementations. A number of recent implementations use chunking to reduce the memory usage of the cross-entropy layer. Yet chunking induces a trade-off. Memory footprint is minimized when the number of chunks is high, but latency is minimized when the number of chunks is low. CCE utilizes only on-chip SRAM and minimizes both memory footprint and latency. Liger Kernels (Hsu et al., 2024) make efficient use of the GPU via chunking and by computing the loss+gradient simultaneously. The latter requires that any transform applied to the loss (such as masking) is implemented in the kernel itself. CCE has separate forward and backward stages, enabling user-defined transformations on the loss.
|
| 39 |
+
|
| 40 |
+
# 3 PRELIMINARIES
|
| 41 |
+
|
| 42 |
+
Let $\begin{array} { r } { P ( x ) = \prod _ { i = 1 } ^ { N } P ( x _ { i } \mid x _ { 1 } . . . x _ { i - 1 } ) } \end{array}$ be a Large Language Model (LLM) over a vocabulary $V$ . The LLM parameterizes an autoregressive distribution over all possible tokens $x _ { i } \in V$ given the preceding $N - 1$ tokens. Specifically, this distribution is the combination of a backbone network $f : x _ { 1 } \ldots x _ { i - 1 } \to \mathbb { R } ^ { D }$ and a linear classifier $\mathbf { C } \in \mathbb { R } ^ { D \times | V | }$ :
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
P \left(x _ {i} \mid x _ {1} \dots x _ {i - 1}\right) = \operatorname {s o f t m a x} _ {x _ {i}} \left(\mathbf {C} ^ {\top} f \left(x _ {1} \dots x _ {i - 1}\right)\right), \tag {1}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\operatorname {s o f t m a x} _ {k} (\mathbf {v}) = \frac {\exp \left(v _ {k}\right)}{\sum_ {j} \exp \left(v _ {j}\right)}. \tag {2}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
The backbone network $f ( x _ { 1 } , \dots , x _ { i - 1 } ) \ \in \ \mathbb { R } ^ { D }$ encodes a token sequence in the $D$ -dimensional feature vector. The linear classifier $\mathbf { C } \in \mathbb { R } ^ { D \times | V | }$ projects the embedding into an output space of the vocabulary $V$ . The $\operatorname { s o f t m a x } _ { k } ( \mathbf { v } )$ produces the probability over all vocabulary entries from the unnormalized log probabilities (logits) produced by $\mathbf { C } ^ { \top } f ( x _ { 1 } \dots x _ { i - 1 } )$ .
|
| 53 |
+
|
| 54 |
+
# 3.1 VOCABULARY
|
| 55 |
+
|
| 56 |
+
LLMs represent their input (and output) as a set of tokens in a vocabulary $V$ . The vocabulary is typically constructed by a method such as Byte Pair Encoding (BPE) (Gage, 1994). BPE initializes the vocabulary with all valid byte sequences from a standard text encoding, such as utf-8. Then, over a large corpus of text, BPE finds the most frequent pair of tokens and creates a new token that represents this pair. This continues iteratively until the maximum number of tokens is reached.
|
| 57 |
+
|
| 58 |
+
Large vocabularies enable a single token to represent multiple characters. This reduces the length of both input and output sequences, compresses larger and more diverse documents into shorter context windows, thus improving the model’s comprehension while reducing computational demands.
|
| 59 |
+
|
| 60 |
+
# 3.2 INFERENCE AND TRAINING
|
| 61 |
+
|
| 62 |
+
Even with a large vocabulary, sampling from an LLM is memory-efficient at inference time. Specifically, the LLM produces one token at a time, computing $P ( x _ { i } | x _ { 1 } \dots x _ { i - 1 } )$ and sampling from this distribution (Kwon et al., 2023). Because the distribution over the vocabulary is only needed for a single token at a time, the memory footprint is independent of sequence length.
|
| 63 |
+
|
| 64 |
+
At training time, the LLM maximizes the log-likelihood of the next token:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\ell (\hat {\mathbf {x}}) = \sum_ {i = 1} ^ {N} \log P \left(\hat {x} _ {i} \mid \hat {x} _ {1}, \dots , \hat {x} _ {i - 1}\right). \tag {3}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
Due to the structure of most backbones (Vaswani et al., 2017; Gu et al., 2022; Gu & Dao, 2023), $f ( x _ { 1 } ) , f ( x _ { 1 } , x _ { 2 } ) , \ldots , f ( x _ { 1 } , \ldots , x _ { N } )$ is efficiently computed in parallel. However, activations for non-linear layers have to be saved for the backward pass, consuming significant memory. Most LLM training frameworks make use of aggressive activation checkpointing (Chen et al., 2016), sharding (Rajbhandari et al., 2020), and specialized attention implementations (Dao et al., 2022) to keep this memory footprint manageable.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
(a) Indexed matmul (forward)
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
(b) Linear-log-sum-exp, forward pass
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
(c) Linear-log-sum-exp, backward pass
|
| 80 |
+
Figure 2: Access patterns and computation of blockwise (a) indexed matrix multiplication, (b) linear-log-sum-exp forward pass, and (c) linear-log-sum-exp backward pass. See Algorithms 1 to 3 for the corresponding algorithms.
|
| 81 |
+
|
| 82 |
+
With the aforementioned optimizations, the final (cross-entropy loss) layer of the LLM becomes by far the biggest memory hog. For large vocabularies, the final cross-entropy layer accounts for the majority of the model’s memory footprint at training time (Fig. 1a). For example, the logprobabilities materialized by the cross-entropy layer account for $4 0 \%$ of the memory consumption of Phi 3.5 (Mini) (Abdin et al., 2024) $( | V | = 3 2 , 0 6 4 )$ , $6 5 \%$ of the memory consumption of Llama 3 (8B) (Dubey et al., 2024) $( | V | = 1 2 8 , 0 0 0 )$ , and $8 9 \%$ of the memory consumption of Gemma 2 (2B) (Riviere et al. ` , 2024) $| V | = 2 5 6 , 1 2 8 ,$ ). In fact, the log-probabilities of Gemma 2 (2B) for a single sequence x with length $N = 8 0 { , } 0 0 0$ use the entire available memory of an 80 GB H100 GPU. (The sequence length is a factor due to the use of teacher forcing for parallelism.)
|
| 83 |
+
|
| 84 |
+
We show that a reformulation of the training objective leads to an implementation that has negligible memory consumption above what is required to store the loss and the gradient.
|
| 85 |
+
|
| 86 |
+
# 4 CUT CROSS-ENTROPY
|
| 87 |
+
|
| 88 |
+
Consider the cross-entropy loss $\ell _ { i }$ over a single prediction of the next token $P ( x _ { i } | x _ { 1 } \dots x _ { i - 1 } )$ :
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\ell_ {i} (\mathbf {x}) = \log \operatorname {s o f t m a x} _ {x _ {i}} \left(\mathbf {C} ^ {\top} E _ {i}\right) = C _ {x _ {i}} ^ {\top} E _ {i} - \log \sum_ {j} \exp \left(C _ {j} ^ {\top} E _ {i}\right).
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
Here the first term is a vector product over $D$ -dimensional embeddings $\mathbf { \Phi } _ { i } = f ( x _ { 1 } \dots x _ { i - 1 } )$ and a classifier C. The second term is a log-sum-exp operation and is independent of the next token $x _ { i }$ . During training, we optimize all next-token predictions $\ell = [ \ell _ { 1 } \dots \ell _ { N } ]$ jointly using teacher forcing:
|
| 95 |
+
|
| 96 |
+
$$
|
| 97 |
+
\ell = \left(\mathbf {C} ^ {\top} \mathbf {E}\right) _ {\mathbf {x}} - \log \sum_ {j} \exp \left(C _ {j} ^ {\top} \mathbf {E}\right), \tag {4}
|
| 98 |
+
$$
|
| 99 |
+
|
| 100 |
+
where $\mathrm { ~ ~ { ~ \pi ~ } ~ } = \left[ \begin{array} { l l l } { \mathrm { ~ ~ { ~ \pi ~ } ~ } _ { 1 } \ldots } & { \mathrm { ~ ~ { ~ \pi ~ } ~ } _ { N } } \end{array} \right]$ and $\Big ( \mathbf { C } ^ { \top } \mathbb { E } \Big ) _ { \mathbf { x } } = \left[ C _ { x _ { 1 } } ^ { \top } E _ { 1 } \ldots C _ { x _ { N } } ^ { \top } E _ { N } \right]$ . The first term in Equation (4) is a combination of an indexing operation and matrix multiplication. It has efficient forward and backward passes, in terms of both compute and memory, as described in Section 4.1. The second term in Equation (4) is a joint log-sum-exp (LSE) and matrix multiplication operation. Section 4.2 describes how to compute the forward pass of this linear-log-sum-exp operation efficiently using a joint matrix multiplication and reduction kernel. Section 4.3 describes how to compute its backward pass efficiently by taking advantage of the sparsity of the gradient over a large vocabulary. Putting all the pieces together yields a memory-efficient low-latency cross-entropy loss.
|
| 101 |
+
|
| 102 |
+
# 4.1 MEMORY-EFFICIENT INDEXED MATRIX MULTIPLICATION
|
| 103 |
+
|
| 104 |
+
A naive computation of indexed matrix multiplication involves either explicit computation of the logits $\mathbf { C } ^ { \top } \mathbf { E }$ with an $O ( N | V | )$ memory cost, or indexing into the classifier $\mathbf { C _ { x } } = [ C _ { x _ { 1 } } \ldots C _ { x _ { N } } ]$ with
|
| 105 |
+
|
| 106 |
+
Algorithm 1 Memory-efficient indexed matrix multiplication
|
| 107 |
+
Inputs: $\mathbf{E}\in \mathbb{R}^{D\times N}$ $\mathbf{C}\in \mathbb{R}^{D\times |V|}$ $\mathbf{x}\in \mathbb{R}^{N}$ Block sizes $N_{B}$ and $D_B$ .
|
| 108 |
+
Outputs: $\mathbf{o} = (\mathbf{C}^{\top}\mathbf{E})_{\mathbf{x}}\in \mathbb{R}^{N}$ for blocks $\mathbf{E}_n,\mathbf{x}_n$ do $\triangleright$ Divide E and x into blocks of size $D\times N_B$ and $N_B$ , respectively $\triangleright$ Zero vector of size $N_B$ in on-chip SRAM
|
| 109 |
+
for blocks $\mathbf{E}_{n,d}$ do $\triangleright$ Divide $\mathbf{E}_n$ into blocks of size $D_B\times N_B$ $\mathbf{c} = \mathbf{C}_{\mathbf{x}_n,d}$ $\triangleright$ Indexed load into on-chip SRAM $\mathbf{0}_n + = \mathbf{E}_{n,d}\cdot \mathbf{c}$ $\triangleright$ Column-wide dot product
|
| 110 |
+
end for
|
| 111 |
+
write $\mathbf{o}_n$ $\triangleright$ From on-chip SRAM to main GPU memory
|
| 112 |
+
end for
|
| 113 |
+
|
| 114 |
+
an $O ( N D )$ memory cost. Our implementation fuses the classifier indexing $\mathbf { C _ { x } }$ with the consecutive dot product between columns $C _ { x _ { i } }$ and $\textit { \textbf { i } }$ in a single CUDA/Triton kernel (Tillet et al., 2019). Our kernel retrieves the value $x _ { i }$ , the $x _ { i }$ -th column from C, and the $i$ -th column from E, and stores them in on-chip shared memory (SRAM). It then performs a dot product between $C _ { x _ { i } }$ and $\textit { \textbf { i } }$ and writes the result into global memory. The kernel uses only on-chip SRAM throughout and does not allocate any GPU memory. For efficiency, we perform all operations blockwise to make the best use of GPU cache structure. Algorithm 1 and Fig. 2a summarize the computation and access patterns.
|
| 115 |
+
|
| 116 |
+
# 4.2 MEMORY-EFFICIENT LINEAR-LOG-SUM-EXP, FORWARD PASS
|
| 117 |
+
|
| 118 |
+
Implementing a serial memory-efficient linear-log-sum-exp is fairly straightforward: use a triple forloop. The innermost loop computes the dot product between $C _ { v }$ and $E _ { n }$ for the $v$ -th token and the $n$ -th batch element. The middle loop iterates over the vocabulary, updating the log-sum-exp (LSE) along the way. Finally, the outermost loop iterates over all batch elements. Parallelizing over the outermost loop is trivial and would expose enough work to saturate the CPU due to the number of tokens in training batches (commonly in the thousands). Parallelization that exposes enough work to saturate the GPU is more challenging.
|
| 119 |
+
|
| 120 |
+
Let us first examine how efficient matrix multiplication between the batch of model output embeddings $\mathbf { E } \in \mathbb { R } ^ { D \times N }$ and the classifier $\mathbf { C } \in \mathbb { R } ^ { D \times | V | }$ is implemented on modern GPUs (Kerr et al., 2017). A common method is to first divide the output $\begin{array} { r } { \begin{array} { r } { \bar { \mathbf { O } } = \mathbf { C } ^ { \top } \quad \in \mathbb { R } ^ { | V | \times N } } \end{array} } \end{array}$ into a set of blocks of size $V _ { B } \times N _ { B }$ . Independent CUDA blocks retrieve the corresponding parts $\mathbb { E } _ { n }$ of E with size $D \times N _ { B }$ and blocks $\mathbf { C } _ { m }$ of $\mathbf { C }$ with size $D \times V _ { B }$ , and perform the inner product ${ \bf O } _ { n m } = { \bf C } _ { m } ^ { \top } { \bf E } _ { n }$ En along the $D$ dimension. Due to limited on-chip SRAM, most implementations use a for-loop for large values of $D$ . They loop over smaller size $D _ { B } \times N _ { B }$ and $D _ { B } \times V _ { B }$ blocks and accumulate $\begin{array} { r } { \bar { \mathbf { O } _ { n v } } = \sum _ { d } \mathbf { C } _ { v d } ^ { \top } \mathbf { \Sigma } _ { n d } } \end{array}$ in SRAM. Each CUDA block then writes $\mathbf { O } _ { n m }$ back into global memory. This method exposes enough work to the GPU and makes efficient use of SRAM and L2 cache.
|
| 121 |
+
|
| 122 |
+
To produce log-sum-exp $( \mathbf { C } ^ { \top } \mathbf { E } )$ , we use the same blocking and parallelization strategy as matrix multiplication. Each block first computes a matrix multiplication, then the log-sum-exp along the vocabulary dimension $m$ for its block, and finally updates LSE with its result.
|
| 123 |
+
|
| 124 |
+
Note that multiple CUDA blocks are now all writing to the same location of LSE. This includes blocks in the same input range $n$ but different vocabulary ranges $m$ . We use a spin-lock on an atomic operation in global memory to synchronize the updates by different CUDA blocks as this is simple to implement in our Triton framework and incurs little overhead. Alternative methods, such as an atomic compare-and-swap loop, may perform better when implementing in CUDA directly.
|
| 125 |
+
|
| 126 |
+
Algorithm 2 and Fig. 2b summarize the computation and access patterns.
|
| 127 |
+
|
| 128 |
+
# 4.3 MEMORY-EFFICIENT LINEAR-LOG-SUM-EXP, BACKWARD PASS
|
| 129 |
+
|
| 130 |
+
The backward pass needs to efficiently compute two gradient updates:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\nabla \mathbf {E} = \lambda^ {\top} \frac {\partial}{\partial \mathbf {E}} \log \sum \exp (\mathbf {C} ^ {\top} \mathbf {E}) \quad \text {a n d} \quad \nabla \mathbf {C} = \lambda^ {\top} \frac {\partial}{\partial \mathbf {C}} \log \sum \exp (\mathbf {C} ^ {\top} \mathbf {E})
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
Algorithm 2 Memory-efficient linear-log-sum-exp, forward pass
|
| 137 |
+
Inputs: $\mathbf{E}\in \mathbb{R}^{D\times N}$ and $\mathbf{C}\in \mathbb{R}^{D\times |V|}$ Block sizes $N_{B},V_{B}$ ,and $D_B$ Outputs: $\mathrm{LSE} = \log \sum_{j}\exp (C_{j}^{\top}\mathbf{E})\in \mathbb{R}^{N}$ $\mathrm{LSE} = -\infty_{N}$ $\triangleright -\infty$ vector of size $N$ in main GPU memory
|
| 138 |
+
for all pairs of blocks $\mathbf{E}_n,\mathbf{C}_v$ do $\triangleright$ Divide E and C into blocks of size $D\times N_B$ and $D\times V_B$ $\mathbf{A}_{nv} = \mathbf{0}_{V_B\times N_B}$ $\triangleright$ Zero matrix of size $V_{B}\times N_{B}$ in on-chip SRAM
|
| 139 |
+
for blocks $\mathbf{E}_{n,d},\mathbf{C}_{v,d}$ do $\triangleright$ Divide $\mathbf{E}_n$ and $\mathbf{C}_v$ into blocks of $D_B\times N_B$ and $D_B\times V_B$ $\mathbf{A}_{nv} + = \mathbf{C}_{v,d}^{\top}\cdot \mathbf{E}_{n,d}$ $\triangleright$ Blockwise matrix multiplication
|
| 140 |
+
end for $\mathrm{LSE}_{nv} = \log \sum \exp (\mathbf{A}_{nv}^{\top})$ $\triangleright$ Numerically stable implementation with max $\mathrm{LSE}_n = \log (\exp (\mathrm{LSE}_n) + \exp (\mathrm{LSE}_{nv}))$ $\triangleright$ Locking thread-safe log-add-exp
|
| 141 |
+
end for
|
| 142 |
+
|
| 143 |
+
for a backpropagated gradient $\lambda = \nabla \mathbb { L } \mathrm { S E }$ . Formally, the gradient is defined as
|
| 144 |
+
|
| 145 |
+
$$
|
| 146 |
+
\nabla \mathbf {E} ^ {\top} = (\mathbf {S} \cdot \nabla \mathrm {L S E}) \mathbf {C} \quad \text {a n d} \quad \nabla \mathbf {C} ^ {\top} = (\mathbf {S} \cdot \nabla \mathrm {L S E}) ^ {\top} \mathbf {E}
|
| 147 |
+
$$
|
| 148 |
+
|
| 149 |
+
where $\mathbf { S } = \mathrm { s o f t m a x } ( \mathbf { C } ^ { \top } )$ and $\ast$ refers to the row-by-row elementwise multiplication of the softmax S and the gradient ∇LSE: $\begin{array} { r } { \hat { \mathbf { S } } = \mathbf { S } \cdot \nabla \mathrm { L S E } } \end{array}$ .
|
| 150 |
+
|
| 151 |
+
Computationally, the backward pass is a double matrix multiplication $\mathbf { C } ^ { \top } \mathbf { E }$ and $\hat { \mathbf { S } } \mathbf { C }$ or $\hat { \mathbf { S } } ^ { \top } \mathbb { E }$ with intermediate matrices S and $\hat { \bf S }$ that do not fit into GPU memory and undergo a non-linear operation. We take a similar approach to the forward pass, recomputing the matrix $\mathbf { C } ^ { \top }$ implicitly in the GPU’s shared memory. For the backward pass, we do not need to compute the normalization constant of the softmax, since $\mathbf { S } = \mathrm { s o f t m a x } ( \mathbf { \bar { C } } ^ { \top } ) = \mathrm { e x p } ( \mathbf { C } ^ { \top } \mathbf { \Sigma } - \mathrm { L S E } )$ . This allows us to reuse the global synchronization of the forward pass, and compute S efficiently in parallel.
|
| 152 |
+
|
| 153 |
+
We implement the second matrix multiplication in the main memory of the GPU, as a canonical blockwise implementation would require storing or synchronizing S. Algorithm 3 and Fig. 2c summarize the computation and access patterns. A naive implementation of this algorithm requires zero additional memory but is slow due to repeated global memory load and store operations. We use two techniques to improve the memory access pattern: gradient filtering and vocabulary sorting.
|
| 154 |
+
|
| 155 |
+
Gradient filtering. By definition, the softmax S sums to one over the vocabulary dimension. If stored in bfloat16 with a 7-bit fraction, any value below $\varepsilon = 2 ^ { - 1 2 }$ will likely be ignored due to truncation in the summation or rounding in the normalization.1 This has profound implications for the softmax matrix S: For any column, at most $\begin{array} { r } { \frac { 1 } { \varepsilon } = 4 0 9 6 } \end{array}$ entries have non-trivial values and contribute to the gradient computation. All other values are either rounded to zero or truncated. In practice, the sparsity of the softmax matrix S is much higher: empirically, in frontier models we evaluate, less than $0 . 0 2 \%$ of elements are non-zero. Furthermore, the sparsity of the softmax matrix grows as vocabulary size increases. In Algorithm 3, we take advantage of this sparsity and skip gradient computation for any block whose corresponding softmax matrix $S _ { n m }$ has only negligible elements. We chose the threshold $\varepsilon = 2 ^ { - 1 2 }$ to be the smallest bfloat16 value that is not truncated. In practice, this leads to a $3 . 5 \mathrm { x }$ speedup without loss of precision in any gradient computation. See Section 5 for a detailed analysis.
|
| 156 |
+
|
| 157 |
+
The efficiency of gradient filtering is directly related to the block-level sparsity of the softmax matrix. We cannot control the overall sparsity pattern without changing the output. However, we can change the order of the vocabulary to create denser local blocks for more common tokens.
|
| 158 |
+
|
| 159 |
+
Vocabulary sorting. Ideally the vocabulary would be ordered such that all tokens with non-trivial gradients would be contiguously located. This reduces the amount of computation wasted by partially populated blocks – ideally blocks would either be entirely empty (and thus skipped) or entirely populated. We heuristically group the non-trivial gradients by ordering the tokens by their average logit. Specifically, during the forward pass (described in Section 4.2) we compute the average logit
|
| 160 |
+
|
| 161 |
+
Algorithm 3 Memory-efficient linear-log-sum-exp, backward pass
|
| 162 |
+
Inputs: $\mathbf{E} \in \mathbb{R}^{D \times N}$ , $\mathbf{C} \in \mathbb{R}^{D \times |V|}$ , $\mathrm{LSE} \in \mathbb{R}^N$ , and $\nabla \mathrm{LSE} \in \mathbb{R}^N$ . Block sizes $N_B, V_B$ , and $D_B$ . Accuracy threshold $\varepsilon$ .
|
| 163 |
+
Outputs: $\nabla \mathbf{E} \in \mathbb{R}^{D \times N}$ , $\nabla \mathbf{C} \in \mathbb{R}^{D \times |V|}$ for all pairs of blocks $\mathbf{E}_n, \mathbf{C}_v$ do $\triangleright$ Divide $\mathbf{E}$ and $\mathbf{C}$ into blocks of size $D \times N_B$ and $D \times V_B$ $\mathbf{A}_{nv} = \mathbf{0}_{V_B \times N_B}$ for blocks $\mathbf{E}_{n,d}, \mathbf{C}_{v,d}$ do $\triangleright$ Divide $\mathbf{E}_n$ and $\mathbf{C}_v$ into blocks of $D_B \times N_B$ and $D_B \times V_B$ $\triangleright$ Blockwise matrix multiplication
|
| 164 |
+
end for $\mathbf{S}_{nv} = \exp(\mathbf{A}_{nv} - \mathrm{LSE}_n)$ if all $(\mathbf{S}_{nv} < \varepsilon)$ then $\triangleright$ Skip computation if below desired numerical precision
|
| 165 |
+
end if
|
| 166 |
+
for blocks $\mathbf{E}_{n,d}, \mathbf{C}_{v,d}$ do $\triangleright$ Divide $\mathbf{E}_n$ and $\mathbf{C}_m$ into blocks of $D_B \times N_B$ and $D_B \times V_B$ $\nabla \mathbf{E}_{n,d}^{\top} + = (\mathbf{S}_{nv} \cdot \nabla \mathrm{LSE}_n) \mathbf{C}_{v,d}$ $\triangleright$ Locking thread-safe gradient update $\nabla \mathbf{C}_{v,d}^{\top} + = (\mathbf{S}_{nv} \cdot \nabla \mathrm{LSE}_n)^{\top} \mathbf{E}_{n,d}$ $\triangleright$ Locking thread-safe gradient update
|
| 167 |
+
end for
|
| 168 |
+
end for
|
| 169 |
+
|
| 170 |
+
per token using an atomic addition. For the backward pass, we divide the vocabulary dimension $| V |$ into blocks with similar average logit instead of arbitrarily. This requires a temporary buffer of size $O ( | V | )$ , about 1 MB for the largest vocabularies in contemporary LLMs (Riviere et al. ` , 2024).
|
| 171 |
+
|
| 172 |
+
Putting all the pieces together, we arrive at forward and backward implementations of cross-entropy that have a negligible incremental memory footprint without sacrificing speed. Note that in practice, we found it to be easier and more memory-efficient to merge the indexed matrix-multiplication backward implementation with the backward pass of the linear-log-sum-exp operator (Algorithm 3). The two operations share much of the computation and memory access pattern, see Algorithm 4.
|
| 173 |
+
|
| 174 |
+
# 5 ANALYSIS
|
| 175 |
+
|
| 176 |
+
# 5.1 RUNTIME AND MEMORY
|
| 177 |
+
|
| 178 |
+
First we examine the runtime and memory of various implementations of the cross-entropy loss $\log \operatorname { s o f t m a x } _ { x _ { i } } ( \mathbf { C } ^ { \top } )$ . We consider a batch of 8,192 tokens with a vocabulary size of 256,000 and hidden dimension 2,304. This corresponds to Gemma 2 (2B) (Riviere et al. ` , 2024). We use the Alpaca dataset (Taori et al., 2023) for inputs and labels and Gemma 2 (2B) Instruct weights to compute $\cdot$ and for C. The analysis is summarized in Table 1.
|
| 179 |
+
|
| 180 |
+
The baseline implements the loss directly in PyTorch (Paszke et al., 2019). This is the default in popular frameworks such as Torch Tune (Torch Tune Team, 2024) and Transformers (Wolf et al., 2019). This method has reasonable throughput but a peak memory usage of 28,000 MB of GPU memory to compute the loss+gradient (Table 1 row 5). Due to memory fragmentation, just computing the loss+gradient for the classifier head requires an 80 GB GPU. torch.compile (Ansel et al., 2024) is able to reduce memory usage by $43 \%$ and computation time by $33 \%$ , demonstrating the effectiveness of kernel fusion (Table 1 row 4 vs. 5). Torch Tune (Torch Tune Team, 2024) includes a method to compute the cross-entropy loss that divides the computation into chunks and uses torch.compile to save memory. This reduces memory consumption by $65 \%$ vs. Baseline and by $40 \%$ vs. torch.compile (to 9,631 MB, see Table 1 row 3 vs. 4 and 5). Liger Kernels (Hsu et al., 2024) provide a memory-efficient implementation of the cross-entropy loss that, like Torch Tune, makes uses of chunked computation to reduce peak memory usage. While very effective at reducing the memory footprint, using $9 5 \%$ less memory than Baseline, it has a detrimental effect on latency, more than doubling the wall-clock time for the computation (Table 1, row 2 vs. 4). The memory
|
| 181 |
+
|
| 182 |
+
Table 1: Peak memory footprint and time to compute the loss, its gradient, and their combination. Note that intermediate buffers can often (but not always) be reused between the loss and gradient computation, resulting in lower peak memory consumption than the sum of the parts. Batch of 8,192 tokens with a vocabulary size of 256,000 and hidden dimension 2304. Embedding and classifier matrix taken during Gemma 2 (2B) training on Alpaca. Measured on an A100-SXM4 GPU with 80 GB of RAM, PyTorch 2.4.1, CUDA 12.4, rounded to closest MB. Some numbers are multiples of 1,000 due to dimensions chosen and PyTorch’s allocation strategy. ‘Lower bound’ is the amount of memory required for the output buffer(s), i.e., ∇E and ∇C, this is the lower bound for the memory footprint of any method. Results averaged over 5 seeds.
|
| 183 |
+
|
| 184 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Loss</td><td colspan="2">Gradient</td><td colspan="2">Loss+Gradient</td></tr><tr><td>Memory</td><td>Time</td><td>Memory</td><td>Time</td><td>Memory</td><td>Time</td></tr><tr><td>Lower bound</td><td>0.004 MB</td><td></td><td>1,161 MB</td><td></td><td>1,161 MB</td><td></td></tr><tr><td>1)CCE (Ours)</td><td>1 MB</td><td>46 ms</td><td>1,163 MB</td><td>100 ms</td><td>1,164 MB</td><td>145 ms</td></tr><tr><td>2)Liger Kernels (Hsu et al., 2024)2</td><td>1,474 MB</td><td>304 ms</td><td></td><td></td><td>1,474 MB</td><td>304 ms</td></tr><tr><td>3)Torch Tune Team (2024) (8 chunks)</td><td>8,000 MB</td><td>55 ms</td><td>1,630 MB</td><td>115 ms</td><td>9,631 MB</td><td>169 ms</td></tr><tr><td>4)torch.compile</td><td>4,000 MB</td><td>49 ms</td><td>12,000 MB</td><td>92 ms</td><td>16,000 MB</td><td>143 ms</td></tr><tr><td>5)Baseline</td><td>24,000 MB</td><td>82 ms</td><td>16,000 MB</td><td>122 ms</td><td>28,000 MB</td><td>208 ms</td></tr><tr><td>6)CCE (No Vocab Sorting)</td><td>0.09 MB</td><td>45 ms</td><td>1,162 MB</td><td>115 ms</td><td>1,162 MB</td><td>159 ms</td></tr><tr><td>7)CCE (No Grad. Filter)</td><td>0.09 MB</td><td>45 ms</td><td>1,163 MB</td><td>314 ms</td><td>1,162 MB</td><td>357 ms</td></tr><tr><td>8)CCE-Kahan</td><td>1 MB</td><td>47 ms</td><td>2,325 MB</td><td>114 ms</td><td>2,326 MB</td><td>160 ms</td></tr><tr><td>9)CCE-Kahan-FullC</td><td>1 MB</td><td>47 ms</td><td>2,326 MB</td><td>268 ms</td><td>2,326 MB</td><td>313 ms</td></tr><tr><td>10)CCE-Kahan-FullE</td><td>1 MB</td><td>47 ms</td><td>2,326 MB</td><td>247 ms</td><td>2,326 MB</td><td>292 ms</td></tr></table>
|
| 185 |
+
|
| 186 |
+
usage of CCE grows with $O ( N + | V | )$ , as opposed to $O ( N \times | V | )$ for Baseline, torch.compile, and Torch Tune, and $O ( N \times D )$ for Liger Kernels. In practice, CCE has a negligible memory footprint regardless of vocabulary size or sequence length.
|
| 187 |
+
|
| 188 |
+
Compared to the fastest method, torch.compile, CCE computes the loss slightly faster $5 \%$ , 4ms, Table 1 row 1 vs. 4). This is because CCE does not write all the logits to global memory. CCE computes the loss+gradient slightly slower (6%, 2 ms). While CCE needs to recompute $\mathbf { C } ^ { \top } \mathbf { E }$ , it is able to save time in other parts of the computation. See Appendix C.1 for a breakdown of the backwards pass of CCE and Baseline. This increase is largely negligible as the forward+backward pass for even a small LLM (2B parameters) is on the order of seconds.
|
| 189 |
+
|
| 190 |
+
The performance of CCE is enabled several factors. Without vocabulary sorting CCE takes $15 \%$ (23 ms) longer (Table 1 row 1 vs. 6) and without gradient filtering it is 3.4x (356 ms) longer (row 1 vs. 7). CCE utilizes the final gradient floating point type (typically bf16) for summation in global memory. For increased numerical stability, we experiment with Kahan summation (Kahan, 1965) with a higher time and memory cost (Table 1 row 1 vs. 8). We can further incraese the numerical stability by selectively applying gradient filtering to just $\nabla E$ and $\boldsymbol { \nabla } C$ . When combined with Kahan summation, removing gradient filtering from either $\boldsymbol { \nabla } C$ or $\nabla$ results in a similar decrease of performance (Table 1 row 9 or 10 vs. 8). The last variant (CCE-Kahan-FullC) is particularly in-
|
| 191 |
+
|
| 192 |
+
teresting for pretraining, where the numerical precision makes a difference. For fine-tuning all variants of CCE perform equivalently, as shown in Section 5.3.
|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 3: Average probability for the ith most likely token, log-log plot. The probabilities very quickly vanish below numerical precision.
|
| 196 |
+
|
| 197 |
+
In Appendix B, we demonstrate that CCE (and other methods) can be made up to 3 times faster by removing tokens that are ignored. In Appendix C we benchmark with more models. We find that as the vocabulary size $( | V | )$ to hidden size $( D )$ ratio decreases, CCE’s advantage in computation time for Loss+Gradient decreases, but continues to save a substantial amount of memory.
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
(a) Gemma 2 2B
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
400 (b) Phi 3.5 Mini
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
(c) Qwen 2.5 7B
|
| 207 |
+
|
| 208 |
+

|
| 209 |
+
(d) Mistral Nemo
|
| 210 |
+
Figure 4: Training loss curves for four models on the Alpaca dataset (Taori et al., 2023). The loss curves for CCE and torch.compile are nearly indistinguishable, showing that the gradient filtering in CCE does not impair convergence. Results averaged over 5 seeds.
|
| 211 |
+
|
| 212 |
+
# 5.2 GRADIENT FILTERING
|
| 213 |
+
|
| 214 |
+
Fig. 3 shows the sorted softmax probability of vocabulary entries. Note that the probabilities vanish very quickly and, for the top $1 0 ^ { 5 }$ most likely tokens, there is a linear relationship between log rank and log probability. Second, by the ${ \sim } 5 0 0 \mathrm { h }$ most likely token, the probability has fallen bellow our threshold for gradient filtering.
|
| 215 |
+
|
| 216 |
+
This explains why we are able to filter so many values from the gradient computation without affecting the result. At these sparsity levels, most blocks of the softmax matrix S are empty.
|
| 217 |
+
|
| 218 |
+
# 5.3 TRAINING STABILITY
|
| 219 |
+
|
| 220 |
+
Fine-tuning. We fine-tune Qwen 2.5 7B Instruct (Qwen Team, 2024), Phi 3.5 Mini Instruct (Abdin et al., 2024), Gemma 2 2B Instruct (Riviere et al. ` , 2024), and Mistral NeMo (Mistral AI Team, 2024) on the Alpaca Dataset (Taori et al., 2023) using CCE and torch.compile as the control. CCE and torch.compile have indistinguishable loss curves, demonstrating that the gradient filtering in CCE does not impair convergence (Fig. 4).
|
| 221 |
+
|
| 222 |
+
Pretraining. In our initial experiments using CCE for pretraining, we found that validation perplexity suffered due to two sources of error. First, gradient filtering when applied to ∇C causes no gradient to be propagated to tokens that have little to no support in the training set. This does not cause issues when fine-tuning but does when pretraining. Second, CCE performs a summation in global memory. It is most efficient to perform this reduction in the desired final floating point type. In pretraining, the resulting loss of precision reduces performance. We use Kahan summation (Kahan, 1965) to recover this loss of precision. This changes correspond to CCE-Kahan-FullC.
|
| 223 |
+
|
| 224 |
+
We pretrain Qwen 2.5 7B Instruct (Qwen Team, 2024), Phi 3.5 Mini Instruct (Abdin et al., 2024), Gemma 2 2B Instruct (Riviere et al. ` , 2024), and Mistral NeMo (Mistral AI Team, 2024) on the $5 \%$ of the Open WebText Dataset (Gokaslan et al., 2019) using CCE-Kahan-FullC and torch.compile. We report validation perplexity on a held-out $0 . 2 5 \%$ of Open WebText and find that CCE-Kahan-FullC produces identical curves as torch.compile (Fig. 5).
|
| 225 |
+
|
| 226 |
+
We make two notes about CCE-Kahan-FullC. First, the increased memory usage of CCE-Kahan-FullC vs. CCE is due to temporary buffers used in the backward pass. The size of these buffers
|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
(a) Gemma 2 2B
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
400 (b) Phi 3.5 Mini
|
| 233 |
+
|
| 234 |
+

|
| 235 |
+
(c) Qwen 2.5 7B
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
(d) Mistral Nemo
|
| 239 |
+
Figure 5: Validation perplexity curves for four models on trained using $5 \%$ of the Open WebText dataset (Gokaslan et al., 2019). The validation set is a $0 . 2 5 \%$ subset of Open WebText that does not overlap with the train set. We find that CCE-Kahan-FullC matches torch.compile. Results averaged over 5 seeds.
|
| 240 |
+
|
| 241 |
+
is typically less than the amount of free memory needed to rematerialize activations when using activation/gradient checkpoint (Chen et al., 2016). Thus CCE-Kahan-FullC often shares the same memory saving benefits as CCE. Second, the increased computation time of CCE-Kahan-FullC vs. torch.compile is often offset by the larger batch sizes CCE-Kahan-FullC enables. In our experiments with Mistral NeMo, CCE-Kahan-FullC enabled doubling the batch size, thereby decreasing training time by 2 hours $( 1 6 \% )$ compared to torch.compile.
|
| 242 |
+
|
| 243 |
+
# 6 DISCUSSION
|
| 244 |
+
|
| 245 |
+
As vocabulary size $| V |$ has grown in language models, so has the memory footprint of the loss layer. The memory used by this one layer dominates the training-time memory footprint of many recent language models. We described CCE, an algorithm to compute $\ell _ { i } = \log \operatorname { s o f t m a x } _ { i } ( \mathbf { C } ^ { T } f ( x _ { 1 } \dots x _ { i - 1 } ) )$ and its gradient with negligible memory footprint.
|
| 246 |
+
|
| 247 |
+
Beyond the immediate impact on compact large-vocabulary LLMs, as illustrated in Fig. 1, we expect that CCE may prove beneficial for training very large models. Specifically, very large models are trained with techniques such as pipeline parallelism (Huang et al., 2019; Narayanan et al., 2019). Pipeline parallelism works best when all stages are equally balanced in computation load. Achieving this balance is easiest when all blocks in the network have similar memory-to-computation ratios. The classification head is currently an outlier, with a disproportionately high memory-tocomputation ratio. CCE may enable better pipeline balancing or reducing the number of stages.
|
| 248 |
+
|
| 249 |
+
We implemented CCE using Triton (Tillet et al., 2019). Triton creates efficient GPU kernels and enables rapid experimentation but has some limitations in control flow. Specifically, the control flow must be specified at the block level and therefore our thread-safe log-add-exp and gradient filtering are constrained to operate at the block level as well. We expect that implementing CCE in CUDA may bring further performance gains because control flow could be performed at finer-grained levels.
|
| 250 |
+
|
| 251 |
+
It could also be interesting to extend CCE to other classification problems where the number of classes is large, such as image classification and contrastive learning.
|
| 252 |
+
|
| 253 |
+
# REFERENCES
|
| 254 |
+
|
| 255 |
+
Marah I Abdin, Sam Ade Jacobs, Ammar Ahmad Awan, Jyoti Aneja, Ahmed Awadallah, Hany Awadalla, Nguyen Bach, Amit Bahree, Arash Bakhtiari, Harkirat S. Behl, et al. Phi-3 technical report: A highly capable language model locally on your phone, 2024. URL https://arxiv. org/abs/2404.14219.
|
| 256 |
+
Jason Ansel, Edward Z. Yang, Horace He, Natalia Gimelshein, Animesh Jain, Michael Voznesensky, Bin Bao, Peter Bell, David Berard, Evgeni Burovski, et al. Pytorch 2: Faster machine learning through dynamic python bytecode transformation and graph compilation. In ACM International Conference on Architectural Support for Programming Languages and Operating Systems, 2024.
|
| 257 |
+
Tianqi Chen, Bing Xu, Chiyuan Zhang, and Carlos Guestrin. Training deep nets with sublinear memory cost, 2016. URL http://arxiv.org/abs/1604.06174.
|
| 258 |
+
Yu-Hui Chen, Raman Sarokin, Juhyun Lee, Jiuqiang Tang, Chuo-Ling Chang, Andrei Kulik, and Matthias Grundmann. Speed is all you need: On-device acceleration of large diffusion models via GPU-aware optimizations. In Conference on Computer Vision and Pattern Recognition, Workshops, 2023.
|
| 259 |
+
Krzysztof Marcin Choromanski, Valerii Likhosherstov, David Dohan, Xingyou Song, Andreea Gane, Tamas Sarl ´ os, Peter Hawkins, Jared Quincy Davis, Afroz Mohiuddin, Lukasz Kaiser, ´ David Benjamin Belanger, Lucy J. Colwell, and Adrian Weller. Rethinking attention with performers. In International Conference on Learning Representations, 2021.
|
| 260 |
+
Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Re. FlashAttention: Fast and ´ memory-efficient exact attention with IO-awareness. In Neural Information Processing Systems, 2022.
|
| 261 |
+
Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, et al. The Llama 3 herd of models, 2024. URL https://arxiv.org/abs/2407.21783.
|
| 262 |
+
Philip Gage. A new algorithm for data compression. The C Users Journal, 12(2):23–38, 1994.
|
| 263 |
+
Aaron Gokaslan, Vanya Cohen, Ellie Pavlick, and Stefanie Tellex. Openwebtext corpus, 2019. URL http://Skylion007.github.io/OpenWebTextCorpus.
|
| 264 |
+
Priya Goyal, Piotr Dollar, Ross B. Girshick, Pieter Noordhuis, Lukasz Wesolowski, Aapo Kyrola, ´ Andrew Tulloch, Yangqing Jia, and Kaiming He. Accurate, large minibatch SGD: Training ImageNet in 1 hour, 2017. URL http://arxiv.org/abs/1706.02677.
|
| 265 |
+
Edouard Grave, Armand Joulin, Moustapha Cisse, David Grangier, and Herv ´ e J ´ egou. Efficient´ softmax approximation for gpus. In International Conference on Machine Learning, 2017.
|
| 266 |
+
Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces, 2023. URL https://arxiv.org/abs/2312.00752.
|
| 267 |
+
Albert Gu, Karan Goel, and Christopher Re. Efficiently modeling long sequences with structured ´ state spaces. In International Conference on Learning Representations, 2022.
|
| 268 |
+
W. Daniel Hillis and Guy L. Steele. Data parallel algorithms. Commun. ACM, 29(12):1170–1183, 1986.
|
| 269 |
+
Pin-Lun Hsu, Yun Dai, Vignesh Kothapalli, Qingquan Song, Shao Tang, and Siyu Zhu. Liger-Kernel: Efficient Triton kernels for LLM training, 2024. URL https://github.com/linkedin/ Liger-Kernel.
|
| 270 |
+
Yanping Huang, Youlong Cheng, Ankur Bapna, Orhan Firat, Dehao Chen, Mia Xu Chen, HyoukJoong Lee, Jiquan Ngiam, Quoc V. Le, Yonghui Wu, and Zhifeng Chen. GPipe: Efficient training of giant neural networks using pipeline parallelism. In Neural Information Processing Systems, 2019.
|
| 271 |
+
|
| 272 |
+
Sam Ade Jacobs, Masahiro Tanaka, Chengming Zhang, Minjia Zhang, Shuaiwen Leon Song, Samyam Rajbhandari, and Yuxiong He. Deepspeed ulysses: System optimizations for enabling training of extreme long sequence transformer models, 2023. URL https://doi.org/ 10.48550/arXiv.2309.14509.
|
| 273 |
+
William Kahan. Pracniques: further remarks on reducing truncation errors. Communications of the ACM, 1965.
|
| 274 |
+
Andrew Kerr, Duane Merrill, Julien Demouth, and John Tran. CUTLASS: Fast linear algebra in CUDA $\mathrm { C } { + } { + }$ , 2017. URL https://developer.nvidia.com/blog/ cutlass-linear-algebra-cuda/.
|
| 275 |
+
Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In International Conference on Learning Representations, 2015.
|
| 276 |
+
Nikita Kitaev, Lukasz Kaiser, and Anselm Levskaya. Reformer: The efficient transformer. In International Conference on Learning Representations, 2020.
|
| 277 |
+
Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph Gonzalez, Hao Zhang, and Ion Stoica. Efficient memory management for large language model serving with pagedattention. In Symposium on Operating Systems Principles, 2023.
|
| 278 |
+
Shenggui Li, Fuzhao Xue, Chaitanya Baranwal, Yongbin Li, and Yang You. Sequence parallelism: Long sequence training from system perspective. In Association for Computational, 2023.
|
| 279 |
+
Ilya Loshchilov and Frank Hutter. Decoupled weight decay regularization. In International Conference on Learning Representations, 2019.
|
| 280 |
+
Maxim Milakov and Natalia Gimelshein. Online normalizer calculation for softmax, 2018. URL http://arxiv.org/abs/1805.02867.
|
| 281 |
+
Mistral AI Team. Mistral NeMo, 2024. URL https://mistral.ai/news/mistral-nemo/.
|
| 282 |
+
Deepak Narayanan, Aaron Harlap, Amar Phanishayee, Vivek Seshadri, Nikhil R. Devanur, Gregory R. Ganger, Phillip B. Gibbons, and Matei Zaharia. Pipedream: Generalized pipeline parallelism for DNN training. In ACM Symposium on Operating Systems Principles, 2019.
|
| 283 |
+
Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. PyTorch: An imperative style, high-performance deep learning library. In Neural Information Processing Systems, 2019.
|
| 284 |
+
Qwen Team. Qwen2.5: A party of foundation models, September 2024. URL https://qwenlm. github.io/blog/qwen2.5/.
|
| 285 |
+
Markus N. Rabe and Charles Staats. Self-attention does not need ${ \mathrm { O } } ( { \mathrm { n } } ^ { 2 } )$ memory, 2021. URL https://arxiv.org/abs/2112.05682.
|
| 286 |
+
Samyam Rajbhandari, Jeff Rasley, Olatunji Ruwase, and Yuxiong He. ZeRO: Memory optimizations toward training trillion parameter models. In International Conference for High Performance Computing, Networking, Storage and Analysis, 2020.
|
| 287 |
+
Morgane Riviere, Shreya Pathak, Pier Giuseppe Sessa, Cassidy Hardin, Surya Bhupatiraju, L ` eonard ´ Hussenot, Thomas Mesnard, Bobak Shahriari, Alexandre Rame, Johan Ferret, et al. Gemma ´ 2: Improving open language models at a practical size, 2024. URL https://arxiv.org/abs/ 2408.00118.
|
| 288 |
+
Mohammad Shoeybi, Mostofa Patwary, Raul Puri, Patrick LeGresley, Jared Casper, and Bryan Catanzaro. Megatron-LM: Training multi-billion parameter language models using model parallelism, 2019. URL http://arxiv.org/abs/1909.08053.
|
| 289 |
+
Chaofan Tao, Qian Liu, Longxu Dou, Niklas Muennighoff, Zhongwei Wan, Ping Luo, Min Lin, and Ngai Wong. Scaling laws with vocabulary: Larger models deserve larger vocabularies, 2024. URL https://arxiv.org/abs/2407.13623.
|
| 290 |
+
|
| 291 |
+
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford Alpaca: An instruction-following LLaMA model, 2023. URL https://github.com/tatsu-lab/stanford alpaca.
|
| 292 |
+
Philippe Tillet, Hsiang-Tsung Kung, and David D. Cox. Triton: An intermediate language and compiler for tiled neural network computations. In ACM SIGPLAN International Workshop on Machine Learning and Programming Languages, 2019.
|
| 293 |
+
Torch Tune Team. torchtune, 2024. URL https://github.com/pytorch/torchtune.
|
| 294 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Neural Information Processing Systems, 2017.
|
| 295 |
+
Sinong Wang, Belinda Z. Li, Madian Khabsa, Han Fang, and Hao Ma. Linformer: Self-attention with linear complexity, 2020. URL https://arxiv.org/abs/2006.04768.
|
| 296 |
+
Thomas Wolf, Lysandre Debut, Victor Sanh, Julien Chaumond, Clement Delangue, Anthony Moi, Pierric Cistac, Tim Rault, Remi Louf, Morgan Funtowicz, and Jamie Brew. Huggingface’s trans- ´ formers: State-of-the-art natural language processing, 2019.
|
| 297 |
+
Lili Yu, Daniel Simig, Colin Flaherty, Armen Aghajanyan, Luke Zettlemoyer, and Mike Lewis. MEGABYTE: Predicting million-byte sequences with multiscale transformers. In Neural Information Processing Systems, 2023.
|
| 298 |
+
|
| 299 |
+
# A NOTATION
|
| 300 |
+
|
| 301 |
+
Throughout the paper, we use the following notation conventions. Matrices are bold, capital letters, e.g., A. Indexed matrices are capital letters and are indexed by column and then, optionally, row. For example, given $\mathbf { A } \in \mathbb { R } ^ { N \times M }$ , then e.g., $A _ { j }$ is the length $N$ vector that is the $j$ th column for A, $A _ { j , i }$ is then the ith value in the vector $A _ { j }$ . When we combine indexing and transposing, we always index and then transpose.
|
| 302 |
+
|
| 303 |
+
Vectors are bold lower-case letters, e.g., x, with the exception of LSE which is the vector containing the log-sum-exp (LSE). Indexed vectors are lower-case letters, $x _ { i }$ .
|
| 304 |
+
|
| 305 |
+
In addition to scalar indexing, we also block index matrices when describing how our algorithms are implemented. In these cases, the matrix and vector will maintain their bold to indicate that the indexing refers to a block and thus are still a matrix or vector.
|
| 306 |
+
|
| 307 |
+
<table><tr><td>Notation</td><td>Description</td></tr><tr><td>E</td><td>A D × N matrix containing batch of inputs.</td></tr><tr><td>Ei</td><td>A D-dimensional vector containing the embedding for theith input.</td></tr><tr><td>C</td><td>A D × |V| classifier matrix used to compute the logit for each token.</td></tr><tr><td>Ci</td><td>A D-dimensional vector used to create the logit for theith token.</td></tr><tr><td>x</td><td>A length N vector containing the inputs.</td></tr><tr><td>xi</td><td>A scalar that is theith input.</td></tr><tr><td>Cx_i</td><td>A length D containing the vector used to create the logit for the xi th token.</td></tr><tr><td>C^T E</td><td>A |V| × N matrix containing the logits over the vocabulary for each input.</td></tr><tr><td>(C^T E)_x</td><td>A length N vector where theith entry is the logit for the xi th token.</td></tr><tr><td>LSE</td><td>A length N vector containing the log-sum-exp (LSE) for each input over the vocabulary.</td></tr><tr><td>En</td><td>Theith D × NB block of E.</td></tr><tr><td>En,d</td><td>Theith DB × NB block of En.</td></tr><tr><td>[[a = b^T]]</td><td>An indicator matrix where the value at theith column and jth row is 1 if aj = bi and 0 otherwise.</td></tr></table>
|
| 308 |
+
|
| 309 |
+
# B REMOVING IGNORED TOKENS
|
| 310 |
+
|
| 311 |
+
It is common to have tokens that have no loss computation when training LLMs in practice. Examples include padding, the system prompt, user input, etc.. While these tokens must be processed by the backbone – to enable efficient batching in the case of padding or to give the model the correct context for its prediction in the case of system prompts and use inputs – they do not contribute directly to the loss.
|
| 312 |
+
|
| 313 |
+
In all implementations we are aware of, the logits and loss for these ignored tokens is first computed and then set to zero. We notice that this is unnecessary. These tokens can be removed before logits+loss computation with no change to the loss/gradient and save a significant amount of computation.
|
| 314 |
+
|
| 315 |
+
Table A1 shows the performance of all methods in Table 1 with a filter that removes ignored tokens before logits+loss computation. This represents a significant speed up for all methods but Liger Kernels. Due to heavy chunking in Liger Kernels to save memory, it is bound by kernel launch overhead, not computation, and therefore reducing the amount of computation does not increase speed. Filtering ignored tokens is also a significant memory saving for most all but CCE (because CCE already uses the minimum amount of memory possible).
|
| 316 |
+
|
| 317 |
+
# C ADDITIONAL RESULTS
|
| 318 |
+
|
| 319 |
+
# C.1 FURTHER PERFORMANCE ANALYSIS
|
| 320 |
+
|
| 321 |
+
Table A2 shows a breakdown of the time spent for different components of in the backward pass of CCE and Baseline. For CCE, we selectively disabled/enabled portions of the kernel and measured the time saved to determine the amount of time taken by that component. For Baseline, we manually implemented each operation of the backward pass and timed them seperately.
|
| 322 |
+
|
| 323 |
+
Table A1: Table 1 where all methods include a filter that removes tokens that are ignored in loss computation. This simple change represents large improvements in practice. Results averaged over 5 seeds.
|
| 324 |
+
|
| 325 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Loss</td><td colspan="2">Gradient</td><td colspan="2">Loss+Gradient</td></tr><tr><td>Memory</td><td>Time</td><td>Memory</td><td>Time</td><td>Memory</td><td>Time</td></tr><tr><td>Lower bound</td><td>0.004 MB</td><td></td><td>1,161 MB</td><td></td><td>1,161 MB</td><td></td></tr><tr><td>1) CCE (Ours)</td><td>245 MB</td><td>17 ms</td><td>1,163 MB</td><td>37 ms</td><td>1,164 MB</td><td>54 ms</td></tr><tr><td>2) Liger Kernels (Hsu et al., 2024)3</td><td>1,316 MB</td><td>301 ms</td><td></td><td></td><td>1,314 MB</td><td>303 ms</td></tr><tr><td>3) Torch Tune Team (2024) (8 chunks)</td><td>3,688 MB</td><td>23 ms</td><td>2,789 MB</td><td>54 ms</td><td>6,157 MB</td><td>77 ms</td></tr><tr><td>4) torch.compile</td><td>1,847 MB</td><td>19 ms</td><td>5,490 MB</td><td>34 ms</td><td>7,337 MB</td><td>53 ms</td></tr><tr><td>5) Baseline</td><td>10,997 MB</td><td>30 ms</td><td>7,320 MB</td><td>44 ms</td><td>12,826 MB</td><td>75 ms</td></tr><tr><td>6) CCE (No VOCab Sorting)</td><td>0.06 MB</td><td>17 ms</td><td>1,162 MB</td><td>43 ms</td><td>1,163 MB</td><td>60 ms</td></tr><tr><td>7) CCE (No Grad. Filter)</td><td>0.06 MB</td><td>17 ms</td><td>1,163 MB</td><td>110 ms</td><td>1,163 MB</td><td>126 ms</td></tr><tr><td>8) CCE-Kahan</td><td>1 MB</td><td>18 ms</td><td>2,325 MB</td><td>42 ms</td><td>2,327 MB</td><td>59 ms</td></tr><tr><td>9) CCE-Kahan-FullC</td><td>1 MB</td><td>18 ms</td><td>2,326 MB</td><td>98 ms</td><td>2,327 MB</td><td>114 ms</td></tr><tr><td>10) CCE-Kahan-FullE</td><td>1 MB</td><td>18 ms</td><td>2,325 MB</td><td>92 ms</td><td>2,327 MB</td><td>109 ms</td></tr></table>
|
| 326 |
+
|
| 327 |
+
Table A2: Performance breakdown for the backward pass of CCE and Baseline. Gemma 2 (2 B) model. Batch of 8192 tokens. Alpaca dataset used to generate inputs.
|
| 328 |
+
|
| 329 |
+
<table><tr><td>Component</td><td>Baseline</td><td>CCE</td></tr><tr><td>logits = softmax(C^T E) recompunation</td><td></td><td>45 ms (43.2%)</td></tr><tr><td>∇ log softmax_x (logits)</td><td>35 ms (28.5%)</td><td>4.7 ms (4.4%)</td></tr><tr><td>Gradient Filter</td><td></td><td>1.3 ms (1.2%)</td></tr><tr><td>∇ softmax(C^T E)</td><td>17 ms (13.7%)</td><td>4.7 ms (4.4%)</td></tr><tr><td>∇ E</td><td>37 ms (30.0%)</td><td>31 ms (29.6%)</td></tr><tr><td>∇ C</td><td>34 ms (27.7%)</td><td>18 ms (17.3%)</td></tr></table>
|
| 330 |
+
|
| 331 |
+
CCE spends considerably less time on the cross-entropy loss and softcap portions of the gradient computation. For Baseline, these are very memory intensive operations as there is relatively very little computation done compared the amount of reading/writing. For CCE, the logits are already in SRAM (they were just recomputed) and CCE does not write the result of this computation to main memory, saving a significant amount of time.
|
| 332 |
+
|
| 333 |
+
Coincidentally, CCE spends a very similar amount of time computing the gradient wrt. the embeddings. CCE spends less time computing the gradient wrt. the classifier. This is because the axis we reduce along for the classifier, N, is shorter than the axis for the embeddings, —V—, and thus leads to less contention on global memory.
|
| 334 |
+
|
| 335 |
+
Compared to Baseline, CCE saves 30 ms on the gradient of the logits wrt. cross-entropy loss, 12 ms on the gradient wrt. softcapping, 5 ms on the gradient wrt. E, and 15 ms on the gradient wrt. C. This saving of 62 ms more than offsets the $4 5 \mathrm { m s }$ spent re-computing and applying the gradient filter.
|
| 336 |
+
|
| 337 |
+
# C.2 ADDITIONAL RUNTIME AND MEMORY
|
| 338 |
+
|
| 339 |
+
Table A3 shows additional results for Gemma 2 (9 B), Gemma 2 (27 B), Qwen 2.5 (7 B) (Qwen Team, 2024), Qwen 2.5 (32 B), PHI 3.5 Mini (Abdin et al., 2024), and Mistral NeMo (Mistral AI Team, 2024) in the same setting as Table 1. For each model CCE is able to reduce the total memory consumed by the loss by an order of magnitude from the baseline. For forward (Loss) and backward (Gradient) passes combined, CCE is within 3 MB of the lowest possible memory consumption. Compared to Gemma 2 (2 B) all these models have a smaller ratio of the vocabulary size to hidden dimension. This has two impacts.
|
| 340 |
+
|
| 341 |
+
First, the number of tokens that have a significant gradient is largely constant (it is dependent on the data type). Therefore proportionally less of the gradient will be filtered out.
|
| 342 |
+
|
| 343 |
+
Second, for all other methods increasing the hidden dimension increase the amount of parallelism that can be achieved. Liger Kernels (Hsu et al., 2024) sets its chunk size based on $| \bar { V } | / D$ – the lower that ratio, the bigger the chunk size. As $| V | / D$ continues to decrease, Liger Kernels is able to make better use of the GPU. All other methods use two matrix multiplications to compute the gradient. The amount of work that can be performed in parallel to compute $\nabla ^ { \circ }$ and $\boldsymbol { \nabla } C$ is $B \times D$ and $| V | \times D$ , respectively4. The amount of parallel work for CCE is $B \times | V |$ , thus increasing $D$ increases the amount of work but not the amount of parallelism. It may be possible leverage ideas from split-k matrix multiplication kernels to expose more parallelism to CCE for large values of $D$ .
|
| 344 |
+
|
| 345 |
+
For the smallest $| V | / D$ considered, Phi 3.5 Mini ( $\cdot | V | { = } 3 2 { , } 0 6 4$ , $\mathrm { D { = } 3 , 0 7 2 }$ ) ours is approximately $5 0 \%$ slower (12 ms) than torch.compile (although it uses substantially less memory). In our experiments, this increase in linear-cross-entropy loss computation time is largely negligible and only increases training time by one to two percent.
|
| 346 |
+
|
| 347 |
+
We also consider how changing the number of tokens changes performance (Figs. A1 and A2). We find that CCE behaves very similarly to Baseline and torch.compile. Further, because CCE does not utilize chunking, it does not reach a point where the overhead of dispatching all the kernels becomes the dominating factor. We also find that while CCE-Kahan-FullC is slower than the Liger Kernel and Torch Tune baselines with a large number of tokens, it becomes more performant than those baselines as the number of tokens reduces.
|
| 348 |
+
|
| 349 |
+
# D MEMORY USE METHOD DETAILS
|
| 350 |
+
|
| 351 |
+
Table A4 contains the raw numbers used to create Fig. 1. The maximum batch size for 16 GPUs was calculated by assuming that the total amount of memory available is $7 5 \times 1 6$ (i.e., each 80 GB GPU will be fully occupied expect for a 5 GB buffer for various libraries), then subtracting the memory used for weights $^ +$ optimizer $^ +$ gradients and then diving by the memory used per token.
|
| 352 |
+
|
| 353 |
+
The numbers in Table A4 are computed using the following methods. When present, the number of tokens is assumed to be 65,536.
|
| 354 |
+
|
| 355 |
+
We compute the amount of memory used for intermediate activations as the number of layers times the hidden size times number of tokens times 2 bytes per bfloat16. This assumes the use of activation/gradient checkpointing (Chen et al., 2016) for transformer layer.
|
| 356 |
+
|
| 357 |
+
The amount of memory used by the logits is the number of tokens times the vocabulary size times 4 bytes per float32. This likely undercounts the amount of memory used for computing the probability distribution, as its common to also keep a copy of the logits in bfloat16 and, for models like Gemma 2 (Riviere et al. ` , 2024) that use logit softcapping, an additional copy of the logits after softcapping may be needed. However, this method can be uniformly applied to all models.
|
| 358 |
+
|
| 359 |
+
The amount of memory used by Weights+Opt+Grad is the number of parameters times 4 (parameters, gradient, and Adam first and second moments) times 2 bytes per bfloat16.
|
| 360 |
+
|
| 361 |
+
# E FLOATING POINT ADDITION
|
| 362 |
+
|
| 363 |
+
Here we provide a brief explanation of floating point addition and how it relates to our proposed gradient filtering.
|
| 364 |
+
|
| 365 |
+
Given two numbers $a$ and $b$ represented using floating point, such that $| a | < | b |$ , the following steps are performed
|
| 366 |
+
|
| 367 |
+
1. Separate the mantissa (the fractional part) and the exponent from both numbers $a$ and $b$
|
| 368 |
+
2. Re-write the mantissa of the smaller number ( $a$ in our case) such that it shares the same exponent as the $b$ .
|
| 369 |
+
3. Add the re-written mantissa of $a$ to the mantissa of $b$ .
|
| 370 |
+
|
| 371 |
+
Table A3: Memory usage and time of CCE, Liger Kernels, Torch Tune, torch.compile, and Baseline for additional models. Batch of 8,192 tokens. Results averaged over 5 seeds.
|
| 372 |
+
|
| 373 |
+
<table><tr><td rowspan="2">Method</td><td colspan="2">Loss</td><td colspan="2">Gradient</td><td colspan="2">Loss+Gradient</td></tr><tr><td>Memory</td><td>Time</td><td>Memory</td><td>Time</td><td>Memory</td><td>Time</td></tr><tr><td colspan="7">Gemma 2 (9 B) (Rivière et al., 2024) (|V|=256,000, D=3,584)</td></tr><tr><td>Lower bound</td><td>0.004 MB</td><td></td><td>1,806 MB</td><td></td><td>1,806 MB</td><td></td></tr><tr><td>CCE (Ours)</td><td>1 MB</td><td>68 ms</td><td>1,808 MB</td><td>141 ms</td><td>1,809 MB</td><td>208 ms</td></tr><tr><td>Liger Kernels (Hsu et al., 2024)</td><td>2,119 MB</td><td>418 ms</td><td></td><td></td><td>2,119 MB</td><td>419 ms</td></tr><tr><td>Torch Tune Team (2024) (8 chunks)</td><td>8,000 MB</td><td>75 ms</td><td>3,264 MB</td><td>168 ms</td><td>11,264 MB</td><td>243 ms</td></tr><tr><td>torch.compile</td><td>4,000 MB</td><td>70 ms</td><td>12,000 MB</td><td>134 ms</td><td>16,000 MB</td><td>207 ms</td></tr><tr><td>Baseline</td><td>24,000 MB</td><td>102 ms</td><td>16,000 MB</td><td>164 ms</td><td>28,000 MB</td><td>271 ms</td></tr><tr><td>CCE-Kahan-FullC</td><td>1 MB</td><td>68 ms</td><td>3,558 MB</td><td>384 ms</td><td>3,559 MB</td><td>450 ms</td></tr><tr><td colspan="7">Gemma 2 (27 B) (Rivière et al., 2024) (|V|=256,000, D=4,608)</td></tr><tr><td>Lower bound</td><td>0.004 MB</td><td></td><td>2,322 MB</td><td></td><td>2,322 MB</td><td></td></tr><tr><td>CCE (Ours)</td><td>1 MB</td><td>83 ms</td><td>2,324 MB</td><td>200 ms</td><td>2,325 MB</td><td>281 ms</td></tr><tr><td>Liger Kernels (Hsu et al., 2024)</td><td>2,948 MB</td><td>361 ms</td><td></td><td></td><td>2,948 MB</td><td>363 ms</td></tr><tr><td>Torch Tune Team (2024) (8 chunks)</td><td>8,000 MB</td><td>91 ms</td><td>4,768 MB</td><td>204 ms</td><td>12,768 MB</td><td>296 ms</td></tr><tr><td>torch.compile</td><td>4,000 MB</td><td>86 ms</td><td>12,000 MB</td><td>168 ms</td><td>16,000 MB</td><td>256 ms</td></tr><tr><td>Baseline</td><td>24,000 MB</td><td>119 ms</td><td>16,000 MB</td><td>197 ms</td><td>28,000 MB</td><td>322 ms</td></tr><tr><td>CCE-Kahan-FullC</td><td>1 MB</td><td>83 ms</td><td>4,574 MB</td><td>513 ms</td><td>4,575 MB</td><td>593 ms</td></tr><tr><td colspan="7">Mistral NeMo (Mistral AI Team, 2024) (|V|=131,072, D=5,120)</td></tr><tr><td>Lower bound</td><td>0.004 MB</td><td></td><td>1,360 MB</td><td></td><td>1,360 MB</td><td></td></tr><tr><td>CCE (Ours)</td><td>0.6 MB</td><td>52 ms</td><td>1,361 MB</td><td>129 ms</td><td>1,362 MB</td><td>180 ms</td></tr><tr><td>Liger Kernels (Hsu et al., 2024)</td><td>1,872 MB</td><td>166 ms</td><td></td><td></td><td>1,872 MB</td><td>167 ms</td></tr><tr><td>Torch Tune Team (2024) (8 chunks)</td><td>2,048 MB</td><td>49 ms</td><td>3,348 MB</td><td>113 ms</td><td>5,396 MB</td><td>161 ms</td></tr><tr><td>torch.compile</td><td>2,048 MB</td><td>48 ms</td><td>6,144 MB</td><td>94 ms</td><td>8,192 MB</td><td>143 ms</td></tr><tr><td>Baseline</td><td>10,240 MB</td><td>58 ms</td><td>8,192 MB</td><td>100 ms</td><td>12,288 MB</td><td>161 ms</td></tr><tr><td>CCE-Kahan-FullC</td><td>0.6 MB</td><td>52 ms</td><td>2,641 MB</td><td>291 ms</td><td>2,642 MB</td><td>342 ms</td></tr><tr><td colspan="7">Phi 3.5 Mini (Abdin et al., 2024) (|V|=32,064, D=3,072)</td></tr><tr><td>Lower bound</td><td>0.004 MB</td><td></td><td>236 MB</td><td></td><td>236 MB</td><td></td></tr><tr><td>CCE (Ours)</td><td>0.2 MB</td><td>8 ms</td><td>236 MB</td><td>26 ms</td><td>236 MB</td><td>34 ms</td></tr><tr><td>Liger Kernels (Hsu et al., 2024)</td><td>487 MB</td><td>26 ms</td><td></td><td></td><td>488 MB</td><td>26 ms</td></tr><tr><td>Torch Tune Team (2024) (8 chunks)</td><td>502 MB</td><td>9 ms</td><td>451 MB</td><td>18 ms</td><td>953 MB</td><td>30 ms</td></tr><tr><td>torch.compile</td><td>502 MB</td><td>8 ms</td><td>1,504 MB</td><td>15 ms</td><td>2,006 MB</td><td>22 ms</td></tr><tr><td>Baseline</td><td>2,506 MB</td><td>11 ms</td><td>2,004 MB</td><td>16 ms</td><td>3,006 MB</td><td>27 ms</td></tr><tr><td>CCE-Kahan-FullC</td><td>0.2 MB</td><td>8 ms</td><td>424 MB</td><td>46 ms</td><td>424 MB</td><td>54 ms</td></tr><tr><td colspan="7">Qwen 2.5 (7 B) (Qwen Team, 2024) (|V|=152,064, D=3,584)</td></tr><tr><td>Lower bound</td><td>0.004 MB</td><td></td><td>1,096 MB</td><td></td><td>1,096 MB</td><td></td></tr><tr><td>CCE (Ours)</td><td>0.6 MB</td><td>43 ms</td><td>1,098 MB</td><td>93 ms</td><td>1,097 MB</td><td>136 ms</td></tr><tr><td>Liger Kernels (Hsu et al., 2024)</td><td>1,394 MB</td><td>171 ms</td><td></td><td></td><td>1,394 MB</td><td>171 ms</td></tr><tr><td>Torch Tune Team (2024) (8 chunks)</td><td>2,379 MB</td><td>42 ms</td><td>2,540 MB</td><td>96 ms</td><td>4,921 MB</td><td>138 ms</td></tr><tr><td>torch.compile</td><td>2,376 MB</td><td>41 ms</td><td>7,128 MB</td><td>79 ms</td><td>9,504 MB</td><td>121 ms</td></tr><tr><td>Baseline</td><td>11,880 MB</td><td>53 ms</td><td>9,504 MB</td><td>86 ms</td><td>14,256 MB</td><td>142 ms</td></tr><tr><td>CCE-Kahan-FullC</td><td>0.6 MB</td><td>43 ms</td><td>2,138 MB</td><td>225 ms</td><td>2,138 MB</td><td>267 ms</td></tr><tr><td colspan="7">Qwen 2.5 (32 B) (Qwen Team, 2024) (|V|=152,064, D=5,120)</td></tr><tr><td>Lower bound</td><td>0.004 MB</td><td></td><td>1,565 MB</td><td></td><td>1,565 MB</td><td></td></tr><tr><td>CCE (Ours)</td><td>0.6 MB</td><td>60 ms</td><td>1,566 MB</td><td>133 ms</td><td>1,567 MB</td><td>193 ms</td></tr><tr><td>Liger Kernels (Hsu et al., 2024)</td><td>2,159 MB</td><td>192 ms</td><td></td><td></td><td>2,161 MB</td><td>192 ms</td></tr><tr><td>Torch Tune Team (2024) (8 chunks)</td><td>2,376 MB</td><td>57 ms</td><td>3,882 MB</td><td>130 ms</td><td>6,259 MB</td><td>186 ms</td></tr><tr><td>torch.compile</td><td>2,376 MB</td><td>56 ms</td><td>7,128 MB</td><td>108 ms</td><td>9,504 MB</td><td>165 ms</td></tr><tr><td>Baseline</td><td>11,880 MB</td><td>68 ms</td><td>9,504 MB</td><td>115 ms</td><td>14,256 MB</td><td>186 ms</td></tr><tr><td>CCE-Kahan-FullC</td><td>0.6 MB</td><td>61 ms</td><td>3,052 MB</td><td>326 ms</td><td>3,053 MB</td><td>384 ms</td></tr></table>
|
| 374 |
+
|
| 375 |
+
4. Combine the resulting mantissa and exponent of $b$ and then convert them into normalized form.
|
| 376 |
+
|
| 377 |
+
Step 2 is where truncation happens and the intuition of gradient filtering comes from. In bfloat16, if the exponent of $b$ is more than $\bar { 2 } ^ { 7 }$ times larger than that of a, the 7-bit mantissa no longer has enough precision to represent any of $a$ ’s mantissa and in the process of re-writing, $a$ will be, in effect, set to zero. For gradient filtering, we are only concerned with values in the range $[ 0 , 1 ]$ , so the threshold of $2 ^ { - 1 2 }$ means that we only keep values that don’t get rounded to zero when $\dot { \mathbf b } = \dot { 2 } ^ { - 5 }$ .
|
| 378 |
+
|
| 379 |
+

|
| 380 |
+
|
| 381 |
+

|
| 382 |
+
|
| 383 |
+

|
| 384 |
+
|
| 385 |
+

|
| 386 |
+
|
| 387 |
+

|
| 388 |
+
(a) Gemma 2 2 B
|
| 389 |
+
|
| 390 |
+

|
| 391 |
+
|
| 392 |
+

|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
|
| 396 |
+

|
| 397 |
+
(b) Gemma 2 9 B
|
| 398 |
+
|
| 399 |
+

|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
|
| 405 |
+

|
| 406 |
+
(c) Gemma 2 27 B
|
| 407 |
+
|
| 408 |
+

|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
|
| 412 |
+

|
| 413 |
+
(d) Mistral NeMo
|
| 414 |
+
Figure A1: Performance of CCE and baselines for all models with a varying batch sizes. Results averaged over 5 seeds. Continued in Fig. A2.
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
|
| 420 |
+

|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
(a) Phi 3.5 Mini
|
| 426 |
+
|
| 427 |
+

|
| 428 |
+
|
| 429 |
+

|
| 430 |
+
|
| 431 |
+

|
| 432 |
+
|
| 433 |
+

|
| 434 |
+
(b) Qwen 2.5 7 B
|
| 435 |
+
|
| 436 |
+

|
| 437 |
+
|
| 438 |
+

|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
(c) Qwen 2.5 32 B
|
| 442 |
+
Figure A2: Performance of CCE and baselines for all models with a varying batch sizes. Results averaged over 5 seeds.
|
| 443 |
+
|
| 444 |
+
Table A4: Raw data for Fig. 1. Memory usage calculated using a global batch size of 65,536.
|
| 445 |
+
|
| 446 |
+
<table><tr><td>Model</td><td>Logits</td><td>Activations</td><td>Weights+Opt+Grad</td><td>Max Batch Size (Before)</td><td>Max Batch Size (After)</td><td>Increase</td></tr><tr><td>GPT 2</td><td>12,564 MB</td><td>1,152 MB</td><td>1,045 MB</td><td>5,866,190</td><td>69,845,595</td><td>11.9×</td></tr><tr><td>GPT Neo (1.3 B)</td><td>12,564 MB</td><td>6,144 MB</td><td>10,421 MB</td><td>4,268,047</td><td>12,996,042</td><td>3.0×</td></tr><tr><td>GPT Neo (2.7 B)</td><td>12,564 MB</td><td>10,240 MB</td><td>20,740 MB</td><td>3,471,784</td><td>7,731,585</td><td>2.2×</td></tr><tr><td>Gemma (2 B)</td><td>64,000 MB</td><td>4,608 MB</td><td>19,121 MB</td><td>1,155,515</td><td>17,204,330</td><td>14.9×</td></tr><tr><td>Gemma 2 (27 B)</td><td>64,000 MB</td><td>26,496 MB</td><td>207,727 MB</td><td>739,448</td><td>2,525,554</td><td>3.4×</td></tr><tr><td>Gemma 2 (2 B)</td><td>64,000 MB</td><td>7,488 MB</td><td>19,946 MB</td><td>1,108,206</td><td>10,580,057</td><td>9.5×</td></tr><tr><td>Llama 2 (13 B)</td><td>8,000 MB</td><td>25,600 MB</td><td>99,303 MB</td><td>2,203,057</td><td>2,891,512</td><td>1.3×</td></tr><tr><td>Llama 2 (7 B)</td><td>8,000 MB</td><td>16,384 MB</td><td>51,410 MB</td><td>3,164,429</td><td>4,709,560</td><td>1.5×</td></tr><tr><td>Llama 3 (70 B)</td><td>32,064 MB</td><td>81,920 MB</td><td>538,282 MB</td><td>397,019</td><td>552,414</td><td>1.4×</td></tr><tr><td>Llama 3 (8 B)</td><td>32,064 MB</td><td>16,384 MB</td><td>61,266 MB</td><td>1,579,333</td><td>4,670,136</td><td>3.0×</td></tr><tr><td>Mistral 7 B</td><td>8,000 MB</td><td>16,384 MB</td><td>55,250 MB</td><td>3,154,108</td><td>4,694,200</td><td>1.5×</td></tr><tr><td>Mixtral 8x7 B</td><td>8,000 MB</td><td>16,384 MB</td><td>356,314 MB</td><td>2,344,949</td><td>3,489,944</td><td>1.5×</td></tr><tr><td>Phi 1.5</td><td>12,574 MB</td><td>6,144 MB</td><td>10,821 MB</td><td>4,264,482</td><td>12,991,781</td><td>3.0×</td></tr><tr><td>Phi 3 Medium</td><td>8,003 MB</td><td>25,600 MB</td><td>106,508 MB</td><td>2,188,824</td><td>2,873,067</td><td>1.3×</td></tr><tr><td>Qwen 1.5 (7 B)</td><td>37,912 MB</td><td>16,384 MB</td><td>58,909 MB</td><td>1,412,087</td><td>4,679,564</td><td>3.3×</td></tr></table>
|
| 447 |
+
|
| 448 |
+
Algorithm 4 Memory-efficient linear-cross-entropy loss, backward pass
|
| 449 |
+
Inputs: $\mathbf{E}\in \mathbb{R}^{D\times N}$ $\mathbf{C}\in \mathbb{R}^{D\times |V|}$ $\mathrm{LSE}\in \mathbb{R}^N$ $\nabla \mathrm{CEL}\in \mathbb{R}^N$ , and $\mathbf{x}\in \mathbb{R}^N$ Block sizes $N_{B},V_{B}$ , and $D_B$ Accuracy threshold $\varepsilon$ $\mathbf{v} = [1,\dots ,|V|]$ .
|
| 450 |
+
Outputs: $\nabla \mathbf{E}\in \mathbb{R}^{D\times N}$ $\nabla \mathbf{C}\in \mathbb{R}^{D\times |V|}$ for all pairs of blocks $\mathbf{E}_n$ $\mathbf{C}_v$ do $\triangleright$ Divide $\mathbf{E}$ and $\mathbf{C}$ into blocks of size $D\times N_B$ and $D\times V_B$ $\triangleright$ Zero matrix of size $V_{B}\times N_{B}$ in on-chip SRAM for blocks $\mathbf{E}_{n,d}$ $\mathbf{C}_{v,d}$ do $\triangleright$ Divide $\mathbf{E}_n$ and $\mathbf{C}_v$ into blocks of $D_B\times N_B$ and $D_B\times V_B$ $\triangleright$ Blockwise matrix multiplication end for $\mathbf{S}_{nv} = \exp (\mathbf{A}_{nv} - \mathrm{LSE}_n)$ $\triangleright$ Compute the softmax $\mathbf{G}_{nv} = \left[[\mathbf{v}_v = \mathbf{x}_n^\top ]\right] - \mathbf{S}_{nv}$ $\triangleright$ Gradient of cross-entropy loss wrt. logits if all $(|\mathbf{G}_{nv}| < \varepsilon)$ then skip $\triangleright$ Skip computation if below desired numerical precision end if for blocks $\mathbf{E}_{n,d}$ $\mathbf{C}_{v,d}$ do $\triangleright$ Divide $\mathbf{E}_n$ and $\mathbf{C}_m$ into blocks of $D_B\times N_B$ and $D_B\times V_B$ $\nabla \mathbf{E}_{n,d}^{\top} + = (\mathbf{G}_{nv}\cdot \nabla \mathrm{CEL}_n)\mathbf{C}_{v,d}$ $\triangleright$ Locking thread-safe gradient update $\nabla \mathbf{C}_{v,d}^{\top} + = (\mathbf{G}_{nv}\cdot \nabla \mathrm{CEL}_{n})^{\top}\mathbf{E}_{n,d}$ $\triangleright$ Locking thread-safe gradient update end for
|
paper_markdowns/bamboo-02344.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-02410.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-02420.md
ADDED
|
Binary file (61.3 kB). View file
|
|
|
paper_markdowns/bamboo-02682.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-02690.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-02720.md
ADDED
|
@@ -0,0 +1,488 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# LAYERWISE RECURRENT ROUTER FOR MIXTURE-OF-EXPERTS
|
| 2 |
+
|
| 3 |
+
1Zihan Qiu∗ 2Zeyu Huang∗ 3Shuang Cheng 4Yizhi Zhou 5Zili Wang
|
| 4 |
+
|
| 5 |
+
2,6Ivan Titov 7Jie Fu†
|
| 6 |
+
|
| 7 |
+
1Alibaba Group, 2University of Edinburgh, 3ICT, Chinese Academy of Sciences,
|
| 8 |
+
|
| 9 |
+
4Nanjing University, 5INF Technology 6University of Amsterdam 7Shanghai AI Lab qzh11628@gmail.com, zeyu.huang@ed.ac.uk, fujie@pjlab.org.cn
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
The scaling of large language models (LLMs) has revolutionized their capabilities in various tasks, yet this growth must be matched with efficient computational strategies. The Mixture-of-Experts (MoE) architecture stands out for its ability to scale model size without significantly increasing training costs. Despite their advantages, current MoE models often display parameter inefficiency. For instance, a pre-trained MoE-based LLM with 52 billion parameters might perform comparably to a standard model with 6.7 billion parameters (Rajbhandari et al., 2022). Being a crucial part of MoE, current routers in different layers independently assign tokens without leveraging historical routing information, potentially leading to suboptimal token-expert combinations and the parameter inefficiency problem. To alleviate this issue, we introduce the Layerwise Recurrent Router for Mixture-of-Experts (RMoE). RMoE leverages a Gated Recurrent Unit (GRU) to establish dependencies between routing decisions across consecutive layers. Such layerwise recurrence can be efficiently parallelly computed for input tokens and introduces negotiable costs. Our extensive empirical evaluations demonstrate that RMoE-based language models consistently outperform a spectrum of baseline models. Furthermore, RMoE integrates a novel computation stage orthogonal to existing methods, allowing seamless compatibility with other MoE architectures. Our analyses attribute RMoE’s gains to its effective cross-layer information sharing, which also improves expert selection and diversity. Our code is at https://github.com/qiuzh20/RMoE.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
In the era of large language models (LLMs), scaling the model parameters and training data up has unlocked remarkable model capabilities, such as in-context learning (Brown et al., 2020; Dong et al., 2022), nuanced conversations (Ouyang et al., 2022), and even complex code (Guo et al., 2024) and math (Imani et al., 2023) tasks. These advancements showcase the profound impact of increasing model size. The quest to enhance neural networks’ capacity while ensuring training and inference efficiency spurred the development of computation-efficient transformer architectures. The Mixture-of-Experts (MoE) framework is one of such efficient architectural recipes (Shazeer et al., 2017; Lepikhin et al., 2021; Fedus et al., 2022; Zhang et al., 2022; Dai et al., 2024). Most MoE modules comprise one router and a group of expert networks. The router, usually parametrized as one linear layer, conditionally and sparsely assigns each input token to its corresponding experts, i.e., the FeedForward Network (FFN) in the transformer layer. Therefore, MoE can significantly scale the model size and keep computational costs nearly unchanged (Smith et al., 2022).
|
| 18 |
+
|
| 19 |
+
Despite efficiently increasing the model size, most current pre-trained MoE models are not on par with standard models of the same size, demonstrating their parameter inefficiency. For example, Rajbhandari et al. (2022) shows that with the same training data, an MoE with 52B parameters and 1.3B activated ones for each token performs similarly to a 6.7B standard model. Komatsuzaki
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Recurrent router for Mixture-of-Experts. In the $_ { i }$ -th layer, the hidden state $\mathbf { x } _ { i }$ is I. projected to $\mathbf { x } ^ { \prime }$ with alower hidden dimension (Eq. 4), II. combined with previous layer’s GRU output $\mathbf { h } _ { i - 1 }$ , and processed through the cross-layer-shared GRU to produce the current layer’s GRU output, $\mathbf { h } _ { i }$ (Eq. 5). III. layer $_ { i }$ ’s router uses this output to select experts and executes standard MoE computation (Eq. 6). Such operation doesn’t introduce sequence-level recurrence and can be efficiently implemented, as shown in Tab. 1 and Tab. 3.
|
| 23 |
+
|
| 24 |
+
et al. (2023) demonstrates that upcycling a standard T5-base (248M) into its MoE counterpart (2B) by copying existing FFN can bring some improvements, but it still lags behind the T5-large with 783M parameters. Similarly, Dai et al. (2024) use fine-grained and shared experts to improve the effectiveness, but the 16B MoE performs comparably with the 7B standard model (Bi et al., 2024).
|
| 25 |
+
|
| 26 |
+
One potential bottleneck for the current MoE could be the router. Typically, the router is parameterized as one lightweight linear layers, which may limit its capacity to explore the optimal tokenexpert combination. Previous works also reveal such limitations. For instance, Xue et al. (2024) finds the routing results converge to the token-id-based routing very quickly during the early phase of pre-training, which means the token-expert combination is far from well-explored. Some works even show hash functions (Roller et al., 2021), stochastic routing policy (Zuo et al., 2021), and fixed-random router (Chen et al., 2023) achieves competitive performance with the learnable router, illustrating that the learnable router component in MoE needs further enhancement.
|
| 27 |
+
|
| 28 |
+
Despite some enhancements for router (Chi et al., 2022; Shen et al., 2023; Do et al., 2023; Chen et al., 2023), current routers in different MoE layers still operate independently without comprehensive investigations into the decisions of other layers. This isolation may lead to suboptimal expert utilization, as each layer manages its routing based solely on local information, potentially leading to inefficiency of model parameters. Though vanilla MoE models could technically share the routing information via hidden states residual, this information may be overshadowed by the language modelling loss, requiring routing-relevant information to ”compete” for its representation.
|
| 29 |
+
|
| 30 |
+
To this end, we introduce a dedicated component to capture and pass routing information for each layer. The proposed architecture, Recurrent Router for Mixture-of-Experts (RMoE), is shown in the Fig. 1. Concretely, we regard routing decisions in consecutive layers as a sequence in which the routing results of the $i$ -th layer should be conditioned on previous layers’ decisions. We thus introduce a lightweight Gated Recurrent Unit (GRU) (Dey & Salem, 2017) to capture this dependence and simulate the information flow between routers across layers. Intuitively, GRU has a reset and an update gate to control the information flow across time steps. Hence, such layerwise recurrence will inform the router to which experts the current token was assigned in previous layers, potentially supporting cross-layer collaborations. Furthermore, the introduced GRU is especially for routing. It thus helps to disentangle the states relevant to model prediction and routing decisions.
|
| 31 |
+
|
| 32 |
+
We validate RMoE’s performance with various model sizes, architectures, datasets, and training settings (per-training and supervised fine-tuning), demonstrating that RMoE outperforms a range of baselines. Moreover, RMoE’s introduction of a novel computation stage during routing makes it orthogonal to and compatible with most existing methods. We further analyze RMoE and elucidate the primary contributors to its improvement. Our findings indicate that while the GRU in RMoE shares essential cross-layer information, it also enables additional gradient propagation for the router. Our analysis shows that layerwise recurrence provides cross-layer information, fostering router exploration and optimizing expert utilization. Consequently, the selected experts are leveraged more effectively, leading to increased diversity of experts. We believe that our innovative router design and massive analysis can offer insights into the development of future MoE models.
|
| 33 |
+
|
| 34 |
+
# 2 RELATED WORKS: VARIOUS ROUTERS FOR MOE
|
| 35 |
+
|
| 36 |
+
In this section, we review previous approaches to improve router design in SMoE. For example, XMoE (Chi et al., 2022) first projects hidden states into a lower-dimension space and computes their cosine-similarity to low-dimension expert embeddings, which can prevent the hidden states from collapsing to a linear combination of expert embeddings. Moduleformer (Shen et al., 2023) uses an MLP router with ReLU activation to increase router capacity. SMoE-dropout (Chen et al., 2023) utilizes a fixed random-initialized linear router and gradually increases Top-k during training. HyperMoE (Do et al., 2023) introduces a fixed random-initialized hypernet (Ha et al., 2016) at each layer to generate router weights condition on input and one learnable router embedding. One concurrent work (Gong et al., 2024) also introduces GRU in sequential routing stages. However, it does not view such a recurrent mechanism as a general and composable method with broad MoE fields or provide relative ablation or analysis. Extra discussion of related work to improve MoE from routing and training strategies, and utilize recurrent controllers can be found in App. A.1.
|
| 37 |
+
|
| 38 |
+
# 3 METHODOLOGY
|
| 39 |
+
|
| 40 |
+
# 3.1 PRELIMINARIES
|
| 41 |
+
|
| 42 |
+
Mixture-of-Experts MoEs are typically implemented by replacing transformer models’ original feed-forward networks (FFNs) with a group of parallel FFNs and incorporating a router. Suppose there are $N$ experts, denoted as $E _ { n } , n \in [ 1 , N ]$ . The router $g ( \cdot ; { \bf G } , k )$ , defined by its parameters $\mathbf { G } \in \mathbb { R } ^ { ( h , N ) }$ and an integer $k$ , maps the input $\mathbf { x }$ to a score distribution over the experts, $g ( \mathbf { x } ; \mathbf { G } , k ) \in$ $\mathbb { R } ^ { N }$ . Given $\mathbf { x } \in \mathbb { R } ^ { h }$ , the output $\mathbf { y } \in \mathbb { R } ^ { h }$ is the weighted sum of the outputs from all experts:
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\mathbf {y} = \sum_ {n \in N} g _ {n} (\mathbf {x}; \mathbf {G}, k) E _ {n} (\mathbf {x}) \tag {1}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
Typically, $g$ is a simple linear layer followed by a softmax and a Top- $\mathrm { . k }$ function. The $n$ th element of $\mathbf { \bar { x } } \times \mathbf { G } \in \mathbf { \bar { \Gamma } } R ^ { N }$ represents the gating score of expert $E _ { n }$ , and the $n$ th column of $\mathbf { G }$ can be regarded as the expert embedding for expert $E _ { n }$ . When $k$ for Top- $\mathrm { \nabla _ { k } }$ is smaller than $N$ , only a subset of experts is involved in the computation, which is known as Sparse Mixture-of-Experts (SMoE) (Shazeer et al., 2017; Fedus et al., 2022).
|
| 49 |
+
|
| 50 |
+
Recurrent Neural Networks RNNs (Medsker et al., 2001) are designed to handle sequential data by maintaining a hidden state h that holds the information from previous time steps. This hidden state is updated at each time step $i$ based on the current input $\mathbf { x } _ { i } ^ { \prime }$ and the hidden state at the last time step $\mathbf { h } _ { i - 1 }$ , formulated as $\mathbf { h } _ { i } = f ( \mathbf { h } _ { i - 1 } , \mathbf { x } _ { i } ^ { \prime } )$ .
|
| 51 |
+
|
| 52 |
+
The Gated Recurrent Units (GRU) Dey & Salem (2017) module is an advanced variant of RNNs that addresses traditional RNNs’ limitations, such as difficulty capturing long-term dependencies and gradient vanishing issues. Given an input $\mathbf { x } _ { i } ^ { \prime }$ at time step $i$ , GRU first calculates the reset gate $\mathbf { s } _ { i }$ and the update gate $\mathbf { z } _ { i }$ to determine how much of the previous memory to keep and to forget,
|
| 53 |
+
|
| 54 |
+
$$
|
| 55 |
+
\mathbf {s} _ {i} = \sigma \left(\mathbf {W} _ {s} \mathbf {x} _ {i} ^ {\prime} + \mathbf {U} _ {s} \mathbf {h} _ {i - 1}\right), \quad \mathbf {z} _ {i} = \sigma \left(\mathbf {W} _ {z} \mathbf {x} _ {i} ^ {\prime} + \mathbf {U} _ {z} \mathbf {h} _ {i - 1}\right) \tag {2}
|
| 56 |
+
$$
|
| 57 |
+
|
| 58 |
+
where $\sigma$ represented the sigmoid activation function and all W and U are tranable parameters. And then, the hidden state $h _ { t }$ is updated by
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\tilde {\mathbf {h}} _ {i} = \tanh \left(\mathbf {W} _ {h} \mathbf {x} _ {i} ^ {\prime} + \mathbf {s} _ {i} \odot \left(\mathbf {W} _ {h} \mathbf {h} _ {i - 1}\right)\right), \quad \mathbf {h} _ {i} = \left(1 - \mathbf {z} _ {i}\right) \odot \tilde {\mathbf {h}} _ {i} + \mathbf {z} _ {i} \odot \mathbf {h} _ {i - 1} \tag {3}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
# 3.2 LAYERWISE RECURRENT ROUTER
|
| 65 |
+
|
| 66 |
+
Existing routers work independently, this lack of global information may prevent routers from discovering more effective token-expert combinations. Therefore, we integrate a GRU into the routing process, explicitly incorporating historical routing information into the current expert selection for each token. Formally, at the $i$ th layer, we first use a linear layer to project the hidden state $\mathbf { x } _ { i }$ to the dimension of the GRU state $\mathbf { x } _ { i } ^ { \prime } \in \mathbb { R } ^ { p }$ (usually smaller than the dimension $h$ of $\mathbf { x } _ { i }$ . We choose 128 for most of the settings provide further analysis in Tab. 6 and Tab. 7):
|
| 67 |
+
|
| 68 |
+
$$
|
| 69 |
+
\mathbf {x} _ {i} ^ {\prime} = \operatorname {P r o j} _ {i} \left(\mathbf {x} _ {i}\right) \tag {4}
|
| 70 |
+
$$
|
| 71 |
+
|
| 72 |
+
Importantly, we use separate projectors for each layer since the hidden states x of different layers vary greatly (more discussion in Sec. 5). This projection output $\mathbf { x } ^ { \prime }$ , along with the GRU result from the previous layer, $\mathbf { h } _ { i - 1 }$ , is then fed into a GRU unit to obtain the current GRU output $\mathbf { h } _ { i }$ .
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathbf {h} _ {i} = \operatorname {G R U} \left(\mathbf {x} _ {i} ^ {\prime}, \mathbf {h} _ {i - 1}\right). \tag {5}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
Next, $\mathbf { h } _ { i }$ is input into the router and then expert outputs are aggregated based on the router output:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\mathbf {y} _ {\mathbf {i}} = \sum_ {n \in N} g _ {n} \left(\mathbf {h} _ {i}; \mathbf {G} _ {i}, k\right) E _ {n} \left(\mathbf {x} _ {i}\right). \tag {6}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
Here, $\mathbf { y } _ { i }$ represents the output of the $i$ -th layer, $\mathbf { h } _ { i }$ is the GRU output, $g _ { n } ( \mathbf { h } _ { i } ; \mathbf { G _ { i } } , k )$ is the router output computed with routing parameter $\mathbf { G _ { i } }$ in layer $i$ . Notice that, unlike traditional RNNs, which use a shared projector together for sequential inputs when the input dimension isn’t equal to the RNN’s hidden dimension, we use different projectors $\mathrm { P r o j } _ { i }$ in Eq. 4 for different layers since hidden states and model weights in different layers usually various a lot (Fig. 11 and Tab. 6).
|
| 85 |
+
|
| 86 |
+
Despite capturing inter-layer dependencies between routers in different layers, RMoE potentially has other advantages: (1) Prevent representation collapse: Chi et al. (2022) identified that the single linear layer routers encourage token embeddings clustering around expert embedding, implying a trend toward representation collapse issue. And they propose XMoE to first project hidden states into a low-dimension and then calculate the gating score. Similarly, the projector (Eq. 4) and GRU (Eq. 6) in RMoE also separate hidden states from expert embeddings and can reduce this issue. (2) Additional Gradient Flow: Before the inclusion of GRU, the router’s gradient mainly derive from the expert weight score $g _ { n }$ in Eq. 1. The introduction of GRU not only provides enriched information about historical routing but also an extra gradient propagation through GRU hidden states. We denote this extra gradient flow as Recurrent Gradient, and we empirically demonstrated that this Recurrent Gradient is important to RMoE. (3) Applicable with other MoE design: the proposed method introduces an additional computation stage into SMoE, it is orthogonal to most existing attempts to improve MoE and is seamlessly compatible with them.
|
| 87 |
+
|
| 88 |
+
# 4 EXPERIMENTS
|
| 89 |
+
|
| 90 |
+
# 4.1 EXPERIMENTAL SETTINGS
|
| 91 |
+
|
| 92 |
+
Langauge Modeling Tasks and Metrics Following (Pham et al., 2024), we first test on two common language modeling tasks: enwiki8 (character-level language modeling, with Bits-Per-Character (BPC) as the evaluation metrics) and WikiText-103 (word-level language modeling, with Perplexity (PPL) as the evaluation metrics). We employ default train-validation-test splits for each dataset. We report test performances of the best validation checkpoints. More details can be found in App. A.2.
|
| 93 |
+
|
| 94 |
+
Configurations and Baselines We compare RMoE with other existing router designs. All methods are based on the decoder-only standard switch-transformer architecture with post-norm. Following (Pham et al., 2024), all routers select top-2 experts from 16 experts. Each task is trained on 2 NVIDIA A100 GPUs for about 20 hours. More training configurations can be found in App. A.2. Our baselines include (1) SMoE: standard switch-transformers with a standard linear router. (2) HyperMoE (Do et al., 2023): the method employs a fixed, randomly initialized hypernetwork (Ha et al., 2016) to produce the weights for the linear router, subsequently allowing the generated linear layer to perform the routing. (3) SMoE-MLP (Shen et al., 2023): it replaces the linear router with a two-layer MLP using the GELU activation function. (4) RandomMoE: inspired by SMoE-Dropout (Chen et al., 2023) and HyperMoE, we propose to compare with a fixed randomly initialized linear router; this could be a naive baseline for all learnable routers. (5) XMoE (Chi et al., 2022): it first down-projects the token embeddings to a lower dimension (default 16) and computes its cosine-similarity with the low-dimension expert embeddings. It also uses a learnable temperature in softmax. (5) CosineSMoE, similar to XMoE except without down-projection.
|
| 95 |
+
|
| 96 |
+
Pre-Training and SFT paradigm As pre-training-then-supervised-fine-tuning has become the standard paradigm, we also evaluate the RMoE in this setting. We conduct preliminary scale-up experiment on a setting of training 0.91B models with 40B tokens. Our pre-training corpus is a multilingual data collection that spans common and specialized domains, including Wikipedia, finance,
|
| 97 |
+
|
| 98 |
+
Table 1: Performance of RMoE and baselines on two language modeling tasks, Enwiki8 and WikiText-103. Params means the non-embedding model parameters and (router parameters). Notice we don’t separate unlearnable parameters in HyperMoE and RandomSMoE. Mem means the peak GPU memory usage with the same batch-size configurations. Speed is the average time for 1k training steps. Results demonstrate that the RMoE outperforms baseline models and achieves comparable memory usage and speed as the standard SMoE.
|
| 99 |
+
|
| 100 |
+
<table><tr><td rowspan="2">Algorithm</td><td colspan="2">Enwiki8 (BPC)↓</td><td colspan="2">WikiText (PPL)↓</td><td rowspan="2">Params (M)</td><td rowspan="2">Mem (GB)</td><td rowspan="2">Speed (s/1k steps)</td></tr><tr><td>val</td><td>test</td><td>val</td><td>test</td></tr><tr><td>SMoE</td><td>1.152</td><td>1.128</td><td>31.279</td><td>33.061</td><td>36.08 (0.04)</td><td>47.92</td><td>960.2</td></tr><tr><td>HyperMoE</td><td>1.162</td><td>1.139</td><td>31.918</td><td>33.374</td><td>48.41 (12.4)</td><td>49.69</td><td>962.0</td></tr><tr><td>SMoE-MLP</td><td>1.164</td><td>1.137</td><td>31.430</td><td>33.142</td><td>36.79 (0.75)</td><td>48.70</td><td>964.1</td></tr><tr><td>RandomSMoE</td><td>1.163</td><td>1.135</td><td>31.938</td><td>33.410</td><td>36.08 (0.04)</td><td>47.72</td><td>961.4</td></tr><tr><td>CosineMoE</td><td>1.148</td><td>1.122</td><td>31.367</td><td>33.047</td><td>36.08 (0.04)</td><td>48.68</td><td>962.4</td></tr><tr><td>XMoE</td><td>1.150</td><td>1.125</td><td>31.265</td><td>32.926</td><td>36.13 (0.09)</td><td>48.70</td><td>967.5</td></tr><tr><td>RMoE</td><td>1.141</td><td>1.116</td><td>30.939</td><td>32.867</td><td>36.51 (0.47)</td><td>49.46</td><td>972.9</td></tr></table>
|
| 101 |
+
|
| 102 |
+
and legal texts. Our model architecture is modified based on Llama family (Touvron et al., 2023). Specifically, we use a 24-layer model and top-4 gating from 16 experts per layer following (Dai et al., 2024). This yields a model with approximately 0.53B activated / 0.91B total parameters. All different routers use the same training configurations. To ensure expert load balance, we employ balance loss with weights 0.01 during training. These experiments are conducted using the Megablocks (Gale et al., 2023) on 8 NVIDIA A100 GPUs for about 5 days. More details can be found in App. A.2. After pertaining, we perform supervised fine-tuning (sft). All models are trained on Alpaca (Taori et al., 2023) with the same configuration. We use lm-evaluation-harness1 to evaluate the fine-tuned model. To simulate the real LLMs application scenario, we don’t perform task-specific fine-tuning and evaluation. Since the models are largely under-trained, they give almost random-guessing results on challenging tasks like MMLU (Hendrycks et al., 2020). Therefore, we only test on tasks (ARC-easy, Hellaswag, PIQA, SciQ, LAMBADA) in lm-evaluation-harness. More details about sft configurations and tasks can be found in App. A.2. We further justify the scalability of RMoE on the setting of training 15B activate 2.7B models with 120B / 400B tokens. Given our utilization of a high-quality pre-training corpus, pre-training on 400B tokens yields better results compared to experimental MoE like OpenMoE (Xue et al., 2024). We find RMoE consistently provides over a one-point improvement in performance on benchmarks such as MMLU, GSM8K, and HumanEval. More details can be found in App. A.3.
|
| 103 |
+
|
| 104 |
+
# 4.2 MAIN RESULTS
|
| 105 |
+
|
| 106 |
+
Tab. 1 shows the performance of RMoE and selected baselines on two language modelling tasks. Our observations are as follows: (1) RMoE performs best on validation and test sets of two tasks, and the recurrent routing mechanism and the introduction of extra GRU block do not severely impact the training speed and memory usage, making RMoE more practical. (2) Comparing SMoE-MLP and SMoE, we find that replacing the original simple linear layer with a more capable MLP does not improve perfor-
|
| 107 |
+
|
| 108 |
+
mance. It even underperforms the fixed random routing (RandomMoE) on Enwikik8, suggesting that naively increasing model capacity can’t result in a more powerful router. Furthermore, since RMoE introduces novel computation stages in routing and is orthogonal to most existing router designs, it can easily be combined with them. Tab. 2 showcases the performance of the original XMoE and XMoE with GRU router in different XMoE lower dimensions (8, 16, and 32). We observe that the GRU router benefits all of the 3 configurations of XMoE.
|
| 109 |
+
|
| 110 |
+
While previous work on improving routers has not mostly been evaluated on large-scale pretraining (Dai et al., 2022; Chi et al., 2022; Do et al., 2023), we scale up RMoE to billion-level parameters and training tokens. We report SMoE and RMoE’s evaluation results (both directly evaluated and evaluated after supervised fine-tuning (sft)) in Tab. 3. Existing works suggest freezing the router during SMoE tuning Zoph et al. (2022); we report SMoE’s results under freeze and unfreeze settings. Correspondingly, for RMoE, we freeze the GRU and the linear layer under the freeze setting. From Tab. 3, we can observe that (1) Even in large-scale pre-training that requires more
|
| 111 |
+
|
| 112 |
+
Table 2: Performance of combining layer-wise recurrent routing mechanism with XMoE.
|
| 113 |
+
|
| 114 |
+
<table><tr><td rowspan="2">Algorithm</td><td colspan="2">Enwiki8 (BPC)↓</td><td colspan="2">WikiText (PPL)↓</td></tr><tr><td>Val</td><td>test</td><td>val</td><td>test</td></tr><tr><td>XMoE (8)</td><td>1.160</td><td>1.132</td><td>31.74</td><td>33.55</td></tr><tr><td>+ GRU router</td><td>1.150</td><td>1.124</td><td>31.34</td><td>32.99</td></tr><tr><td>XMoE (16)</td><td>1.150</td><td>1.125</td><td>31.27</td><td>32.93</td></tr><tr><td>+ GRU router</td><td>1.144</td><td>1.119</td><td>31.15</td><td>32.47</td></tr><tr><td>XMoE (32)</td><td>1.140</td><td>1.114</td><td>31.30</td><td>32.71</td></tr><tr><td>+ GRU router</td><td>1.136</td><td>1.112</td><td>31.25</td><td>32.55</td></tr></table>
|
| 115 |
+
|
| 116 |
+
Table 3: SMoE and RMoE’s pre-training costs and evaluation results in selected informative lm-evaluationharness tasks. ‘sft’ means supervised fine-tuning on the Alpaca dataset. The task names and metrics for short names in the table are: ‘ARC-e’ for ARC-Easy, acc; ‘Hella’ is for Hellaswag, acc-norm; ‘Piqa’ for PIQA, acc-norm; ‘Lamb’ for LAMBADA, acc. Each model has approximately 0.53B activated parameters out-of 0.91B parameters. RMoE introduces about 3.5M additional parameters relative to SMoE.
|
| 117 |
+
|
| 118 |
+
<table><tr><td>Algorithm</td><td>Training</td><td>ARC-e</td><td>Hella</td><td>Piqa</td><td>Sciq</td><td>Lamb</td><td>Avg↑</td></tr><tr><td rowspan="3">SMoE</td><td>pre-train 20B tokens</td><td>47.14</td><td>35.51</td><td>64.69</td><td>76.2</td><td>14.61</td><td>47.63</td></tr><tr><td>+sft</td><td>50.93</td><td>35.82</td><td>65.61</td><td>74.7</td><td>17.81</td><td>48.97</td></tr><tr><td>+sft (freeze router)</td><td>50.59</td><td>35.78</td><td>66.32</td><td>74.7</td><td>18.18</td><td>49.11</td></tr><tr><td rowspan="3">Speed: 48.87 s/step Mem: 48.00 GB</td><td>pre-train 40B tokens</td><td>52.57</td><td>40.85</td><td>67.74</td><td>83.4</td><td>26.74</td><td>54.26</td></tr><tr><td>+sft</td><td>53.70</td><td>42.07</td><td>68.61</td><td>83.5</td><td>32.80</td><td>56.13</td></tr><tr><td>+sft (freeze router)</td><td>53.45</td><td>41.94</td><td>68.88</td><td>83.1</td><td>32.06</td><td>55.88</td></tr><tr><td rowspan="3">RMoE</td><td>pre-train 20B tokens</td><td>47.01</td><td>35.91</td><td>65.23</td><td>78.7</td><td>19.13</td><td>49.20</td></tr><tr><td>+sft</td><td>48.53</td><td>36.90</td><td>66.21</td><td>79.6</td><td>24.74</td><td>51.20</td></tr><tr><td>+sft (freeze router)</td><td>49.24</td><td>36.79</td><td>66.16</td><td>79.7</td><td>24.32</td><td>51.24</td></tr><tr><td rowspan="3">Speed: 49.07 s/step Mem: 48.69 GB</td><td>pre-train 40B tokens</td><td>51.18</td><td>41.38</td><td>67.79</td><td>83.6</td><td>32.58</td><td>55.31</td></tr><tr><td>+sft</td><td>53.20</td><td>43.05</td><td>68.55</td><td>83.8</td><td>37.16</td><td>57.15</td></tr><tr><td>+sft (freeze router)</td><td>53.11</td><td>43.16</td><td>68.77</td><td>82.8</td><td>37.57</td><td>57.08</td></tr></table>
|
| 119 |
+
|
| 120 |
+
complex parallel training strategies, RMoE brings negligible wall time and memory cost compared with vanilla SMoE. (2) In comparable settings (e.g., the same number of tokens and with/without sft), RMoE outperforms SMoE, and even the best results of SMoE are lower than those of RMoE.
|
| 121 |
+
|
| 122 |
+
# 5 ABLATION STUDIES
|
| 123 |
+
|
| 124 |
+
# Which contributes more?
|
| 125 |
+
|
| 126 |
+
More Router parameters or layerwise recurrence. A straightforward reason for RMoE improvement could be that RMoE introduces additional computation and parameters. To disentangle the effect of introducing more router parameters and layerwise recurrence, we consider the fol-
|
| 127 |
+
|
| 128 |
+
lowing two extra settings: (1) SMoE+MLP: we naively increase the router parameters by replacing the original linear layer with a larger MLP layer; (2) $\mathrm { R M o E + N P }$ : we change Eq. 5 to $\mathrm { G R U } \bar { ( } \mathbf { r } _ { i } , \mathbf { h } _ { 0 } \bar { ) }$ to cancel the layerwise recurrence of RMoE, rendering a stateless GRU. The setting has the same parameters and computation as RMoE. From Tab. 4, we can observe that (1) in our setting, introducing larger routers in SMoE doesn’t bring improvement (SMoE v.s. $\mathbf { S M o E + M L P } )$ ). (2) When ablated on the layerwise recurrence in RMoE, the performance largely drops, even worse than SMoE. Both results suggest that the layerwise recurrence is the main contributor.
|
| 129 |
+
|
| 130 |
+
Table 4: Enwiki8 validation and test BPC for different routing designs. ‘NP’ stands for not passing recurrent states cross-layer. ‘RMoE+NP’ has the same parameters and FLOPs as ‘RMoE’.
|
| 131 |
+
|
| 132 |
+
<table><tr><td>Algorithm</td><td>Val↓</td><td>Test↓</td><td>Paras (M)</td><td>Val↓</td><td>Test↓</td><td>Paras (M)</td></tr><tr><td colspan="4">Small</td><td colspan="3">Medium</td></tr><tr><td>SMoE</td><td>1.214</td><td>1.184</td><td>15.32</td><td>1.152</td><td>1.128</td><td>36.08</td></tr><tr><td>SMoE + MLP</td><td>1.214</td><td>1.183</td><td>15.73</td><td>1.164</td><td>1.137</td><td>36.79</td></tr><tr><td>RMoE + NP</td><td>1.227</td><td>1.196</td><td>15.61</td><td>1.150</td><td>1.123</td><td>36.51</td></tr><tr><td>RMoE</td><td>1.213</td><td>1.183</td><td>15.61</td><td>1.141</td><td>1.116</td><td>36.51</td></tr></table>
|
| 133 |
+
|
| 134 |
+
Recurrent Gradient is important to RMoE Following the aforementioned analysis, we try to further disentangle the effect of the layerwise recurrence. When removing the layerwise recurrence as in the RMoE + NP setting, we remove two information flows across layers: (1) the forward information about previous routers’ decisions and (2) the backward gradient propagation through GRU hidden states in different layers. To compare the two information flows, we investigate the following settings: (1) RMoE $^ +$ detach $h _ { i - 1 }$ : in intermediate stage between RMoE and RMoE-NP. By detaching $h _ { i - 1 }$ to stop its gradient computation in Eq. 5, each GRU cell can only use previous information during feed-forward. (2) RMoE $+ \ \mathrm { N P } \ + \ \mathrm { r } { - \alpha }$ : inspired by Realformer (He et al.,
|
| 135 |
+
|
| 136 |
+
2020) that introduces residual attention score to facilitate attention gradient back-propagation, we investigate an intermediate stage between RMoE and RMoE-NP by adding gating logits residual for the RMoE + NP settings. Concretely, the gating score of $i$ -th layer for expert $n$ is
|
| 137 |
+
|
| 138 |
+
Table 5: Enwiki8 validation and test BPC. ‘detach $h _ { i - 1 } \ Y ^ { ' }$ means detaching the recurrent hidden states before passing it to the next block. ‘r-0.5/1.0’ means passing the routing logits of the previous block to the current block. ‘detach-r’ means detaching the gradient computation of passed logits.
|
| 139 |
+
|
| 140 |
+
<table><tr><td>Algorithm</td><td>Val</td><td>Test</td></tr><tr><td>SMoE</td><td>1.152</td><td>1.128</td></tr><tr><td>RMoE</td><td>1.141</td><td>1.116</td></tr><tr><td>+ NP</td><td>1.150</td><td>1.123</td></tr><tr><td>+ detach hi-1</td><td>1.159</td><td>1.133</td></tr><tr><td>+ NP + r-0.5</td><td>1.149</td><td>1.124</td></tr><tr><td>+ NP + r-1.0</td><td>1.150</td><td>1.124</td></tr><tr><td>+ NP + r-0.5 + detach-r</td><td>1.157</td><td>1.133</td></tr><tr><td>+ NP + r-1.0 + detach-r</td><td>1.152</td><td>1.126</td></tr></table>
|
| 141 |
+
|
| 142 |
+
$g _ { n } ( \mathbf { h } _ { i } ; \mathbf { G } _ { i } , k ) + \alpha g _ { n } ( \mathbf { h } _ { i - 1 } ; \mathbf { G } _ { i - 1 } , k )$ . It is a straightforward way to supplement router information across layers based on the NP setting. In our experiments, we set $\alpha$ as 0.5 and 1.0. (3) Moreover, we also test detaching the gradient computation of passed logits $( \mathbf { h } _ { i - 1 } \times \mathbf { G } _ { i - 1 } )$ , denoted as ‘detach-r’. From Tab. 5, RMoE $^ +$ detach $h _ { i - 1 }$ performs even worse than RMoE-NP, showing that the Recurrent Gradient is important. Similarly, $\mathrm { \cdot N P } { \mathrm { + r 0 . 5 } } ^ { \prime }$ and $\mathrm { \cdot N P { + r 1 . 0 } } ^ { \mathrm { , } }$ are comparable with ‘NP’, showing that the naive gating score residual can’t provide effective cross-layer information. The performance of their detached version largely drops, demonstrating the importance of extra gradient passing.
|
| 143 |
+
|
| 144 |
+
To further validate the gradient passing hypothesis, we test ‘NP‘ and $\mathsf { \cdot N P - r 0 } . 5 / 1 . 0 ^ { \circ }$ on deeper models. The results are summarized in Fig. 2. As the layer increases, we can observe that (1) RMoE consistently outperforms other settings, and RMoE-NP even lags behind SMoE. The possible reason is, without passing recurrent states, RMoE-NP is similar to SMoE-MLP which simply increases router complexity but doesn’t refine the router training. (2) RMoE-NP-r0.5 surpasses RMoE-NP, further emphasizing that SMoE’s optimization benefits from the added additional gradient flow for routers. The spirit echoes the principles behind residual network, where residual connection are used to create direct paths for gradient propagation, thereby mitigating gradient vanishing
|
| 145 |
+
|
| 146 |
+
as lerys deepen. Similarly, the GRU and the direct logits passing help for gradient flow of routers in deep layers. Ad shown in the Fig. 2, as the layer increases. the performance gaps between them may becomes more significant (3) While providing additional gradient across layers, RMoE-NP-r0.5 underperforms RMoE. This may because the indexes of experts in layer $i$ are not aligned with those in other layers, directly adding logits can lead to improper constraints and hurt the model performance, further highlighting that RMoE adds flexible while informative pathways in the SMoE framework.
|
| 147 |
+
|
| 148 |
+

|
| 149 |
+
Figure 2: Test BPC on Enwiki8 with different model sizes (6, 12, 18, 24, 32). Similar validation results are in App. A.5 Fig. 14
|
| 150 |
+
|
| 151 |
+
Table 6: Ablation of RMoE design. ‘L-proj‘ means the layerwise projector in Equ 4, ‘S-proj‘ is the standard RNN projector. ‘SMoE + L-proj $^ +$ GRU router‘ is our proposed used RMoE method.
|
| 152 |
+
|
| 153 |
+
<table><tr><td rowspan="2">Algorithm</td><td colspan="2">Enwiki8 (BPC)↓</td><td colspan="2">WikiText (PPL)↓</td><td rowspan="2">Params</td></tr><tr><td>Val</td><td>test</td><td>val</td><td>test</td></tr><tr><td>SMoE</td><td>1.152</td><td>1.128</td><td>31.28</td><td>33.06</td><td>36.08</td></tr><tr><td>SMoE + L-proj + GRU router</td><td>1.141</td><td>1.116</td><td>30.93</td><td>32.86</td><td>36.50</td></tr><tr><td>SMoE + S-proj + GRU router</td><td>1.148</td><td>1.123</td><td>31.15</td><td>33.02</td><td>36.23</td></tr><tr><td>SMoE + L-proj + RNN router</td><td>1.145</td><td>1.119</td><td>31.18</td><td>32.72</td><td>36.44</td></tr><tr><td>SMoE + L-proj + LSTM router</td><td>1.148</td><td>1.122</td><td>31.19</td><td>33.04</td><td>36.54</td></tr></table>
|
| 154 |
+
|
| 155 |
+
Layerwise projector and suitable recurrent net bring the best results. This part tests the other components in RMoE, such as recurrent hidden state dimension, layerwise projector, and GRU cell. As shown in Tab. 6: (1) All methods with recurrent routers outperform SMoE. (2) Layerwise projector in Eq. 5 performs better than standard RNNs using a single shared projector. One possible reason is that the weights and hidden states norm in different layers vary greatly (as shown in App. A.4.5 Fig. 11), and it would be hard for a single shared projector to process them. This approach aligns with the design principle of not sharing LayerNorm parameters when employing shared MoE transformer blocks, as discussed by Xue
|
| 156 |
+
|
| 157 |
+
et al. (2022). (3) The GRU router performs best. Moreover, we further compare RMoE variants in the larger scale settings. We compare pre-trained models with different structures and recurrent hidden dimensions in Tab. 7 (Averaged results, full results in App. A.5 Tab. 12). We can find similar results: (1) All RMoE variants outperform SMoE; (2) Simple router (RNN) and complex routers (GRU with $p = 2 5 6 , 5 1 2 ,$ ) perform worse. In short, layerwise projector and moderate recurrent cell (e.g. GRU with $p = 1 2 8 .$ ) effectively introduce layerwise recurrent.
|
| 158 |
+
|
| 159 |
+
Table 7: Ablation of the recurrent design on large scale per-training setting. $p$ is the dimension of the recurrent state $\mathbf { r } _ { i }$ in Eq. 4. We report averaged tasks (the same as Tab. 3) results for pre-trained and stf models. All models are trained with 20B tokens.
|
| 160 |
+
|
| 161 |
+
<table><tr><td>Algorithm</td><td>Pretrain</td><td>+sft</td></tr><tr><td>SMoE</td><td>47.63</td><td>49.11</td></tr><tr><td>RMoE (GRU, p = 128)</td><td>49.20</td><td>51.32</td></tr><tr><td>RMoE (GRU, p = 256)</td><td>49.08</td><td>50.04</td></tr><tr><td>RMoE (GRU, p = 512)</td><td>49.19</td><td>50.02</td></tr><tr><td>RMoE (RNN, p = 256)</td><td>47.92</td><td>50.44</td></tr></table>
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
(a) Mean MI of SMoE
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
(b) Mean MI of XMoE
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
(c) Mean MI of HyperMoE
|
| 171 |
+
|
| 172 |
+

|
| 173 |
+
(d) Mean MI of RMoE
|
| 174 |
+
|
| 175 |
+

|
| 176 |
+
(e) Mean MI of RMoE-NP
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
(f) Mean MI of RMoE-NP-r1.0
|
| 180 |
+
Figure 3: Heat maps of cross-layer mutual information (MI) for different methods. The (i-th row, j-th column) value represents MI between layers i and j. The First Row ((a) SMoE, (b) XMoE, (c) HyperMoE): All three methods have low cross-layer MI. Second Row((d) RMoE, (e) RMoE-NP, (f) RMoE-NP-r1.0): While RMoE has high cross-layer MI when disabled layerwise recurrent states passing, MI largely drops.
|
| 181 |
+
|
| 182 |
+
# 6 OBSERVATIONS
|
| 183 |
+
|
| 184 |
+
Layerwise recurrence increases cross-layer mutual information. The intuition of the proposed RMoE is that current routers in different layers are isolated, and the layerwise GRU is incorporated to provide routers with global information for coordination. Therefore, we measure the Mutual Information (MI) between routing distributions in different layers for each router in Fig. 3. The code can be found in App. A.4.2. We can observe: (1) Besides RMoE, all existing methods show low cross-layer MI, indicating that the routers of different layers work relatively independently. (2) RMoE shows higher MI than three baselines (d v.s. a, b, and c) and RMoE-NP (d v.s. e), showing the recurrent router can facilitate cross-layer information sharing. (3) While RMoE-NP’s MI is largely smaller than RMoE, it still surpasses the three baseline methods. The reason can be the shared GRU in Eq. 5. (4) Intuitively, passing routing logits can directly improve MI (f v.s. e). However, directly passing logits can’t ensure long-range information sharing, as the values in the right part of (f), which indicate the MI between non-neighbor layers, are smaller than those in (d).
|
| 185 |
+
|
| 186 |
+
RMoE enables moderate flat gating scores. The router’s gating score is a noteworthy feature for MoE-based models. It showcases the models’ training dynamics and how they ultimately exploit their experts. Ideally, the training paradigm of MoE models may have two stages: exploration and then exploitation. i.e., the router should actively explore more new expert combinations at the early stage of learning. But if the gating score converges to a sharp distribution too early, the router will learn very shallow routing mechanisms and fail to find optimal routing decisions. So We record gate entropy for each token $( - ( \sum _ { n } g _ { n } \ln g _ { n } )$ , $g _ { n }$ is the gating score for expert $n$ ) and plot the entropy distribution in Fig. 4 (left). Generally, the higher the entropy, the more evenly the router activates different experts rather than allowing one expert to dominate the layer. Thus, large density in highentropy parts means many recorded tokens have flat gating score distributions. We can observe that (1) RandomMoE, with a fixed random-initialized router, shows the largest gate entropy. Moreover, most tokens have high entropy, as there is only one peak in the large entropy location. This indicates while RandomRMoE can highly encourage exploration, the router may be under-trained and lack exploitation. (2) SMoE and HyperMoE show low routing entropy, with many tokens having nearly zero entropy. Such low entropy means the softmax operation gives nearly one-hot results, which means the Top-k experts degrade to Top-1 and the router’s gradient are very sparse. This can hurt the exploration of expert selection and lead to inefficient Top-k experts usage. (3) XMoE and
|
| 187 |
+
|
| 188 |
+
CosineMoE, using cosine similarity, which normalized the input and weights $G$ before computing logits, show relatively high entropy. They also perform better than SMoE in Tab. 1, indicating the benefits of suitable exploration. (4) RMoE, with unique cross-layer information sharing, has high entropy for many tokens while low entropy for a few tokens. These moderate gating scores can achieve a better balance between exploration and exploitation.
|
| 189 |
+
|
| 190 |
+
One may argue that such high entropy may come from the under-trained recurrent router in RMoE instead of capturing the dependency across layers, as the unlearnable RandomMoE also gives high entropy. Therefore, we further visualize the scores of ‘RMoE-NP’ and ‘RMoE-NP- $\mathrm { \Gamma } _ { \mathrm { r 0 . 5 / 1 . 0 ^ { \circ } } }$ in Fig. 4 (right). The observations are: (1) RMoE-NP’s entropy is slightly larger than SMoE’s but largely smaller than RMoE’s. , indicating that the larger entropy in RMoE is not from under-training but from cross-layer information sharing. (2) While ‘RMoE-NP- $\cdot \mathrm { r 0 } . 5 ^ { \cdot }$ is larger than SMoE and smaller than RMoE, ‘RMoE-NP-r1.0‘ is the largest. From Tab. 5 and Fig. 2, the small and large one both under-perform RMoE, These further demonstrate that the recurrent network can achieve a moderate flat gating score distribution, leading to a better trade-off between exploration and exploitation.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
|
| 194 |
+

|
| 195 |
+
Figure 4: Gate score entropy distribution over Enwiki8 test set for different router configurations. More similar results can be found in App. A.4.4 Fig. 8 and Fig. 9.
|
| 196 |
+
|
| 197 |
+
We also look into the statistics of selected experts’ scores. Here we calculate the (1) Inner Balance (IB): defined as the ratio Top-1 score/Top-2 score, large IB means the first expert dominates all selected experts; and (2) Outer Balance (OB), defined as $\sum _ { k \in { \mathrm { T o p } } - \mathrm { k } } g _ { k }$ , indicating the selected scores’ ratio in the score distribution, large OB means selected expert scores dominate the gate score distribution. Because such a ratio could have some extreme values, we report the median number for all tokens in Tab. 8. We can observe: (1) RandomMoE, with a fixed router, shows the lowest IB and OB. (2) Low-entropy models in the previous section (Sec. 6) have high IB and OB. (3) RMoE gives suitable IB and OB. While simply using a complex router (‘RMoE-NP’) shows relatively low IB and OB, RMoE is even lower. Moreover, passing logits can reduce IB and OB $\mathrm { \mathrm { ^ { * } R M o E } } { + } \mathrm { N P } { + } \mathrm { r } { - } 0 . 5 / 1 . 0 \mathrm { ^ { \circ } }$ ). All these experiments show sharing cross-layer router information can lead to more balanced routing decision and thus facilitate expert usage.
|
| 198 |
+
|
| 199 |
+
Table 8: Expert scores balance on Enwiki8. Inner Balance (IB) represents the (top-1 score / top-2 score) ratio, and Outer Balance (OB) represents summed selected gate scores.
|
| 200 |
+
|
| 201 |
+
<table><tr><td>Algorithm</td><td>IB</td><td>OB</td></tr><tr><td>SMoE</td><td>34.68</td><td>0.915</td></tr><tr><td>HyperMoE</td><td>34.60</td><td>0.920</td></tr><tr><td>CosineMoE</td><td>7.611</td><td>0.794</td></tr><tr><td>XMoE</td><td>19.93</td><td>0.861</td></tr><tr><td>RandomMoE</td><td>2.000</td><td>0.414</td></tr><tr><td>RMoE</td><td>2.021</td><td>0.573</td></tr><tr><td>+ NP</td><td>16.58</td><td>0.842</td></tr><tr><td>+ NP + r-0.5</td><td>2.792</td><td>0.661</td></tr><tr><td>+ NP + r-1.0</td><td>1.147</td><td>0.212</td></tr></table>
|
| 202 |
+
|
| 203 |
+
Layerwise recurrence reduces the negative effect of load balance constraint. To provide a more direct analysis of the router gradient, we investigate how the gradient norm of the router varies throughout the entire training process. When training a MoE model, the gradient of the router has
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
Figure 5: Experts similarity distribution across layers during large-scale pre-training. We plot box plots of expert similarity from checkpoints taken every 1k training steps (approximately 4B tokens), showing the expert similarity across the 24 layers of the model (with maximum, minimum, first quartile, median, and mean).
|
| 207 |
+
|
| 208 |
+
two separate sources: (1) the language modeling (LM) loss, and (2) the load balancing (LB) loss that pushes the router to assign tokens to different experts in a balanced manner. We empirically find (1) LB loss dominates the training of the linear router at the early training stage. This could hurt model’s general performance, as Wang et al. (2024) find, a high LB loss can cause balance token distribution but reduce performance. (2) On the contrary, the gradient of the RNN router from LB loss stabilises in the early stage, and the gradient from the LM loss keeps decreasing, suggesting that the RNN router is more optimised towards the LM loss. These observations suggest the recurrent router can effectively controls the influence of the LB loss. More details can be found in App. A.4.1
|
| 209 |
+
|
| 210 |
+
Layerwise recurrence encourages expert diversity One intriguing feature of MoE is that experts could modularly specialize on different inputs. Therefore, following recent works that analyze the FFNs (Geva et al., 2021; Qiu et al., 2024a;b) and expert weights similarity (Wu et al., 2022; Lo et al., 2024), we use the cosine-similarity of expert’s parameters to measure the expert diversity . We calculate for SMoE and RMoE in the large-scale pre-training settings, and the results are shown inFig. 5. To better understand the scale of similarity score, we also plot one dash line showing the similarity of random initialized experts. More details about similarity calculation and explanation can be found in App. A.4.3. We can observe that: (1) At the beginning of the training, the lowest expert similarities are similar to the random initialized one. (2) The expert similarity increases in the early training stages, then decreases later. This may be due to the randomly initialized router in the early stages, which essentially assigns tokens randomly to different experts, leading to increased expert similarity. As the router continues to learn, it gradually assigns specific tokens to the corresponding experts, resulting in decreased expert similarity as training progresses. (3) During the entire training stages, the average similarity score between experts in RMoE is lower than those in SMoE, indicating that RMoE encourages more diverse experts. This expert diversity also reasonably corresponds to the moderate flat gate scores in Sec 6.
|
| 211 |
+
|
| 212 |
+
# 7 CONCLUSION
|
| 213 |
+
|
| 214 |
+
This work introduces a layer-wise recurrent router for existing MoE-based language models. We validate the effectiveness of this layer-wise recurrence across various settings, tasks, and model sizes. By adding a new yet efficient computation stage in the routing, RMoE stands orthogonal to most existing methods and can be flexibly integrated with them. Ablation studies reveal that this recurrent mechanism offers additional Recurrent Gradients, aiding router optimization. Further analysis validates our intuition that GRU facilitates inter-layer information sharing. We also systematically compare RMoE’s model behavior with various baseline models, demonstrating that RMoE can enhance existing SMoE methods and providing insights for future research.
|
| 215 |
+
|
| 216 |
+
# ACKNOWLEDGMENT
|
| 217 |
+
|
| 218 |
+
Jie Fu is supported by Shanghai Artificial Intelligence Laboratory.
|
| 219 |
+
|
| 220 |
+
# REFERENCES
|
| 221 |
+
|
| 222 |
+
Xiao Bi, Deli Chen, Guanting Chen, Shanhuang Chen, Damai Dai, Chengqi Deng, Honghui Ding, Kai Dong, Qiushi Du, Zhe Fu, et al. Deepseek llm: Scaling open-source language models with longtermism. arXiv preprint arXiv:2401.02954, 2024.
|
| 223 |
+
Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. Piqa: Reasoning about physical commonsense in natural language. In Thirty-Fourth AAAI Conference on Artificial Intelligence, 2020.
|
| 224 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners, 2020.
|
| 225 |
+
Tianlong Chen, Zhenyu Zhang, Ajay Jaiswal, Shiwei Liu, and Zhangyang Wang. Sparse moe as the new dropout: Scaling dense and self-slimmable transformers. arXiv preprint arXiv:2303.01610, 2023.
|
| 226 |
+
Zewen Chi, Li Dong, Shaohan Huang, Damai Dai, Shuming Ma, Barun Patra, Saksham Singhal, Payal Bajaj, Xia Song, Xian-Ling Mao, Heyan Huang, and Furu Wei. On the representation collapse of sparse mixture of experts. In NeurIPS, 2022.
|
| 227 |
+
Peter Clark, Isaac Cowhey, Oren Etzioni, Daniel Khashabi, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. In arXiv preprint arXiv:1803.05457, 2018.
|
| 228 |
+
Damai Dai, Li Dong, Shuming Ma, Bo Zheng, Zhifang Sui, Baobao Chang, and Furu Wei. Stablemoe: Stable routing strategy for mixture of experts. arXiv preprint arXiv:2204.08396, 2022.
|
| 229 |
+
Damai Dai, Chengqi Deng, Chenggang Zhao, RX Xu, Huazuo Gao, Deli Chen, Jiashi Li, Wangding Zeng, Xingkai Yu, Y Wu, et al. Deepseekmoe: Towards ultimate expert specialization in mixtureof-experts language models. arXiv preprint arXiv:2401.06066, 2024.
|
| 230 |
+
Rahul Dey and Fathi M Salem. Gate-variants of gated recurrent unit (gru) neural networks. In 2017 IEEE 60th international midwest symposium on circuits and systems (MWSCAS), pp. 1597–1600. IEEE, 2017.
|
| 231 |
+
Yifeng Ding, Jiawei Liu, Yuxiang Wei, Terry Yue Zhuo, and Lingming Zhang. Xft: Unlocking the power of code instruction tuning by simply merging upcycled mixture-of-experts. arXiv preprint arXiv:2404.15247, 2024.
|
| 232 |
+
Giang Do, Khiem Le, Quang Pham, Trungtin Nguyen, Thanh-Nam Doan, Bint T Nguyen, Chenghao Liu, Savitha Ramasamy, Xiaoli Li, and Steven Hoi. Hyperrouter: Towards efficient training and inference of sparse mixture of experts. arXiv preprint arXiv:2312.07035, 2023.
|
| 233 |
+
Qingxiu Dong, Lei Li, Damai Dai, Ce Zheng, Zhiyong Wu, Baobao Chang, Xu Sun, Jingjing Xu, and Zhifang Sui. A survey on in-context learning. arXiv preprint arXiv:2301.00234, 2022.
|
| 234 |
+
William Fedus, Barret Zoph, and Noam Shazeer. Switch transformers: Scaling to trillion parameter models with simple and efficient sparsity. J. Mach. Learn. Res., 23:120:1–120:39, 2022.
|
| 235 |
+
Trevor Gale, Deepak Narayanan, Cliff Young, and Matei Zaharia. MegaBlocks: Efficient Sparse Training with Mixture-of-Experts. Proceedings of Machine Learning and Systems, 5, 2023.
|
| 236 |
+
|
| 237 |
+
Mor Geva, Roei Schuster, Jonathan Berant, and Omer Levy. Transformer feed-forward layers are key-value memories. In Marie-Francine Moens, Xuanjing Huang, Lucia Specia, and Scott Wentau Yih (eds.), Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, EMNLP 2021, Virtual Event / Punta Cana, Dominican Republic, 7-11 November, 2021, pp. 5484–5495. Association for Computational Linguistics, 2021.
|
| 238 |
+
Zhuocheng Gong, Ang Lv, Jian Guan, Junxi Yan, Wei Wu, Huishuai Zhang, Minlie Huang, Dongyan Zhao, and Rui Yan. Mixture-of-modules: Reinventing transformers as dynamic assemblies of modules. arXiv preprint arXiv:2407.06677, 2024.
|
| 239 |
+
Daya Guo, Qihao Zhu, Dejian Yang, Zhenda Xie, Kai Dong, Wentao Zhang, Guanting Chen, Xiao Bi, Y Wu, YK Li, et al. Deepseek-coder: When the large language model meets programming–the rise of code intelligence. arXiv preprint arXiv:2401.14196, 2024.
|
| 240 |
+
Suchin Gururangan, Mike Lewis, Ari Holtzman, Noah A Smith, and Luke Zettlemoyer. Demix layers: Disentangling domains for modular language modeling. arXiv preprint arXiv:2108.05036, 2021.
|
| 241 |
+
Suchin Gururangan, Margaret Li, Mike Lewis, Weijia Shi, Tim Althoff, Noah A Smith, and Luke Zettlemoyer. Scaling expert language models with unsupervised domain discovery. arXiv preprint arXiv:2303.14177, 2023.
|
| 242 |
+
David Ha, Andrew Dai, and Quoc V Le. Hypernetworks. arXiv preprint arXiv:1609.09106, 2016.
|
| 243 |
+
Ruining He, Anirudh Ravula, Bhargav Kanagal, and Joshua Ainslie. Realformer: Transformer likes residual attention. arXiv preprint arXiv:2012.11747, 2020.
|
| 244 |
+
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding. arXiv preprint arXiv:2009.03300, 2020.
|
| 245 |
+
Quzhe Huang, Zhenwei An, Nan Zhuang, Mingxu Tao, Chen Zhang, Yang Jin, Kun Xu, Liwei Chen, Songfang Huang, and Yansong Feng. Harder tasks need more experts: Dynamic routing in moe models. arXiv preprint arXiv:2403.07652, 2024.
|
| 246 |
+
Shima Imani, Liang Du, and Harsh Shrivastava. Mathprompter: Mathematical reasoning using large language models. arXiv preprint arXiv:2303.05398, 2023.
|
| 247 |
+
Aran Komatsuzaki, Joan Puigcerver, James Lee-Thorp, Carlos Riquelme Ruiz, Basil Mustafa, Joshua Ainslie, Yi Tay, Mostafa Dehghani, and Neil Houlsby. Sparse upcycling: Training mixture-of-experts from dense checkpoints. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023.
|
| 248 |
+
Dmitry Lepikhin, HyoukJoong Lee, Yuanzhong Xu, Dehao Chen, Orhan Firat, Yanping Huang, Maxim Krikun, Noam Shazeer, and Zhifeng Chen. Gshard: Scaling giant models with conditional computation and automatic sharding. In Proceedings of the 2021 International Conference on Learning Representations (ICLR), 2021.
|
| 249 |
+
Bo Li, Yifei Shen, Jingkang Yang, Yezhen Wang, Jiawei Ren, Tong Che, Jun Zhang, and Ziwei Liu. Sparse mixture-of-experts are domain generalizable learners. In The Eleventh International Conference on Learning Representations, ICLR 2023, Kigali, Rwanda, May 1-5, 2023. OpenReview.net, 2023.
|
| 250 |
+
Margaret Li, Suchin Gururangan, Tim Dettmers, Mike Lewis, Tim Althoff, Noah A Smith, and Luke Zettlemoyer. Branch-train-merge: Embarrassingly parallel training of expert language models. arXiv preprint arXiv:2208.03306, 2022.
|
| 251 |
+
Bin Lin, Zhenyu Tang, Yang Ye, Jiaxi Cui, Bin Zhu, Peng Jin, Junwu Zhang, Munan Ning, and Li Yuan. Moe-llava: Mixture of experts for large vision-language models. arXiv preprint arXiv:2401.15947, 2024.
|
| 252 |
+
Hanxiao Liu, Karen Simonyan, and Yiming Yang. Darts: Differentiable architecture search. arXiv preprint arXiv:1806.09055, 2018.
|
| 253 |
+
|
| 254 |
+
Ka Man Lo, Zeyu Huang, Zihan Qiu, Zili Wang, and Jie Fu. A closer look into mixture-of-experts in large language models. arXiv preprint arXiv:2406.18219, 2024.
|
| 255 |
+
Larry R Medsker, Lakhmi Jain, et al. Recurrent neural networks. Design and Applications, 5(64-67): 2, 2001.
|
| 256 |
+
Xiaonan Nie, Xupeng Miao, Shijie Cao, Lingxiao Ma, Qibin Liu, Jilong Xue, Youshan Miao, Yi Liu, Zhi Yang, and Bin Cui. Evomoe: An evolutional mixture-of-experts training framework via dense-to-sparse gate. arXiv preprint arXiv:2112.14397, 2021.
|
| 257 |
+
Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, et al. Training language models to follow instructions with human feedback. Advances in neural information processing systems, 35: 27730–27744, 2022.
|
| 258 |
+
Denis Paperno, German Kruszewski, Angeliki Lazaridou, Ngoc Quan Pham, Raffaella Bernardi,´ Sandro Pezzelle, Marco Baroni, Gemma Boleda, and Raquel Fernandez. The lambada dataset: Word prediction requiring a broad discourse context. In Proceedings of the 54th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), 2016.
|
| 259 |
+
Hieu Pham, Melody Guan, Barret Zoph, Quoc Le, and Jeff Dean. Efficient neural architecture search via parameters sharing. In International conference on machine learning, pp. 4095–4104. PMLR, 2018.
|
| 260 |
+
Quang Pham, Giang Do, Huy Nguyen, TrungTin Nguyen, Chenghao Liu, Mina Sartipi, Binh T Nguyen, Savitha Ramasamy, Xiaoli Li, Steven Hoi, et al. Competesmoe–effective training of sparse mixture of experts via competition. arXiv preprint arXiv:2402.02526, 2024.
|
| 261 |
+
Joan Puigcerver, Carlos Riquelme, Basil Mustafa, and Neil Houlsby. From sparse to soft mixtures of experts. arXiv preprint arXiv:2308.00951, 2023.
|
| 262 |
+
Zihan Qiu, Zeyu Huang, and Jie Fu. Unlocking emergent modularity in large language models. In Kevin Duh, Helena Gomez, and Steven Bethard (eds.), Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), Mexico City, Mexico, June 2024a. Association for Computational Linguistics.
|
| 263 |
+
Zihan Qiu, Zeyu Huang, Youcheng Huang, and Jie Fu. Empirical study on updating key-value memories in transformer feed-forward layers. arXiv preprint arXiv:2402.12233, 2024b.
|
| 264 |
+
Samyam Rajbhandari, Conglong Li, Z. Yao, Minjia Zhang, Reza Yazdani Aminabadi, A. Awan, Jeff Rasley, and Yuxiong He. Deepspeed-moe: Advancing mixture-of-experts inference and training to power next-generation ai scale. ArXiv, abs/2201.05596, 2022.
|
| 265 |
+
Prajit Ramachandran, Barret Zoph, and Quoc V Le. Searching for activation functions. arXiv preprint arXiv:1710.05941, 2017.
|
| 266 |
+
Stephen Roller, Sainbayar Sukhbaatar, Jason Weston, et al. Hash layers for large sparse models. Advances in Neural Information Processing Systems, 34:17555–17566, 2021.
|
| 267 |
+
Noam Shazeer, Azalia Mirhoseini, Krzysztof Maziarz, Andy Davis, Quoc V. Le, Geoffrey E. Hinton, and Jeff Dean. Outrageously large neural networks: The sparsely-gated mixture-of-experts layer. In 5th International Conference on Learning Representations, ICLR 2017, Toulon, France, April 24-26, 2017, Conference Track Proceedings. OpenReview.net, 2017.
|
| 268 |
+
Yikang Shen, Zheyu Zhang, Tianyou Cao, Shawn Tan, Zhenfang Chen, and Chuang Gan. Moduleformer: Learning modular large language models from uncurated data. CoRR, abs/2306.04640, 2023.
|
| 269 |
+
Samuel L. Smith, Ananya Kumar Ram, James Bradbury, Sharan Narang, Jared Casper, Matthew Johnson, Anselm Levskaya, John Schulman, Jascha Sohl-Dickstein, and Barret Zoph. Using megablocks to scale language model training. In International Conference on Machine Learning, pp. 20275–20291. PMLR, 2022.
|
| 270 |
+
|
| 271 |
+
Sainbayar Sukhbaatar, Olga Golovneva, Vasu Sharma, Hu Xu, Xi Victoria Lin, Baptiste Roziere, ` Jacob Kahn, Daniel Li, Wen-tau Yih, Jason Weston, et al. Branch-train-mix: Mixing expert llms into a mixture-of-experts llm. arXiv preprint arXiv:2403.07816, 2024.
|
| 272 |
+
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023.
|
| 273 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee´ Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Ar- ` mand Joulin, Edouard Grave, and Guillaume Lample. Llama: Open and efficient foundation language models, 2023. URL https://arxiv.org/abs/2302.13971.
|
| 274 |
+
Lean Wang, Huazuo Gao, Chenggang Zhao, Xu Sun, and Damai Dai. Auxiliary-loss-free load balancing strategy for mixture-of-experts. arXiv preprint arXiv:2408.15664, 2024.
|
| 275 |
+
Johannes Welbl, Pontus Stenetorp, and Sebastian Riedel. Constructing datasets for multi-hop reading comprehension across documents. In arXiv preprint arXiv:1710.06481, 2017.
|
| 276 |
+
Haoze Wu, Zihan Qiu, Zili Wang, Hang Zhao, and Jie Fu. Gw-moe: Resolving uncertainty in moe router with global workspace theory. arXiv preprint arXiv:2406.12375, 2024.
|
| 277 |
+
Lemeng Wu, Mengchen Liu, Yinpeng Chen, Dongdong Chen, Xiyang Dai, and Lu Yuan. Residual mixture of experts. arXiv preprint arXiv:2204.09636, 2022.
|
| 278 |
+
Fuzhao Xue, Ziji Shi, Futao Wei, Yuxuan Lou, Yong Liu, and Yang You. Go wider instead of deeper. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pp. 8779– 8787, 2022.
|
| 279 |
+
Fuzhao Xue, Zian Zheng, Yao Fu, Jinjie Ni, Zangwei Zheng, Wangchunshu Zhou, and Yang You. Openmoe: An early effort on open mixture-of-experts language models. arXiv preprint arXiv:2402.01739, 2024.
|
| 280 |
+
Yuanhang Yang, Shiyi Qi, Wenchao Gu, Chaozheng Wang, Cuiyun Gao, and Zenglin Xu. Enhancing efficiency in sparse models with sparser selection. arXiv preprint arXiv:2403.18926, 2024.
|
| 281 |
+
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, 2019.
|
| 282 |
+
Xiaofeng Zhang, Yikang Shen, Zeyu Huang, Jie Zhou, Wenge Rong, and Zhang Xiong. Mixture of attention heads: Selecting attention heads per token. In Proceedings of the 2022 Conference on Empirical Methods in Natural Language Processing, EMNLP 2022, Abu Dhabi, United Arab Emirates, December 7-11, 2022, pp. 4150–4162. Association for Computational Linguistics, 2022.
|
| 283 |
+
Hao Zhao, Zihan Qiu, Huijia Wu, Zili Wang, Zhaofeng He, and Jie Fu. Hypermoe: Towards better mixture of experts via transferring among experts. arXiv preprint arXiv:2402.12656, 2024.
|
| 284 |
+
Yanqi Zhou, Tao Lei, Hanxiao Liu, Nan Du, Yanping Huang, Vincent Zhao, Andrew M Dai, Quoc V Le, James Laudon, et al. Mixture-of-experts with expert choice routing. Advances in Neural Information Processing Systems, 35:7103–7114, 2022.
|
| 285 |
+
Barret Zoph and Quoc V Le. Neural architecture search with reinforcement learning. arXiv preprint arXiv:1611.01578, 2016.
|
| 286 |
+
Barret Zoph, Irwan Bello, Sameer Kumar, Nan Du, Yanping Huang, Jeff Dean, Noam Shazeer, and William Fedus. St-moe: Designing stable and transferable sparse expert models. arXiv preprint arXiv:2202.08906, 2022.
|
| 287 |
+
Simiao Zuo, Xiaodong Liu, Jian Jiao, Young Jin Kim, Hany Hassan, Ruofei Zhang, Tuo Zhao, and Jianfeng Gao. Taming sparsely activated transformer with stochastic experts. arXiv preprint arXiv:2110.04260, 2021.
|
| 288 |
+
|
| 289 |
+
# A APPENDIX
|
| 290 |
+
|
| 291 |
+
# A.1 MORE RELATED WORKS
|
| 292 |
+
|
| 293 |
+
Routing Strategies While most MoE works follow the original success and use token choice routing, some works explore different routing approaches. In Expert-Choice Routing (Zhou et al., 2022), each expert selects tokens to process across the whole batch input. This method avoids expert imbalance issues and allows different tokens to be processed by a flexible number of experts. Soft Mixture-of-Experts (Puigcerver et al., 2023) further assigns token weights for input tokens, weighted-averages them, and passes these merged tokens to different experts. This method moves one step behind the Expert-Choice Routing to allow more precise control. However, their tokenselecting operations are non-causal and thus can’t be directly used in the decoder models. Recent works (Huang et al., 2024; Yang et al., 2024) introduce dynamic top-k for each input token. While the FLOPs can be reduced, since this dynamic assignment can hurt the parallel computation of experts, more system-level implementation must be optimized to achieve wall-time efficiency. Some works also analyze issues in the routing of standard MoE like uncertain tokens (Wu et al., 2024) and lack of expert knowledge transfer (Zhao et al., 2024).
|
| 294 |
+
|
| 295 |
+
Training Strategies Due to the unstable nature of MoE (Zoph et al., 2022), some works investigate special training strategies for MoE. EvoMoE (Nie et al., 2021) uses a large top- $k$ (even equal to the expert number) at the beginning of training, gradually decreasing $k$ . StableMoE (Dai et al., 2022) proposes to freeze the router after training some tokens to avoid token assignment conflicts. Residual Mixture of Experts (Wu et al., 2022) initializes MoE from dense training checkpoints and finds it is an efficient method to train MoE models. Later, sparse-upcycling (Komatsuzaki et al., 2023) further trains large-scale language models from dense checkpoints, and many works follow this paradigm to efficiently utilize the power of MoE in fine tuning (Li et al., 2023), instruction tuning (Lin et al., 2024), and visual instruction tuning (Ding et al., 2024). Different from directly training MoE models, some works continue training the same pre-trained model on several different datasets to encourage specialization and combine them, either merging them into an MoE-style model (Gururangan et al., 2021; Sukhbaatar et al., 2024) or keeping a group of models and introducing a model-level router (Li et al., 2022; Gururangan et al., 2023).
|
| 296 |
+
|
| 297 |
+
Recurrence Controller A series of works introduce recurrent networks for Neural Architecture Search (NAS) (Zoph & Le, 2016; Ramachandran et al., 2017; Pham et al., 2018; Liu et al., 2018). They introduce a recurrent controller network that predicts the current layer-i’s architecture (like CNN filters’ number, size, and stride) based on layer-i’s input hidden states and previous recurrent states (Zoph & Le, 2016). While these works use RNN to predict model architecture configurations of each layer for all inputs, RMoE utilizes RNN to help the router select expert combinations for each token, which can be viewed as a dynamic version of NAS.
|
| 298 |
+
|
| 299 |
+
# A.2 EXPERIMENT SETUP
|
| 300 |
+
|
| 301 |
+
Enwiki8 and WikiText-103 We follow the default configurations in CompeteSMoE (Pham et al., 2024). Each model is trained for 80,000 steps with Adam optimizer. The learning rate is 0.0007 with 4000 warmup steps, and the batch size is 48. The main used model is a decoder-only transformerbased architecture with 8 layers and a hidden size of 352. It includes 16 experts, where the top 2 are selected during computation, each with an expert size of 352. The model uses 8 attention heads and handles sequences up to 512 tokens in length, with an attention span of 2048 tokens. It incorporates a dropout rate of 0.1 and a load balancing factor of 0.01 to ensure an even distribution of expert utilization. Computation Cost Each 8-layer model is trained on one NVIDIA-A100 GPU for approximately 21 hours.
|
| 302 |
+
|
| 303 |
+
Large Scale Pre-training For model architecture, our 24-layer model employs Rotary Embedding for positional encoding, SwiGLU for activation functions, and RMSNorm to enhance the model’s efficiency and performance. Other model configuration includes a hidden size of 1280, 20 attention heads, an initialization method standard deviation of 0.02, a sequence length of 4096, and a maximum positional embedding length of 4096. All dropout rates are set to 0. For the MoE part, we use 16 experts, with each expert having a feedforward network hidden size of 448, following
|
| 304 |
+
|
| 305 |
+
the fine-grained MoE settings, and each token activating 4 experts. We use a tokenizer with a 96512 vocabulary size, which adds approximately 123M embedding parameters and 123M vocabulary projection head parameters. Under this configuration, each model has approximately 664M non-embedding parameters, and every token activates 334M non-embedding parameters. The total parameter is around 910M. For pre-training configurations, we use a global batch size of 1120, a warmup period of 2000 iterations, a learning rate of $4 . 2 \mathrm { e } { \cdot } 4$ , a minimum learning rate of 4.2e-5, cosine learning rate decay, Adam optimizer with $\beta _ { 1 } = 0 . 9$ and $\beta _ { 2 } = 0 . 9 5$ , a weight decay of 0.1, and gradient clipping at 1.0. Computation Cost Each 24-layer model is trained on 8 NVIDIA-A100 GPUs for approximately 5 days.
|
| 306 |
+
|
| 307 |
+
Instruction Tuning Data The Alpaca (Taori et al., 2023) dataset is an open-source instructionfollowing dataset created by Stanford researchers, inspired by OpenAI’s ChatGPT. The dataset consists of 52,000 instruction-response pairs generated using the text-davinci-003 model by providing diverse and comprehensive instructions and recording the corresponding responses. It is designed to facilitate the training and evaluation of models in understanding and generating human-like text responses to various instructions.
|
| 308 |
+
|
| 309 |
+
Instruction Tuning Setting We use the codebase2 and corresponding default configurations. More concretely, we use bfloat16 (bf16) precision to accelerate training while maintaining numerical stability. The model is trained for 3 epochs using AdamW optimizer with a global batch size 128. We set the learning rate to 2e-5 and do not apply weight decay. A warmup ratio of 0.03 is used to gradually increase the learning rate at the beginning of training, and we utilize a cosine learning rate scheduler to adjust it throughout the training process, promoting smoother convergence. Computation Cost Each is trained on 8 NVIDIA-A100 GPUs for approximately 2 hours.
|
| 310 |
+
|
| 311 |
+
Evaluation Tasks Here we shortly describe our used evaluation datasets:
|
| 312 |
+
|
| 313 |
+
ARC-Easy is a subset of the AI2 Reasoning Challenge (ARC) dataset (Clark et al., 2018). It consists of multiple-choice questions from elementary and middle school science exams that are relatively easier than the ARC-Challenge set. These questions require basic reasoning and knowledge application.
|
| 314 |
+
|
| 315 |
+
Hellaswag (Zellers et al., 2019) is a dataset designed for commonsense reasoning and narrative prediction. It involves choosing the most plausible continuation of a given scenario from multiple options. The task is challenging because it requires understanding and applying common sense knowledge.
|
| 316 |
+
|
| 317 |
+
PIQA (Bisk et al., 2020) dataset tests a model’s ability to understand and reason about physical interactions and affordances. The task involves selecting the correct answer to questions about everyday physical activities.
|
| 318 |
+
|
| 319 |
+
SciQ (Welbl et al., 2017) is a dataset of science questions that includes multiple-choice and directanswer formats. It aims to test a model’s ability to understand and reason with scientific concepts typically taught at the school level.
|
| 320 |
+
|
| 321 |
+
LAMBADA (Paperno et al., 2016) is a dataset designed for language modeling and comprehension. The task involves predicting the last word of a given passage, which requires a deep understanding of the context provided by the preceding text.
|
| 322 |
+
|
| 323 |
+
# A.3 FURTHER PRETRAINING VALIDATION
|
| 324 |
+
|
| 325 |
+
To further validate the scalability of RMoE, we conduct experiments with larger model sizes and increased pre-training corpus. Both MoE models followed the design principles of DeepSeek-MoE (Dai et al., 2024), utilizing fine-grained experts and shared experts to maintain strong baselines. We evaluated the models on more challenging benchmarks, including Hellaswag, MMLU, GSM8K, and HumanEval, to assess their language capabilities, multi-domain knowledge, mathematical skills, and coding abilities. Additionally, we tested the models’ perplexity on multiple domain test datasets and reported the average results.
|
| 326 |
+
|
| 327 |
+
Tab. 9 and Tab. 10 present the performance of a 15-billion parameter model with 2.7 billion activated experts, trained on 120 billion and 400 billion tokens, respectively. The results show that RMoE consistently delivers improvements even with increased data volumes. The findings indicate that RMoE enhances performance in standard language modeling tasks, such as Hellaswag and PPL, and improves performance on more complex reasoning tasks.
|
| 328 |
+
|
| 329 |
+
Table 9: Performance comparison of SMoE, SMoE-MLP and RMoE at the model scale of 15B activation 2.7B parameters, training 120B tokens.
|
| 330 |
+
|
| 331 |
+
<table><tr><td></td><td>Hellaswag</td><td>MMLU</td><td>GSM8K</td><td>Avg PPL</td></tr><tr><td colspan="5">Pretrain 80B Tokens</td></tr><tr><td>SMoE</td><td>67.69</td><td>46.24</td><td>24.18</td><td>7.406</td></tr><tr><td>SMoE-MLP</td><td>67.98</td><td>46.47</td><td>23.58</td><td>7.437</td></tr><tr><td>RMoE</td><td>68.00</td><td>47.74</td><td>27.14</td><td>7.361</td></tr><tr><td colspan="5">Pretrain 100B Tokens</td></tr><tr><td>SMoE</td><td>70.98</td><td>50.61</td><td>30.78</td><td>6.754</td></tr><tr><td>SMoE-MLP</td><td>70.8</td><td>50.6</td><td>30.17</td><td>6.786</td></tr><tr><td>RMoE</td><td>71.02</td><td>51.74</td><td>32.98</td><td>6.732</td></tr><tr><td colspan="5">Pretrain 120B Tokens</td></tr><tr><td>SMoE</td><td>72.03</td><td>52.79</td><td>34.8</td><td>6.447</td></tr><tr><td>SMoE-MLP</td><td>72.19</td><td>52.81</td><td>34.57</td><td>6.479</td></tr><tr><td>RMoE</td><td>72.36</td><td>54.02</td><td>36.13</td><td>6.425</td></tr></table>
|
| 332 |
+
|
| 333 |
+
Table 10: Performance comparison of SMoE, SMoE-MLP and RMoE at the model scale of 15B activation 2.7B parameters, training 400B tokens.
|
| 334 |
+
|
| 335 |
+
<table><tr><td></td><td>Hellaswag</td><td>MMLU</td><td>GSM8K</td><td>Avg PPL</td></tr><tr><td colspan="5">Pretrain 200B Tokens</td></tr><tr><td>SMoE</td><td>69.48</td><td>49.96</td><td>33.21</td><td>7.718</td></tr><tr><td>SMoE-MLP</td><td>69.76</td><td>50.27</td><td>31.77</td><td>7.736</td></tr><tr><td>RMoE</td><td>70.00</td><td>52.21</td><td>32.98</td><td>7.608</td></tr><tr><td colspan="5">Pretrain 280B Tokens</td></tr><tr><td>SMoE</td><td>72.40</td><td>54.66</td><td>42.61</td><td>6.477</td></tr><tr><td>SMoE-MLP</td><td>72.62</td><td>55.33</td><td>38.51</td><td>6.502</td></tr><tr><td>RMoE</td><td>73.18</td><td>56.06</td><td>44.35</td><td>6.400</td></tr><tr><td colspan="5">Pretrain 400B Tokens</td></tr><tr><td>SMoE</td><td>76.39</td><td>59.54</td><td>52.16</td><td>5.685</td></tr><tr><td>SMoE-MLP</td><td>76.09</td><td>59.96</td><td>51.71</td><td>5.709</td></tr><tr><td>RMoE</td><td>76.72</td><td>60.60</td><td>52.99</td><td>5.620</td></tr></table>
|
| 336 |
+
|
| 337 |
+
# A.4 ADDITIONAL OBSERVATIONS
|
| 338 |
+
|
| 339 |
+
# A.4.1 ROUTER GRADIENT NORM AND DROP RATIO
|
| 340 |
+
|
| 341 |
+
Table 11: Comparison of linear and RNN routers in terms of gradients and drop ratios at various training steps. We record the router gradient every 10k training steps (20B tokens). We compute the gradient with language modeling (LM) loss and load balance (LB) loss. Drop ratio is the ratio of dropped tokens and all tokens as we assign capacity factor 1.0 for each expert.
|
| 342 |
+
|
| 343 |
+
<table><tr><td>Training steps (k step)</td><td>0.1</td><td>10</td><td>20</td><td>30</td><td>40</td><td>50</td><td>60</td></tr><tr><td colspan="8">Linear router</td></tr><tr><td>grad from the whole loss</td><td>1.058</td><td>0.194</td><td>0.1911</td><td>0.198</td><td>0.208</td><td>0.217</td><td>0.221</td></tr><tr><td>grad from LM loss</td><td>0.625</td><td>0.183</td><td>0.184</td><td>0.192</td><td>0.204</td><td>0.215</td><td>0.220</td></tr><tr><td>grad from LB loss</td><td>0.433</td><td>0.011</td><td>0.008</td><td>0.006</td><td>0.004</td><td>0.002</td><td>0.001</td></tr><tr><td>drop ratio</td><td>35.6</td><td>5.43</td><td>5.34</td><td>5.17</td><td>4.89</td><td>4.64</td><td>4.50</td></tr><tr><td colspan="8">RNN router</td></tr><tr><td>grad from the whole loss</td><td>0.972</td><td>0.160</td><td>0.153</td><td>0.153</td><td>0.155</td><td>0.155</td><td>0.154</td></tr><tr><td>grad from LM loss</td><td>0.636</td><td>0.146</td><td>0.138</td><td>0.139</td><td>0.144</td><td>0.148</td><td>0.151</td></tr><tr><td>grad from LB loss</td><td>0.337</td><td>0.014</td><td>0.015</td><td>0.014</td><td>0.011</td><td>0.007</td><td>0.003</td></tr><tr><td>drop ratio</td><td>38.7</td><td>6.35</td><td>6.30</td><td>5.94</td><td>5.32</td><td>4.54</td><td>4.09</td></tr></table>
|
| 344 |
+
|
| 345 |
+
Based on the setting of training 15B models for 120B tokens, we investigate how the gradient norm of the router varies throughout the entire training process. When training an MoE-based model, the gradient of the router has two separate sources: due to (1) the language modeling (LM) loss, and (2) the load balancing (LB) loss that forces the router to assign tokens to different experts in a balanced manner. Therefore, for each router, we compare the gradient from the LM loss only and from the whole training loss. We calculate the average for 100 training steps to estimate the gradient norm.
|
| 346 |
+
|
| 347 |
+
Furthermore, to better investigate the relation between the router behavior and the router gradient, we calculate the drop ratio for the router. This is because during the large-scale MoE pre-training, to ensure the training efficiency, the expert is usually controlled by an hyper-parameter called capacity factor, which determines the total tokens that one expert can process. If the router assigns tokens to some expert that exceeds its capacity, the expert will drop tokens with the lowest scores. And we define the drop ratio as tokens dropped / total tokens. The LB loss mentioned before is critical to decreasing the drop ratio.
|
| 348 |
+
|
| 349 |
+
According to Tab. 11, we have the following observations: 1. The gradient norm of the RNN router is generally smaller than that of the linear router. And for both routers, the drop ratio decreases with the training. 2. According to the drop ratios, we observe the significant behavioral difference between the two routers: during the early training phase (10k steps $- \dot { \zeta } \ 3 0 \bf k$ steps), the drop ratio of the linear router is noticeably lower than that of the RNN router; the drop ratio of the RNN router archives at the lower value in the end. 3. The trend observed in the drop ratio is consistent with the results of the gradient norm. The grad norm for LB loss is relatively higher in the RNN router until the final training stage $( 5 0 \mathrm { k } - 6 0 \mathrm { k } )$ , whereas the gradient from LB loss in the linear router is high at the beginning and generally low during the later part of training (10k - 60k).
|
| 350 |
+
|
| 351 |
+
These phenomena indicate that the LB loss could dominate the training of the linear router: when the drop ratio is low and stays unchanged, the grad from LB loss will be low because the router is already well-optimized for LB loss. Such early convergence in the LB loss may reach a suboptimal solution in the trade-off between optimizing load balance and language modeling. On the contrary, the gradient of the RNN router from LB loss stabilizes in the early training steps $( 1 0 \mathbf { k } - 3 0 \mathbf { k } )$ , and the gradient from the lm loss keeps decreasing, suggesting that the RNN router is more optimized towards the LM loss.
|
| 352 |
+
|
| 353 |
+
# A.4.2 MUTUAL INFORMATION
|
| 354 |
+
|
| 355 |
+
i m p o r t numpy a s np
|
| 356 |
+
|
| 357 |
+
f r o m s k l e a r n . m e t r i c s i m p o r t m u t u a l i n f o s c o r e
|
| 358 |
+
|
| 359 |
+
def discretizeprob_dist(prob_dist,bins $= 100$ : Discretize the probability distribution into discrete bins. discretized $=$ np.digitize(prob_dist,bins $\equiv$ np.linspace(0,1,bins)) return discretized
|
| 360 |
+
|
| 361 |
+
```python
|
| 362 |
+
def calculate_mutual_information(x1, x2, bins=100):
|
| 363 |
+
Calculate mutual information between each pair of distributions in x1 and x2.
|
| 364 |
+
x1, x2: numpy arrays of shape (N, 16)
|
| 365 |
+
bins: number of bins to use for discretization
|
| 366 |
+
Returns a numpy array of mutual information values.
|
| 367 |
+
mi_values = []
|
| 368 |
+
for i in range(x1.shape[0]):
|
| 369 |
+
x1_discretized = discretize_prob_dist(x1[i], bins)
|
| 370 |
+
x2_discretized = discretize_prob_dist(x2[i], bins)
|
| 371 |
+
mi = mutual_info_score(x1_discretized, x2_discretized)
|
| 372 |
+
mi_values.append(mi)
|
| 373 |
+
return np.array(mi_values)
|
| 374 |
+
```
|
| 375 |
+
|
| 376 |
+
# A.4.3 EXPERT SIMILARITIES
|
| 377 |
+
|
| 378 |
+
```python
|
| 379 |
+
def get_similarities(htoh4_0,htoh4_1,h4toh):
|
| 380 |
+
avg_key_0 =htoh4_0.mean(dim=1)# (num_experts,4h,h)
|
| 381 |
+
avg_key_1 =htoh4_1.mean(dim=1)# (num_experts,4h,h)
|
| 382 |
+
avg_value =h4toh.mean(dim=2)# (num_experts,h,4h)
|
| 383 |
+
normed_key_0 = nn.Functional.normalize(avg_key_0,p=2, dim=1)
|
| 384 |
+
normed_key_1 = nn.Functional.normalize(avg_key_1,p=2, dim=1)
|
| 385 |
+
normed_value = nn.Functional.normalize(avg_value,p=2, dim=1)
|
| 386 |
+
normed_avg_expert = torch.cat([normed_key_0, normed_key_1, normed_value],dim=1)
|
| 387 |
+
#compute the average expert similarity
|
| 388 |
+
similarity = torch.mm(normed_avg_expert, normed_avg_expert.t())
|
| 389 |
+
avg_sim = normed_similarity.mean().item()
|
| 390 |
+
return avg_sim
|
| 391 |
+
```
|
| 392 |
+
|
| 393 |
+
# A.4.4 MORE ROUTER ENTROPY DISTRIBUTIONS
|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 6: Mutual information of RMoE-NP-r0.5 and CosineMoE settings
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 7: Mutual information of SMoE, RMoE, RMoE-NP, and RMoE-NP-r0.5 in 24-layer models.
|
| 400 |
+
|
| 401 |
+

|
| 402 |
+
|
| 403 |
+

|
| 404 |
+
|
| 405 |
+

|
| 406 |
+
|
| 407 |
+

|
| 408 |
+
|
| 409 |
+

|
| 410 |
+
|
| 411 |
+

|
| 412 |
+
Figure 8: Gate score entropy distribution over Enwiki test set for different routers in 8-layer models.
|
| 413 |
+
|
| 414 |
+
A.4.5 ROUTER WEIGHTS INFORMATION
|
| 415 |
+
A.4.6 EXPERT SELECTION FREQUENCY
|
| 416 |
+
A.5 ADDITIONAL RESULTS
|
| 417 |
+
|
| 418 |
+
Table 12: More SMoE and RMoE variants pre-training costs and evaluation results in selected informative lm-evaluation-harness tasks. ‘sft’ means supervised fine-tuning on the Alpaca dataset. The task names and metrics for short names in the table are: ‘ARC-e’ for ARC-Easy, acc; ‘Hella’ is for Hellaswag, acc-norm; ‘Piqa’ for PIQA, acc-norm; ‘Lamb’ for LAMBADA, acc.
|
| 419 |
+
|
| 420 |
+
<table><tr><td>Algorithm</td><td>Training</td><td>ARC-e</td><td>Hella</td><td>Piqa</td><td>Sciq</td><td>Lamb</td><td>Avg↑</td></tr><tr><td rowspan="6">SMoE</td><td>20B (5k steps)</td><td>47.14</td><td>35.51</td><td>64.69</td><td>76.2</td><td>14.61</td><td>47.63</td></tr><tr><td>+sft</td><td>50.93</td><td>35.82</td><td>65.61</td><td>74.7</td><td>17.81</td><td>48.97</td></tr><tr><td>+sft (freeze gate)</td><td>50.59</td><td>35.78</td><td>66.32</td><td>74.7</td><td>18.18</td><td>49.11</td></tr><tr><td>40B (10k steps)</td><td>52.57</td><td>40.85</td><td>67.74</td><td>83.4</td><td>26.74</td><td>54.26</td></tr><tr><td>+sft</td><td>53.7</td><td>42.07</td><td>68.61</td><td>83.5</td><td>32.8</td><td>56.13</td></tr><tr><td>+sft (freeze gate)</td><td>53.45</td><td>41.94</td><td>68.88</td><td>83.1</td><td>32.06</td><td>55.89</td></tr><tr><td rowspan="4">RMoE</td><td>20B</td><td>47.01</td><td>35.91</td><td>65.23</td><td>78.7</td><td>19.13</td><td>49.20</td></tr><tr><td>+sft</td><td>48.53</td><td>36.9</td><td>66.21</td><td>79.6</td><td>24.74</td><td>51.20</td></tr><tr><td>+sft (freeze router)</td><td>48.65</td><td>36.88</td><td>66.43</td><td>80.1</td><td>24.55</td><td>51.32</td></tr><tr><td>+sft (freeze router and GRU)</td><td>49.24</td><td>36.79</td><td>66.16</td><td>79.7</td><td>24.32</td><td>51.24</td></tr><tr><td rowspan="4">GRU p=128</td><td>40B</td><td>51.18</td><td>41.38</td><td>67.79</td><td>83.6</td><td>32.58</td><td>55.31</td></tr><tr><td>+sft</td><td>53.20</td><td>43.05</td><td>68.55</td><td>83.8</td><td>37.16</td><td>57.15</td></tr><tr><td>+sft (freeze router)</td><td>53.03</td><td>42.96</td><td>68.34</td><td>83.6</td><td>36.68</td><td>56.92</td></tr><tr><td>+sft (freeze router and GRU)</td><td>53.11</td><td>43.16</td><td>68.77</td><td>82.8</td><td>37.57</td><td>57.08</td></tr><tr><td rowspan="4">RMoE</td><td>20B</td><td>47.47</td><td>35.91</td><td>65.78</td><td>76.2</td><td>20.03</td><td>49.08</td></tr><tr><td>+sft</td><td>48.36</td><td>36.49</td><td>65.07</td><td>77.4</td><td>22.86</td><td>50.04</td></tr><tr><td>+sft (freeze router)</td><td>48.27</td><td>36.42</td><td>65.23</td><td>76.9</td><td>22.88</td><td>49.94</td></tr><tr><td>+sft (freeze router and GRU)</td><td>48.23</td><td>36.46</td><td>64.94</td><td>77.3</td><td>22.61</td><td>49.91</td></tr><tr><td rowspan="4">GRU p=256</td><td>40B</td><td>53.07</td><td>41.15</td><td>68.52</td><td>84.0</td><td>19.17</td><td>53.18</td></tr><tr><td>+sft</td><td>54.46</td><td>43.06</td><td>67.46</td><td>84.9</td><td>24.57</td><td>54.89</td></tr><tr><td>+sft (freeze router)</td><td>54.45</td><td>43.10</td><td>67.19</td><td>84.1</td><td>23.93</td><td>54.55</td></tr><tr><td>+sft (freeze router and GRU)</td><td>54.50</td><td>43.13</td><td>67.36</td><td>83.8</td><td>23.62</td><td>54.48</td></tr><tr><td rowspan="4">RMoE</td><td>20B</td><td>47.77</td><td>35.39</td><td>64.80</td><td>79.5</td><td>25.00</td><td>50.49</td></tr><tr><td>+sft</td><td>48.27</td><td>36.47</td><td>65.51</td><td>76.6</td><td>22.18</td><td>49.81</td></tr><tr><td>+sft (freeze router)</td><td>47.73</td><td>36.41</td><td>65.78</td><td>76.6</td><td>22.88</td><td>49.88</td></tr><tr><td>+sft (freeze router and GRU)</td><td>48.19</td><td>36.22</td><td>65.29</td><td>76.8</td><td>23.5</td><td>50.00</td></tr><tr><td rowspan="4">GRU p=512</td><td>40B</td><td>51.64</td><td>41.37</td><td>66.81</td><td>86.0</td><td>22.76</td><td>53.72</td></tr><tr><td>+sft</td><td>52.82</td><td>42.68</td><td>68.55</td><td>86.0</td><td>26.88</td><td>55.39</td></tr><tr><td>+sft (freeze router)</td><td>52.48</td><td>42.61</td><td>68.44</td><td>86.0</td><td>27.23</td><td>55.35</td></tr><tr><td>+sft (freeze router and GRU)</td><td>52.74</td><td>42.44</td><td>68.77</td><td>86.3</td><td>27.13</td><td>55.48</td></tr><tr><td rowspan="4">RMoE</td><td>20B</td><td>46.63</td><td>35.7</td><td>64.91</td><td>76.1</td><td>16.24</td><td>47.92</td></tr><tr><td>+sft</td><td>48.40</td><td>36.45</td><td>65.51</td><td>77.3</td><td>22.65</td><td>50.06</td></tr><tr><td>+sft (freeze router)</td><td>48.70</td><td>36.29</td><td>65.45</td><td>77.3</td><td>22.60</td><td>50.07</td></tr><tr><td>+sft (freeze router and RNN)</td><td>49.24</td><td>36.48</td><td>65.56</td><td>77.7</td><td>23.20</td><td>50.44</td></tr></table>
|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
|
| 426 |
+

|
| 427 |
+
|
| 428 |
+

|
| 429 |
+
|
| 430 |
+

|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
Figure 9: Gate score entropy distribution over Enwiki test set for different information passing settings in 8-layer models.
|
| 434 |
+
|
| 435 |
+

|
| 436 |
+
|
| 437 |
+

|
| 438 |
+
|
| 439 |
+

|
| 440 |
+
|
| 441 |
+

|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
|
| 445 |
+

|
| 446 |
+
|
| 447 |
+

|
| 448 |
+
|
| 449 |
+

|
| 450 |
+
Figure 10: Gate score entropy distribution over Enwiki test set for different routers. RMoE can be combined with XMoE to encourage the exploration of XMoE.
|
| 451 |
+
|
| 452 |
+

|
| 453 |
+
|
| 454 |
+

|
| 455 |
+
|
| 456 |
+

|
| 457 |
+
|
| 458 |
+

|
| 459 |
+
|
| 460 |
+

|
| 461 |
+
|
| 462 |
+

|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
|
| 466 |
+

|
| 467 |
+
Figure 11: Different layers’ router weight statistics (left column: norm and right column: standard deviation) in Enwiki8 setting. (1) different layers have different norms and STDs, which inspires us to introduce layerwise projector in Equ 4 and explains using the shared projector can hurt RMoE’s performance (Tab. 6). (2) While SMoE routers show larger weight norms than RMoE settings, their standard deviations are not the highest. The large router norms can potentially explain the larger IB and OB in Tab. 8.
|
| 468 |
+
|
| 469 |
+

|
| 470 |
+
|
| 471 |
+

|
| 472 |
+
|
| 473 |
+

|
| 474 |
+
|
| 475 |
+

|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
|
| 479 |
+

|
| 480 |
+
Figure 12: Different methods’ expert selection frequency on medium size models in Enwiki8. (1) RMoE slightly increases expert imbalance than SMoE. (2) Methods using a frozen-random-initialize router (Hyper-MoE and RandomMoE) show more imbalance problems.
|
| 481 |
+
|
| 482 |
+

|
| 483 |
+
|
| 484 |
+

|
| 485 |
+
Figure 13: Expert similarity in Enwiki8 training experiments. RandomMoE shows the highest expert similarity. XMoE, which introduces down-projected cosine routing to resolve representation collapse in SMoE, shows the lowest expert similarity. While RMoE doesn’t significantly diversify experts as in the large-scale training settings (left), it can be further combined with XMoE, which largely increases expert diversity and brings improvement (right).
|
| 486 |
+
|
| 487 |
+

|
| 488 |
+
Figure 14: Validation BPC on Enwiki8 with different model sizes (6, 12, 18, 24, 32 layers).
|
paper_markdowns/bamboo-02926.md
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
|
| 3 |
+
<!-- [chunk 1/2 failed] -->
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
|
| 7 |
+
Table 9: Our proposed NSR module vs other regularisation methods for all test anomalies.
|
| 8 |
+
|
| 9 |
+
<table><tr><td></td><td>Dataset</td><td>SAD</td><td>CL (unsup)</td><td>CL (s)</td><td>NSR (dual)</td><td>NSR</td></tr><tr><td rowspan="5">AUC-ROC</td><td>Photo</td><td>0.599±0.134</td><td>0.807±0.010</td><td>0.891±0.010</td><td>0.894±0.016</td><td>0.908±0.016</td></tr><tr><td>Computers</td><td>0.644±0.126</td><td>0.743±0.012</td><td>0.781±0.022</td><td>0.778±0.021</td><td>0.797±0.015</td></tr><tr><td>CS</td><td>0.819±0.014</td><td>0.894±0.006</td><td>0.927±0.012</td><td>0.927±0.022</td><td>0.957±0.007</td></tr><tr><td>Yelp</td><td>0.522±0.041</td><td>0.731±0.014</td><td>0.665±0.072</td><td>0.732±0.016</td><td>0.734±0.012</td></tr><tr><td>average</td><td>0.646±0.079</td><td>0.794±0.011</td><td>0.816±0.029</td><td>0.833±0.019</td><td>0.849±0.013</td></tr><tr><td rowspan="5">AUC-RR</td><td>Photo</td><td>0.269±0.215</td><td>0.513±0.018</td><td>0.583±0.012</td><td>0.623±0.029</td><td>0.640±0.036</td></tr><tr><td>Computers</td><td>0.381±0.190</td><td>0.492±0.014</td><td>0.539±0.024</td><td>0.539±0.023</td><td>0.559±0.018</td></tr><tr><td>CS</td><td>0.700±0.016</td><td>0.795±0.009</td><td>0.843±0.020</td><td>0.858±0.042</td><td>0.889±0.016</td></tr><tr><td>Yelp</td><td>0.175±0.046</td><td>0.392±0.013</td><td>0.330±0.078</td><td>0.399±0.021</td><td>0.398±0.014</td></tr><tr><td>Average</td><td>0.646±0.079</td><td>0.794±0.011</td><td>0.816±0.029</td><td>0.833±0.019</td><td>0.849±0.013</td></tr></table>
|
| 10 |
+
|
| 11 |
+
Table 10: Our proposed NSR module vs other regularisation methods for unseen anomalies.
|
| 12 |
+
|
| 13 |
+
<table><tr><td></td><td>Dataset</td><td>SAD</td><td>CL (unsup)</td><td>CL (s)</td><td>NSR (dual)</td><td>NSR</td></tr><tr><td rowspan="5">AUC-ROC</td><td>Photo</td><td>0.516±0.047</td><td>0.652±0.018</td><td>0.807±0.017</td><td>0.810±0.031</td><td>0.836±0.031</td></tr><tr><td>Computers</td><td>0.614±0.103</td><td>0.685±0.015</td><td>0.733±0.027</td><td>0.730±0.025</td><td>0.752±0.019</td></tr><tr><td>CS</td><td>0.797±0.016</td><td>0.883±0.006</td><td>0.920±0.013</td><td>0.924±0.021</td><td>0.953±0.008</td></tr><tr><td>Yelp</td><td>0.511±0.026</td><td>0.677±0.023</td><td>0.613±0.071</td><td>0.679±0.018</td><td>0.690±0.025</td></tr><tr><td>average</td><td>0.610±0.048</td><td>0.724±0.016</td><td>0.768±0.032</td><td>0.786±0.024</td><td>0.808±0.021</td></tr><tr><td rowspan="5">AUC-RR</td><td>Photo</td><td>0.053±0.004</td><td>0.068±0.004</td><td>0.133±0.019</td><td>0.207±0.049</td><td>0.221±0.057</td></tr><tr><td>Computers</td><td>0.285±0.134</td><td>0.318±0.018</td><td>0.379±0.032</td><td>0.389±0.028</td><td>0.417±0.024</td></tr><tr><td>CS</td><td>0.631±0.019</td><td>0.743±0.010</td><td>0.797±0.025</td><td>0.834±0.046</td><td>0.866±0.021</td></tr><tr><td>Yelp</td><td>0.090±0.017</td><td>0.178±0.011</td><td>0.152±0.045</td><td>0.190±0.023</td><td>0.196±0.020</td></tr><tr><td>Average</td><td>0.265±0.044</td><td>0.327±0.011</td><td>0.365±0.030</td><td>0.405±0.037</td><td>0.425±0.031</td></tr></table>
|
| 14 |
+
|
| 15 |
+
# C.5 EFFECT OF INCLUDING NORMAL-ANOMALY RELATIONS
|
| 16 |
+
|
| 17 |
+
This section investigates the effect of including an additional type of normal relation that connects normal and anomaly nodes in the relation modelling of NSReg. We report the GAD performance for all test anomalies and the unseen anomalies in both AUC-ROC and AUC-PR in Table 13. We found that the inclusion of connected normal-anomaly relations is less effective than the default NSReg in terms of average performance, although it can achieve comparable performance on the CS and Yelp datasets. This is because the structural distinction between the normal and the seen anomalies is usually sufficiently preserved by the GAD loss. Additionally, it could introduce unnecessary complexity into the hierarchy of the relation modelling, resulting in less effective modelling of the normality that is not addressed by the GAD loss.
|
| 18 |
+
|
| 19 |
+
# C.6 DETAILED HYPERPARAMETER ANALYSIS
|
| 20 |
+
|
| 21 |
+
We report the GAD performance on all test anomalies in both AUC-ROC and AUC-PR with respect to $\lambda$ and $\alpha$ in Figure 7 and Figure 8, respectively. The results demonstrate stability across a wide spectrum, indicating the robustness of NSReg with respect to their settings.
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 7: Overall GAD performance of NSReg w.r.t α.
|
| 25 |
+
|
| 26 |
+
Table 11: Results on large-scale graph datasets for all test anomalies, where “-” denotes unavailable results due to out of memory.
|
| 27 |
+
|
| 28 |
+
<table><tr><td>Metric</td><td>Datasets</td><td>ogbn-arxiv</td><td>ogbn-proteins</td><td>T-Finance</td><td>avg.</td></tr><tr><td rowspan="10">AUC-ROC(All)</td><td>PReNet</td><td>0.581±0.006</td><td>0.613±0.035</td><td>0.892±0.017</td><td>0.695±0.019</td></tr><tr><td>DevNet</td><td>0.601±0.015</td><td>0.622±0.057</td><td>0.654±0.210</td><td>0.626±0.094</td></tr><tr><td>DCI</td><td>0.566±0.041</td><td>0.815±0.037</td><td>0.763±0.111</td><td>0.715±0.063</td></tr><tr><td>BWGNN</td><td>0.587±0.013</td><td>0.727±0.067</td><td>0.922±0.011</td><td>0.745±0.030</td></tr><tr><td>AMNet</td><td>0.600±0.049</td><td>0.711±0.077</td><td>0.889±0.024</td><td>0.733±0.050</td></tr><tr><td>GHRN</td><td>0.588±0.009</td><td>0.674±0.019</td><td>0.923±0.010</td><td>0.728±0.013</td></tr><tr><td>G.ENS</td><td>-</td><td>-</td><td>0.847±0.087</td><td>-</td></tr><tr><td>G.SMOTE</td><td>-</td><td>-</td><td>0.875±0.016</td><td>-</td></tr><tr><td>BCE</td><td>0.592±0.004</td><td>0.568±0.020</td><td>0.922±0.011</td><td>0.694±0.012</td></tr><tr><td>NSReg</td><td>0.659±0.012</td><td>0.843±0.029</td><td>0.929±0.007</td><td>0.810±0.016</td></tr><tr><td rowspan="10">AUC-PR(All)</td><td>PReNet</td><td>0.288±0.004</td><td>0.432±0.028</td><td>0.571±0.140</td><td>0.430±0.057</td></tr><tr><td>DevNet</td><td>0.304±0.009</td><td>0.436±0.017</td><td>0.323±0.327</td><td>0.354±0.118</td></tr><tr><td>DCI</td><td>0.275±0.033</td><td>0.597±0.062</td><td>0.264±0.240</td><td>0.379±0.112</td></tr><tr><td>BWGNN</td><td>0.263±0.009</td><td>0.582±0.026</td><td>0.746±0.023</td><td>0.530±0.019</td></tr><tr><td>AMNet</td><td>0.272±0.053</td><td>0.576±0.053</td><td>0.644±0.046</td><td>0.497±0.051</td></tr><tr><td>GHRN</td><td>0.271±0.007</td><td>0.564±0.005</td><td>0.727±0.031</td><td>0.521±0.014</td></tr><tr><td>G.ENS</td><td>-</td><td>-</td><td>0.332±0.076</td><td>-</td></tr><tr><td>G.SMOTE</td><td>-</td><td>-</td><td>0.573±0.077</td><td>-</td></tr><tr><td>BCE</td><td>0.310±0.003</td><td>0.524±0.008</td><td>0.726±0.034</td><td>0.520±0.015</td></tr><tr><td>NSReg</td><td>0.336±0.006</td><td>0.723±0.020</td><td>0.757±0.020</td><td>0.605±0.125</td></tr></table>
|
| 29 |
+
|
| 30 |
+
Table 12: Results on large-scale graph datasets for unseen anomalies, where “-” denotes unavailable results due to out of memory.
|
| 31 |
+
|
| 32 |
+
<table><tr><td>Metric</td><td>Datasets</td><td>ogbn-arxiv</td><td>ogbn-proteins</td><td>T-Finance</td><td>avg.</td></tr><tr><td rowspan="10">AUC-ROC(Unseen)</td><td>PReLUNet</td><td>0.465±0.008</td><td>00.250±0.058</td><td>00.881±0.029</td><td>0.532±0.032</td></tr><tr><td>DevNet</td><td>0.494±0.019</td><td>0.264±0.112</td><td>0.642±0.227</td><td>0.467±0.119</td></tr><tr><td>DCI</td><td>0.465±0.045</td><td>0.672±0.095</td><td>0.742±0.106</td><td>0.626±0.082</td></tr><tr><td>BWGNN</td><td>0.499±0.014</td><td>0.429±0.156</td><td>0.903±0.023</td><td>0.610±0.064</td></tr><tr><td>AMNet</td><td>0.519±0.053</td><td>0.339±0.263</td><td>0.872±0.045</td><td>0.577±0.120</td></tr><tr><td>GHRN</td><td>0.493±0.012</td><td>0.309±0.043</td><td>0.908±0.012</td><td>0.570±0.022</td></tr><tr><td>G.ENS</td><td>-</td><td>-</td><td>0.835±0.100</td><td>-</td></tr><tr><td>G.SMOTE</td><td>-</td><td>-</td><td>0.878±0.016</td><td>-</td></tr><tr><td>BCE</td><td>0.478±0.005</td><td>0.120±0.033</td><td>0.921±0.010</td><td>0.506±0.016</td></tr><tr><td>NSReg</td><td>0.570±0.016</td><td>0.748±0.047</td><td>0.928±0.006</td><td>0.749±0.023</td></tr><tr><td rowspan="10">AUC-PR(Unseen)</td><td>PReLUNet</td><td>0.124±0.002</td><td>0.029±0.004</td><td>0.431±0.147</td><td>0.195±0.051</td></tr><tr><td>DevNet</td><td>0.142±0.006</td><td>0.032±0.007</td><td>0.284±0.306</td><td>0.153±0.106</td></tr><tr><td>DCI</td><td>0.125±0.011</td><td>0.182±0.172</td><td>0.185±0.221</td><td>0.164±0.135</td></tr><tr><td>BWGNN</td><td>0.135±0.004</td><td>0.058±0.018</td><td>0.609±0.029</td><td>0.267±0.017</td></tr><tr><td>AMNet</td><td>0.141±0.024</td><td>0.048±0.030</td><td>0.461±0.067</td><td>0.217±0.040</td></tr><tr><td>GHRN</td><td>0.132±0.003</td><td>0.044±0.002</td><td>0.583±0.057</td><td>0.238±0.021</td></tr><tr><td>G.ENS</td><td>-</td><td>-</td><td>0.201±0.061</td><td>-</td></tr><tr><td>G.SMOTE</td><td>-</td><td>-</td><td>0.459±0.095</td><td>-</td></tr><tr><td>BCE</td><td>0.136±0.002</td><td>0.025±0.001</td><td>0.629±0.047</td><td>0.263±0.017</td></tr><tr><td>NSReg</td><td>0.165±0.005</td><td>0.488±0.042</td><td>0.669±0.024</td><td>0.441±0.024</td></tr></table>
|
| 33 |
+
|
| 34 |
+
# C.7 DETAILED DATA EFFICIENCY RESULTS
|
| 35 |
+
|
| 36 |
+
In this section, our primary focus is on showing the data efficiency performance of NSReg in terms of AUC-ROC, which complements the discussion of AUC-PR in Sec. 4.1. As illustrated in Figure 9 and Figure 10, NSReg consistently achieves remarkable performance similar to AUC-PR. Specifically, across the entire spectrum, NSReg outperforms the baselines on both overall and unseen anomaly detection for the Photo, Computers, and CS datasets. For the Yelp dataset, NSReg either outperforms or achieves comparable performance, particularly when the number of labelled training anomalies exceeds 5. While GraphSMOTE slightly outperforms NSReg in unseen anomaly detec-
|
| 37 |
+
|
| 38 |
+
Table 13: NSReg vs. NSReg considering connected normal-anomaly relation $( \mathrm { N S R e g + N A } )$ ).
|
| 39 |
+
|
| 40 |
+
<table><tr><td rowspan="2" colspan="2"></td><td colspan="2">AUC-ROC</td><td colspan="2">AUC-PR</td></tr><tr><td>NSReg + NA</td><td>NSReg</td><td>NSReg + NA</td><td>NSReg</td></tr><tr><td rowspan="5">all</td><td>Photo</td><td>0.860±0.017</td><td>0.908±0.016</td><td>0.561±0.019</td><td>0.640±0.036</td></tr><tr><td>computers</td><td>0.761±0.013</td><td>0.797±0.015</td><td>0.538±0.018</td><td>0.559±0.018</td></tr><tr><td>CS</td><td>0.965±0.005</td><td>0.957±0.007</td><td>0.904±0.014</td><td>0.889±0.016</td></tr><tr><td>Yelp</td><td>0.738±0.004</td><td>0.734±0.012</td><td>0.401±0.009</td><td>0.398±0.014</td></tr><tr><td>Average</td><td>0.831±0.010</td><td>0.849±0.013</td><td>0.601±0.015</td><td>0.622±0.021</td></tr><tr><td rowspan="5">unseen</td><td>Photo</td><td>0.747±0.032</td><td>0.836±0.031</td><td>0.107±0.018</td><td>0.221±0.057</td></tr><tr><td>Computers</td><td>0.708±0.015</td><td>0.752±0.019</td><td>0.392±0.025</td><td>0.417±0.024</td></tr><tr><td>CS</td><td>0.962±0.006</td><td>0.953±0.008</td><td>0.884±0.018</td><td>0.866±0.021</td></tr><tr><td>Yelp</td><td>0.689±0.009</td><td>0.690±0.025</td><td>0.193±0.010</td><td>0.196±0.020</td></tr><tr><td>Average</td><td>0.777±0.016</td><td>0.808±0.021</td><td>0.394±0.018</td><td>0.425±0.031</td></tr></table>
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Figure 8: Overall GAD performance of NSReg w.r.t λ.
|
| 44 |
+
|
| 45 |
+
tion, its effectiveness in the seen anomalies is limited, resulting in less effective overall detection performance.
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Test All
|
| 49 |
+
|
| 50 |
+

|
| 51 |
+
|
| 52 |
+

|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Test Unseen
|
| 60 |
+
|
| 61 |
+

|
| 62 |
+
|
| 63 |
+

|
| 64 |
+
|
| 65 |
+

|
| 66 |
+
Figure 9: Data efficiency of NSReg and the competing methods in utilising labelled data in AUC-ROC for both all test anomalies and the unseen anomalies.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Test All
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
|
| 77 |
+

|
| 78 |
+
Test Unseen
|
| 79 |
+
|
| 80 |
+

|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
|
| 84 |
+

|
| 85 |
+
|
| 86 |
+

|
| 87 |
+
Figure 10: Data efficiency of NSReg and the competing methods in utilising labelled data in AUC-PR for both all test anomalies and the unseen anomalies.
|
paper_markdowns/bamboo-03025.md
ADDED
|
@@ -0,0 +1,299 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# RANDLORA: FULL-RANK PARAMETER-EFFICIENT FINE-TUNING OF LARGE MODELS
|
| 2 |
+
|
| 3 |
+
Paul Albert Frederic Z. Zhang Hemanth Saratchandran Cristian Rodriguez-Opazo Anton van den Hengel Ehsan Abbasnejad
|
| 4 |
+
|
| 5 |
+
Australian Institute for Machine Learning The University of Adelaide {firstname.lastname}@adelaide.edu.au https://github.com/PaulAlbert31/RandLoRA
|
| 6 |
+
|
| 7 |
+
# ABSTRACT
|
| 8 |
+
|
| 9 |
+
Low-Rank Adaptation (LoRA) and its variants have shown impressive results in reducing the number of trainable parameters and memory requirements of large transformer networks while maintaining fine-tuning performance. The low-rank nature of the weight update inherently limits the representation power of finetuned models, however, thus potentially compromising performance on complex tasks. This raises a critical question: when a performance gap between LoRA and standard fine-tuning is observed, is it due to the reduced number of trainable parameters or the rank deficiency? This paper aims to answer this question by introducing RandLoRA, a parameter-efficient method that performs full-rank updates using a learned linear combinations of low-rank, non-trainable random matrices. Our method limits the number of trainable parameters by restricting optimization to diagonal scaling matrices applied to the fixed random matrices. This allows us to effectively overcome the low-rank limitations while maintaining parameter and memory efficiency during training. Through extensive experimentation across vision, language, and vision-language benchmarks, we systematically evaluate the limitations of LoRA and existing random basis methods. Our findings reveal that full-rank updates are beneficial across vision and language tasks individually, and even more so for vision-language tasks, where RandLoRA significantly reduces—and sometimes eliminates—the performance gap between standard fine-tuning and LoRA, demonstrating its efficacy.
|
| 10 |
+
|
| 11 |
+
# 1 INTRODUCTION
|
| 12 |
+
|
| 13 |
+
Large pre-trained models that leverage broad data have demonstrated significantly improved generalization capabilities and remarkable versatility across diverse tasks. However, the resultant high parameter count also leads to a significant increase in the computational resources required to finetune such models on downstream tasks. To tackle this issue, parameter-efficient fine-tuning (PEFT) approaches such as low-rank adaptation (LoRA) (Hu et al., 2022), draw inspiration from the low intrinsic dimensionality of pre-trained models (Li et al., 2018; Aghajanyan et al., 2021) and characterize the weight updates as the product of two low-rank matrices, substantially reducing the number of trainable parameters and memory requirements during training. This formulation leads to an adaptable number of trainable parameters, as one modifies the rank of the matrices, providing great flexibility under various resource constraints.
|
| 14 |
+
|
| 15 |
+
In spite of the strong performance of LoRAs in parameter-efficient settings, our investigation uncovers an accuracy plateau, wherein an increase of rank and thus learnable parameters fail to bridge the accuracy gap with standard fine-tuning. These undesirable scaling properties (Kopiczko et al., 2024) raise questions about the inherent limitations imposed by the low-rank structure, particularly when tackling complex tasks that benefit from larger parameter counts. This issue would ideally be addressed by introducing full-rank updates while maintaining the parameter-efficiency. To this end, we propose RandLoRA, a PEFT method that leverages a set of linearly-independent random bases in the form of non-trainable low-rank matrices. By solely learning scaling coefficients for the linear combination of the random low-rank bases, our method achieves full-rank updates, while maintain-
|
| 16 |
+
|
| 17 |
+

|
| 18 |
+
(a) DinoV2
|
| 19 |
+
|
| 20 |
+

|
| 21 |
+
(b) CLIP
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
(c) LLama3-8B
|
| 25 |
+
Figure 1: LoRA becomes limited by the rank of its update. We train DinoV2 and CLIP to classify 21 image datasets and LLama3-8B to solve 8 commonsense reasoning tasks.
|
| 26 |
+
|
| 27 |
+
ing low memory usage. As a result, RandLoRA strikes a balance between parameter efficiency and full-rank updates, allowing for more flexible and effective fine-tuning.
|
| 28 |
+
|
| 29 |
+
Through extensive experimentation, we empirically demonstrate the limitations of the low-rank formulation in LoRA, particularly on vision-language tasks, and show how RandLoRA can improve performance under similar parameter budget. Figure 1 summarizes our findings across pure vision (DinoV2), vision-language (CLIP) and commonsense reasoning (LLama3-8B), where increasing LoRA’s parameter count has highly diminishing returns. We find that RandLoRA outperforms LoRA as the parameter budget expands, while remaining parameter efficient thanks to its full-rank update strategy. We conclude our investigation with an insightful discussion on the distinctive characteristics of RandLoRA where our analysis reveals that, in contrast to LoRA, RandLoRA yields activation patterns in deeper layers that closely align with those obtained through full fine-tuning. Furthermore, our visualization of the loss landscape reveals that the local minima reached by Rand-LoRA is often closer to that reached by standard fine-tuning, and it always leads to a lower loss than LoRA for an equal parameter count. Additionally, we explore the integration of sparse random bases, where initial findings highlight that sparse bases preserves the performance of RandLoRA. This suggests promising avenues to further reduce memory and computational requirements when training large transformer models, without compromising model performance.
|
| 30 |
+
|
| 31 |
+
# Our contributions are summarized as:
|
| 32 |
+
|
| 33 |
+
1. We investigate the interplay between rank and number of trainable parameters when finetuning large pre-trained models, highlighting the limitations of LoRA in improving performance when larger ranks are required.
|
| 34 |
+
2. We propose RandLoRA, a novel parameter-efficient fine-tuning (PEFT) strategy based on random basis combinations, enabling full-rank updates without memory overhead over LoRA.
|
| 35 |
+
3. We rigorously assess RandLoRA across diverse pre-trained architectures and tasks, spanning pure vision and vision-language image classification to commonsense reasoning, demonstrating its versatility and effectiveness.
|
| 36 |
+
|
| 37 |
+
# 2 RELATED WORK
|
| 38 |
+
|
| 39 |
+
# 2.1 LOW RANK ADAPTATION OF LARGE MODELS
|
| 40 |
+
|
| 41 |
+
Low Rank Adaptation (LoRA) of large language models has revolutionized the fine-tuning paradigm, enabling memory-constrained adaptation to specialist tasks and democratizing access to larger models. Initially introduced by (Hu et al., 2022), LoRA leverages the observation that weight updates during fine-tuning can converge to suitable performances without necessitating full rank updates. By factorizing weight updates into the product of two low rank matrices, LoRA achieves a memory-efficient solution for adapting large models. Moreover, once the low rank matrices are
|
| 42 |
+
|
| 43 |
+
merged into the original weight matrix size, no latency is present during inference. Several improvements have been proposed to build upon LoRA’s success. Weight-decomposed LoRAs (DoRA) (Liu et al., 2024) proposes to improve convergence by decomposing LoRA updates into magnitude and direction components. AdaLoRA (Zhang et al., 2023) and AutoLoRA (Zhang et al., 2024c), utilize specialized metrics or meta-learning to propose rank-adapted LoRA formulations that dynamically adjust the rank to suit every layer’s need. Other improvements include initialization strategies for the low rank matrices using the truncated SVD of the pre-trained weights and where the whole decomposition is fine-tuned as in Pissa (Meng et al., 2024) or where only the singular value matrix is as in SVFT (Lingam et al., 2024) or LoRA-XS (Bałazy et al., 2024). Further improvements are proposed in HydraLoRA (Tian et al., 2024) where the scaling-up matrix of the low rank decomposition is split into multiple ones with a routing layer added to select the contribution of each head. This formulation enhances multi-task learning at the cost of losing the merging capabilities of LoRA in the pre-trained weight at test-time. These advancements collectively enhance the efficiency of LoRA, solidifying its position as a cornerstone of large language model fine-tuning.
|
| 44 |
+
|
| 45 |
+
# 2.2 PARAMETER-EFFICIENT FINE-TUNING (PEFT) USING RANDOM BASES
|
| 46 |
+
|
| 47 |
+
Recent research has focused on further reducing the trainable parameter count of LoRA, a crucial aspect for low-shot applications where minimizing trainable parameters can prevent overfitting and enhance generalization. A promising direction involves utilizing random bases combinations, where randomly generated matrices are combined using a limited number of trainable parameters to estimate a weight update.
|
| 48 |
+
|
| 49 |
+
PRANC (Nooralinejad et al., 2023) pioneered the random base strategy by learning a weighted averaged of random matrices through back-propagation. PRANC’s solution averages multiple full size weight matrices for each layer, leading to high memory consumption. To address this, the authors generate random bases on the fly during forward and backward passes using a fixed seed random number generator, reducing memory usage to that of the largest trained layer in the network at the cost of training latency.
|
| 50 |
+
|
| 51 |
+
Building upon PRANC, NOLA (Koohpayegani et al., 2024) introduces an improved algorithm where random bases are estimated as the product of two low-rank random matrices, each weighed using a learnable scalar and summed before matrix multiplication. This approach effectively approximates a rank 1 LoRA with significantly fewer trainable parameters and largely reduces memory consumption during training over PRANC.
|
| 52 |
+
|
| 53 |
+
Concurrently, VeRA (Kopiczko et al., 2024) proposed an alternative strategy utilizing a single highrank random matrix (typically 256 or 1024), instead of summing multiple rank 1 matrices as in NoLA. VeRA also employs a scaling strategy of random bases distinct from NoLA, detailed in section 4, which relates to our approach. Both NOLA and VeRA achieve comparable performance to LoRA in few-shot fine-tuning scenarios while training substantially fewer parameters.
|
| 54 |
+
|
| 55 |
+
# 2.3 ALTERNATIVE STRATEGIES FOR PARAMETER-EFFICIENT FINE-TUNING
|
| 56 |
+
|
| 57 |
+
We report here on alternatives to weight tuning for parameter-efficient adaptation, specifically focusing on prompt tuning. Context Optimization (CoOP) (Zhou et al., 2022b) introduced learnable context vectors for CLIP class names, later generalized to instance-specific prompts in Conditional CoOP (CoCoOP) (Zhou et al., 2022a). Recent prompt tuning methods, like DePT (Zhang et al., 2024b) and PromptSRC (Khattak et al., 2023b), emphasize knowledge preservation by isolating shared subspaces or regularizing prompts. While parameter-efficient, prompt tuning can struggle with generalization beyond few-shot settings (Han et al., 2024) and may be less effective than LoRA as data increases (Zanella & Ben Ayed, 2024). We therefore consider prompt tuning orthogonal to weight-tuning for the scope of this paper and exclude it from direct RandLoRA comparisons except for early results found in Appendix B.3.
|
| 58 |
+
|
| 59 |
+
# 3 MOTIVATIONS
|
| 60 |
+
|
| 61 |
+
Our literature review reveals that research on improving LoRA is focused on reducing the number of trainable parameters further, either through adaptable ranks or by using fixed or shared low rank
|
| 62 |
+
|
| 63 |
+
projection matrices. When looking at moderate to larger parameter budgets however LoRA remains highly competitive.
|
| 64 |
+
|
| 65 |
+
We identify that early research has convincingly demonstrated the promise of random basis combinations as a parameter-efficient strategy for large models, particularly in few-shot scenarios. Two approaches have emerged, each representing a distinct paradigm. VeRA advocates for a unique random base with large rank, while NoLA proposes to average a large number of random bases with small ranks. Both approaches report performance comparable to LoRA in few-shot scenarios while converging on a significantly reduced number of trainable parameters. However, as we will demonstrate, this reduction comes at the cost of limited performance when venturing beyond few-shot learning, limiting the scalability of these algorithms.
|
| 66 |
+
|
| 67 |
+
Finally, we report that LoRA is predicated on the assumption that low-rank updates suffice for finetuning large models. We aim in this paper to question the universality of this hypothesis, exploring scenarios where full rank alternatives may be necessary. The fundamental question follows: is parameter efficiency achieved through low-rank approximation limited by (1) the low-rank nature of the update or (2) by the low parameter count. Can parameter-efficient full rank updates provide a more accurate solution ? This paper aims to address these questions, exploring the balance between parameter efficiency and low-rank fine-tuning of large transformer models, and shedding light on the limitations of existing approaches.
|
| 68 |
+
|
| 69 |
+
# 4 RANDLORA—PARAMETER-EFFICIENT FINE-TUNING WITH FULL RANK
|
| 70 |
+
|
| 71 |
+
# 4.1 WEIGHT UPDATES AS A SUM OF LOW-RANK MATRICES
|
| 72 |
+
|
| 73 |
+
Let $W _ { 0 } ~ \in ~ \mathbb { R } ^ { D \times d }$ be a weight matrix of a large pre-trained model. Fine-tuning aims to find an appropriate $\Delta W \in \mathbb { R } ^ { D \times d }$ , such that the fine-tuned weights $W _ { 0 } + \Delta W$ lead to an adapted model, tailored to a specific downstream task. Without loss of generality, let us assume $d \ < \ D$ . The motivation behind RandLoRA stems from the singular value decomposition (SVD) of $\Delta W$ , i.e., $\Delta W = U \Sigma V ^ { \mathsf { T } }$ , where $U \in \mathbb { R } ^ { D \times d }$ , $\Sigma \in \mathbb { R } ^ { d \times d }$ , $V ^ { \mathbf { \breve { \mathbf { \Phi } } } } \in \mathbb { R } ^ { d \times d }$ . This decomposition can be written as the sum of the product of rank-one matrices, as follows
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\Delta W = \sum_ {i = 1} ^ {d} \mathbf {u} _ {i} \sigma_ {i} \mathbf {v} _ {i} ^ {\mathsf {T}}, \tag {1}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\mathbf { u } _ { i }$ and $\mathbf { v } _ { i }$ denote the columns of $U$ and $V$ , respectively. We suggest that in this context, lowrank updates such as LoRAs can be characterized as an approximation of the few largest singular values while the rest of the information in $\Delta W$ being discarded. To better illustrate this point, let us denote the rank of LoRA by $r$ and for brevity of exposition, assume $d$ is divisible by $r$ . We rewrite equation 1 as a sum of the product of rank- $r$ matrices, as follows
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\Delta W = \sum_ {j = 1} ^ {n} U _ {j} \Sigma_ {j} V _ {j} ^ {\mathrm {T}}, \tag {2}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where Uj Σj V Tj = Pr(j+1i=rj $\begin{array} { r } { U _ { j } \Sigma _ { j } V _ { j } ^ { \mathsf { T } } = \sum _ { i = r j } ^ { r ( j + 1 ) } { \bf u } _ { i } \sigma _ { i } { \bf v } _ { i } ^ { \mathsf { T } } } \end{array}$ and where $n = d / r$ . This formulation reveals how LoRA models the approximates the first low-rank partition $U _ { 1 } \Sigma _ { 1 } V _ { 1 } ^ { \mathsf { T } }$ , and implicitly assumes ${ \textstyle \sum _ { j = 2 } ^ { n } U _ { j } \Sigma _ { j } V _ { j } ^ { \mathsf { T } } \approx }$ 0. We however argue that the remaining $n - 1$ terms can play a crucial role when capturing more complex task-specific variations that require larger deviations from the pre-trained weight $W _ { 0 }$ .
|
| 86 |
+
|
| 87 |
+
# 4.2 PARAMETER-EFFICIENT APPROXIMATION OF LOW-RANK MATRICES
|
| 88 |
+
|
| 89 |
+
Approximating more terms in the decomposition of $\Delta W$ using LoRA’s formulation quickly becomes parameter inefficient, culminating to $D d + d ^ { 2 }$ parameters for a full rank $d$ in place of the original $D d$ parameters of $\Delta W$ . To perform full-rank updates while maintaining parameter-efficiency, we propose instead to approximate each term of $\Delta W$ in equation 2 using low-rank random bases where only scaling coefficients are learned,
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\Delta W = \sum_ {j = 1} ^ {n} B _ {j} \Lambda_ {j} A _ {j} \Gamma_ {j}, \tag {3}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $B _ { j } \in \mathbb { R } ^ { D \times { r } }$ and $A _ { j } \in \mathbb { R } ^ { r \times d }$ are non-trainable, random matrices. The two learnable diagonal scaling matrices, $\Lambda _ { j } \in \mathbb { R } ^ { r \times r }$ and $\Gamma _ { j } \in \mathbb { R } ^ { d \times d }$ are unique to each of the $n$ terms and fulfill complementary roles to improve the approximation. We aim for $A _ { j } \Gamma _ { j }$ transform the input features into an low-dimensional space (rank- $r$ ), $\Lambda _ { j }$ to scale the compressed features which are then transformed back into the desired output space by $B _ { j }$ .1 Since $\Gamma _ { j }$ operates on the column space of $A _ { j }$ and is unique to each $A _ { j }$ , we use a unique shared matrix $\bar { \boldsymbol { A } } \in \mathbb { R } ^ { r \times d }$ across all $n$ terms without loss of expressivity but reducing memory consumption. With a shared $A$ , we formulate the update as
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\Delta W = \sum_ {j = 1} ^ {n} B _ {j} \Lambda_ {j} A \Gamma_ {j}. \tag {4}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
To achieve a full-rank update, we set $n = d / r$ , leading to $\begin{array} { r } { \frac { d } { r } ( d + r ) = d ^ { 2 } / r + d } \end{array}$ learnable parameters. Note that unlike LoRA, the number of learnable parameters is inversely proportional to the rank of the random bases in RandLoRA, as increasing the rank of the bases leads to a reduction in trainable parameters while maintaining full rank. In summary, RandLoRA trades-off approximation accuracy for scope, sacrificing a more precise representation of the individual SVD elements of $\Delta W$ to capture a larger portion of its singular value decomposition.
|
| 102 |
+
|
| 103 |
+
# 4.3 CONVERGENCE ANALYSIS
|
| 104 |
+
|
| 105 |
+
In this section, we present a theorem showing that weight updates using RandLoRA is an accurate approximation of general matrices under certain theoretical conditions.
|
| 106 |
+
|
| 107 |
+
Theorem 4.1. Let W be a fixed $D \times d$ matrix, with $D > d$ and rank $( W ) = d .$ . Fi $\mathfrak { c } \mathrm { 1 } \leq n \leq d ,$ , such that $d = n r$ . The matrix $W$ can be factorized using SVD as
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
W = \sum_ {j} ^ {n} U _ {j} \Sigma_ {j} V _ {j} ^ {\mathsf {T}}, \tag {5}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
where $U _ { j } \in \mathbb { R } ^ { D \times { r } }$ , $V _ { j } \in \mathbb { R } ^ { r \times d }$ are partitions of the left and right singular vectors, and $\Sigma _ { j } \in \mathbb { R } ^ { r \times r }$ contains r singular values. For each $1 \leq j \leq n$ , let $B _ { j }$ denote a random $D \times r$ matrix whose entries are drawn i.i.d from either a Gaussian or uniform distribution, $A _ { j }$ denotes an $r \times d$ matrix whose entries are drawn similarly, $\Lambda _ { j }$ is a diagonal $r \times r$ matrix and $\Gamma _ { j }$ is a diagonal $d \times d$ matrix drawn similarly. Assume
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\left\| U _ {j} \Sigma_ {j} V _ {j} ^ {\mathsf {T}} - B _ {j} \Lambda_ {j} A _ {j} \Gamma_ {j} \right\| _ {F} \leq \epsilon \tag {6}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
for each $1 \leq j \leq n$ for some $0 < \epsilon$ . Then we have that with probability 1 that each $B _ { j } \Lambda _ { j } A _ { j } \Gamma _ { j }$ has full rank and
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
\left\| W - \sum_ {j = 1} ^ {n} B _ {j} \Lambda_ {j} A _ {j} \Gamma_ {j} \right\| _ {F} \leq n \cdot \epsilon . \tag {7}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
For details on the proof of theorem 4.1 please refer to appendix D.1.
|
| 126 |
+
|
| 127 |
+
Theorem 4.1 is premised on $B _ { j } \Lambda _ { j } A _ { j } \Gamma _ { j }$ being a good approximation for the $r$ -truncated singular value of $\Delta W$ , which is shown to be true empirically in VeRA (Kopiczko et al., 2024) for example. We show in this case that $\Delta W$ can be accurately approximated as $\textstyle \sum _ { j = 1 } ^ { n } B _ { j } \Lambda _ { j } A _ { j } \Gamma _ { j }$ , motivating RandLoRA’s formulation. In contrast, since the best approximation a rank- $\mathbfit { \nabla } \cdot \boldsymbol { r }$ LoRA can achieve is the $r$ -truncated SVD of $W$ , then by Eckart-Young-Mirsky theorem, the Frobenius norm of the difference between $W$ and low-rank adaptation $B A$ is lower bounded as follows
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\| W - B A \| _ {F} \geq \left\| W - \sum_ {i = 1} ^ {r} \mathbf {u} _ {i} \sigma_ {i} \mathbf {v} _ {i} ^ {\mathrm {T}} \right\| _ {F} = \sum_ {i = r + 1} ^ {d} \sigma_ {i} ^ {2}. \tag {8}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
We conclude that while LoRA’s rank $r$ approximation is limited by the sum of the last $d - r - 1$ squared singular values of $W$ , RandLoRA does not present this low bound and is only limited by how close (ϵ) can $B _ { j } \Lambda _ { j } A _ { j } \Gamma _ { j }$ approximate length-r segments of the SVD of $W$ .
|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
(a) ViT-B/32
|
| 137 |
+
|
| 138 |
+

|
| 139 |
+
(b) ViT-L/14
|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
(c) DinoV2
|
| 143 |
+
Figure 2: Tuning CLIP and DinoV2 vision encoders for image classification. Accuracy averaged over 21 datasets. We additionally report max GPU VRAM usage during training.
|
| 144 |
+
|
| 145 |
+
# 5 EXPERIMENTS
|
| 146 |
+
|
| 147 |
+
# 5.1 EXPERIMENTAL SETTINGS
|
| 148 |
+
|
| 149 |
+
We conduct a comprehensive comparison with three state-of-the-art approaches: LoRA (Hu et al., 2022), NoLA (Koohpayegani et al., 2024), and VeRA (Kopiczko et al., 2024). We perform a hyperparameter search to identify optimal settings for LoRA, NoLA, VeRA, and RandLoRA to ensure a fair comparison. More details about the experimental settings can be found in appendix C. Additional experiments on the General Language Understanding Evaluation (GLUE) (Wang et al., 2019) and End-to-end (E2E) Novikova et al. (2017) natural language generation benchmarks as well as further comparison with prompt-tuning algorithms are available in appendix B.
|
| 150 |
+
|
| 151 |
+
# 5.2 VISION: DINOV2 AND CLIP’S VISION BACKBONE
|
| 152 |
+
|
| 153 |
+
We evaluate fine-tuning vision backbones for image classification using pre-trained ViT-B/14 DinoV2 (Oquab et al., 2023) and ViT-B/32, ViT-L/14 CLIP (Radford et al., 2021) vision only backbones. We fine-tune on 21 datasets (Appendix C.1, Table 7) and evaluate $\{ 1 , 2 , 4 , 1 6 \}$ -shot learning and performance with $50 \%$ and $100 \%$ training data.
|
| 154 |
+
|
| 155 |
+
We compare RandLoRA to LoRA rank 32 where RandLoRA’s rank is adjusted to match LoRA’s parameters, and include VeRA and NoLA as random base alternatives. We fine-tune the vision backbones and learn linear classifiers for DinoV2, or use frozen CLIP language embeddings for classification. Results are displayed in Figure 2 where we also report VRAM usage, detailed results are available in Appendix E.2.
|
| 156 |
+
|
| 157 |
+
We find that LoRA exhibits a smaller accuracy gap with standard fine-tuning (FT) on DinoV2 than CLIP. With equal parameters, RandLoRA improves over LoRA, bridging the FT gap in both cases. We believe that LoRA’s success on the DinoV2 backbone is partly explained by its training objective (see Section 6.1). RandLoRA demonstrates LoRA’s rank limitation for CLIP architectures and the benefit of full-rank updates in matching FT performance. VeRA and NoLA are efficient in few-shot settings but become limited with more data.
|
| 158 |
+
|
| 159 |
+
# 5.3 VISION-LANGUAGE: CLIP
|
| 160 |
+
|
| 161 |
+
We extend in this section our experimental setting to fine-tuning CLIP-like transformer architectures on classification datasets where contrary to section 5.2 both the language and vision encoders of CLIP are trained. We add ImageNet (Krizhevsky et al., 2012) to the dataset pool to scale up to 22 classification datasets. To assess the effectiveness of RandLoRA compared to LoRA on models of varying sizes, we consider three variants of pre-trained CLIPs from the open-clip repository (Cherti et al., 2023): ViT-B/32 (151M parameters), ViT-L/14 (428M parameters) and ViT-H/14 (1B pa-
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
(a) ViT-B/32
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
(b) ViT-L/14
|
| 168 |
+
|
| 169 |
+

|
| 170 |
+
(c) ViT-H/14
|
| 171 |
+
Figure 3: Tuning CLIP’s vision and language encoders for image classification. Accuracy averaged over 22 datasets. We additionally report max GPU VRAM usage during training.
|
| 172 |
+
|
| 173 |
+
rameters). We scale the rank of the random bases in RandLoRA in the same way as section 5.2 to maintain a number of parameters comparable to a rank 32 LoRA: RandLoRA-{6,8,10} for ViT-$\{ { \mathrm { B } } / { 3 2 } , \mathrm { L } / { 1 4 } , \mathrm { H } / { 1 4 } \}$ respectively.
|
| 174 |
+
|
| 175 |
+
A summary of results is available in Figure 3 with detailed results being available in appendix E.1. Because fine-tuning vision-language architectures such as CLIP is a harder optimization problem, we observe the existence of a larger performance gap between full fine-tuning and LoRA than for pure vision, which we confirm is not bridged by increasing the rank of LoRA (see Figure 1). This suggests that increasing parameter count is not enough, pointing towards the rank of the update as the possible limit to the performance of LoRA. When running RandLoRA with the same amount of trainable parameters, we observe that the gap with fine-tuning is bridged. When compared with NoLA and VeRA we come to the same conclusions as section 5.2 although VeRA is this time much more competitive for larger data budgets, hinting towards the importance of high ranks for finetuning CLIP-like vision language architectures. We also report that our base sharing strategy allows RandLoRA to decrease VRAM usage over LoRA which can be relevant for large architectures such as ViT-H/14.
|
| 176 |
+
|
| 177 |
+
# 5.4 COMMONSENSE REASONING
|
| 178 |
+
|
| 179 |
+
We evaluate RandLoRA for fine-tuning LLMs on eight commonsense reasoning tasks (see Appendix C.4). We fine-tune Qwen2 (0.5B), Phi3 (3B), and Llama3 (8B) models and assess data efficiency by training on both a 170,000-sample full dataset and a 15,000-sample subset, following Hu et al. (2023).
|
| 180 |
+
|
| 181 |
+
Table 1 compares RandLoRA to LoRA, VeRA, and NoLA. We test two LoRA ranks: rank-16 (”Efficient”) and rank-32 (”Performant”). We then scale RandLoRA the same or lower amount of parameters to ensure a fair comparison. Detailed results are found in Appendix 15
|
| 182 |
+
|
| 183 |
+
RandLoRA performs competitively with, and sometimes surpasses, LoRA. Phi3’s strong zero-shot abilities enable VeRA and NoLA to achieve strong results despite fewer parameters. Conversely, Qwen2 and Llama3 require more adaptation, challenging VeRA and NoLA to match LoRA’s performance. The 15k-sample regime can lead to overfitting when scaling trainable parameters for LoRA and RandLoRA, decreasing performance even with dropout regularization. When training on the full 170k samples, RandLoRA consistently outperforms LoRA. Results comparing with DoRA (Liu et al., 2024) for LLama3 only are available in Table 6 in the appendix where RandLoRA outperforms both DoRA and LoRA for larger parameter budgets, while DoRA and LoRA are competitive at ”Efficient” budgets. We conclude RandLoRA is a compelling alternative to LoRA and DoRA for LLM fine-tuning, especially with larger datasets and parameter budgets.
|
| 184 |
+
|
| 185 |
+
Table 1: Parameter-efficient fine-tuning of Large Language Models (LLMs). Results averaged over 8 commonsense reasoning tasks. We bold the best accuracy between parameter-equivalent RandLoRA and LoRA configurations.
|
| 186 |
+
|
| 187 |
+
<table><tr><td rowspan="2">Network</td><td rowspan="2">Size</td><td rowspan="2">ZeroShot</td><td rowspan="2">NoLA</td><td rowspan="2">VeRA</td><td colspan="2">LoRA</td><td colspan="2">RandLoRA</td></tr><tr><td>Efficient</td><td>Performant</td><td>Efficient</td><td>Performant</td></tr><tr><td rowspan="2">Qwen2-0.5b</td><td>15k</td><td>5.2</td><td>42.6</td><td>48.1</td><td>53.2</td><td>52.3</td><td>53.5</td><td>52.9</td></tr><tr><td>170k</td><td>5.2</td><td>47.4</td><td>51.8</td><td>57.4</td><td>57.3</td><td>57.7</td><td>57.9</td></tr><tr><td rowspan="2">Phi3-3b</td><td>15k</td><td>65.4</td><td>80.4</td><td>78.6</td><td>81.8</td><td>80.3</td><td>81.7</td><td>82.3</td></tr><tr><td>170k</td><td>65.4</td><td>82.3</td><td>81.4</td><td>84.6</td><td>85.0</td><td>84.7</td><td>85.2</td></tr><tr><td rowspan="2">LLama3-8b</td><td>15k</td><td>27.0</td><td>76.9</td><td>77.1</td><td>82.7</td><td>83.1</td><td>81.0</td><td>81.3</td></tr><tr><td>170k</td><td>27.0</td><td>81.2</td><td>81.7</td><td>84.4</td><td>85.2</td><td>84.6</td><td>85.6</td></tr></table>
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Figure 4: How close do RandLoRA and LoRA get to standard fine-tuning ? We compare CKA scores of RandLoRA and LoRA with fine-tuned activations (top) and the mode connectivity in the loss landscape of UCF101 (bottom)
|
| 191 |
+
(a) CKA with fine-tuning CLIP
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
(c) CKA with fine-tuning DinoV2
|
| 195 |
+
|
| 196 |
+

|
| 197 |
+
(b) Loss landscape CLIP
|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
(d) Loss landscape DinoV2
|
| 201 |
+
|
| 202 |
+
# 6 DISCUSSION
|
| 203 |
+
|
| 204 |
+
# 6.1 SIMILARITIES WITH FINE-TUNING: ACTIVATIONS
|
| 205 |
+
|
| 206 |
+
We evaluate activation similarity to assess LoRA and RandLoRA’s ability to mimic fine-tuned model activations. Using the Centered Kernel Alignment (CKA) (Kornblith et al., 2019) metric, we measure the similarity between activations of LoRA, RandLoRA, and a fully fine-tuned model. This protocol assesses how well each method captures dataset-specific activation patterns. Figure 4a shows CKA scores for self-attention and MLP layers in CLIP and DinoV2 vision backbones, averaged over 5 datasets where RandLoRA imrpoves over LoRA. For CLIP, LoRA’s CKA decreases in deeper layers, losing alignment with fine-tuned activations. RandLoRA, with equal parameters, matches LoRA’s early layer alignment but improves upon it in deeper layers. This CKA drop for LoRA in deeper layers is absent in DinoV2, explaining LoRA’s near-identical accuracy to finetuning on DinoV2. This difference likely arises from training objectives: DinoV2’s visual objective creates classification-ready features needing minimal weight adjustments, thus low-rank LoRA suf-
|
| 207 |
+
|
| 208 |
+
Table 2: Ablation on the rank of the updates. The same amount of trainable parameters is used in all methods.
|
| 209 |
+
|
| 210 |
+
<table><tr><td>Method</td><td>Rank</td><td>Accuracy</td></tr><tr><td>LoRA</td><td>32</td><td>83.74</td></tr><tr><td>RandLoRA-a</td><td>32</td><td>83.62</td></tr><tr><td>RandLoRA-b</td><td>384</td><td>85.32</td></tr><tr><td>RandLoRA-6</td><td>768</td><td>85.98</td></tr></table>
|
| 211 |
+
|
| 212 |
+
Table 3: Fine-tuning CLIP or LLama3 using Rand-LoRA different random distributions or base sparsity.
|
| 213 |
+
|
| 214 |
+
<table><tr><td>Model</td><td>Sparsity</td><td>Accuracy</td></tr><tr><td>CLIP-ViT-B/32 - uniform</td><td>0%</td><td>85.98</td></tr><tr><td>CLIP-ViT-B/32 - normal</td><td>0%</td><td>85.61</td></tr><tr><td>CLIP-ViT-B/32 - binary</td><td>0%</td><td>85.52</td></tr><tr><td>CLIP-ViT-B/32</td><td>66%</td><td>85.43</td></tr><tr><td>CLIP-ViT-B/32</td><td>93%</td><td>85.57</td></tr><tr><td>CLIP-ViT-B/32</td><td>98%</td><td>84.35</td></tr><tr><td>CLIP-ViT-B/32</td><td>99%</td><td>83.34</td></tr><tr><td>LLama3-8b</td><td>0%</td><td>85.59</td></tr><tr><td>LLama3-8b</td><td>66%</td><td>85.42</td></tr></table>
|
| 215 |
+
|
| 216 |
+
fices. CLIP’s multimodal objective, however, demands higher ranks for effective adaptation to vision tasks.
|
| 217 |
+
|
| 218 |
+
# 6.2 SIMILARITIES WITH FINE-TUNING: LOSS LANDSCAPE
|
| 219 |
+
|
| 220 |
+
We analyze loss landscape connectivity for models fine-tuned with standard fine-tuning, LoRA, and RandLoRA. We visualize a 2D loss landscape plane by positioning LoRA, RandLoRA, and fine-tuning models at (0,0), (1,0), and (0.5,1) respectively. For each point $( x , y )$ on this plane, we interpolate model weights bythe interpolated model’s loss on a ing for coefficients training subset. Fig $\alpha _ { i }$ (where 4b sho $\textstyle \sum _ { i = 1 } ^ { 3 } \alpha _ { i } \ = \ 1 )$ and evaluateP, RandLoRA $5 \%$ reaches a deeper loss minima than LoRA, often with a low-loss path to the fine-tuning optimum, and despite training the same parameter count. For DinoV2, all optima reside in a shared low-loss basin, with LoRA already close to fine-tuning, reflecting LoRA’s strong performance on this task. These visualizations reinforce LoRA’s low rank it particularly limiting for complex tasks, and demonstrate RandLoRA’s ability to achieve deeper minima than LoRA with equal parameters due to full-rank updates. Appendix A provides 3D visualizations for additional datasets.
|
| 221 |
+
|
| 222 |
+
# 6.3 FURTHER STUDIES ON FULL VS LOW RANK FINE-TUNING OF CLIP
|
| 223 |
+
|
| 224 |
+
We investigate whether RandLoRA’s CLIP performance advantage over LoRA stems from better SVD approximation or its full-rank capability. We ablate RandLoRA with two rank-controlled variants. RandLoRA-a restricts the update rank to $r$ by averaging bases before multiplication: $\begin{array} { r } { \Delta W \ = \ \left( \sum _ { i = 1 } ^ { N } B _ { i } \Lambda _ { i } \right) \left( \sum _ { i = 1 } ^ { N } A _ { i } \Gamma _ { i } \right) ^ { } } \end{array}$ PN . RandLoRA-b uses half-rank updates by setting $N =$ $\mathrm { r a n k } ( \Delta W ) { \ ' } r / 2$ and adjusting base rank to maintain parameter count parity with RandLoRA- $r$ . All variants train the same parameters, only update rank varies. Table 2 presents accuracy on $100 \%$ of 22 datasets for CLIP ViT-B/32. Results show that higher update rank correlates with better performance, given equal parameter counts. This supports the importance of large rank updates, particularly for CLIP fine-tuning.
|
| 225 |
+
|
| 226 |
+
# 6.4 SPARSE RANDOM MATRICES
|
| 227 |
+
|
| 228 |
+
We propose to investigate using sparse random matrices for improved memory and computational efficiency, drawing inspiration from random projection literature and the Johnson-Lindenstrauss lemma (Lindenstrauss & Johnson, 1984). We adopt the sparse construction from Bingham & Mannila (2001) and Li et al. (2006), where matrix elements are √ $\{ - 1 , 0 , 1 \}$ with probabilities $\textstyle { \left\{ { \frac { 1 } { s } } , 1 - { \frac { 2 } { s } } , { \frac { 1 } { s } } \right\} }$ $( s \in [ 2 , \sqrt { D } ]$ for $W \in \mathbb { R } ^ { D \times d } ,$ ), followed by normalization. Appendix C.6 discusses why this formulation preserves full rank. Table 3 shows experimental results using these sparse bases in RandLoRA.√ We explore sparsity ratios $s \in \{ 2 , 6 , \sqrt { D } , 1 0 0 , 2 0 0 \}$ , achieving sparsity levels from 66 to √ $9 9 \%$ . Consistent with Li et al. (2006), the recommended sparsity levels $( \sqrt { D } )$ yield performance comparable to dense matrices, theoretically reducing memory and compute. However, higher sparsity can de-
|
| 229 |
+
|
| 230 |
+
grade accuracy, suggesting potential for optimized RandLoRA variants using compute-optimized sparse random bases.
|
| 231 |
+
|
| 232 |
+
# 6.5 SUMMARY OF DIFFERENCES WITH RELATED RANDOM BASES ALGORITHMS
|
| 233 |
+
|
| 234 |
+
Prior work like VeRA (Kopiczko et al., 2024) and NoLA (Koohpayegani et al., 2024) utilizes random bases for parameter-efficient fine-tuning. However, unlike VeRA and NoLA which approximate a low-rank LoRA update, RandLoRA aims to approximate the full-rank weight update. It could be argued that VeRA approximates only the first block in a decomposition of $W$ , whereas RandLoRA approximates all blocks. Thus, while VeRA and NoLA improve parameter-efficiency while maintaining low-rank updates, RandLoRA addresses cases requiring full-rank updates. Furthermore, Equation equation 4 evidences the flexibility in RandLoRA’s parameter count, ranging from VeRA’s parameter efficiency $( r = { \mathrm { r a n k } } ( W ) )$ to full fine-tuning parameters $( r = 1 )$ ) while maintaining fullrank.
|
| 235 |
+
|
| 236 |
+
# 6.6 LIMITATIONS
|
| 237 |
+
|
| 238 |
+
Despite RandLoRA’s effectiveness, we identify three key limitations for future research.
|
| 239 |
+
|
| 240 |
+
First, RandLoRA introduces computational overhead in weight update calculations, increasing training time for larger models (Appendix C.6.1). We however evidence room for improvement using ternary sparse bases in Section 6.4. Future work should explore matmul-free matrix combinations using these ternary sparse bases. Efficient implementations could replace costly matrix products with simple aggregations, eliminating floating-point arithmetic (Li et al., 2006), and accelerating RandLoRA training time pending the development of optimized CUDA kernels (Zhu et al., 2024).
|
| 241 |
+
|
| 242 |
+
Second, exploring non-random, optimal bases $B _ { i }$ and $A$ could improve convergence and efficiency by further reducing $\epsilon$ in equation equation 6. Discovering such bases, potentially through experiments or decomposition of pre-trained weights (Bałazy et al., 2024; Meng et al., 2024), is a promising research direction to enhance RandLoRA.
|
| 243 |
+
|
| 244 |
+
Third, hybrid approaches combining LoRA and RandLoRA warrant investigation. LoRA could estimate the dominant SVD components of W , while RandLoRA captures the remaining spectral information efficiently. Despite challenges in harmonizing training objectives, a starting point would use RandLoRA to refine a LoRA when convergence is insufficient. Addressing these limitations will further improve RandLoRA’s potential for efficient full-rank fine-tuning.
|
| 245 |
+
|
| 246 |
+
# 7 CONCLUSION
|
| 247 |
+
|
| 248 |
+
This paper introduces RandLoRA, a method achieving parameter efficiency and low memory cost while enabling full rank model updates. Our findings underscore the critical importance of fullrank updates when fine-tuning pre-trained architectures and we observe that our approach surpasses LoRA’s performance for an equal parameter count, highlighting the value of full-rank updates in large model fine-tuning. Through extensive experiments across diverse tasks we demonstrated the efficacy of our method. While RandLoRA incurs additional computational overhead due to random basis multiplications, memory consumption remains contained and we provide venues for reducing this compute in practice. As a results, RandLoRA offers a viable alternative to LoRA for fine-tuning large pre-trained models on consumer-grade hardware. Our results have significant implications for efficient and effective model adaptation, prompting for future research in scalable and versatile full-rank fine-tuning techniques.
|
| 249 |
+
|
| 250 |
+
# ACKNOWLEDGMENTS
|
| 251 |
+
|
| 252 |
+
This research is funded in part by the Australian Government through the Australian Research Council (Project DP240103278), and the Centre of Augmented Reasoning at the Australian Institute for Machine Learning, established by a grant from the Department of Education. This work is also supported by supercomputing resources provided by the Phoenix HPC service at the University of Adelaide.
|
| 253 |
+
|
| 254 |
+
# REFERENCES
|
| 255 |
+
|
| 256 |
+
Armen Aghajanyan, Sonal Gupta, and Luke Zettlemoyer. Intrinsic dimensionality explains the effectiveness of language model fine-tuning. In Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing, pp. 7319–7328. Association for Computational Linguistics, Aug 2021. URL https://aclanthology.org/2021.acl-long.568.
|
| 257 |
+
Klaudia Bałazy, Mohammadreza Banaei, Karl Aberer, and Jacek Tabor. Lora-xs: Low-rank adaptation with extremely small number of parameters. arXiv preprint arXiv:2405.17604, 2024.
|
| 258 |
+
Ella Bingham and Heikki Mannila. Random projection in dimensionality reduction: applications to image and text data. In International Conference on Knowledge Discovery and Data mining (ACM SIGKDD), 2001.
|
| 259 |
+
Yonatan Bisk, Rowan Zellers, Jianfeng Gao, Yejin Choi, et al. Piqa: Reasoning about physical commonsense in natural language. In Proceedings of the AAAI conference on Artificial Intelligence (AAAI), 2020.
|
| 260 |
+
Mehdi Cherti, Romain Beaumont, Ross Wightman, Mitchell Wortsman, Gabriel Ilharco, Cade Gordon, Christoph Schuhmann, Ludwig Schmidt, and Jenia Jitsev. Reproducible scaling laws for contrastive language-image learning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023.
|
| 261 |
+
Christopher Clark, Kenton Lee, Ming-Wei Chang, Tom Kwiatkowski, Michael Collins, and Kristina Toutanova. BoolQ: Exploring the surprising difficulty of natural yes/no questions. arXiv preprint arXiv:1905.10044, 2019.
|
| 262 |
+
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge. arXiv preprint arXiv:1803.05457, 2018.
|
| 263 |
+
Zeyu Han, Chao Gao, Jinyang Liu, Jeff Zhang, and Sai Qian Zhang. Parameter-efficient fine-tuning for large models: A comprehensive survey. arXiv preprint arXiv:2403.14608, 2024.
|
| 264 |
+
Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. LoRA: Low-Rank Adaptation of Large Language Models. In International Conference on Learning Representations (ICLR), 2022.
|
| 265 |
+
Zhiqiang Hu, Lei Wang, Yihuai Lan, Wanyu Xu, Ee-Peng Lim, Lidong Bing, Xing Xu, Soujanya Poria, and Roy Ka-Wei Lee. Llm-adapters: An adapter family for parameter-efficient fine-tuning of large language models. arXiv preprint arXiv:2304.01933, 2023.
|
| 266 |
+
Muhammad Uzair Khattak, Hanoona Rasheed, Muhammad Maaz, Salman Khan, and Fahad Shahbaz Khan. Maple: Multi-modal prompt learning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2023a.
|
| 267 |
+
Muhammad Uzair Khattak, Syed Talal Wasim, Muzammal Naseer, Salman Khan, Ming-Hsuan Yang, and Fahad Shahbaz Khan. Self-regulating prompts: Foundational model adaptation without forgetting. In IEEE/CVF International Conference on Computer Vision (ICCV), 2023b.
|
| 268 |
+
Soroush Abbasi Koohpayegani, KL Navaneet, Parsa Nooralinejad, Soheil Kolouri, and Hamed Pirsiavash. NOLA: Compressing LoRA using Linear Combination of Random Basis. In International Conference on Learning Representations (ICLR), 2024.
|
| 269 |
+
Dawid Jan Kopiczko, Tijmen Blankevoort, and Yuki Markus Asano. Vera: Vector-based random matrix adaptation. In International Conference on Learning Representations (ICLR), 2024.
|
| 270 |
+
Simon Kornblith, Mohammad Norouzi, Honglak Lee, and Geoffrey Hinton. Similarity of neural network representations revisited. In International Conference on Machine Learning (ICML), 2019.
|
| 271 |
+
A. Krizhevsky, I. Sutskever, and G. Hinton. Imagenet classification with deep convolutional neural networks. In Advances in neural information processing systems (NeurIPS), 2012.
|
| 272 |
+
|
| 273 |
+
Chunyuan Li, Heerad Farkhoor, Rosanne Liu, and Jason Yosinski. Measuring the instrinsic dimension of objective landscapes. In ICLR, Vancouver, Canada, 30 Apr–3 May 2018. URL https://openreview.net/pdf?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ ryup8-WCW.
|
| 274 |
+
Ping Li, Trevor J Hastie, and Kenneth W Church. Very sparse random projections. In ACM SIGKDD international conference on Knowledge discovery and data mining, 2006.
|
| 275 |
+
W Johnson J Lindenstrauss and J Johnson. Extensions of lipschitz maps into a hilbert space. Contemp. Math, 1984.
|
| 276 |
+
Vijay Lingam, Atula Tejaswi, Aditya Vavre, Aneesh Shetty, Gautham Krishna Gudur, Joydeep Ghosh, Alex Dimakis, Eunsol Choi, Aleksandar Bojchevski, and Sujay Sanghavi. SVFT: Parameter-Efficient Fine-Tuning with Singular Vectors. In International Conference on Machine Learning Workshops (ICMLW), 2024.
|
| 277 |
+
Shih-Yang Liu, Chien-Yi Wang, Hongxu Yin, Pavlo Molchanov, Yu-Chiang Frank Wang, Kwang-Ting Cheng, and Min-Hung Chen. Dora: Weight-decomposed low-rank adaptation. In International Conference on Machine Learning (ICML), 2024.
|
| 278 |
+
Y Liu, M Ott, N Goyal, J Du, M Joshi, D Chen, O Levy, M Lewis, L Zettlemoyer, and V Stoyanov. RoBERTa: A robustly optimized BERT pretraining approach. arXiv:1907.11692, 2019.
|
| 279 |
+
Fanxu Meng, Zhaohui Wang, and Muhan Zhang. Pissa: Principal singular values and singular vectors adaptation of large language models. Advances in Neural Information Processing Systems (NeurIPS), 2024.
|
| 280 |
+
Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering. arXiv preprint arXiv:1809.02789, 2018.
|
| 281 |
+
Parsa Nooralinejad, Ali Abbasi, Soroush Abbasi Koohpayegani, Kossar Pourahmadi Meibodi, Rana Muhammad Shahroz Khan, Soheil Kolouri, and Hamed Pirsiavash. Pranc: Pseudo random networks for compacting deep models. In IEEE/CVF International Conference on Computer Vision (ICCV), 2023.
|
| 282 |
+
Jekaterina Novikova, Ondˇrej Dusek, and Verena Rieser. The E2E dataset: New challenges for ˇ end-to-end generation. In Proceedings of the 18th Annual SIGdial Meeting on Discourse and Dialogue, 2017.
|
| 283 |
+
Maxime Oquab, Timothee Darcet, Theo Moutakanni, Huy V. Vo, Marc Szafraniec, Vasil Khalidov, ´ Pierre Fernandez, Daniel Haziza, Francisco Massa, Alaaeldin El-Nouby, Russell Howes, Po-Yao Huang, Hu Xu, Vasu Sharma, Shang-Wen Li, Wojciech Galuba, Mike Rabbat, Mido Assran, Nicolas Ballas, Gabriel Synnaeve, Ishan Misra, Herve Jegou, Julien Mairal, Patrick Labatut, Armand Joulin, and Piotr Bojanowski. DINOv2: Learning Robust Visual Features without Supervision, 2023.
|
| 284 |
+
Alec Radford, Jeffrey Wu, Rewon Child, David Luan, Dario Amodei, Ilya Sutskever, et al. Language models are unsupervised multitask learners. OpenAI blog, 2019.
|
| 285 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International Conference on Machine Learning (ICML), 2021.
|
| 286 |
+
Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adversarial winograd schema challenge at scale. Communications of the ACM, 2021.
|
| 287 |
+
Maarten Sap, Hannah Rashkin, Derek Chen, Ronan LeBras, and Yejin Choi. Socialiqa: Commonsense reasoning about social interactions. arXiv preprint arXiv:1904.09728, 2019.
|
| 288 |
+
Chunlin Tian, Zhan Shi, Zhijiang Guo, Li Li, and Chengzhong Xu. HydraLoRA: An Asymmetric LoRA Architecture for Efficient Fine-Tuning. In Advances in Neural Information Processing Systems (NeurIPS), 2024.
|
| 289 |
+
|
| 290 |
+
Alex Wang, Amanpreet Singh, Julian Michael, Felix Hill, Omer Levy, and Samuel R. Bowman. GLUE: multi-task benchmark and analysis platform for natural language understanding. In International Conference on Learning Representations (ICLR), 2019.
|
| 291 |
+
Maxime Zanella and Ismail Ben Ayed. Low-Rank Few-Shot Adaptation of Vision-Language Models. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024.
|
| 292 |
+
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? arXiv preprint arXiv:1905.07830, 2019.
|
| 293 |
+
Frederic Z Zhang, Paul Albert, Cristian Rodriguez-Opazo, Anton van den Hengel, and Ehsan Abbasnejad. Knowledge Composition using Task Vectors with Learned Anisotropic Scaling. In Advances in Neural Information Processing Systems (NeurIPS), 2024a.
|
| 294 |
+
Ji Zhang, Shihan Wu, Lianli Gao, Heng Tao Shen, and Jingkuan Song. Dept: Decoupled prompt tuning. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2024b.
|
| 295 |
+
Qingru Zhang, Minshuo Chen, Alexander Bukharin, Nikos Karampatziakis, Pengcheng He, Yu Cheng, Weizhu Chen, and Tuo Zhao. AdaLoRA: Adaptive budget allocation for parameterefficient fine-tuning. In International Conference on Learning Representations (ICLR), 2023.
|
| 296 |
+
Ruiyi Zhang, Rushi Qiang, Sai Ashish Somayajula, and Pengtao Xie. AutoLoRA: Automatically Tuning Matrix Ranks in Low-Rank Adaptation Based on Meta Learning. arXiv preprint arXiv:2403.09113, 2024c.
|
| 297 |
+
Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Conditional prompt learning for vision-language models. In IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 2022a.
|
| 298 |
+
Kaiyang Zhou, Jingkang Yang, Chen Change Loy, and Ziwei Liu. Learning to prompt for visionlanguage models. International Journal of Computer Vision, 2022b.
|
| 299 |
+
Rui-Jie Zhu, Yu Zhang, Ethan Sifferman, Tyler Sheaves, Yiqiao Wang, Dustin Richmond, Peng Zhou, and Jason K Eshraghian. Scalable MatMul-free Language Modeling. arXiv preprint arXiv:2406.02528, 2024.
|
paper_markdowns/bamboo-03061.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-03245.md
ADDED
|
@@ -0,0 +1,402 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TEXTAILOR: CUSTOMIZED TEXT-ALIGNED TEXTUR-ING VIA EFFECTIVE RESAMPLING
|
| 2 |
+
|
| 3 |
+
Suin Lee, Dae-Shik Kim
|
| 4 |
+
|
| 5 |
+
KAIST
|
| 6 |
+
|
| 7 |
+
Daejeon, South Korea
|
| 8 |
+
|
| 9 |
+
{suinlee, daeshik}@kaist.ac.kr
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
We present TexTailor, a novel method for generating consistent object textures from textual descriptions. Existing text-to-texture synthesis approaches utilize depth-aware diffusion models to progressively generate images and synthesize textures across predefined multiple viewpoints. However, these approaches lead to a gradual shift in texture properties across viewpoints due to (1) insufficient integration of previously synthesized textures at each viewpoint during the diffusion process and (2) the autoregressive nature of the texture synthesis process. Moreover, the predefined selection of camera positions, which does not account for the object’s geometry, limits the effective use of texture information synthesized from different viewpoints, ultimately degrading overall texture consistency. In TexTailor, we address these issues by (1) applying a resampling scheme that repeatedly integrates information from previously synthesized textures within the diffusion process, and (2) fine-tuning a depth-aware diffusion model on these resampled textures. During this process, we observed that using only a few training images restricts the model’s original ability to generate high-fidelity images aligned with the conditioning, and therefore propose an performance preservation loss to mitigate this issue. Additionally, we improve the synthesis of viewconsistent textures by adaptively adjusting camera positions based on the object’s geometry. Experiments on a subset of the Objaverse dataset and the ShapeNet car dataset demonstrate that TexTailor outperforms state-of-the-art methods in synthesizing view-consistent textures. The source code for TexTailor is available at https://github.com/Adios42/Textailor
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Realistic, high-quality 3D creatures are critical for creating immersive experiences in video games, films, and AR/VR applications, making them an essential part of modern digital media. While advancements in graphics engines and technical expertise have enabled the production of high-quality 3D content, the process remains labor-intensive, requiring multiple iterations and adjustments as well as substantial creative input.
|
| 18 |
+
|
| 19 |
+
To alleviate these challenges, the computer vision community has focused on breakthroughs in implicit neural representations (Mildenhall et al., 2021; Barron et al., 2021; Chen et al., 2022; Wang et al., 2021) and diffusion models based on textual descriptions, which provide an intuitive approach to 3D content generation (Rombach et al., 2022; Saharia et al., 2022; Nichol et al., 2021). Notably, the introduction of the score distillation sampling (SDS) loss function (Poole et al., 2022) has enabled the generation of diverse, high-quality 3D content by combining implicit neural representations with the strong priors provided by diffusion models (Wang et al., 2024; Lin et al., 2023).
|
| 20 |
+
|
| 21 |
+
While these methodologies provide both geometry and texture, converting implicit neural representations into explicit formats, such as meshes, remains necessary for integration into graphics engines and real-time applications. Recently, DMTet (Shen et al., 2021) has enabled precise mesh geometry extraction from implicit representations by leveraging a signed distance field and the Marching Tetrahedra algorithm. However, in texture synthesis, texture unwrapping often leads to inconsistent mappings, which can degrade the visual quality of the output or necessitate additional texture synthesis steps (Lin et al., 2023; Chen et al., 2023b).
|
| 22 |
+
|
| 23 |
+
With significant advances in 3D geometry generation (Shen et al., 2021; Vahdat et al., 2022; ?; Nash et al., 2020; Muller et al., 2023) and geometry optimization process (Shen et al., 2021), recent ¨
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
(a)
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
(b)
|
| 30 |
+
Figure 1: (a): The illustration of definition of viewpoint. Following the red arrow, the pencil case mesh is painted from left to right in each row in (b). (b): This visualization illustrates the gradual shift in texture properties that becomes more pronounced as the viewpoint changes. Compared to Text2Tex (Chen et al., 2023a) and TEXTure (Richardson et al., 2023), TexTailor exhibits significantly less of this gradual shift.
|
| 31 |
+
|
| 32 |
+
research (Chen et al., 2023a; Richardson et al., 2023; Tang et al., 2024; Youwang et al., 2024; Metzer et al., 2023) has focused on texture synthesis strategies for textureless meshes using language cues. Among these approaches, several works (Tang et al., 2024; Chen et al., 2023a; Richardson et al., 2023) utilize inpainting techniques (Lugmayr et al., 2022) within pre-trained depth-aware image diffusion models (Zhang et al., 2023; Rombach et al., 2022) to progressively generate images, projecting them back onto the mesh for specific regions from predefined viewpoints. However, achieving coherent texture synthesis across all viewpoints remains a challenge for two key reasons: (1) The current inpainting techniques applied to texture synthesis are incomplete, as information from previously synthesized visible textures at the current viewpoint is reflected onto the untextured areas only once per timestep in the diffusion process. This results in inconsistencies between adjacent viewpoints. (2) Additionally, progressively generating textures from multiple viewpoints introduces inherent sequential and temporal biases, gradually obscuring the texture information from the initial viewpoint. As a result, the characteristics of the texture synthesized from the initial viewpoint gradually degrade as the viewpoints shift, a phenomenon similar to the short-term dependency problems (Sutskever, 2014) observed in language models.
|
| 33 |
+
|
| 34 |
+
For instance, assuming the Y-axis is the vertical axis in the world coordinate system, we define the viewpoint as $\boldsymbol { \mathbf { \mathit { v } } } = ( \theta , \psi , \rho )$ , as shown in Fig.1 (a). Fig.1 (b) shows the generated texture images of ‘a pencil box’ mesh as $\theta$ decreases, with $\psi$ and $\rho$ fixed, following red arrow in Fig. 1 (a). In comparison to TexTailor in Fig. 1(b), the texture properties (e.g., color and pattern) of the other methods, synthesized from the initial viewpoint, progressively degrade as $\theta$ decreases. This gradual degradation intensifies over time, ultimately undermining texture consistency.
|
| 35 |
+
|
| 36 |
+
To address these challenges, we present a novel texture synthesis method, TexTailor. (1) TexTailor utilizes the resampling scheme proposed by Lugmayr et al. (2022) for texture synthesize fields, which helps to repeatedly integrate information from previously synthesized textures. To enhance its effectiveness, we implement this scheme within the non-Markovian diffusion process (DDIM, Song et al. (2020)). And (2) we finetunes a depth-aware text-to-image diffusion model using images generated through this resampling. During this process, we observe that finetuning with a limited sample set risks reducing the model’s ability to generate high-fidelity images conditioned on depth maps and textual descriptions. To mitigate this, we introduce an performance preservation loss, ensuring that the model learns the resampled distributions without compromising its generalization capabilities. Additionally, since the inpainting technique relies on previously synthesized visible textures, poorly predefined viewpoint locations that fail to consider the complexity of the mesh geometry can lead to suboptimal texture generation for the current viewpoint. To resolve this, we propose an adaptive viewpoint refinement scheme, which dynamically adjusts the viewpoint based on the amount of previously generated texture. This method enables the synthesis of coherent textures across all viewpoints by adaptively positioning the viewpoint according to the geometry of the mesh.
|
| 37 |
+
|
| 38 |
+
Experiments on a subset of the Objaverse dataset (Deitke et al., 2022) and the ShapeNet car dataset (Chang et al., 2015) demonstrate the superior performance of TexTailor in synthesizing coherent 3D textures guided by textual descriptions. It surpasses state-of-the-art texture synthesis methods driven by language cues, achieving better results in terms of LPIPS (Zhang et al., 2018) and FID (Heusel et al., 2017) on a subset of the Objaverse dataset. Our contributions are as follows:
|
| 39 |
+
|
| 40 |
+
• We extend the resampling technique, previously used only in 2D image inpainting, to the field of 3D texture synthesis by applying it to the DDIM non-Markovian process, enabling consistent texture generation within a single view with significantly fewer steps.
|
| 41 |
+
• We analyze the gradual shift phenomenon in the texture synthesis process and propose a novel approach that trains the model using only a few resampled images, removing the need for an external dataset of 3D meshes, textures, or text. By incorporating the performance preservation loss, this method effectively mitigates the gradual shift across multiple angles.
|
| 42 |
+
• To address the catastrophic forgetting phenomenon, we propose the performance preservation loss to mitigate this issue and maintain the model’s performance. Experimental results demonstrate that this loss effectively prevents forgetting and maintains high texture quality across diverse viewpoints.
|
| 43 |
+
• We introduce an adaptive method that dynamically adjusts camera positions based on texture coverage, eliminating manual configuration and ensuring consistent texture synthesis for complex geometries.
|
| 44 |
+
|
| 45 |
+
# 2 BACKGROUND
|
| 46 |
+
|
| 47 |
+
# 2.1 DIFFUSION MODELS
|
| 48 |
+
|
| 49 |
+
Diffusion models generate high-fidelity images by learning to iteratively convert a sample from a simple Gaussian distribution $\bar { \mathbf { x } } _ { T } \sim \mathcal { N } ( \mathbf { 0 } , I )$ into a complex data distribution ${ \pmb x } _ { 0 } \sim { \pmb q } ( { \pmb x } _ { 0 } )$ through a forward(diffusion) and generative process (Ho et al., 2020; Sohl-Dickstein et al., 2015; Song et al., 2020). The forward process, which approximates the posterior $q \big ( \pmb { x } _ { 1 : T } | \pmb { x } _ { 0 } \big )$ , is modeled as a Markov chain that progressively adds Gaussian noise to the data using coefficients $\bar { \alpha } _ { 1 : T } \in ( 0 , 1 ] ^ { T }$ :
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
q \left(\boldsymbol {x} _ {1: T} \mid \boldsymbol {x} _ {0}\right) := \prod_ {t = 1} ^ {T} q \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {t - 1}\right), \text {w h e r e} q \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {t - 1}\right) := \mathcal {N} \left(\sqrt {\frac {\bar {\alpha} _ {t}}{\bar {\alpha} _ {t - 1}}} \boldsymbol {x} _ {t - 1}, \left(1 - \frac {\bar {\alpha} _ {t}}{\bar {\alpha} _ {t - 1}}\right) \boldsymbol {I}\right). \tag {1}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
The generative process, modeled by the joint distribution $p _ { \theta } ( { \pmb x } _ { 0 : T } )$ , gradually denoises noisy data, starting from $p ( { \pmb x } _ { T } ) : = \mathcal { N } ( { \pmb x } _ { T } ; { \bf 0 } , T )$ . During this process, a noise predictor $\epsilon _ { \phi } ( \boldsymbol { x } _ { t } ; t )$ , typically implemented using a U-Net architecture (Ronneberger et al., 2015), predicts the noise in $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ . Song et al. (2020) introduce DDIM, a non-Markovian diffusion process that enables different generative samplers by adjusting the generative noise variance, allowing for deterministic mappings. This approach reduces the number of sampling steps while maintaining the same marginals as DDPM.
|
| 56 |
+
|
| 57 |
+
However, training diffusion models in high-dimensional pixel space can be computationally expensive. To address this, Rombach et al. (2022) proposed Stable Diffusion Model, which first use auto-encoding models to transform the data into a lower-dimensional semantic space before applying the forward and generative processes. This dimensionality reduction significantly decreases the computational cost. Consequently, the noise predictor is trained in the semantic space as follows:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
L _ {L D M} (\phi , \boldsymbol {z} _ {0}) := \mathbb {E} _ {\boldsymbol {z} _ {0}, \epsilon \sim \mathcal {N} (\boldsymbol {0}, \boldsymbol {I}), t \sim \mathcal {U} (0, 1)} \left[ w (t) \| \epsilon_ {\phi} \left(\sqrt {\bar {\alpha} _ {t}} \boldsymbol {z} _ {0} + \sqrt {1 - \bar {\alpha} _ {t}} \epsilon ; t, \boldsymbol {c}\right) - \epsilon \| _ {2} ^ {2} \right], \tag {2}
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $z _ { \mathrm { 0 } }$ is the latent vector of the input image $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ , obtained from the auto-encoder, $^ c$ is a conditioning vector (e.g., from textual descriptions), and $w ( t )$ is a weighting term indexed by timestep $t$ . Zhang et al. (2023) extends this approach by adding trainable encoder blocks connected to convolutional layers with zero weights (ControlNet) to the pre-trained noise predictor network $\epsilon _ { \phi } ( z _ { t } , t , c )$ . This architecture ensures that the pre-trained diffusion model remains fixed during training, while the newly added trainable blocks and layers learn conditional information, such as depth, normal, and edge maps. This approach enables the model to generate data distributions controlled by additional 2D spatial inputs including depth maps, allowing training with fewer parameters on smaller datasets without compromising pre-trained capabilities. In this paper, we utilize Stable Diffusion with ControlNet as a depth-aware T2I diffusion model, fine-tuning only the ControlNet component to synthesize partial textures conditioned on depth maps.
|
| 64 |
+
|
| 65 |
+
# 2.2 TEXT-TO-TEXTURE GENERATION
|
| 66 |
+
|
| 67 |
+
Texture synthesis procedure. In recent works (Richardson et al., 2023; Chen et al., 2023a; Tang et al., 2024), the partial mesh surface viewed from a single viewpoint are segmented into several regions and undergo incremental texturing from one viewpoint to the next to ensure both local and global consistency. Specifically, Chen et al. (2023a) divides the partial surface into four regions (“keep”, “new”, “update”, and “ignore”) as illustrated in Fig. 2 (b), and synthesizes partial texture using an image inpainting technique. The portion of the surface in the current viewpoint
|
| 68 |
+
|
| 69 |
+
that has already been textured from the previous viewpoint(see Fig. 2(a)) is labeled the “keep” region, while the part that lacks texture is called the “new” region. Only the “new” region undergoes partial texturing using the inpainting strategy, while the “keep” region remains unchanged. Additionally, from the same viewpoint, surfaces where view direction is parallel to the normal vector of the object’s visible faces are categorized as the “update” region. This “update” region is re-textured and projected again since it is viewed from a better angle than other regions. Consequently, partial mesh surfaces corresponding to the “new” region are textured using information from the “keep” region across multiple viewpoints.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
(a) Current view point image
|
| 73 |
+
|
| 74 |
+

|
| 75 |
+
(b) Four regions
|
| 76 |
+
Figure 2: Left: The image $\scriptstyle { \mathbf { { \vec { x } } } } _ { 0 }$ rendered from the current viewpoint before being processed by the depth-aware diffusion model. Right: An illustration of the four regions on the partial mesh surface.
|
| 77 |
+
|
| 78 |
+
Image inpainting for texturing. During the texture synthesize process, an image inpainting strategy (Lugmayr et al., 2022) is applied to a depth-aware diffusion model (Rombach et al., 2022; Zhang et al., 2023) to effectively texture the missing regions of the mesh surface corresponding to the “new” region:
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
\boldsymbol {z} _ {t - 1} ^ {\text {k n o w n}} \sim \mathcal {N} \left(\sqrt {\bar {\alpha}} _ {t} \boldsymbol {z} _ {0}, \left(1 - \bar {\alpha} _ {t}\right) \boldsymbol {I}\right), \tag {3}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\boldsymbol {z} _ {t - 1} ^ {\text {u n k n o w n}} \sim \mathcal {N} \left(\mu_ {\phi} \left(\boldsymbol {z} _ {t}, t\right), \sigma_ {\phi} \left(\boldsymbol {z} _ {t}, t\right)\right), \tag {4}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\tilde {z} _ {t - 1} := z _ {t - 1} ^ {\text {k n o w n}} \odot (1 - \mathcal {M} _ {\text {l a t e n t}}) + z _ {t - 1} ^ {\text {u n k n o w n}} \odot \mathcal {M} _ {\text {l a t e n t}}, \tag {5}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $z _ { \mathrm { 0 } }$ is the latent vector of the input image $\scriptstyle { \mathbf { { \mathit { x } } } } _ { 0 }$ , which is rendered from the current viewpoint of an object with texture applied from a previous viewpoint (see Fig. 2(a)). $z _ { t - 1 } ^ { \mathrm { k n o w n } }$ is the latent vector sampled at timestep $t - 1$ by adding noise to $z _ { \mathrm { 0 } }$ , while $z _ { t - 1 } ^ { \mathrm { u n k n o w n } }$ is the model’s output at the same timestep. $\mathcal { M } _ { l a t e n t }$ represents a mask, with a value of 1 for parts corresponding to the unknown region(“new” ∪ “ignore”) on the imagespace. In the latent space, by combining $z _ { t - 1 } ^ { \mathrm { u n k n o w n } }$ ee Fig. 2), resized to matchfor the unknown region and $z _ { t - 1 } ^ { \mathrm { k n o w n } }$ e of the latentfor the known region(“keep”), the result is the composite $\tilde { z } _ { t - 1 }$ .
|
| 93 |
+
|
| 94 |
+
This process generates a partial texture for the current viewpoint based on information from previous viewpoints. However, simply merging the known and unknown regions once at each timestep is insufficient to fully harmonize the texture information synthesized from previous viewpoints during the denoising process of the diffusion model.
|
| 95 |
+
|
| 96 |
+
# 3 METHOD
|
| 97 |
+
|
| 98 |
+
# 3.1 RESAMPLING
|
| 99 |
+
|
| 100 |
+
As mentioned in Sec. 2, texturing an object involves progressively generating images using a depthaware diffusion model and compositing them across multiple viewpoints. During the denoising process at each timestep, simply merging the known and unknown regions once is insufficient to seamlessly harmonize the unknown regions with the known ones, leading to inconsistencies between adjacent viewpoints. Additionally, discordant textures synthesized from a single viewpoint can accumulate through subsequent viewpoints, further degrading overall 3D texture consistency.
|
| 101 |
+
|
| 102 |
+

|
| 103 |
+
Figure 3: Overview of TexTailor. TexTailor synthesizes textures for a given 3D mesh without textures, based on a textual description, such as “a hippopotamus”. We add additional camera positions to the predefined set to properly condition the previously synthesized textures from each viewpoint, eliminating the need for manually coordinating camera locations. Based on these viewpoints, we progressively generate textures using image inpainting techniques, including a resampling scheme within a non-Markovian process. To prevent the gradual shift in texture properties, we fine-tune ControlNet with a small set of resampled images, incorporating an performance preservation loss.
|
| 104 |
+
|
| 105 |
+
In 2D image inpainting field, Lugmayr et al. (2022) propose a resampling method that iteratively repeats adding noise and denoising, along with a merging step (similar to Eq. 5), multiple times at each timestep to more thoroughly mix the known and unknown regions. However, directly applying this method to texture synthesis requires a large number of timesteps, as it operates within a Markovian process, similar to DDPM, and must be repeated across multiple viewpoints. To generate higher quality, harmonious images in fewer steps, we propose a resampling method within a non-Markovian process using the following formula:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\tilde {z} _ {t} ^ {r} \sim \mathcal {N} \left(\sqrt {\frac {\bar {\alpha} _ {t}}{\bar {\alpha} _ {t - 1}}} \tilde {z} _ {t - 1} ^ {r - 1}, (1 - \frac {\bar {\alpha} _ {t}}{\bar {\alpha} _ {t - 1}}) \boldsymbol {I}\right), \tag {6}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
$$
|
| 112 |
+
\tilde {z} _ {t - 1} ^ {r} \sim \mathcal {N} \left(\sqrt {\bar {\alpha} _ {t - 1}} \tilde {z} _ {0} ^ {r} + \sqrt {1 - \bar {\alpha} _ {t - 1}} \cdot \frac {\tilde {z} _ {t} ^ {r} - \sqrt {\bar {\alpha} _ {t}} \tilde {z} _ {0} ^ {r}}{\sqrt {1 - \bar {\alpha} _ {t}}}, 0\right), \tag {7}
|
| 113 |
+
$$
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\tilde {z} _ {t - 1} ^ {r} = z _ {t - 1} ^ {\text {k n o w n}} \odot \left(1 - \mathcal {M} _ {\text {l a t e n t}}\right) + \tilde {z} _ {t - 1} ^ {r} \odot \mathcal {M} _ {\text {l a t e n t}}, \tag {8}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $r$ denotes the resampling step at each timestep, $r \in \{ 1 , . . . , R \}$ , and $\tilde { z } _ { t - 1 } ^ { 0 }$ corresponds to $\tilde { z } _ { t - 1 }$ from Eq. 5. The resampling process at each timestep, as described in the equations above, occurs after the merging process defined by Eq. 5. Specifically, in the $r$ -th resampling, $\tilde { z } _ { t } ^ { r }$ is sampled by adding noise to $\tilde { z } _ { t - 1 } ^ { r - 1 }$ , the previously merged sample at timestep $t - 1$ , as shown in Eq. 6. In Eq. 7, $\tilde { \mathbf { z } } _ { t - 1 } ^ { r }$ is sampled by denoising $\tilde { \mathbf { z } } _ { t } ^ { r }$ according to the DDIM non-Markovian process. The resulting $\tilde { \mathbf { z } } _ { t - 1 } ^ { r }$ is then combined with $\mathbf { z } _ { t - 1 } ^ { \mathrm { k n o w n } } .$ , as described in Eq. 8, where $\mathbf { z } _ { t - 1 } ^ { \mathrm { k n o w n } }$ is derived from Eq. 3. The timestep $t$ is part of the sequence $\{ \tau _ { s } , . . . , \tau _ { 1 } \}$ , which is a sub-sequence of $\{ T , . . . , 1 \}$ . This approach allows high-quality texture synthesis by merging the “known” regions and “unknown” regions $R$ times with only 30 steps. This is significantly fewer than the 250 steps required by the original resampling method (Lugmayr et al., 2022) for a single view.
|
| 120 |
+
|
| 121 |
+
# 3.2 FINE-TUNING WITH ORIGINAL CAPABILITIES PRESERVED
|
| 122 |
+
|
| 123 |
+
Using the resampling method (Sec. 3.1) within the depth-aware diffusion model, the partial mesh surface from the current viewpoint are coherently painted based solely on the previously synthesized textures visible from that same viewpoint(corresponding to “keep” region). However, the autoregressive nature of the texture synthesis process, which relies only on previously synthesized visible textures, leads to a gradual shift in texture properties, such as material or pattern (see Fig.1(b)), ultimately compromising the consistency of the texture. This is because, as the synthesis progresses from the first viewpoint across multiple viewpoints, the texture information from the first viewpoint becomes increasingly obscured.
|
| 124 |
+
|
| 125 |
+
Furthermore, ControlNet (Zhang et al., 2023) is responsible for extracting data distributions that align with depth maps in the output domain of the diffusion model. However, it is challenging to guide resampled data distributions from the diffusion model through ControlNet without incorporating previously synthesized visible tex-
|
| 126 |
+
|
| 127 |
+

|
| 128 |
+
|
| 129 |
+

|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
|
| 133 |
+

|
| 134 |
+
|
| 135 |
+

|
| 136 |
+
|
| 137 |
+

|
| 138 |
+
|
| 139 |
+

|
| 140 |
+
|
| 141 |
+

|
| 142 |
+
|
| 143 |
+

|
| 144 |
+
W/o preservation
|
| 145 |
+
TexTailor
|
| 146 |
+
Figure 4: Illustration of the loss of original generative ability when fine-tuning ControlNet without the performance preservation loss.
|
| 147 |
+
|
| 148 |
+
tures (i.e., without using image inpainting techniques) in the current viewpoint. In other words, ControlNet itself does not retain or reflect the characteristics of previously synthesized resampled textures at the current viewpoint.
|
| 149 |
+
|
| 150 |
+
These limitations hinder the ability to infer texture information for viewpoints distant from the first viewpoint using resampled textures from viewpoints close to the first viewpoint. To address this challenge, we fine-tune ControlNet with a small set of resampled images near the first viewpoint to extract images of the same object from different angles in the output domain of the diffusion model, allowing it to retain the texture properties across multiple viewpoints:
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
L _ {F i n e} := \mathbb {E} _ {\boldsymbol {z} _ {0} ^ {R}, \epsilon \sim \mathcal {N} (\boldsymbol {0}, \boldsymbol {I}), t \sim \mathcal {U} (0, 1), \boldsymbol {c} _ {t}, \boldsymbol {c} _ {d}} \left[ w (t) \| \epsilon_ {\phi} \left(\boldsymbol {z} _ {t} ^ {R}, t, \boldsymbol {c} _ {t}, \boldsymbol {c} _ {d}\right) - \epsilon \| _ {2} ^ {2} \right], \tag {9}
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
where $\mathbf { } c _ { t }$ and $c _ { d }$ are the text prompts and depth condition, respectively.
|
| 157 |
+
|
| 158 |
+
While this approach helps preserve texture properties during synthesis, it compromises ControlNet’s original capability to extract images aligned with depth conditions and text prompts, a phenomenon known as catastrophic forgetting. For instance, the generated textures from the depth-aware diffusion model finetuned with Eq.9 exhibit significant noise and reduced quality, as shown in Fig.4. To address this issue, we introduce an performance preservation loss:
|
| 159 |
+
|
| 160 |
+
$$
|
| 161 |
+
L _ {p r e} := \mathbb {E} _ {\boldsymbol {z} _ {0} ^ {R}, \epsilon \sim \mathcal {N} (\boldsymbol {0}, \boldsymbol {I}), t \sim \mathcal {U} (0, 1), \boldsymbol {c} _ {t}, \boldsymbol {c} _ {d}} \left[ w (t) \left\| \epsilon_ {\phi} \left(\boldsymbol {z} _ {t} ^ {R}, t, \boldsymbol {c} _ {t}, \boldsymbol {c} _ {d}\right) - \epsilon_ {o r i g} \left(\boldsymbol {z} _ {t} ^ {R}, t, \boldsymbol {c} _ {t}, \boldsymbol {c} _ {d}\right) \right\| _ {2} ^ {2} \right], \tag {10}
|
| 162 |
+
$$
|
| 163 |
+
|
| 164 |
+
where $\epsilon _ { o r i g }$ is the output of the fixed pre-trained network. This loss ensures that the noise prediction network does not deviate significantly from the original pre-trained parameters.
|
| 165 |
+
|
| 166 |
+
Consequently, Our final loss is as follows:
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
L _ {\text {F i n a l}} := L _ {\text {F i n e}} + \lambda L _ {\text {p r e}}, \tag {11}
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
where $\lambda$ adjusts the strength of the performance preservation loss. Fig. 3 illustrates the entire process.
|
| 173 |
+
|
| 174 |
+
# 3.3 ADAPTIVE VIEWPOINT REFINEMENT
|
| 175 |
+
|
| 176 |
+
To achieve consistent texture synthesis using the inpainting method (Sec. 2.2), it is crucial to set the camera’s position for each viewpoint appropriately. This is because the outcomes of images generated by the inpainting technique are highly dependent on the previously synthesized visible
|
| 177 |
+
|
| 178 |
+
textures at the current viewpoint. A simple solution is to distribute as many viewpoints as possible evenly around the object in 3D space. However, this approach presents two problems.
|
| 179 |
+
|
| 180 |
+
First, unnecessary predefined viewpoints make the overall texture synthesis process inefficient. Distributing too many viewpoints is akin to sequentially painting the entire mesh surface in small, redundant sections, which adds unnecessary steps and even exacerbates the gradual shift in texture properties, even with the introduction of Eq.11. Second, complex geometries can lead to camera positions where textures from previous viewpoints are not sufficiently visible. Finding evenly distributed viewpoints $\pmb { v } = ( \theta , \psi , \rho )$ in 3D space often requires numerous trials and errors to achieve precise viewpoint settings. Furthermore, optimal camera positions vary depending on the object’s geometry, making manual configuration particularly difficult, especially for large-scale objects.
|
| 181 |
+
|
| 182 |
+
To select optimal camera positions, we utilize the ratio of the “keep” region to the “new” region at each viewpoint. We render each region from the meshes onto the image planes and convert them into masks where a value of one represents the corresponding region. Then, we calculate the proportion of pixels corresponding to the “keep” region relative to the total of the “keep” and “new” regions on the image plane:
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
p := \frac {\sum_ {i , j} \mathbf {1} _ {\{(i , j) \in \text {k e e p} \}}}{\sum_ {i , j} \mathbf {1} _ {\{(i , j) \in \text {n e w} \}} + \sum_ {i , j} \mathbf {1} _ {\{(i , j) \in \text {k e e p} \}}}. \tag {12}
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
If the proportion $p$ calculated in Eq. 12 is smaller than a threshold $\beta$ , we add an additional camera position $( \bar { \pmb { v } } = ( \theta _ { p r e v } + \gamma ( \theta _ { c u r r e n t } - \bar { \theta } _ { p r e v } ) , \psi _ { p r e v } + \gamma ( \psi _ { c u r r e n t } - \psi _ { p r e v } ) , \rho ) )$ to the predefined camera position sequence $\{ \pmb { v } _ { 1 } , . . . , \pmb { v } _ { n } \}$ . Here, $\gamma \in ( 0 , 1 )$ is an interpolation parameter, and we interpolate the azimuth $\mathbf { \eta } ^ { ( \theta ) }$ and elevation $( \psi )$ angles between the previous and current viewpoints. This adaptive approach ensures that the camera positions are optimized based on the object’s geometry and the amount of previously generated texture.
|
| 189 |
+
|
| 190 |
+
# 4 EXPERIMENTS
|
| 191 |
+
|
| 192 |
+
# 4.1 EXPERIMENT SETUP
|
| 193 |
+
|
| 194 |
+
Implementation Details. We select a subset of the Objaverse dataset (Deitke et al., 2022) to evaluate our model, following the approach of Chen et al. (2023a). In this dataset, Chen et al. (2023a) filter out low-quality or misaligned meshes from the designated categories, resulting in 410 textured meshes across 225 categories for our experiments. Notably, the original textures are used exclusively for evaluation. Recent text-driven texture synthesis methods (Richardson et al., 2023; Metzer et al., 2023; Youwang et al., 2024), which rely on gradient-based rendering using a differential renderer (Fuji Tsang et al., 2022), encounter difficulties when optimizing texture synthesis for ‘car’ objects from the ShapeNet dataset (Chang et al., 2015). Therefore, we present only qualitative results for our approach on this dataset to demonstrate its performance on fine-grained categories compared to Text2Tex.
|
| 195 |
+
|
| 196 |
+
For both datasets, the number of resampling steps, as well as the parameters λ, $\beta$ , and $\gamma$ , are set to 3, 2.5, 0.5, and 0.5, respectively. We finetune the ControlNet using five images rendered from viewpoints close to and including the first viewpoint: $\pmb { v } _ { 1 } = ( 0 ^ { \circ } , 1 5 ^ { \circ } , 1 )$ , $v _ { 2 } = \bar { ( 0 ^ { \circ } , 3 5 ^ { \circ } , 1 ) }$ , ${ \bf { v } } _ { 3 } = { \bf { \Omega } }$ $( 0 ^ { \circ } , - 5 ^ { \circ } , 1 )$ , $\pmb { v } _ { 4 } = ( 2 0 ^ { \circ } , 1 5 ^ { \circ } , 1 )$ , and $\pmb { v } _ { 5 } = ( 3 4 0 ^ { \circ } , 1 5 ^ { \circ } , 1 )$ . For rendering and texture projection, we utilize the PyTorch framework (Paszke et al., 2017) along with PyTorch3D (Ravi et al., 2020).
|
| 197 |
+
|
| 198 |
+
Evaluation metrics. To quantitatively measure the view-consistency of synthesized textures, we report the average LPIPS (Zhang et al., 2018) between images rendered from 3D textured meshes across multiple viewpoints. A gradual shift in texture properties or the presence of artifacts is assumed to increase the perceptual loss between any two viewpoints. To calculate average LPIPS, We sample 25 uniformly spaced camera positions from both the upper and lower hemispheres of a fixedradius sphere. All cameras within the upper hemisphere share the same elevation, and similarly, all cameras within the lower hemisphere share the same elevation, with each set directed towards the center of the sphere. An image is rendered from each viewpoint at a resolution of $5 1 2 \times 5 1 2$ . We then compute the average LPIPS values for all pairs of images in the 3D scene and sum the averages across all evaluated categories.
|
| 199 |
+
|
| 200 |
+
Additionally, we assess the quality and diversity of the generated textures using the Frechet Inception Distance (FID) (Heusel et al., 2017). The synthesized texture distribution consists of rendered
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
Figure 5: Qualitative comparisons on Objaverse. We compare TexTailor with state-of-the-art baselines (Metzer et al., 2023; Chen et al., 2023a; Richardson et al., 2023; Youwang et al., 2024) on Objaverse meshes. Compared to other methods, TexTailor produces textures that are more viewconsistent and better aligned with object geometries.
|
| 204 |
+
|
| 205 |
+
images from the above camera points, while the real distribution is composed of renders of the meshes under the same conditions, using artist-designed textures.
|
| 206 |
+
|
| 207 |
+
Quantitative comparisons. In Tab. 1, we compare our approach against recent SOTA text-driven texture synthesis methods: Latent-Paint (Metzer et al., 2023), Text2Tex (Chen et al., 2023a), TEXTure (Richardson et al., 2023), and Paintit (Youwang et al., 2024), on a subset of the Objaverse dataset. For texture descriptions, template, “a 〈category〉”, is utilized consistently across all approaches. The results demonstrate that our method synthesizes high-quality and more consistent textures than all baselines across various categories.
|
| 208 |
+
|
| 209 |
+
Table 1: Quantitative comparison on Objaverse subset.
|
| 210 |
+
|
| 211 |
+
<table><tr><td>Method</td><td>LPIPS↓</td><td>FID↓</td></tr><tr><td>Latent-Paint</td><td>54.429</td><td>45.334</td></tr><tr><td>Text2Tex</td><td>38.931</td><td>33.487</td></tr><tr><td>TEXTure</td><td>54.138</td><td>43.337</td></tr><tr><td>Paint-it</td><td>38.316</td><td>39.823</td></tr><tr><td>Ours</td><td>37.889</td><td>29.998</td></tr></table>
|
| 212 |
+
|
| 213 |
+
Qualitative comparisons. In Fig. 5, we present the rendered results using TexTailor alongside other baselines on the Objaverse dataset. The qualitative results demonstrate that our approach significantly improves texture quality, particularly in terms of
|
| 214 |
+
|
| 215 |
+

|
| 216 |
+
“Audi A3”
|
| 217 |
+
|
| 218 |
+

|
| 219 |
+
“Modified Aston Martin DB9”
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
|
| 223 |
+

|
| 224 |
+
|
| 225 |
+

|
| 226 |
+
|
| 227 |
+

|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
|
| 241 |
+

|
| 242 |
+
Ours
|
| 243 |
+
Text2Tex
|
| 244 |
+
Figure 6: Qualitative comparisons on ShapeNet car. Our approach synthesizes more viewconsistent and higher-quality textures for fine-grained categories compared to the baseline.
|
| 245 |
+
|
| 246 |
+
Table 2: Table of Ablation Studies.
|
| 247 |
+
|
| 248 |
+
<table><tr><td>w/ Resampling</td><td>w/ Training</td><td>w/Perf.Loss</td><td>w/ View Refine</td><td>LPIPS ↓</td><td>FID ↓</td></tr><tr><td>✓</td><td>X</td><td>X</td><td>X</td><td>38.89</td><td>30.924</td></tr><tr><td>✓</td><td>✓</td><td>X</td><td>X</td><td>39.85</td><td>53.855</td></tr><tr><td>✓</td><td>✓</td><td>✓</td><td>X</td><td>38.00</td><td>30.567</td></tr><tr><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>37.89</td><td>29.998</td></tr></table>
|
| 249 |
+
|
| 250 |
+
view-consistency. Specifically, some methods based on autoregressive processes for texture synthesis exhibit a gradual shift in texture properties (see Fig. 1), leading to reduced view consistency overall. Other approaches that employ score distillation sampling loss (SDS loss) enhance texture quality by optimizing networks that generate texture maps or the texture maps themselves. However, they cannot fully overcome the inherent limitations of SDS loss, such as oversaturation, over-smoothing, and low diversity (Wang et al., 2024; Poole et al., 2022). For example, in the case of “a hammer” (second column in Fig.5), our method successfully textures both the handle and head of the hammer mesh without a gradual shift in each part’s texture properties, and avoiding artifacts across multiple viewpoints. These limitations in the other baselines are also reflected in the quantitative results in Tab. 1. In Fig. 6, due to optimization problems with the differential renderer, we only report the texture results for ShapeNet cars using our method and Text2Tex. Notably, even with fine-grained categories, our results show high-quality, view-consistent textures without the aforementioned problems. Additional qualitative comparisons for texture synthesis on Objaverse dataset objects and human meshes can be found in the appendix.
|
| 251 |
+
|
| 252 |
+
# 4.2 ABLATION STUDIES
|
| 253 |
+
|
| 254 |
+
Effects of resampling. First, we incorporate the resampling method into our baseline, as shown in Fig. 7 (a). The resampling method better preserves the texture properties of the chocolate-covered cherry and muffin liner from the first viewpoint $( \pmb { v } _ { 1 } )$ at the subsequent viewpoints, $\mathbf { \boldsymbol { v } } _ { 2 }$ and ${ \pmb v } _ { 4 }$ , compared to the baseline. However, we still observe a gradual change in the pattern of the muffin liner from $\mathbf { \boldsymbol { v } } _ { 2 }$ to ${ \pmb v } _ { 4 }$ , and this change becomes more pronounced at ${ \pmb v } _ { 1 0 }$ , which is far from ${ \pmb v } _ { 1 }$ , in left example of Fig. 7 (b), compromising view-consistency. This tendency is clearly reflected in the results shown in Tab. 2.
|
| 255 |
+
|
| 256 |
+
Effects of training with resampled texture. To address this problem, we fine-tune ControlNet on the resampled textures from five viewpoints $( v _ { 1 } , v _ { 2 } , v _ { 3 } , v _ { 4 } , v _ { 5 } )$ with the performance preservation loss, as shown in Fig. 7 (b). As a result, the ability to preserve texture properties is significantly improved. We now observe that the muffin textures from ${ \pmb v } _ { 1 1 }$ —a viewpoint diametrically opposite to ${ \pmb v } _ { 1 }$ with respect to the origin—are similar to the textures from ${ \pmb v } _ { 1 }$ .
|
| 257 |
+
|
| 258 |
+
Effects of adaptive view refinement. In Fig. 7(c), we illustrate the texture synthesis process from the side view to the bottom view of the muffin mesh. If the user does not define an appropriate mid-
|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
(a) Effects of resampling
|
| 262 |
+
|
| 263 |
+

|
| 264 |
+
(b) Effects of training with resampled textures
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
(c) Effects of adaptive view refinement
|
| 268 |
+
Figure 7: Ablation studies. The illustration demonstrates the effectiveness of the key components of TexTailor. As each component is applied, the muffin’s texture becomes more consistent across multiple viewpoints, and the overall texture quality improves.
|
| 269 |
+
|
| 270 |
+
point between these views, as shown in the left example, the model generates a texture that is entirely misaligned with the previously synthesized one in terms of geometry. Conversely, proper compensation at predefined viewpoints effectively prevents this phenomenon. Our method eliminates the need for such cumbersome manual efforts, including tracking and precisely defining camera positions for different geometries.
|
| 271 |
+
|
| 272 |
+
# 5 CONCLUSION
|
| 273 |
+
|
| 274 |
+
In this paper, we propose TexTailor, a novel method for synthesizing high-quality textures based on language cues for 3D meshes across multiple categories. Our methodology utilizes a resampling scheme to successfully harmonize unknown regions with known regions in inpainting techniques, thereby improving view consistency between adjacent viewpoints. To address the gradual shift in texture properties, we fine-tune a small set of resampled texture images using ControlNet with an performance preservation loss. Additionally, the adaptive view refinement technique enhances quality and view consistency by leveraging previously synthesized textures, eliminating the need for manual coordination of camera positions based on the object’s geometry. Experiments on datasets from various categories demonstrate the superior performance of our approach in synthesizing highquality, view-consistent textures.
|
| 275 |
+
|
| 276 |
+
# ACKNOWLEDGEMENTS
|
| 277 |
+
|
| 278 |
+
This research has been supported by the LG Electronics Corporation. (Project No. G01230381)
|
| 279 |
+
|
| 280 |
+
# REFERENCES
|
| 281 |
+
|
| 282 |
+
Renderpeople, 2023. URL https://renderpeople.com/.
|
| 283 |
+
Jonathan T Barron, Ben Mildenhall, Matthew Tancik, Peter Hedman, Ricardo Martin-Brualla, and Pratul P Srinivasan. Mip-nerf: A multiscale representation for anti-aliasing neural radiance fields. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 5855–5864, 2021.
|
| 284 |
+
Angel X Chang, Thomas Funkhouser, Leonidas Guibas, Pat Hanrahan, Qixing Huang, Zimo Li, Silvio Savarese, Manolis Savva, Shuran Song, Hao Su, et al. Shapenet: An information-rich 3d model repository. arXiv preprint arXiv:1512.03012, 2015.
|
| 285 |
+
Anpei Chen, Zexiang Xu, Andreas Geiger, Jingyi Yu, and Hao Su. Tensorf: Tensorial radiance fields. In European conference on computer vision, pp. 333–350. Springer, 2022.
|
| 286 |
+
Dave Zhenyu Chen, Yawar Siddiqui, Hsin-Ying Lee, Sergey Tulyakov, and Matthias Nießner. Text2tex: Textdriven texture synthesis via diffusion models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 18558–18568, 2023a.
|
| 287 |
+
Rui Chen, Yongwei Chen, Ningxin Jiao, and Kui Jia. Fantasia3d: Disentangling geometry and appearance for high-quality text-to-3d content creation. In Proceedings of the IEEE/CVF international conference on computer vision, pp. 22246–22256, 2023b.
|
| 288 |
+
Matt Deitke, Dustin Schwenk, Jordi Salvador, Luca Weihs, Oscar Michel, Eli VanderBilt, Ludwig Schmidt, Kiana Ehsani, Aniruddha Kembhavi, and Ali Farhadi. Objaverse: A universe of annotated 3d objects. arXiv preprint arXiv:2212.08051, 2022.
|
| 289 |
+
Clement Fuji Tsang, Maria Shugrina, Jean Francois Lafleche, Towaki Takikawa, Jiehan Wang, Charles Loop, Wenzheng Chen, Krishna Murthy Jatavallabhula, Edward Smith, Artem Rozantsev, Or Perel, Tianchang Shen, Jun Gao, Sanja Fidler, Gavriel State, Jason Gorski, Tommy Xiang, Jianing Li, Michael Li, and Rev Lebaredian. Kaolin: A pytorch library for accelerating 3d deep learning research. https://github. com/NVIDIAGameWorks/kaolin, 2022.
|
| 290 |
+
Martin Heusel, Hubert Ramsauer, Thomas Unterthiner, Bernhard Nessler, and Sepp Hochreiter. Gans trained by a two time-scale update rule converge to a local nash equilibrium. 2017.
|
| 291 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840–6851, 2020.
|
| 292 |
+
Edward J Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yuanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021.
|
| 293 |
+
Chen-Hsuan Lin, Jun Gao, Luming Tang, Towaki Takikawa, Xiaohui Zeng, Xun Huang, Karsten Kreis, Sanja Fidler, Ming-Yu Liu, and Tsung-Yi Lin. Magic3d: High-resolution text-to-3d content creation. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 300–309, 2023.
|
| 294 |
+
Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. Repaint: Inpainting using denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11461–11471, 2022.
|
| 295 |
+
Gal Metzer, Elad Richardson, Or Patashnik, Raja Giryes, and Daniel Cohen-Or. Latent-nerf for shape-guided generation of 3d shapes and textures. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 12663–12673, 2023.
|
| 296 |
+
Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. Communications of the ACM, 65(1): 99–106, 2021.
|
| 297 |
+
Norman Muller, Yawar Siddiqui, Lorenzo Porzi, Samuel Rota Bulo, Peter Kontschieder, and Matthias Nießner. ¨ Diffrf: Rendering-guided 3d radiance field diffusion. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4328–4338, 2023.
|
| 298 |
+
Charlie Nash, Yaroslav Ganin, SM Ali Eslami, and Peter Battaglia. Polygen: An autoregressive generative model of 3d meshes. In International conference on machine learning, pp. 7220–7229. PMLR, 2020.
|
| 299 |
+
Alex Nichol, Prafulla Dhariwal, Aditya Ramesh, Pranav Shyam, Pamela Mishkin, Bob McGrew, Ilya Sutskever, and Mark Chen. Glide: Towards photorealistic image generation and editing with text-guided diffusion models. arXiv preprint arXiv:2112.10741, 2021.
|
| 300 |
+
|
| 301 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
|
| 302 |
+
Ben Poole, Ajay Jain, Jonathan T Barron, and Ben Mildenhall. Dreamfusion: Text-to-3d using 2d diffusion. arXiv preprint arXiv:2209.14988, 2022.
|
| 303 |
+
Nikhila Ravi, Jeremy Reizenstein, David Novotny, Taylor Gordon, Wan-Yen Lo, Justin Johnson, and Georgia Gkioxari. Accelerating 3d deep learning with pytorch3d. arXiv:2007.08501, 2020.
|
| 304 |
+
Elad Richardson, Gal Metzer, Yuval Alaluf, Raja Giryes, and Daniel Cohen-Or. Texture: Text-guided texturing of 3d shapes. In ACM SIGGRAPH 2023 conference proceedings, pp. 1–11, 2023.
|
| 305 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Bjorn Ommer. High-resolution¨ image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), pp. 10684–10695, June 2022.
|
| 306 |
+
Olaf Ronneberger, Philipp Fischer, and Thomas Brox. U-net: Convolutional networks for biomedical image segmentation. In Medical image computing and computer-assisted intervention–MICCAI 2015: 18th international conference, Munich, Germany, October 5-9, 2015, proceedings, part III 18, pp. 234–241. Springer, 2015.
|
| 307 |
+
Chitwan Saharia, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghasemipour, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in neural information processing systems, 35:36479– 36494, 2022.
|
| 308 |
+
Tianchang Shen, Jun Gao, Kangxue Yin, Ming-Yu Liu, and Sanja Fidler. Deep marching tetrahedra: a hybrid representation for high-resolution 3d shape synthesis. Advances in Neural Information Processing Systems, 34:6087–6101, 2021.
|
| 309 |
+
Jascha Sohl-Dickstein, Eric Weiss, Niru Maheswaranathan, and Surya Ganguli. Deep unsupervised learning using nonequilibrium thermodynamics. In International conference on machine learning, pp. 2256–2265. PMLR, 2015.
|
| 310 |
+
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. arXiv preprint arXiv:2010.02502, 2020.
|
| 311 |
+
I Sutskever. Sequence to sequence learning with neural networks. arXiv preprint arXiv:1409.3215, 2014.
|
| 312 |
+
Jiaxiang Tang, Ruijie Lu, Xiaokang Chen, Xiang Wen, Gang Zeng, and Ziwei Liu. Intex: Interactive text-totexture synthesis via unified depth-aware inpainting. arXiv preprint arXiv:2403.11878, 2024.
|
| 313 |
+
Arash Vahdat, Francis Williams, Zan Gojcic, Or Litany, Sanja Fidler, Karsten Kreis, et al. Lion: Latent point diffusion models for 3d shape generation. Advances in Neural Information Processing Systems, 35:10021– 10039, 2022.
|
| 314 |
+
Peng Wang, Lingjie Liu, Yuan Liu, Christian Theobalt, Taku Komura, and Wenping Wang. Neus: Learning neural implicit surfaces by volume rendering for multi-view reconstruction. NeurIPS, 2021.
|
| 315 |
+
Zhengyi Wang, Cheng Lu, Yikai Wang, Fan Bao, Chongxuan Li, Hang Su, and Jun Zhu. Prolificdreamer: Highfidelity and diverse text-to-3d generation with variational score distillation. Advances in Neural Information Processing Systems, 36, 2024.
|
| 316 |
+
Kim Youwang, Tae-Hyun Oh, and Gerard Pons-Moll. Paint-it: Text-to-texture synthesis via deep convolutional texture map optimization and physically-based rendering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4347–4356, 2024.
|
| 317 |
+
Lvmin Zhang, Anyi Rao, and Maneesh Agrawala. Adding conditional control to text-to-image diffusion models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3836–3847, 2023.
|
| 318 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018.
|
| 319 |
+
|
| 320 |
+
# A APPENDIX
|
| 321 |
+
|
| 322 |
+
# A.1 ADDITIONAL QUALITATIVE COMPARISON
|
| 323 |
+
|
| 324 |
+

|
| 325 |
+
Figure 8: Additional qualitative comparisons on Objaverse. We compare TexTailor with stateof-the-art baselines (Metzer et al., 2023; Chen et al., 2023a; Richardson et al., 2023; Youwang et al., 2024) on Objaverse meshes. Compared to other methods, TexTailor produces textures that are more view-consistent and better aligned with object geometries.
|
| 326 |
+
|
| 327 |
+
Objaverse Dataset To further validate the effectiveness of our proposed methodology, we provide qualitative comparisons for four additional objects from the Objaverse dataset, complementing the four objects already showcased in the qualitative results of the paper (see Fig. 5). Specifically, methods that rely on auto-regressive processes for texture synthesis often encounter a gradual shift in texture properties, leading to the emergence of texture seams that significantly degrade overall texture quality across multiple viewpoints. For instance, in the cases of Text2Tex (Chen et al., 2023a) and TEXTure (Richardson et al., 2023) with the prompt “a basketball”, the texture patterns, colors, and materials of the basketball are inconsistently generated, resulting in noticeable variations within a single viewpoint. Similarly, with the prompt “a desk chair,” the chair exhibits patches of paint in colors such as white or blue, further emphasizing these inconsistencies.
|
| 328 |
+
|
| 329 |
+
In contrast, approaches based on SDS loss face challenges stemming from intrinsic limitations of the loss itself, such as oversaturation and low diversity. For example, while Latent-Paint (Metzer et al., 2023) generates textures that appear relatively well-synthesized, it frequently displays a strong bias toward red-dominated textures. Similarly, Paint-it (Youwang et al., 2024) often suffers from visible oversaturation artifacts, detracting from the overall realism of the generated textures.
|
| 330 |
+
|
| 331 |
+

|
| 332 |
+
Figure 9: Additional qualitative comparisons on RenderPeople (ren, 2023). Qualitative comparison of generated textures for clothed human meshes using various text prompts. Each column corresponds to a different text prompt: (1st col) ‘A woman wearing a white blouse with a ribbon detail, light beige pants, nude-tone heels, and neatly tied blonde hair’, (2nd col) ‘A man, wearing a black vest, black formal trousers, a black tie, a black belt, a white dress shirt, and dark formal shoes, with short neatly styled hair’, (3rd col) ‘A man, wearing a gray short-sleeve T-shirt, blue jeans, white sneakers, and short, dark brown hair styled neatly’, and (4th row) ‘A woman with dark skin tone, wearing a black blazer, a black top, gray pants with a gray tied belt, black heels, and having dark hair’. The results demonstrate the performance of our method across diverse prompts and viewpoints.
|
| 333 |
+
|
| 334 |
+
Clothed Human Dataset we provide qualitative comparison results for clothed human meshes from RenderPeople (ren, 2023). The text prompts for RenderPeople’s clothed human meshes were created based on the ground truth images provided by RenderPeople, which were designed by professional designers. Texture synthesis for human meshes demonstrates the superiority of our approach in terms of consistency and quality. For instance, when examining the texture results for the male mesh corresponding to the prompt in the second column - ‘A man, wearing a black vest, black formal trousers, a black tie, a black belt, a white dress shirt, and dark formal shoes, with short neatly styled hair’ - other methods exhibit a phenomenon of textual gradual shift. This causes the clothing colors shifting inconsistently between white, black, and gray, making it challenging for the models to faithfully reproduce the clothing described in the prompt. In contrast, TexTailor effectively eliminates this issue, accurately representing the prompt with textures like “a black vest” and “a white dress shirt”, ensuring precise alignment with the described attire. In addition to clothing, the head region also presents challenges. For instance, in the top view, textures applied to other regions (such as the face, upper body, or lower body) are often not visible, leading to a decline in texture quality for the top view. However, TexTailor addresses this issue by utilizing the adaptive view refinement
|
| 335 |
+
|
| 336 |
+
technique, which transfers texture information from regions like the face and clothing. This ensures seamless texture generation without visible texture seams, even in challenging viewpoints like the top or bottom view.
|
| 337 |
+
|
| 338 |
+
# A.2 ADDITIONAL QUALITATIVE RESULTS
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
(a) Glossy objects
|
| 342 |
+
“a bowl"
|
| 343 |
+
“a cup”
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
(b) Metallic objects
|
| 349 |
+
“a faucet”
|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
“an aerosol can”
|
| 353 |
+
|
| 354 |
+

|
| 355 |
+
(c) Translucent objects
|
| 356 |
+
“a light bulb”
|
| 357 |
+
“a candle”
|
| 358 |
+
|
| 359 |
+

|
| 360 |
+
Figure 10: Additional qualitative comparisons on non-diffuse objects from the Objaverse dataset. We present the texture synthesis results categorized into three types: (a) Glossy objects, (b) Metallic objects, and (c) Translucent objects.
|
| 361 |
+
|
| 362 |
+
We further demonstrate the texture quality of not only diffuse objects but also non-diffuse objects from the Objaverse dataset, categorized into three types: (a) glossy objects, (b) metallic objects, and (c) translucent objects. The results generally show satisfactory texture quality across all categories. However, for regions where light reflection or shadows occur, these features are pre-generated based on the synthesis process rather than dynamically determined by the lighting direction in the user’s graphics software. This could pose challenges for practical applications. Nevertheless, this limitation is not unique to our approach and is observed in other methods as well. Developing techniques to prevent such biases in light effects during the texture synthesis stage will be a focus of our future work.
|
| 363 |
+
|
| 364 |
+
# A.3 ADDITIONAL ABLATION STUDIES
|
| 365 |
+
|
| 366 |
+
Effects of resampling. When observing the texture of “a basket,” the transition from ${ \pmb v } _ { 0 }$ to ${ \pmb v } _ { 1 }$ reveals a change in the texture of the inside of the basket in the left part. This occurs in the baseline method because the previously synthesized texture visible from the current viewpoint is only merged once per timestep during the diffusion process. In contrast, our methodology improves this by utilizing the resampling strategy proposed in (Lugmayr et al., 2022), which allows the texture to be merged multiple times per timestep, resulting in a more consistent outcome.
|
| 367 |
+
|
| 368 |
+
Effects of training with resampled texture. When observing the object “a briefcase,” applying the resampling method generates consistent textures for viewpoints that are close to the initial viewpoint ${ \pmb v } _ { 0 }$ , such as the nearby viewpoint ${ \pmb v } _ { 5 }$ . However, as the viewpoint moves further away from $v _ { 0 }$ , variations in texture properties begin to appear, and at the opposite viewpoint ${ \pmb v } _ { 9 }$ , the texture properties have completely changed. In contrast, when the depth-aware T2I model is fine-tuned using five resampled texture images from viewpoints adjacent to ${ \pmb v } _ { 0 }$ with performance preservation loss, the model fits to the distribution of the resampled textures, leading to noticeable improvements in consistency.
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
(a) Effects of resampling
|
| 372 |
+
(b)Effects of training with resampled textures
|
| 373 |
+
|
| 374 |
+

|
| 375 |
+
(c) Effects of adaptive view refinement
|
| 376 |
+
|
| 377 |
+

|
| 378 |
+
Figure 11: Ablation studies. The illustration highlights the effectiveness of the key components of TexTailor. As each component is applied, the textures of various objects become increasingly consistent across multiple viewpoints, demonstrating improved texture quality regardless of the object type.
|
| 379 |
+
|
| 380 |
+
Effects of adaptive view refinement. When observing the object “a cappuccino”, transitioning from ${ \pmb v } _ { 1 1 }$ to ${ \pmb v } _ { 1 2 }$ on the left part reveals an issue where the bottom of the cup is generated incorrectly. Since there is no texture information from the previous viewpoint, the model generates the top of the cappuccino instead of the bottom. However, by using the adaptive view refinement technique on the right part, an intermediate viewpoint $( v _ { 1 3 } )$ is automatically added. This not only provides the texture information from $v _ { 1 1 }$ to guide a more natural texture synthesis but also eliminates the need for the tedious process of manually configuring optimal camera positions.
|
| 381 |
+
|
| 382 |
+
# A.4 LIMITATIONS
|
| 383 |
+
|
| 384 |
+
TexTailor faces several limitations. First, the overall texture quality heavily relies on the quality of the five images used to fine-tune the depth-aware T2I diffusion model. Even with the resampling method, certain object angles, even from viewpoints close to the initial one, may still produce textures with inconsistent properties or images misaligned with the depth condition. This reliance on suboptimal training images can sometimes degrade texture quality rather than enhance it. Additionally, patterns frequently observed in viewpoints near the initial one often repeat across the object, leading to unrealistic and repetitive textures. For instance, in the case of an alarm clock, the clock hands learned from the initial viewpoint might appear as texture patterns on the sides or even the back. Furthermore, TexTailor’s fine-tuning process is time-intensive, requiring approximately an hour and a half per 3D mesh on an NVIDIA TITAN RTX. Finally, LPIPS does not adequately capture consistency across multiple viewpoints due to spatial misalignments in overlapping sections between adjacent views. To address these limitations, integrating lightweight fine-tuning approaches
|
| 385 |
+
|
| 386 |
+
such as LoRA (Hu et al., 2021) and developing improved metrics for measuring consistency between arbitrary pairs of views offer promising directions for future work.
|
| 387 |
+
|
| 388 |
+
# A.5 HIGHLIGHTING DIFFERENCES: A ZOOMED-IN VIEW
|
| 389 |
+
|
| 390 |
+

|
| 391 |
+
Text2Tex
|
| 392 |
+
Figure 12: Zoomed-in qualitative comparisons between TexTailor and the baseline Text2Tex The red boxes highlight regions where visual differences in texture consistency and quality are more apparent, helping to illustrate the effectiveness of TexTailor in preserving texture properties and minimizing artifacts.
|
| 393 |
+
|
| 394 |
+
We aim to enhance the clarity of the qualitative comparisons between TexTailor and the baseline Text2Tex by providing zoomed-in patches for four challenging cases (“a sushi,” “a hammer,” “a minivan,” and “a desk chair”) where visual differences are harder to discern in the qualitatve comparison sections(Sec. 5 and Sec. 8).
|
| 395 |
+
|
| 396 |
+
# A.6 ABLATION STUDY ON THE THRESHOLD $\beta$
|
| 397 |
+
|
| 398 |
+
We compare our results in Tab. 3 by varying the threshold $\beta$ value from Eq. 12. For this experiment, we randomly select 100 meshes from the Objaverse dataset, ensuring no overlapping categories among the 400 meshes, and evaluate them using FID and LPIPS metrics. When the threshold is set too low (e.g., 0.25), the information for the keep region is not properly reflected, resulting in lower scores. Conversely, when the threshold is set too high (e.g., 0.75), objects tend to be painted in overly fragmented parts rather than as cohesive units. This intensifies the gradual shift effect, also leading to lower scores. Based on these observations, we set $\beta$ to 0.5, a balanced value, for all experiments in this paper.
|
| 399 |
+
|
| 400 |
+
Table 3: Quantitative effect of varying threshold $\beta$ on the adaptive view refinement technique.
|
| 401 |
+
|
| 402 |
+
<table><tr><td>β</td><td>0.25</td><td>0.5</td><td>0.75</td></tr><tr><td>LPIPS ↓</td><td>8.99464</td><td>8.99176</td><td>8.99468</td></tr><tr><td>FID ↓</td><td>58.567</td><td>57.799</td><td>59.503</td></tr></table>
|
paper_markdowns/bamboo-03271.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-03283.md
ADDED
|
@@ -0,0 +1,490 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# TOWARDS SYNERGISTIC PATH-BASED EXPLANATIONS FOR KNOWLEDGE GRAPH COMPLETION: EXPLO-RATION AND EVALUATION
|
| 2 |
+
|
| 3 |
+
Tengfei Ma1 Xiang Song2 Wen Tao1 Mufei $\mathbf { L i ^ { 3 } }$ Jiani Zhang2 Xiaoqin Pan1 Yijun Wang1 Bosheng Song1 Xiangxiang Zeng1,∗
|
| 4 |
+
|
| 5 |
+
1College of Computer Science and Electronic Engineering, Hunan University
|
| 6 |
+
|
| 7 |
+
2Amazon AWS AI 3Georgia Institute of Technology
|
| 8 |
+
|
| 9 |
+
tfma@hnu.edu.cn xiangsx@amazon.com xzeng@hnu.edu.cn
|
| 10 |
+
|
| 11 |
+
# ABSTRACT
|
| 12 |
+
|
| 13 |
+
Knowledge graph completion (KGC) aims to alleviate the inherent incompleteness of knowledge graphs (KGs), a crucial task for numerous applications such as recommendation systems and drug repurposing. The success of knowledge graph embedding (KGE) models provokes the question about the explainability: “Which the patterns of the input KG are most determinant to the prediction?” Particularly, path-based explainers prevail in existing methods because of their strong capability for human understanding. In this paper, based on the observation that a fact is usually determined by the synergy of multiple reasoning chains, we propose a novel explainable framework, called KGExplainer, to explore synergistic pathways. KGExplainer is a model-agnostic approach that employs a perturbation-based greedy search algorithm to identify the most crucial synergistic paths as explanations within the local structure of target predictions. To evaluate the quality of these explanations, KGExplainer distills an evaluator from the target KGE model, allowing for the examination of their fidelity. We experimentally demonstrate that the distilled evaluator has comparable predictive performance to the target KGE. Experimental results on benchmark datasets demonstrate the effectiveness of KGExplainer, achieving a human evaluation accuracy of $8 3 . 3 \%$ and showing promising improvements in explainability. Code is available at https://github.com/xiaomingaaa/KGExplainer.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Knowledge graph completion (KGC) aims to infer missing facts and tackles the incompleteness of knowledge graphs (KGs) (Akrami et al., 2020), which has been widely used to support various applications including recommendation (Wang et al., 2019a; Yang et al., 2022; Wang et al., 2022), sponsored search (Lin et al., 2022), and drug discovery (Ma et al., 2023; Bang et al., 2023; Pan et al., 2022). Most KGC models utilize knowledge graph embedding (KGE) methods to map KG elements into multi-dimensional vectors (Nguyen et al., 2023; Song et al., 2023). These vectors are commonly used as features for downstream tasks and input into scoring functions for predicting missing links. KGE methods have been shown to achieve more powerful predictive performance than traditional models and can be easily scaled to large graphs (Ali et al., 2021; Zheng et al., 2020). However, current KGE methods make black-box predictions without providing explanations, hindering their deployment in risk-sensitive scenarios (Wang et al., 2022; Zhang et al., 2023).
|
| 18 |
+
|
| 19 |
+
To address the aforementioned limitation, the idea of adversarial modifications is adopted to find the key facts, which identify the facts to include or exclude from the KG and monitor their prediction score change in the perturbed KG (Pezeshkpour et al., 2018; Rossi et al., 2022; Betz et al., 2022). These methods can provide discrete evidence, which is insufficient to completely explain why the model makes such a prediction (Zhang et al., 2023). To capture the coherent reasoning chains for target predictions, some researchers extract possible logical rules by leveraging the known facts
|
| 20 |
+
|
| 21 |
+
within the KG (Zhang et al., 2019; Sadeghian et al., 2019; Arakelyan et al., 2021). The mined rules are usually represented as paths, which can give the basis of decision-making and enhance the transparency of the prediction model. Besides, a line of work adopts reinforcement learning to identify the next node step-by-step and form a reasoning chain by designing a reward model (Xian et al., 2019; Bhowmik & de Melo, 2020; Jiang et al., 2023). Apart from them, more recent approaches prefer relying on graph neural networks and introducing pruning mechanisms, learning an edge scorer to search for valid paths as explanations (Zhang et al., 2023; Chang et al., 2024).
|
| 22 |
+
|
| 23 |
+
Despite the fruitful progress and the popular trend toward path-based explainers, generating multiple synergistic paths for complex queries has not been discussed. For example, as shown in Figure 1a, Alibaba can be identified as a competitor of JD.com over a complex $\mathrm { K G ^ { 1 } }$ when given the synergistic facts: both Alibaba and JD.com invest in retail in China. In addition, for the prediction that the drug Acetaminophen decreases the serum concentration of drug Warfarin (Figure 1b), the explainers need to provide multiple synergistic paths simultaneously to describe the facts: Acetaminophen inhibits the activity of the enzymes that metabolize Warfarin, thus bringing a decrease in the serum concentration of Warfarin.
|
| 24 |
+
|
| 25 |
+
Additionally, for the identified explanations, we cannot directly verify their rationality due to the ground truth is unavailable. Previous methods focused more on model faithfulness (Pezeshkpour et al., 2018; Xian et al., 2019) or manual verification of small-scale facts case by case (Zhang et al., 2021), ignoring the quantitative assessment of model explainability.
|
| 26 |
+
|
| 27 |
+
Based on the above observations, we propose KGExplainer to explore synergistic path-based explanations for KGC tasks and provide
|
| 28 |
+
|
| 29 |
+
an effective evaluation. KGExplainer is a post-hoc explainable model performed on the trained KGEs, which searches for single or multiple path-based reasoning chains. We first perform a modelagnostic greedy search approach to identify important paths and distill an explanation evaluator from target KGEs to measure the correlation between explanations and predictions. Then we evaluate the fidelity (Wu et al., 2023) of the identified synergistic paths by measuring whether the original prediction can be maintained based on the explored explanations.
|
| 30 |
+
|
| 31 |
+
To the best of our knowledge, we are the first to approach the explanations of KGE-based KGC models from a novel perspective by emphasizing and evaluating synergistic paths. Besides, we propose an evaluation strategy to quantitatively assess the effectiveness of synergistic path-based explanations by distilling an evaluator to examine their fidelity. Extensive experiments and human evaluation on benchmarks demonstrate the effectiveness and efficiency of KGExplainer.
|
| 32 |
+
|
| 33 |
+
# 2 RELATED WORKS
|
| 34 |
+
|
| 35 |
+
Knowledge Graph Completion. KGC aims to address the invariable incompleteness of knowledge graphs (KGs) by identifying missing interactions between entities. Previous rule-based methods (Sadeghian et al., 2019; Arakelyan et al., 2021) mine logical rules iteratively based on pretrained embeddings of KGEs during the training process. These methods provide reasoning chains for prediction, which enhance the model’s transparency. Knowledge graph embedding (KGE) models map KG elements to multi-dimensional vectors and define a scoring function to infer new
|
| 36 |
+
|
| 37 |
+
facts, showing superior performance and scalability over rule-based methods for predicting missing links (Zhang et al., 2022; Wang et al., 2023; Gregucci et al., 2023). Specifically, the translational models, TransE (Bordes et al., 2013a) and its extensions (Wang et al., 2014; Lin et al., 2015), represent relations and entities as embedding vectors and treat the relation as the translation from head entities to tail entities. In another aspect, the bilinear models, RESCAL (Nickel et al., 2011) and its variants (Trouillon et al., 2016; Yang et al., 2015), represent relations with matrices and combine the head and tail entities by sequentially multiplying head embedding, relation matrix, and tail embedding. To effectively infer various relation patterns or properties (e.g., symmetry and inversion) over complex KGs, RotatE (Sun et al., 2019) represents each relation as a rotation operation from the source entity to the target entity in the complex vector space. Although these KGE models are successful in predicting unknown facts, they are limited in lacking transparency, blocking researchers from developing trustworthy models. To address the above limitations, we propose KGExplainer to enhance the explainability of KGE-based KGC models.
|
| 38 |
+
|
| 39 |
+
Explainability in KGC. To increase the transparency of models in KGC tasks, researchers have developed various explainable models (Wang et al., 2022; Huang et al., 2022; Zhang et al., 2023; Yao et al., 2023). Learning rules as the explanations from KGs has been studied extensively in inductive logic programming (Galarraga et al., 2013; Qu et al., 2021; Ho et al., 2018). To improve ´ the explainability of KGE methods, CRIAGE (Pezeshkpour et al., 2018), Kelpie (Rossi et al., 2022), and KE-X (Zhao et al., 2023) search for the isolated key edges to explain the target prediction by approximately evaluating the impact of removing an existing fact from the KG on prediction score. However, discrete edges can not form a complete reasoning chain. To explore path-based explanations, PGPR (Xian et al., 2019) and ELEP (Bhowmik & de Melo, 2020) have adopted a reinforcement learning approach to predict tail entities and take the reasoning path between the head and tail entities as the evidence. PaGE-Link (Zhang et al., 2023) proposed a path-based explainable method for the graph neural network-based KGC tasks, providing valid reasoning chains. To provide enough evidence for the decision-making complex scenario, we propose KGExplainer to explore synergistic paths and form a connected subgraph as an explanation.
|
| 40 |
+
|
| 41 |
+
# 3 PRELIMINARY
|
| 42 |
+
|
| 43 |
+
KGE-based KGC. We define a knowledge graph (KG) as a labeled directed graph $\mathcal { G } = ( \nu , \mathcal { R } , \mathcal { E } ) =$ $\{ \langle h , r , t \rangle | h , t \in \mathcal { V } , r \in \mathcal { R } , ( h , t ) \in \mathcal { E } \}$ where each triple represents a relation $r$ between the head entity $h$ and tail entity $t$ . Most KGs are incomplete. Knowledge graph completion (KGC) leverages existing facts in the KG to infer missing ones. Currently, the KGC method adopts deep learning techniques to learn the embeddings of KG elements. Intuitively, knowledge graph embeddings (KGEs) contain the semantic information of the original KG and can be used to predict new links. Generally, the KGE-based models define a score function $\phi$ to estimate the plausibility of triples and optimize the vectorized embeddings by maximizing the scores of existing facts. For the incomplete triple $\langle h , r , ? \rangle$ , the KGE models find the missing tail entity $t$ with best scores as follows:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
t = \underset {v \in \mathcal {V}} {\operatorname {a r g m a x}} \phi (h, r, v). \tag {1}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
The head entity prediction for the unknown links like $\langle ? , r , t \rangle$ can be defined analogously. In the following sections, we mostly refer to tail entity prediction for simplicity. All our methods can be applied to head entity prediction.
|
| 50 |
+
|
| 51 |
+
Enclosing Subgraph. Based on GraIL (Teru et al., 2020), when given a KG $\mathcal { G }$ and a link $\langle h , r , t \rangle$ for tail prediction, we extract an enclosing subgraph surrounding the target link to represent the relevant patterns for model’s decision. Initially, we obtain the $k$ -hop neighboring entities $\mathcal { N } _ { k } ( h ) =$ $\{ s | d ( h , \bar { s } ) \le k \}$ and $\mathcal { N } _ { k } ( t ) = \{ s | d ( t , s ) \le \dot { k } \}$ for both $h$ and $t$ , where $d ( \cdot , \cdot )$ is the shortest path distance between the entity pair on $\mathcal { G }$ . We then obtain the set of entities $V = \{ s | s \in \mathcal { N } _ { k } ( h ) \cap \mathcal { N } _ { k } ( t ) \}$ as vertices of the enclosing subgraph. Finally, we extract the edges $E$ linked by the set of entities $V$ from $\mathcal { G }$ as the $k$ -hop enclosing subgraph $g = ( V , E )$ .
|
| 52 |
+
|
| 53 |
+
# 4 THE KGEXPLAINER FRAMEWORK
|
| 54 |
+
|
| 55 |
+
Problem Formulation. Given a fact $\langle h , r , t \rangle$ , KGExplainer investigates the explanation that intuitively consists of the most critical synergistic path patterns featuring $h$ that allow KGE mod-
|
| 56 |
+
|
| 57 |
+

|
| 58 |
+
Figure 2: The KGExplainer framework comprises three modules: (a) Pre-training KGE models on the target KG ; (b) Exploring synergistic path-based explanations for pre-trained KGE models by greedy search ; (c) Distilling an evaluator from pre-trained KGE to assess the fidelity of explored explanations quantitatively.
|
| 59 |
+
|
| 60 |
+
els to predict tail $t$ . For instance, when explaining why the top ranking tail for the missing fact ⟨Donald T rump, nationality, $\mathord { ? } \mathord { \rangle }$ is $U S A$ , KGExplainer searches for the smallest key paths between Donald Trump and USA, allowing the model to predict the same ranking of USA. Specifically, KGExplainer aims to find a connected subgraph (i.e., multiple synergistic paths) $g _ { k e y }$ that is most influential to the target prediction $\langle h , r , t \rangle$ , and removing the other irrelevant facts do not affect the model’s prediction. We can define this process as follows:
|
| 61 |
+
|
| 62 |
+
$$
|
| 63 |
+
g _ {k e y} = \underset {\tilde {g} \in g _ {s u b}} {\operatorname {a r g m a x}} D (g, \tilde {g}) \tag {2}
|
| 64 |
+
$$
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\text {s u b j e c t} \Delta (f (g), f (\tilde {g})) = \min _ {\hat {g} \in g _ {s u b}} \Delta (f (g), f ^ {\prime} (\hat {g})) \tag {3}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $g$ is the original enclosing subgraph , $g _ { s u b }$ denotes the all possible connected subgraphs from $h$ to $t$ within $g . f ( \cdot )$ and $f ^ { \prime } ( \cdot )$ represent the original and retrained KGE models. $D ( g , \tilde { g } )$ represents the structure similarity between $g$ and $\tilde { g }$ , and also indicates the sparsity of explanations (see Section 5.4).
|
| 71 |
+
|
| 72 |
+
# 4.1 PRE-TRAINING KGE.
|
| 73 |
+
|
| 74 |
+
In this paper, we developed the KGExplainer as a post-hoc explanation method for KGE-based KGC models by exploring synergistic paths (i.e., connected subgraph). To effectively learn semantic knowledge within the complex KG, we adopt the state-of-the-art RotatE (Sun et al., 2019) as the target KGE. Specifically, given a triple $\langle h , r , t \rangle$ , we adopt a score function and expect that the embedding of head entity $h$ is similar to the embedding of tail entity $t$ by rotating it over the relation $r$ . By maximizing the scores of positive triples and minimizing the scores of negative ones, we can obtain the pre-trained entity and relation embeddings (Figure 2a). Theoretically, KGExplainer is model-agnostic and can be applied to any KGE-based model with a score function. We designed experiments to verify the effectiveness of KGExplainer on various KGE models, the details can be found in Section 5.3.
|
| 75 |
+
|
| 76 |
+
# 4.2 EXPLANATION EXPLORATION.
|
| 77 |
+
|
| 78 |
+
Greedy Search for Key Synergistic Paths. As shown in Figure 2b, given a predicted link $\langle h , r , t \rangle$ for the prediction of tail entity $t$ , we developed a greedy search algorithm based on a perturbation mechanism to search for crucial paths as the explanations. We first extract the enclosing subgraph $g$ around the target link, which contains informative interactions for such prediction. To identify the most important paths influencing the prediction within $g$ , we search all entities in $g$ and measure their importance to capture key ones. Specifically, we remove each entity and its adjacent from $g$ and retrain2 the target KGE on the perturbed subgraph $g ^ { \prime }$ . Then we measure the score change of
|
| 79 |
+
|
| 80 |
+
the target link using the original and retrained embedding as the entity importance. The more the score changes, the more critical an entity is. To ensure that the key entities obtained from the $k$ - hop enclosing subgraph $g$ lead to a single connected component, we search the key entities from the head $h$ and tail $t$ hop by hop. We first remove each 1-hop neighbor entity of $h$ and measure their importance to identify the top important entities. After getting the top- $n$ important entities $\mathrm { v } _ { 1 } ^ { n }$ from 1-hop neighbor entities, we then search the one-hop neighboring entities of $\mathrm { v } _ { 1 } ^ { n }$ analogously for important two-hop neighbors $\mathrm { v } _ { 2 } ^ { n }$ . We repeat this one-hop search process until reaching the tail entity $t$ of the target link. As a result, we capture a set of the $k$ -hop key neighboring entities $\mathbf { v } ^ { n } =$ $\{ \mathbf { v } _ { 1 } ^ { n } , \cdots , \mathbf { v } _ { k } ^ { n } \}$ and construct a connected subgraph for multiple synergistic paths as the explanation. We provide a detailed Algorithm in Appendix A.1.
|
| 81 |
+
|
| 82 |
+
Retraining Strategy for Importance Assessment. To effectively obtain the score changes of target facts based on the KGE models, we designed a retraining strategy to capture the new embedding on the perturbed KG. Since each entity perturbation only makes minor changes over the entire KG, retraining the embeddings over the revised KG is infeasible when $\mathcal { G }$ has millions of entities and facts. To focus on the relevant patterns and reduce the overhead of the retraining, we introduce a subgraph-based retraining strategy. We extract the enclosing subgraph $g$ of the target fact $\langle h , r , t \rangle$ and expand $g$ by including the 1-hop neighbors $\mathcal { N } _ { e x t e n d }$ of the existing entities, which constructs a new subgraph $g _ { e x t e n d }$ . Then we retrain the embeddings of the KG elements on $g _ { e x t e n d }$ to make the calculation of score changes effective. To keep the overall entity and relation embeddings of $g$ within the same representation space of $\mathcal { G }$ , we alleviate the following constraints: (1) We initialize the embeddings of the entities in $g _ { e x t e n d }$ with the pre-trained embeddings from $\mathcal { G }$ ; (2) We fix the relation embeddings in $g _ { e x t e n d }$ as the same as those in $\mathcal { G }$ ; (3) We fix the embeddings of entities $v \in \mathcal { N } _ { e x t e n d }$ . By using the retraining strategy, KGExplainer can effectively capture the target fact’s score change and efficiently search for key subgraphs. More details can be found in Appendix A.2.
|
| 83 |
+
|
| 84 |
+
# 4.3 EVALUATOR DISTILLATION
|
| 85 |
+
|
| 86 |
+
Why Subgraph Evaluator? Evaluating the quality of identified synergistic paths is essential. However, the ground truth explanations are unavailable, making it difficult to achieve that objective. To evaluate the quality of explanations, we introduce a hypothesis that a perfect explanation should retain the key context of target prediction and can still maintain the predicted score (Wu et al., 2023). Thus, an effective idea is to verify that the explored explanations can still obtain the target prediction. However, the base KGEs implicitly have access to the entire graph and only score one triple, which can not compute the prediction based on multiple synergistic paths. To address this limitation, we design a subgraph evaluator by distilling a relational graph neural network (GNN) from pre-trained KGEs for KGC. Given a pre-trained KGE-based KGC model $\phi ( h , r , t )$ , we aim to train a subgraph evaluator to replicate the predictive performance of the target KGE and evaluate the subgraph structures of explanations. During training, the GNN is optimized to predict the facts from their complete enclosing subgraphs. Once trained, the explored explanations as connected subgraphs can be fed into the evaluator and evaluate the fidelity of multiple synergistic paths (i.e., the connected subgraph).
|
| 87 |
+
|
| 88 |
+
How to get Subgraph Evaluator? Given a link $\langle h , r , t \rangle$ , we develop a score function $Z ( h , r , t )$ with a $L$ -layer relational graph attention neural network (R-GAT) on its enclosing subgraph $g$ to score it based on the local substructure representation. The update function of the entities in the $l$ -th layer is defined as:
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbf {x} _ {i} ^ {l} = \sum_ {r \in \mathcal {R}} \sum_ {j \in \mathcal {N} _ {r} (i)} \alpha_ {(i, r, j)} \mathbf {W} _ {r} ^ {l} \Phi \left(\mathbf {e} _ {r} ^ {l - 1}, \mathbf {x} _ {j} ^ {l - 1}\right), \tag {4}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\alpha_ {(i, r, j)} = \mathrm {s i g m o i d} \left(\mathbf {W} _ {1} \left[ \mathbf {x} _ {i} ^ {l - 1} \oplus \mathbf {x} _ {j} ^ {l - 1} \oplus \mathbf {e} _ {r} ^ {l - 1} \right]\right),
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where $\mathbf { e } _ { r } ^ { l }$ and $\mathbf { x } _ { i } ^ { l }$ represent the $l$ -th layer embeddings of relation $r$ and entity $i$ . $\alpha _ { ( i , r , j ) }$ and $\mathcal { N } _ { r } ( i )$ denote the weight and neighbors of entity $i$ under the relation $r$ , respectively. $\oplus$ is the concatenation operation. $\mathbf { W } _ { r } ^ { l }$ represents the transformation matrix of relation $r$ , and $\Phi$ is the aggregation operation to fuse the hidden features of entities and relations. Finally, we obtain the global representation $\mathbf { X } _ { s u b }$ of the subgraph $g$ as follows:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
\mathbf {X} _ {s u b} = \frac {1}{| V |} \sum_ {i \in V} f \left(\mathbf {x} _ {i} ^ {L}\right), \tag {5}
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
where $V$ is the entity set of the enclosing subgraph $g$ . After obtaining the global representation $\mathbf { X } _ { s u b }$ , we define a linear layer to score the target link as follows:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
Z (h, r, t) = \mathbf {W} ^ {T} \mathbf {X} _ {s u b}, \tag {6}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $\mathbf { W } ^ { T }$ is a transform matrix.
|
| 111 |
+
|
| 112 |
+
To optimize the subgraph evaluator, inspired by Gou et al. (2021), we adopt the insights of knowledge distillation and consider the predictions of the pre-trained KGE-based KGC model as soft labels. Meanwhile, to enhance the model’s ability to rank candidate entities, we introduce a regularization term that encourages maximizing the margin between the scores for positive and negative samples. The objective for the optimization of this evaluator is defined as follows:
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\min \sum_ {(h, r, t) \in \mathcal {G}} \| \phi (h, r, t) - Z (h, r, t) \| ^ {2} + \lambda L (h, r, t), \tag {7}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where the first term is a score alignment objective. The second term is a pair-wise loss , which is defined by negative sampling:
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
L (h, r, t) = - Z (h, r, t) + \frac {1}{N} \sum_ {n = 1} ^ {N} Z (h, r, v _ {n}), \tag {8}
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
where $N$ denotes the number of negative samples and $v _ { n }$ is uniformly drawn from $\nu$ . By minimizing the above optimization objective, we can obtain an effective subgraph scoring function with powerful predictive performance and evaluation capabilities for synergistic path-based explanations.
|
| 125 |
+
|
| 126 |
+
# 4.4 SCALABILITY OF KGEXPLAINER
|
| 127 |
+
|
| 128 |
+
The computation complexity of finding explanations using KGExplainer is related to two parts: 1) the size of enclosing subgraph $g$ and 2) the number of entities that require importance evaluation.
|
| 129 |
+
|
| 130 |
+
Proposition 1 Given $\mathcal { G } = ( \nu , \mathcal { R } , \mathcal { E } )$ , a predicted fact $\langle h , r , t \rangle$ , the maximum length of paths $L$ , and the number of paths $N$ , the size of $g$ is $\begin{array} { r } { O ( \frac { L N | \mathcal { V } | } { | \mathcal { E } | } ) } \end{array}$ and the size of $\mathcal { N } _ { e x t e n d }$ is $O ( L N )$ .
|
| 131 |
+
|
| 132 |
+
Given $h$ and $t$ , the maximum number of edges within paths is $L * N$ . The probability of an entity $v \in \mathcal V$ in an edge $e \in { \mathcal { E } }$ is $\frac { 2 | \nu | } { | \mathcal { E } | }$ . Thus, the size of $g$ is bounded by $L N * { \frac { 2 | \nu | } { | \varepsilon | } }$ , i.e., $\begin{array} { r } { O ( \frac { L N | \mathcal { V } | } { | \mathcal { E } | } ) } \end{array}$ ( LN |V| ). The number of entities in $\mathcal { N } _ { e x t e n d }$ is $\frac { 2 L N | \mathcal { V } | } { | \mathcal { E } | } * \frac { 2 | \mathcal { E } | } { | \mathcal { V } | }$ , i.e., $O ( L N )$ .
|
| 133 |
+
|
| 134 |
+
Proposition 2 Given $\mathcal { G } = ( \nu , \mathcal { R } , \mathcal { E } )$ , a predicted fact $\langle h , r , t \rangle$ , the maximum length of paths $L$ and the maximum number of entities per hop in an explanation $K$ . The maximum number of entities to evaluate is $\begin{array} { r } { ( 1 + ( L - 2 ) K ) ( \frac { 2 | \mathcal { E } | } { | \mathcal { V } | } ) } \end{array}$ .
|
| 135 |
+
|
| 136 |
+
Following Algorithm 1 in Appendix A.1, the average number of entities to evaluate is $d$ in the first hop, 0 in the last hop, and $K * d$ in the intermediate hops, where $\begin{array} { r } { d = \frac { 2 | \mathcal { E } | } { | \mathcal { V } | } } \end{array}$ is the average degree of an entity. Thus, the total number of entities to evaluate is $\begin{array} { r } { ( 1 + ( L - 2 ) K ) ( \frac { 2 | \mathcal { E } | } { | \mathcal { V } | } ) } \end{array}$ .
|
| 137 |
+
|
| 138 |
+
Here, we conclude that the average computation complexity of finding the explanation for a predicted fact $\langle h , r , t \rangle$ is only related to the maximum length of paths $L$ , the maximum number of paths $N$ , and the average degree of an entity in KG, which is not related to the size of $\mathcal { G }$ . Thus, in theory, KGExplainer can balance the computational complexity by adjusting the size of enclosing subgraphs. Besides, KGExplainer can scale to large KGs with a small average degree. More details refer to Appendix A.3.
|
| 139 |
+
|
| 140 |
+
# 5 EXPERIMENT
|
| 141 |
+
|
| 142 |
+
In this section, we evaluate the proposed KGExplainer by considering the following key research questions: Q1 Can KGExplainer perform comparable faithfulness and explore informative explanations? Q2 Can KGExplainer work well with different sizable explainable subgraphs and various KGE methods? Q3 Is KGExplainer efficient in exploring explanations? We provide more implementation details of KGExplainer and baselines in Appendix B. More additional experiments are shown in Appendix C.
|
| 143 |
+
|
| 144 |
+
# 5.1 EXPERIMENTAL SETTINGS
|
| 145 |
+
|
| 146 |
+
Datasets. We conduct experiments on three widely used datasets for the KGC task. Specifically, OGB-biokg is a large-scale KG from OGB project (Hu et al., 2021), which contains millions of facts and is created from a large number of biomedical data repositories. The Family-rr (Sadeghian et al., 2019) is a dataset that contains the bloodline relationships between individuals of various families. FB15k-237 (Bordes et al., 2013b) is a subset of Freebase (Bollacker et al., 2008), which is a largescale knowledge graph containing general facts. For every dataset, we split it into training and test subsets for the following evaluations of faithfulness and explainability. The detailed statistics of all datasets are shown in Appendix B.1.1.
|
| 147 |
+
|
| 148 |
+
Faithful Metrics. The evaluation of KGC models is performed by running head and tail predictions on each triple in the test set. For each prediction, the ground truth is ranked against all the other entities V. Without loss of generality, for tail prediction, this corresponds to:
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\operatorname {t a i l R a n k} (h, r, t) = | \{v \in \mathcal {V} | \phi (h, r, v) > = \phi (h, r, t) \} |. \tag {9}
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
Following Kadlec et al. (2017), we adopt $H i t s @ N$ to quantify the predictive performance of KGE and distilled models. Hits@N is the fraction of ranks $S _ { r a n k }$ with value $\leq N$ :
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
H i t s @ N = \frac {\left| \left\{s _ {i} \in S _ {r} : s _ {i} \leq N \right\} \right|}{\left| S _ {r} \right|}, \tag {10}
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
where $s _ { i }$ is the ranking of $i$ -th candidate entity and $S _ { r }$ is a set of rankings for all candidate entities. Following the method proposed by Kadlec et al. (2017), we focus on the Hits@1 metric to better highlight model differences. Based on the designed metrics, we report the mean and variance for five runs.
|
| 161 |
+
|
| 162 |
+
Explainable Metrics. As the ground truth explanations of KGC tasks are usually missing, it is not easy to quantitatively evaluate the quality of explanations. We consider explanations to be sufficient if they allow preserving the KGC performance (Akrami et al., 2020; Wang et al., 2021; Wu et al., 2023). Thus we define the Recall@N and $F 1 @ N$ as the metrics to evaluate the effectiveness of explored explanations. Specifically, Recall@N measures the fidelity of explanatory subgraphs by feeding them into the distilled model and examining how well they recover the target predictive rankings. Given the rankings of tested facts by forwarding their explanations to the distilled evaluator, we calculate the Recall@N as follows:
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\operatorname {R e c a l l} @ N = \frac {\left| \left\{s _ {i} \in S _ {r} : s _ {i} \leq N \right\} \cap \left\{s _ {j} \in S _ {r} ^ {e x p} : s _ {j} \leq N \right\} \right|}{\left| \left\{s _ {i} \in S _ {r} : s _ {i} \leq N \right\} \right|}, \tag {11}
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
where $S _ { r } ^ { e x p }$ is the ranking set of explanations and $S _ { r }$ denotes the original predictive rankings of them. We can assess the trustworthiness of explanations by calculating the recovery rate of the rankings $S _ { r }$ . Meanwhile, the synergistic path-based explanations are critical in the precision of rankings (i.e., $H i t s @ N )$ , to comprehensively evaluate the explainability of KGExplainer, we define $F 1 @ N$ to balance the recall and precision of the explored explanations:
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
H i t s @ N = \frac {\left| \left\{s _ {j} \in S _ {r} ^ {e x p} : s _ {j} \leq N \right\} \right|}{\left| S _ {r} ^ {e x p} \right|}, F 1 @ N = \frac {2 \cdot \text {R e c a l l} @ N \cdot \text {H i t s} @ N}{\text {R e c a l l} @ N + \text {H i t s} @ N}. \tag {12}
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
Finally, we consider $N \in \{ 1 , 3 , 1 0 \}$ for the qualitative metrics to emphasize the performance discrepancy.
|
| 175 |
+
|
| 176 |
+
Table 1: The predictive performance of KGE and the distilled models on $\hat { H } i t s @ 1 ( \% )$ metric.
|
| 177 |
+
|
| 178 |
+
<table><tr><td>Methods</td><td>OGB-biokg</td><td>Family-rr</td><td>FB15k-237</td></tr><tr><td>TransE</td><td>11.32 (0.22)</td><td>12.63 (0.09)</td><td>41.86 (0.43)</td></tr><tr><td>KGExp-TransE</td><td>10.40 (0.25)</td><td>15.77 (0.11)</td><td>40.99 (0.31)</td></tr><tr><td>DistMult</td><td>16.11 (0.06)</td><td>8.680 (0.27)</td><td>10.26 (0.21)</td></tr><tr><td>KGExp-DistMult</td><td>14.04 (0.11)</td><td>9.881 (0.14)</td><td>13.09 (0.32)</td></tr><tr><td>RotatE</td><td>17.12 (0.19)</td><td>39.08 (0.45)</td><td>42.10 (0.51)</td></tr><tr><td>KGExp-RotatE</td><td>17.33 (0.12)</td><td>35.79 (0.06)</td><td>39.28 (0.29)</td></tr></table>
|
| 179 |
+
|
| 180 |
+
Baselines. To verify the performance of KG-Explainer in exploring explanations, we compare it against subgraph-based (i.e., a batch of discrete facts) methods CRIAGE (Pezeshkpour et al., 2018) and Kelpie (Rossi et al., 2022), and path-based DRUM (Sadeghian et al., 2019), ELEP (Bhowmik & de Melo, 2020), and PaGE-Link (Zhang et al., 2023). The sources of subgraph-based models KGEx (Baltatzis & Costabello, 2024) and KE-X (Zhao et al., 2023) are unavailable now, so we exclude them as our baselines.
|
| 181 |
+
|
| 182 |
+
Furthermore, we design variants of KGExplainer: KGExp-Rand randomly selected some connective paths between head and tail entities to construct an explainable subgraph, which allows an ablation study. KGExp-TransE, KGExp-DistMult, and KGExp-RotatE are variants of KGExplainer that consider TransE (Bordes et al., 2013b), DistMult (Yang et al., 2015), and RotatE(Sun et al., 2019) as the base KGE, respectively. For convenience, we denote KGExplainer as KGExp.
|
| 183 |
+
|
| 184 |
+
# 5.2 PERFORMANCE OF FAITHFULNESS AND EXPLAINABILITY
|
| 185 |
+
|
| 186 |
+
In response to Q1, we analyze the performance of KGExplainer from faithfulness and explainability. Besides, we provide a human evaluation on Family-rr dataset.
|
| 187 |
+
|
| 188 |
+
Faithfulness Evaluation. An important goal of explainability models is to accurately and comprehensively represent the local decisionmaking structure of the target model. Specifically, in the context of KGE models, KGExplainer should strive to replicate their behavior as closely as possible (Zhang et al., 2021). Thus, to answer Q1, we compare the predictive performance of KGExplainer and the target KGE models. As shown in Table 1, we observe that KGExplainer achieves nearly the same performance on the KGC task compared with the target KGE models (e.g., the performance of KGExp-TransE and TransE on FB15k-237 dataset). Furthermore, we observe that RotatE overall achieves the best performance for KGC and similarly KGExp-RotatE shows superior predictive performance and the best recovery rate among the distilled models, which brings greater credibility than others, supporting that KGExplainer is faithful to target KGE and is reliable in replicating the target KGE. Thus, we chose the RotatE as the target KGE model and distilled a powerful evaluator based on the subgraph substructure around the target link to assess the explainability. In Table 1, we can see that KGExplainer benefits the base model for some datasets. We observe the same behavior in (Deng & Zhang, 2020; Jiao et al., 2019). From their insights, we think the KGExplainer
|
| 189 |
+
|
| 190 |
+
Table 2: The $F 1 @ 1 ( \% )$ performance of explanations over various datasets. The boldface denotes the highest score and the underline indicates the best baseline.
|
| 191 |
+
|
| 192 |
+
<table><tr><td>Methods</td><td>OGB-biokg</td><td>Family-rr</td><td>FB15k-237</td></tr><tr><td>CRIAGE</td><td>50.03 (0.09)</td><td>20.75 (0.32)</td><td>40.99 (0.21)</td></tr><tr><td>Kelpie</td><td>49.32 (0.16)</td><td>20.33 (0.23)</td><td>36.64 (0.13)</td></tr><tr><td>DRUM</td><td>62.56 (0.23)</td><td>21.26 (0.09)</td><td>65.53 (0.19)</td></tr><tr><td>ELEP</td><td>63.44 (0.21)</td><td>22.75 (0.17)</td><td>70.11 (0.21)</td></tr><tr><td>PaGE-Link</td><td>68.29 (0.19)</td><td>21.89 (0.13)</td><td>66.12 (0.14)</td></tr><tr><td>KGExp-Rand</td><td>54.32 (0.43)</td><td>19.16 (0.26)</td><td>55.17 (0.23)</td></tr><tr><td>KGExp-TransE</td><td>81.97 (0.13)</td><td>30.47 (0.25)</td><td>82.04 (0.33)</td></tr><tr><td>KGExp-DistMult</td><td>82.33 (0.03)</td><td>30.49 (0.24)</td><td>84.29 (0.17)</td></tr><tr><td>KGExp-RotatE</td><td>85.21 (0.11)</td><td>29.52 (0.12)</td><td>83.65 (0.14)</td></tr></table>
|
| 193 |
+
|
| 194 |
+
Table 3: The $R e c a l l @ 1 ( \% )$ performance of explanations over various datasets. We mark the best score with bold font and mark the best baseline with underline.
|
| 195 |
+
|
| 196 |
+
<table><tr><td>Methods</td><td>OGB-biokg</td><td>Family-rr</td><td>FB15k-237</td></tr><tr><td>CRIAGE</td><td>58.75 (0.07)</td><td>28.57 (0.33)</td><td>68.23 (0.43)</td></tr><tr><td>Kelpie</td><td>60.32 (0.22)</td><td>27.62 (0.39)</td><td>60.01 (0.27)</td></tr><tr><td>DRUM</td><td>69.87 (0.14)</td><td>16.20 (0.21)</td><td>87.88 (0.22)</td></tr><tr><td>ELEP</td><td>76.23 (0.25)</td><td>29.84 (0.18)</td><td>85.58 (0.29)</td></tr><tr><td>PaGE-Link</td><td>77.69 (0.15)</td><td>27.14 (0.31)</td><td>85.13 (0.09)</td></tr><tr><td>KGExp-Rand</td><td>54.61 (0.55)</td><td>26.98 (0.49)</td><td>50.37 (0.19)</td></tr><tr><td>KGExp-TransE</td><td>88.37 (0.21)</td><td>34.61 (0.43)</td><td>92.07 (0.33)</td></tr><tr><td>KGExp-DistMult</td><td>89.77 (0.11)</td><td>34.60 (0.13)</td><td>91.67 (0.11)</td></tr><tr><td>KGExp-RotatE</td><td>88.65 (0.08)</td><td>33.02 (0.11)</td><td>91.45 (0.09)</td></tr></table>
|
| 197 |
+
|
| 198 |
+
distilled from KGEs may remove some noise and irrelevant information to the KGC task, making KGExplainer more robust and having better generalization ability, which leads to KGExplainer performing better than base KGEs to some extent. Based on these observations, the effectiveness of the distilled evaluator is demonstrated empirically.
|
| 199 |
+
|
| 200 |
+
Explainability Evaluation. It is essential to assess objectively how good an explanation is for KGExplainer. Unfortunately, similar to other explanation methods, evaluating explanations is made difficult by the impossibility of collecting ground truth explanations. To fairly evaluate explanations without ground truth and answer Q1, we distill an evaluator and design two metrics $F 1 @ 1$ and Recall@1 to quantify how trusty an explanation is. As shown in Table 2 and Table 3, we reported the $F 1 @ 1$ and Recall@1 results compared with baselines on three wide-used datasets $( F 1 @ [ 3 , 1 0 ]$ and Recall@[3, 10] are reported in Appendix C.2). Specifically, KGExplainer improves the $F 1 @ 1$ and Recall@1 by at least $1 6 . 9 2 \%$ and $1 2 . 0 8 \%$ respectively on the OGB-biokg dataset and achieves $7 . 7 4 \%$ and $4 . 7 7 \%$ absolute increase over the best baseline on the Family-rr dataset. Meanwhile, the performance of KGExplainer on the FB15k-237 dataset has yielded $1 3 . 5 4 \%$ and $4 . 1 9 \%$ gains in $F 1 @ 1$ and Recall@1 compared with the baselines.
|
| 201 |
+
|
| 202 |
+
Furthermore, we have the following observations: (1) Compared with the subgraph-based methods CRIAGE and Kelpie, the path-based explainability methods DRUM, ELEP, and PaGE-link that
|
| 203 |
+
|
| 204 |
+
utilize reasonable paths between source and target entities achieve better performance, which indicates that the connecting paths are important for the model explanation. (2) Compared with the path-based explainability models ELEP and PaGE-Link, synergistic path-based KGExplainer (e.g., KGExp-RotatE) performs better than them on all datasets, demonstrating that the multiple synergistic path-based patterns are more effective than paths and multiple disconnected facts.
|
| 205 |
+
|
| 206 |
+
(3) For an ablation study, KGExp-Rand, which adopts randomly sampled subgraphs connected to the source and target entities as the explanations, yields significantly inferior performance compared with other KGExplainer variants. This demonstrates that KGExplainer indeed identifies semantically meaningful connected subgraph explanations for model predictions, which are superior to randomly sampled subgraphs by a large margin. This may be because the KGExplainer based on target KGEs can explore synergistic reasonable paths that are crucial to predicting the corresponding facts, and the randomly sampled subgraph may contain irrelevant information with missing key patterns to the predicted facts. The overall performance compared with the baselines demonstrates that KGExplainer effectively explores and evaluates informative explanations.
|
| 207 |
+
|
| 208 |
+
Human Evaluation Following Zhang et al. (2023), we conduct a human evaluation by randomly picking 20 predicted links from the test set of Family-rr and generating explanations for each link using a subgraph-based model (i.e., Kelpie), two path-based methods (i.e., DRUM and PaGE-Link), and KGExplainer. We designed a survey with single-choice questions. In each question, we represent the predicted link and those four explanations with both the graph structure and the node/edge type information, similarly as in Figure 3 but excluding method names. We sent the survey to people across graduate students, PhD students, and professors, including people with and without background knowledge about KGs. We ask respondents to “please select the best explanation
|
| 209 |
+
|
| 210 |
+
of Why the model predicts this relationship b etween source and target nodes?”. At least three answers from different people are collected for each question. In total 78 evaluations were collected each question. In total 78 evaluations were collected and $8 3 . 3 \%$ (65/78) of them selected explanations by KGExplainer as the best. The survey demon- ns by KGExplainer as the best. The survey demonstrates that KGExplainer is more effective in searching for human-understandable explanations than rching forhuman-understandable explanations than other methods. More details refer to Appendix B.2. B.2.
|
| 211 |
+
|
| 212 |
+
# 5.3 ROBUSTNESS OF KGEXPLAINER (Q2)
|
| 213 |
+
|
| 214 |
+
In this section, to answer Q2, we conduct the r obustness analysis on the Family-rr dataset to study the impact of different sizable explored subgrap hs and various KGE-based KGC models.
|
| 215 |
+
|
| 216 |
+
Size of Synergistic Path-based explanations. To investigate the influence of different sizable pathbased explanations, we conduct experiments based on KGExp-RotatE by varying $n$ to 1, 2, and 3. The KGExplainer explored synergistic paths with $n = 1$ is equal to exploring a single explainable path. As illustrated in the left of Figure 4, we observe the best performance on $F 1 @ 1$ and Recall@1 metrics when utilizing the explainable paths with $n = 2$ . Meanwhile, the performance across different sizes collapsed into a hunchback shape. The reason could be that the explored synergistic paths with $n = 1$ are inefficient in recovering the original predictions and the subgraph patterns
|
| 217 |
+
|
| 218 |
+

|
| 219 |
+
Please select the best explanation of “Why the model
|
| 220 |
+
predicts this relationship between source and target nodes?”
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
|
| 228 |
+

|
| 229 |
+
Figure 3: The explanations explored by Kelpie, DRUM, PaGE-Link, and KGExplainer on the fact $\langle i d : 2 , i s F a t h e r , i d : 5 \rangle$ .
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 4: The explainable performance of KG-Explainer with different hyper-parameters over Family-rr dataset.
|
| 233 |
+
|
| 234 |
+
with $n = 3$ may contain many irrelevant facts, which introduce much noise and reduce the performance of KGExplainer. This suggests that KGExplainer maintains comparable performance under different sizable synergistic paths.
|
| 235 |
+
|
| 236 |
+
KGExplainer over various KGE-based KGC models. We investigate the impact of different target KGEs, including TransE, DistMult, and RotatE. As shown on the right side of Figure 4, the results indicate that KGExplainer achieves similar levels of explanation performance across $F 1 @ 1$ and Recall@1 for different variants. This is because KGExplainer selects key entities by perturbing neighboring entities and evaluating their influence on the prediction score, which is independent of the KGE-based KGC models. Our findings show that KGExplainer is effective in searching explanations for embedding-based models and is model-agnostic, as demonstrated by its performance across various KGEs.
|
| 237 |
+
|
| 238 |
+
# 5.4 EFFICIENCY ANALYSIS (Q3)
|
| 239 |
+
|
| 240 |
+
Inference Time. We trained KGExplainer and baselines using a server with 12 virtual Intel(R) Xeon(R) Platinum 8255C CPU and one RTX 2080 Ti GPU. To verify the effectiveness of KG-Explainer in searching for explanations, we designed an experiment to evaluate KGExplainer. As illustrated in Table 4, we show the average cost time of exploring explanations over the test sets of all datasets from different methods. We find that KGExplainer has a similar cost to CRIAGE and is more efficient than PaGE-Link and Kelpie, which indicates that KGExplainer can be effectively extended to complex KGs in searching synergistic path-based explanations. This is because KGExplainer searches explanations within the enclosing subgraph and the number of calculations for each hop is only related to the average degree, which reduces the computational complexity of the exploring process. Overall, KGExplainer has superiority in exploring synergistic path-based explanations with complex patterns, which can scale to large knowledge graphs.
|
| 241 |
+
|
| 242 |
+
# Sparsity of Explanations
|
| 243 |
+
|
| 244 |
+
We discuss the sparsity of the explanations from various explainers. For KGExplainer and baseline methods, we adopt the average number of edges (i.e., #edge) as the size of explanations. For KGExplainer, the users can adjust the sparsity of explanation subgraphs by selecting different top-$n$ nodes per hop (Refer to Section 4.2). As shown in Table 5, we observe that the pathbased method (e.g., PaGE-Link) exploring a coherent reasoning chain with fewer facts is more efficient than the subgraphbased method (e.g., Keplie). Additionally, KGExplainer exploring multiple synergistic paths can achieve superior performance on comparable sparse explanations than the path-based method. The phenomenon in Table 5 shows that KGExplainer can yield better explainability on explanations with low information density.
|
| 245 |
+
|
| 246 |
+
Table 4: The average cost time (s) of exploring explanations for various methods. Ours shows comparable efficiency.
|
| 247 |
+
|
| 248 |
+
<table><tr><td></td><td>CRIAGE</td><td>Kelpie</td><td>PaGE-Link</td><td>Ours</td></tr><tr><td>Family-rr</td><td>1.65</td><td>4.84</td><td>1.74</td><td>1.32</td></tr><tr><td>OGB-biokg</td><td>121.67</td><td>183.24</td><td>257.35</td><td>157.28</td></tr><tr><td>FB15k-237</td><td>15.13</td><td>28.51</td><td>16.93</td><td>16.81</td></tr></table>
|
| 249 |
+
|
| 250 |
+
Table 5: The sparsity and corresponding performance of different explainers. Ours indicates KGExplainer shows superior sparsity.
|
| 251 |
+
|
| 252 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">Family-rr</td><td colspan="2">OGB-biokg</td><td colspan="2">FB15k-237</td></tr><tr><td>#edge</td><td>F1@1</td><td>#edge</td><td>F1@1</td><td>#edge</td><td>F1@1</td></tr><tr><td>Keplie</td><td>8.297</td><td>20.33</td><td>37.58</td><td>49.32</td><td>11.19</td><td>36.64</td></tr><tr><td>PaGE-Link</td><td>3.085</td><td>21.89</td><td>12.87</td><td>68.29</td><td>4.993</td><td>66.12</td></tr><tr><td>Ours (n=1)</td><td>3.182</td><td>28.77</td><td>9.751</td><td>79.28</td><td>5.142</td><td>75.67</td></tr><tr><td>Ours (n=2)</td><td>9.782</td><td>30.47</td><td>45.27</td><td>81.97</td><td>13.66</td><td>82.04</td></tr><tr><td>Ours (n=3)</td><td>15.13</td><td>30.49</td><td>112.3</td><td>80.33</td><td>26.14</td><td>83.21</td></tr></table>
|
| 253 |
+
|
| 254 |
+
# 6 CONCLUSION
|
| 255 |
+
|
| 256 |
+
In this work, we proposed a KGExplainer to identify synergistic paths as explanations over complex KGs and design two quantitative metrics for evaluating them. Specifically, KGExplainer used a greedy search algorithm and distilled an evaluator to find and assess key paths. Extensive experiments demonstrate that KGExplainer is effective in providing meaningful explanations. In the future, we will generalize our framework into multiple domains, including but not limited to AI for chemical and biological applications.
|
| 257 |
+
|
| 258 |
+
# ACKNOWLEDGEMENT
|
| 259 |
+
|
| 260 |
+
The work was supported by the National Natural Science Foundation of China (U22A2037, 62272151, 62122025, 62425204, 62450002 and 62432011), the National Science and Technology Major Project (2023ZD0120902), Hunan Provincial Natural Science Foundation of China (2022JJ20016), The science and technology innovation Program of Hunan Province (2022RC1099), and the Beijing Natural Science Foundation (L248013).
|
| 261 |
+
|
| 262 |
+
# REFERENCES
|
| 263 |
+
|
| 264 |
+
Farahnaz Akrami, Mohammed Samiul Saeef, Qingheng Zhang, Wei Hu, and Chengkai Li. Realistic re-evaluation of knowledge graph completion methods: An experimental study. In Proceedings of the 2020 ACM SIGMOD International Conference on Management of Data, pp. 1995–2010, 2020.
|
| 265 |
+
Mehdi Ali, Max Berrendorf, Charles Tapley Hoyt, Laurent Vermue, Mikhail Galkin, Sahand Sharifzadeh, Asja Fischer, Volker Tresp, and Jens Lehmann. Bringing light into the dark: A large-scale evaluation of knowledge graph embedding models under a unified framework. IEEE Transactions on Pattern Analysis and Machine Intelligence, 44(12):8825–8845, 2021.
|
| 266 |
+
Erik Arakelyan, Daniel Daza, Pasquale Minervini, and Michael Cochez. Complex query answering with neural link predictors. In International Conference on Learning Representations, pp. 1–14, 2021.
|
| 267 |
+
Vasileios Baltatzis and Luca Costabello. Kgex: Explaining knowledge graph embeddings via subgraph sampling and knowledge distillation. In Learning on Graphs Conference, pp. 27–1. PMLR, 2024.
|
| 268 |
+
Dongmin Bang, Sangsoo Lim, Sangseon Lee, and Sun Kim. Biomedical knowledge graph learning for drug repurposing by extending guilt-by-association to multiple layers. Nature Communications, 14(1):3570, 2023.
|
| 269 |
+
Patrick Betz, Christian Meilicke, and Heiner Stuckenschmidt. Adversarial explanations for knowledge graph embeddings. In Proceedings of the Thirty-First International Joint Conference on Artificial Intelligence, IJCAI-22, pp. 2820–2826, 2022.
|
| 270 |
+
Rajarshi Bhowmik and Gerard de Melo. Explainable link prediction for emerging entities in knowledge graphs. In The Semantic Web–ISWC 2020: 19th International Semantic Web Conference, pp. 39–55, 2020.
|
| 271 |
+
Kurt Bollacker, Colin Evans, Praveen Paritosh, Tim Sturge, and Jamie Taylor. Freebase: A collaboratively created graph database for structuring human knowledge. In Proceedings of the 2008 ACM SIGMOD International Conference on Management of Data, pp. 1247–1250, 2008. ISBN 9781605581026.
|
| 272 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. Translating embeddings for modeling multi-relational data. Advances in Neural Information Processing Systems, 26:1–9, 2013a.
|
| 273 |
+
Antoine Bordes, Nicolas Usunier, Alberto Garcia-Duran, Jason Weston, and Oksana Yakhnenko. ´ Translating embeddings for modeling multi-relational data. In Proceedings of the 26th International Conference on Neural Information Processing Systems, pp. 2787–2795, 2013b.
|
| 274 |
+
Heng Chang, Jiangnan Ye, Alejo Lopez Avila, Jinhua Du, and Jia Li. Path-based explanation for knowledge graph completion. arXiv preprint arXiv:2401.02290, 2024.
|
| 275 |
+
Xiang Deng and Zhongfei Zhang. Can students outperform teachers in knowledge distillation based model compression? 2020.
|
| 276 |
+
Luis Antonio Galarraga, Christina Teflioudi, Katja Hose, and Fabian Suchanek. Amie: association´ rule mining under incomplete evidence in ontological knowledge bases. In Proceedings of the 22nd international conference on World Wide Web, pp. 413–422, 2013.
|
| 277 |
+
|
| 278 |
+
Jianping Gou, Baosheng Yu, Stephen J Maybank, and Dacheng Tao. Knowledge distillation: A survey. International Journal of Computer Vision, 129:1789–1819, 2021.
|
| 279 |
+
Cosimo Gregucci, Mojtaba Nayyeri, Daniel Hernandez, and Steffen Staab. Link prediction with ´ attention applied on multiple knowledge graph embedding models. In Proceedings of the ACM Web Conference 2023, pp. 2600–2610, 2023.
|
| 280 |
+
Zhen Han, Peng Chen, Yunpu Ma, and Volker Tresp. Explainable subgraph reasoning for forecasting on temporal knowledge graphs. In International Conference on Learning Representations, 2020.
|
| 281 |
+
Vinh Thinh Ho, Daria Stepanova, Mohamed H Gad-Elrab, Evgeny Kharlamov, and Gerhard Weikum. Rule learning from knowledge graphs guided by embedding models. In The Semantic Web–ISWC 2018: 17th International Semantic Web Conference, pp. 72–90, 2018.
|
| 282 |
+
Weihua Hu, Matthias Fey, Hongyu Ren, Maho Nakata, Yuxiao Dong, and Jure Leskovec. OGB-LSC: A large-scale challenge for machine learning on graphs. In Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), 2021. URL https://openreview. net/forum?id=qkcLxoC52kL.
|
| 283 |
+
Jiacheng Huang, Yao Zhao, Wei Hu, Zhen Ning, Qijin Chen, Xiaoxia Qiu, Chengfu Huo, and Weijun Ren. Trustworthy knowledge graph completion based on multi-sourced noisy data. In Proceedings of the ACM Web Conference 2022, pp. 956–965, 2022.
|
| 284 |
+
Hao Jiang, Chuanzhen Li, Juanjuan Cai, and Jingling Wang. Rcenr: A reinforced and contrastive heterogeneous network reasoning model for explainable news recommendation. In Proceedings of the 46th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 1710–1720, 2023.
|
| 285 |
+
Xiaoqi Jiao, Yichun Yin, Lifeng Shang, Xin Jiang, Xiao Chen, Linlin Li, Fang Wang, and Qun Liu. Tinybert: Distilling bert for natural language understanding. International Conference on Machine Learning and Natural Language Processing, 2019.
|
| 286 |
+
Unmesh Joshi and Jacopo Urbani. Searching for embeddings in a haystack: link prediction on knowledge graphs with subgraph pruning. In Proceedings of The Web Conference 2020, pp. 2817–2823, 2020.
|
| 287 |
+
Rudolf Kadlec, Ondrej Bajgar, and Jan Kleindienst. Knowledge base completion: Baselines strike back. In Proceedings of the 2nd Workshop on Representation Learning for NLP, pp. 69–74, August 2017.
|
| 288 |
+
Su-Chin Lin, Kai-Hsiang Chou, Yen Chen, Hsu-Chun Hsiao, Darion Cassel, Lujo Bauer, and Limin Jia. Investigating advertisers’ domain-changing behaviors and their impacts on ad-blocker filter lists. In Proceedings of the ACM Web Conference 2022, pp. 576–587, 2022.
|
| 289 |
+
Yankai Lin, Zhiyuan Liu, Maosong Sun, Yang Liu, and Xuan Zhu. Learning entity and relation embeddings for knowledge graph completion. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 29, pp. 1–7, 2015.
|
| 290 |
+
Tengfei Ma, Xuan Lin, Bosheng Song, Philip S. Yu, and Xiangxiang Zeng. Kg-mtl: Knowledge graph enhanced multi-task learning for molecular interaction. IEEE Transactions on Knowledge and Data Engineering, 35(7):7068–7081, 2023.
|
| 291 |
+
Trung-Kien Nguyen, Zemin Liu, and Yuan Fang. Link prediction on latent heterogeneous graphs. In Proceedings of the ACM Web Conference 2023, pp. 263–273, 2023.
|
| 292 |
+
Maximilian Nickel, Volker Tresp, Hans-Peter Kriegel, et al. A three-way model for collective learning on multi-relational data. In International Conference on Machine Learning, volume 11, pp. 3104482–3104584, 2011.
|
| 293 |
+
Xiaoqin Pan, Xuan Lin, Dongsheng Cao, Xiangxiang Zeng, Philip S Yu, Lifang He, Ruth Nussinov, and Feixiong Cheng. Deep learning for drug repurposing: Methods, databases, and applications. Wiley Interdisciplinary Reviews: Computational Molecular Science, 12(4):e1597, 2022.
|
| 294 |
+
|
| 295 |
+
Adam Paszke, Sam Gross, Soumith Chintala, Gregory Chanan, Edward Yang, Zachary DeVito, Zeming Lin, Alban Desmaison, Luca Antiga, and Adam Lerer. Automatic differentiation in pytorch. 2017.
|
| 296 |
+
Pouya Pezeshkpour, Yifan Tian, and Sameer Singh. Investigating robustness and interpretability of link prediction via adversarial modifications. In North American Chapter of the Association for Computational Linguistics, pp. 1–12, 2018.
|
| 297 |
+
Meng Qu, Junkun Chen, Louis-Pascal Xhonneux, Yoshua Bengio, and Jian Tang. Rnnlogic: Learning logic rules for reasoning on knowledge graphs. International Conference on Learning Representations, pp. 1–20, 2021.
|
| 298 |
+
Andrea Rossi, Donatella Firmani, Paolo Merialdo, and Tommaso Teofili. Explaining link prediction systems based on knowledge graph embeddings. In Proceedings of the 2022 International Conference on Management of Data, pp. 2062–2075, 2022.
|
| 299 |
+
Ali Sadeghian, Mohammadreza Armandpour, Patrick Ding, and Daisy Zhe Wang. Drum: End-toend differentiable rule mining on knowledge graphs. Advances in Neural Information Processing Systems, 32:1–13, 2019.
|
| 300 |
+
Xiran Song, Jianxun Lian, Hong Huang, Zihan Luo, Wei Zhou, Xue Lin, Mingqi Wu, Chaozhuo Li, Xing Xie, and Hai Jin. xgcn: An extreme graph convolutional network for large-scale social link prediction. In Proceedings of the ACM Web Conference 2023, pp. 349–359, 2023.
|
| 301 |
+
Zhiqing Sun, Zhi-Hong Deng, Jian-Yun Nie, and Jian Tang. Rotate: Knowledge graph embedding by relational rotation in complex space. In ICLR, pp. 1–18, 2019.
|
| 302 |
+
Komal Teru, Etienne Denis, and Will Hamilton. Inductive relation prediction by subgraph reasoning. In International Conference on Learning Representations, pp. 9448–9457, 2020.
|
| 303 |
+
Theo Trouillon, Johannes Welbl, Sebastian Riedel, ´ Eric Gaussier, and Guillaume Bouchard. Com- ´ plex embeddings for simple link prediction. In International Conference on Machine Learning, pp. 2071–2080, 2016.
|
| 304 |
+
Chenxu Wang, Xin Wang, Zhao Li, Zirui Chen, and Jianxin Li. Hyconve: A novel embedding model for knowledge hypergraph link prediction with convolutional neural networks. In Proceedings of the ACM Web Conference 2023, pp. 188–198, 2023.
|
| 305 |
+
Hongwei Wang, Miao Zhao, Xing Xie, Wenjie Li, and Minyi Guo. Knowledge graph convolutional networks for recommender systems. In The World Wide Web Conference, pp. 3307–3313, 2019a.
|
| 306 |
+
Minjie Wang, Da Zheng, Zihao Ye, Quan Gan, Mufei Li, Xiang Song, Jinjing Zhou, Chao Ma, Lingfan Yu, Yu Gai, Tianjun Xiao, Tong He, George Karypis, Jinyang Li, and Zheng Zhang. Deep graph library: A graph-centric, highly-performant package for graph neural networks. arXiv preprint arXiv:1909.01315, 2019b.
|
| 307 |
+
Peng Wang, Renqin Cai, and Hongning Wang. Graph-based extractive explainer for recommendations. In Proceedings of the ACM Web Conference 2022, pp. 2163–2171, 2022.
|
| 308 |
+
Xiang Wang, Yingxin Wu, An Zhang, Xiangnan He, and Tat-Seng Chua. Towards multi-grained explainability for graph neural networks. Advances in Neural Information Processing Systems, 34:18446–18458, 2021.
|
| 309 |
+
Zhen Wang, Jianwen Zhang, Jianlin Feng, and Zheng Chen. Knowledge graph embedding by translating on hyperplanes. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 28, pp. 1112–1119, 2014.
|
| 310 |
+
Fang Wu, Siyuan Li, Lirong Wu, Dragomir Radev, Yinghui Jiang, Xurui Jin, Zhangming Niu, and Stan Z Li. Explaining graph neural networks via non-parametric subgraph matching. International Conference on Machine Learning, pp. 1–13, 2023.
|
| 311 |
+
Yikun Xian, Zuohui Fu, Shan Muthukrishnan, Gerard De Melo, and Yongfeng Zhang. Reinforcement knowledge graph reasoning for explainable recommendation. In Proceedings of the 42nd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 285–294, 2019.
|
| 312 |
+
|
| 313 |
+
Bishan Yang, Wen-tau Yih, Xiaodong He, Jianfeng Gao, and Li Deng. Embedding entities and relations for learning and inference in knowledge bases. International Conference on Learning Representations, pp. 1–12, 2015.
|
| 314 |
+
Yuhao Yang, Chao Huang, Lianghao Xia, and Chenliang Li. Knowledge graph contrastive learning for recommendation. In Proceedings of the 45th International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 1434–1443, 2022.
|
| 315 |
+
Liuyi Yao, Yaliang Li, Bolin Ding, Jingren Zhou, Jinduo Liu, Mengdi Huai, and Jing Gao. Pathspecific causal fair prediction via auxiliary graph structure learning. In Proceedings of the ACM Web Conference 2023, pp. 3680–3688, 2023.
|
| 316 |
+
Shichang Zhang, Jiani Zhang, Xiang Song, Soji Adeshina, Da Zheng, Christos Faloutsos, and Yizhou Sun. Page-link: Path-based graph neural network explanation for heterogeneous link prediction. In Proceedings of the ACM Web Conference 2023, pp. 3784–3793, 2023.
|
| 317 |
+
Wen Zhang, Bibek Paudel, Liang Wang, Jiaoyan Chen, Hai Zhu, Wei Zhang, Abraham Bernstein, and Huajun Chen. Iteratively learning embeddings and rules for knowledge graph reasoning. In The World Wide Web Conference, pp. 2366–2377, 2019.
|
| 318 |
+
Wen Zhang, Mingyang Chen, Zezhong Xu, Yushan Zhu, and Huajun Chen. Explaining knowledge graph embedding via latent rule learning. OpenReview.Net, 26:1–14, 2021.
|
| 319 |
+
Zhanqiu Zhang, Jie Wang, Jieping Ye, and Feng Wu. Rethinking graph convolutional networks in knowledge graph completion. In Proceedings of the ACM Web Conference 2022, pp. 798–807, 2022.
|
| 320 |
+
Dong Zhao, Guojia Wan, Yibing Zhan, Zengmao Wang, Liang Ding, Zhigao Zheng, and Bo Du. Ke-x: Towards subgraph explanations of knowledge graph embedding based on knowledge information gain. Knowledge-Based Systems, 278:110772, 2023.
|
| 321 |
+
Da Zheng, Xiang Song, Chao Ma, Zeyuan Tan, Zihao Ye, Jin Dong, Hao Xiong, Zheng Zhang, and George Karypis. Dgl-ke: Training knowledge graph embeddings at scale. In Proceedings of the 43rd International ACM SIGIR Conference on Research and Development in Information Retrieval, pp. 739–748, 2020.
|
| 322 |
+
|
| 323 |
+
Algorithm 1: Greedy search for subgraph explanation
|
| 324 |
+
Input: Target prediction $\langle h,r,t\rangle$ ; Enclosing subgraph $g$ ; Prediction score $s$ ; Subgraph extracting function $F_{sub}$ ; Score function $\phi$ ; Number of entities retrieved per hop $n$ ; Output: A key subgraph $g_{key}$ that is most critical to the target prediction $\langle h,r,t\rangle$ . Initialize a set of visited entities $S_{\text{visit}}$ as $\{h\}$ ; Initialize a set of key entities $S_{key}$ as $\{h\}$ ; Initialize a queue of searching entities $S_{\text{search}}$ as $\{h\}$ ; while $S_{\text{search}}$ is not empty do Initialize $H$ as an empty max-Heap; $e_{\text{searching}} \gets S_{\text{search}} \cdot \text{pop}$ ; if $t \in \mathcal{N}(e_{\text{searching}})$ then $S_{key} \gets S_{key} \cup \{t\}$ ; break; for $v \in \mathcal{N}(e_{\text{searching}})$ do if $u \notin S_{\text{visit}}$ then $S_{\text{visit}} \gets S_{\text{visit}} \cup \{u\}$ ; Create $g'$ by removing $u$ from $g$ and finetune the KG embeddings of $g'$ ; Get new embeddings of $h, r, t$ as $\mathbf{h}', \mathbf{r}', \mathbf{t}'$ ; $s' \gets \phi(\mathbf{h}', \mathbf{r}', \mathbf{t}')$ ; $\delta_v \gets s - s'$ ; Put $v$ into $H$ with its corresponding value $\delta_v$ ; for $i \gets 1$ to $n$ do Pop $v$ with the maximum $\delta_v$ from $H$ and put it into $S_{key}$ and $S_{\text{search}}$ ; $g_{key} \gets F_{\text{sub}}(g, S_{key})$ ; return $g_{key}$ ;
|
| 325 |
+
|
| 326 |
+
Table 6: The statistics of datasets.
|
| 327 |
+
|
| 328 |
+
<table><tr><td>Dataset</td><td>#entity</td><td>#relation</td><td>#train</td><td>#test</td></tr><tr><td>WN-18</td><td>40,943</td><td>18</td><td>35,354</td><td>2,250</td></tr><tr><td>Family-rr</td><td>3,007</td><td>12</td><td>5,868</td><td>2,835</td></tr><tr><td>FB15k-237</td><td>14,541</td><td>237</td><td>68,028</td><td>9,209</td></tr><tr><td>OGB-biokg</td><td>93,773</td><td>51</td><td>4,762,678</td><td>3000</td></tr></table>
|
| 329 |
+
|
| 330 |
+
# A KGEXPLAINER
|
| 331 |
+
|
| 332 |
+
# A.1 THE ALGORITHM OF GREEDY SEARCH
|
| 333 |
+
|
| 334 |
+
For easier understanding, we show a detailed algorithm to describe how KGExplainer provides key explanations in Algorithm 1.
|
| 335 |
+
|
| 336 |
+
# A.2 RETRAINING STRATEGY
|
| 337 |
+
|
| 338 |
+
Retraing the embeddings over the entire KG $\mathcal { G }$ is infeasible due to removing one entity and its facts have little impact on the embedding of KG elements. To reduce the overhead of retraining, we developed a subgraph-based retraining strategy as shown in Figure 5. We extract a 2-hop enclosing subgraph $g$ around the target fact $\langle h , r , t \rangle$ . We argue that the subgraph $g$ contains the key information that leads to the target prediction. Thus the retraining process is only visible to the subgraph. Figure 5 shows an example of how $g$ is extracted. Meanwhile, to ensure that the retrained entity representation space is consistent with the original knowledge graph, we expand $g$ by including the 1-hop neighbors $\mathcal { N } _ { e x t e n d }$ of the existing entities and fixed their embeddings. In Figure 5, we show the learnable and fixed entities in the fine-tuning process. Specifically, we adopt the following constraints: (a) we use the embeddings of the entities in $\mathcal { G }$ to initialize the embeddings of $g$ ; (b) we fixed the relation embeddings in $g$ as the same as those in $\mathcal { G }$ ; and (c) we fixed the embedding of $v \in \mathcal { N } _ { e x t e n d }$ .
|
| 339 |
+
|
| 340 |
+

|
| 341 |
+
Figure 5: An example of creating a subgraph from $\mathcal { G }$ . On the left, two entities (the orange vertices) were predicted to be connected. A subgraph was created on the right. We first initialized $g$ with all the entities (the orange and green vertices) within $\mathcal { G }$ . Then it was expanded by including the 1-hop neighbors $\mathcal { N } _ { e x t e n d }$ of existing entities (the gray vertices).
|
| 342 |
+
|
| 343 |
+

|
| 344 |
+
Figure 6: The $F 1 @ 1$ performance of KGExplainer on Family-rr and WN-18 over various sizable enclosing subgraphs.
|
| 345 |
+
|
| 346 |
+
# A.3 THE COMPUTATIONAL EFFICIENCY
|
| 347 |
+
|
| 348 |
+
The computational complexity of KGExplainer primarily arises from two factors: (1) the greedy search within $g$ , and (2) the re-training cost associated with $g$ . As discussed in Section 4.4, the complexity of the greedy search is largely determined by local parameters. The re-training cost, on the other hand, depends on the underlying KGE model The computational complexity of the retraining stage for different base KGEs, which is dominated by the size of subgraph $g$ (i.e., $\begin{array} { r } { O ( \frac { L N | \mathcal { V } | } { | \mathcal { E } | } ) } \end{array}$ discussed in Section 4.4), the embedding dimension $d$ , and the size of negative samples $n$ . Thus we can analyze the efficiency of base KGEs as follows:
|
| 349 |
+
|
| 350 |
+
• In TransE, DistMult, and RotatE, the computational efficiency of each fact within $g$ is $O ( ( n + 1 ) d )$ . Therefore, the overall complexity is $\begin{array} { r } { O ( \frac { L N | \mathcal { V } | } { | \mathcal { E } | } ( n + 1 ) d ) } \end{array}$ , where $L$ is the maximum path length, $N$ denotes the path number.
|
| 351 |
+
|
| 352 |
+
In conclusion, the practical runtime largely depends on the local parameters of the knowledge graphs. The results in Table 7 show a strong positive correlation between the number of paths and computation time, which aligns closely with our theoretical analysis. Therefore, we can improve the scalability of large knowledge graphs by adjusting these local parameters.
|
| 353 |
+
|
| 354 |
+
Table 7: The distribution of degree, path length, and path number over various KGs. Note that the analysis is conducted within local subgraphs (2-hop) of test set.
|
| 355 |
+
|
| 356 |
+
<table><tr><td>Datasets</td><td>avg. degree</td><td>avg. path length</td><td>avg. path number</td><td>avg. time</td></tr><tr><td>Family-rr</td><td>3.902</td><td>2.828</td><td>4.1</td><td>1.32</td></tr><tr><td>FB15k-237</td><td>9.357</td><td>4.195</td><td>50.054</td><td>16.81</td></tr><tr><td>OGB-biokg</td><td>101.579</td><td>3.982</td><td>457.234</td><td>157.28</td></tr></table>
|
| 357 |
+
|
| 358 |
+
# A.4 FORMALIZING THE CONCEPT OF PATH SYNERGY
|
| 359 |
+
|
| 360 |
+
We can formalize the concept of synergistic paths from an information-theoretic perspective.
|
| 361 |
+
|
| 362 |
+
Let:
|
| 363 |
+
|
| 364 |
+
• $( G = ( V , R , E ) )$ be a KG with entities $V$ , relations $R$ , and edges $E$ .
|
| 365 |
+
• $< h , r , t >$ denote the head entity, relation, and tail entity, respectively, forming the target prediction.
|
| 366 |
+
• $\mathcal { P } = \{ p _ { 1 } , p _ { 2 } , . . . , p _ { n } \}$ be a set of paths between $h$ and $t$ , where each $p _ { i }$ represents a sequence of edges from $h$ to $t$ .
|
| 367 |
+
|
| 368 |
+
We aim to quantify the synergy among paths in $\mathcal { P }$ by evaluating how much additional information these paths provide collectively toward the prediction $t$ , compared to the information provided by each path individually.
|
| 369 |
+
|
| 370 |
+
1. Mutual Information of Individual Paths: Define $I ( t ; p _ { i } )$ as the mutual information between the target prediction $t$ and a path $p _ { i }$ from $h$ to $t$ . This quantifies the amount of information that $p _ { i }$ alone contributes to the prediction of $t$ :
|
| 371 |
+
|
| 372 |
+
$$
|
| 373 |
+
I (t; p _ {i}) = H (t) - H (t | p _ {i}),
|
| 374 |
+
$$
|
| 375 |
+
|
| 376 |
+
where $H ( t )$ is the entropy of the target prediction $t$ , and $H ( t | p _ { i } )$ is the conditional entropy of $t$ given the information from path $p _ { i }$ .
|
| 377 |
+
|
| 378 |
+
2. Joint Mutual Information of Path Set: Let $I ( t ; \mathcal { P } _ { s y n e r g y } )$ represent the mutual information between $t$ and the subset of paths $\mathcal { P } _ { s y n e r g y } \subset \mathcal { P }$ , which includes multiple paths that contribute to the prediction. This joint mutual information measures the information provided by the paths in Psynergy $\mathcal { P } _ { s y n e r g y }$ when considered together:
|
| 379 |
+
|
| 380 |
+
$$
|
| 381 |
+
I (t; \mathcal {P} _ {s y n e r g y}) = H (t) - H (t | \mathcal {P} _ {s y n e r g y}).
|
| 382 |
+
$$
|
| 383 |
+
|
| 384 |
+
3. Synergy Condition: The paths in $\mathcal { P } _ { s y n e r g y }$ are considered synergistic if the joint mutual information $I ( t ; \mathcal { P } _ { s y n e r g y } )$ is greater than the sum of individual mutual informations $I ( t ; p _ { i } )$ for each $p _ { i } \in \mathcal { P } _ { s y n e r g y }$ :
|
| 385 |
+
|
| 386 |
+
$$
|
| 387 |
+
I (t; \mathcal {P} _ {s y n e r g y}) > \sum_ {p _ {i} \in \mathcal {P} _ {s y n e r g y}} I (t; p _ {i}).
|
| 388 |
+
$$
|
| 389 |
+
|
| 390 |
+
This inequality implies that the paths in $\mathcal { P } _ { s y n e r g y }$ provide *additional predictive information* about $t$ when considered together, beyond what each path contributes individually. This excess information captures the synergy among paths.
|
| 391 |
+
|
| 392 |
+
# 4. Interpretation and Optimization:
|
| 393 |
+
|
| 394 |
+
• The set $\mathcal { P } _ { s y n e r g y }$ can be identified as the subset of paths $\mathcal { P }$ from $h$ to $t$ that maximizes the synergistic mutual information I(t; Psynergy) − Ppi∈Psynergy $\begin{array} { r } { I ( t ; \mathcal { P } _ { s y n e r g y } ) - \sum _ { p _ { i } \in \mathcal { P } _ { s y n e r g y } } I ( t ; p _ { i } ) . } \end{array}$ .
|
| 395 |
+
• Formally, we can define the optimal synergistic path set $\mathcal { P } _ { s y n e r g y } ^ { * }$ as:
|
| 396 |
+
|
| 397 |
+
$$
|
| 398 |
+
\mathcal {P} _ {s y n e r g y} ^ {*} = \arg \max _ {\mathcal {P} ^ {\prime} \subseteq \mathcal {P}} \left(I (t; \mathcal {P} ^ {\prime}) - \sum_ {p _ {i} \in \mathcal {P} ^ {\prime}} I (t; p _ {i})\right).
|
| 399 |
+
$$
|
| 400 |
+
|
| 401 |
+
# B EXPERIMENTAL SETTINGS
|
| 402 |
+
|
| 403 |
+
# B.1 IMPLEMENTATION DETAILS
|
| 404 |
+
|
| 405 |
+
# B.1.1 DATASETS
|
| 406 |
+
|
| 407 |
+
We show detailed statistics of all datasets in Table 6. #train and #test are the number of triples on the training and testing sets.
|
| 408 |
+
|
| 409 |
+
Table 8: The hyperparameters of KGExplainer during distillation phase.
|
| 410 |
+
|
| 411 |
+
<table><tr><td></td><td>Family-rr</td><td>WN-18</td><td>FB15k-237</td><td>OGB-biokg</td></tr><tr><td>embedding dim</td><td>64</td><td>64</td><td>64</td><td>64</td></tr><tr><td>learning rate</td><td>0.0015</td><td>0.001</td><td>0.001</td><td>0.001</td></tr><tr><td>weight of pair-wise loss</td><td>0.5</td><td>0.5</td><td>0.5</td><td>0.5</td></tr><tr><td>Epochs</td><td>50</td><td>50</td><td>50</td><td>100</td></tr><tr><td>R-GAT layers</td><td>2</td><td>3</td><td>3</td><td>3</td></tr><tr><td>Optimizer</td><td>Adam</td><td>Adam</td><td>Adam</td><td>Adam</td></tr><tr><td>Batch size</td><td>1024</td><td>4096</td><td>4096</td><td>4096</td></tr><tr><td>#entity per hop n</td><td>2</td><td>2</td><td>2</td><td>2</td></tr><tr><td>enclosing subgraph size k</td><td>2</td><td>2</td><td>1</td><td>2</td></tr><tr><td>target KGE</td><td>TransE</td><td>RotatE</td><td>RotatE</td><td>RotatE</td></tr></table>
|
| 412 |
+
|
| 413 |
+
# B.1.2 DETAILS OF KGEXPLAINER
|
| 414 |
+
|
| 415 |
+
The experiments contain (1) Generating subgraph-based explanations, and (2) Distilling the subgraph evaluator for assessment.
|
| 416 |
+
|
| 417 |
+
In the explanation phase, we extract key subgraphs from the 2-hop enclosing subgraph surrounding the target prediction. We set $n = 2$ to determine the number of selected entities per hop during greedy searching. To achieve the best evaluation capability, we distill an evaluator from RotatE Sun et al. (2019) to assess explainability (See Section 5.2). More settings of hyperparameters are shown in Table 8. In the distilling phase, to ensure sufficient expressive power for the model to distill, we tune the hyperparameters to get the optimal distilled model. The details of hyperparameters are depicted in Table 8.
|
| 418 |
+
|
| 419 |
+
# B.1.3 DETAILS OF BASELINES
|
| 420 |
+
|
| 421 |
+
We implement our KGExplainer and baseline models in Pytorch Paszke et al. (2017) and DGL Wang et al. (2019b) library on an RTX 2080Ti GPU with 11GB memory. For the implementation of baselines, we use the source code of Kelpie Rossi et al. (2022) to reproduce the faithful results and explore explanations of fact-based methods CRIAGE Pezeshkpour et al. (2018) and Kelpie. For other baselines, we adopt the source code reported by their original paper and use their pre-defined parameters to produce explanations. In addition to comparing against baselines with no parameter settings for certain datasets, we also examine the parameters used in a similar scale dataset. We report the average results and their standard deviation by five runs in Section 5.
|
| 422 |
+
|
| 423 |
+
# B.2 DETAILS OF HUMAN EVALUATION
|
| 424 |
+
|
| 425 |
+
For valuable human evaluations, we consider the following guidance for participants:
|
| 426 |
+
|
| 427 |
+
• We give two bases for judgment as a guide when asking participants questions. 1. In Family-rr, for predicting the kinship between two individuals, the explanation should be based on the known family memberships, marital relationships, etc. reasonably derived. 2. Encourage testers to choose more concise and clear explanations, while maintaining completeness. Avoid overly complex explanations so that key information can be presented clearly.
|
| 428 |
+
• The results from different models are presented to the participants simultaneously
|
| 429 |
+
• We randomly selected 20 samples from the test set of Family-rr for participants to evaluate.
|
| 430 |
+
|
| 431 |
+
# C ADDITIONAL EXPERIMENTS
|
| 432 |
+
|
| 433 |
+
# C.1 PERFORMANCE ON VARIOUS SIZABLE ENCLOSING SUBGRAPHS
|
| 434 |
+
|
| 435 |
+
Similar to the experiments in Section 5.3 (i.e., Hyper-parameter Sensitivity Analysis), we conduct another experiment to study the model’s explainability on various sizable enclosing subgraphs. We
|
| 436 |
+
|
| 437 |
+
Table 9: The $F 1 @ N ( \% )$ performance of explanations over various datasets. The boldface denotes the highest score.
|
| 438 |
+
|
| 439 |
+
<table><tr><td></td><td colspan="2">Family-rr</td><td colspan="2">WN-18</td><td colspan="2">FB15k-237</td><td colspan="2">OGB-biokg</td></tr><tr><td></td><td>F1@3</td><td>F1@10</td><td>F1@3</td><td>F1@10</td><td>F1@3</td><td>F1@10</td><td>F1@3</td><td>F1@10</td></tr><tr><td>CRIAGE</td><td>27.22</td><td>36.44</td><td>72.91</td><td>77.78</td><td>48.81</td><td>53.26</td><td>54.27</td><td>61.62</td></tr><tr><td>Keplie</td><td>27.18</td><td>36.25</td><td>73.58</td><td>79.39</td><td>40.77</td><td>48.01</td><td>52.59</td><td>61.21</td></tr><tr><td>DRUM</td><td>25.23</td><td>30.73</td><td>75.58</td><td>77.80</td><td>67.34</td><td>71.03</td><td>65.87</td><td>72.54</td></tr><tr><td>ELPE</td><td>75.69</td><td>79.27</td><td>78.35</td><td>83.21</td><td>29.71</td><td>40.40</td><td>67.41</td><td>71.65</td></tr><tr><td>PaGE-Link</td><td>28.42</td><td>38.49</td><td>70.99</td><td>75.21</td><td>70.77</td><td>76.51</td><td>71.32</td><td>77.58</td></tr><tr><td>KGExp-rand</td><td>27.55</td><td>41.48</td><td>37.43</td><td>40.46</td><td>61.03</td><td>66.58</td><td>56.47</td><td>59.39</td></tr><tr><td>KGExp-TransE</td><td>45.89</td><td>62.96</td><td>98.57</td><td>99.58</td><td>85.41</td><td>89.97</td><td>84.22</td><td>88.37</td></tr><tr><td>KGExp-DistMult</td><td>44.08</td><td>57.47</td><td>97.89</td><td>99.41</td><td>86.74</td><td>90.17</td><td>84.35</td><td>89.73</td></tr><tr><td>KGExp-RotatE</td><td>39.56</td><td>57.25</td><td>98.58</td><td>99.57</td><td>87.41</td><td>92.97</td><td>86.97</td><td>90.04</td></tr></table>
|
| 440 |
+
|
| 441 |
+
Table 10: The $R e c a l l @ N ( \% )$ performance of explanations over various datasets. The boldface denotes the highest score.
|
| 442 |
+
|
| 443 |
+
<table><tr><td></td><td colspan="2">Family-rr</td><td colspan="2">WN-18</td><td colspan="2">FB15k-237</td><td colspan="2">OGB-biokg</td></tr><tr><td></td><td>Recall@3</td><td>Recall@10</td><td>Recall@3</td><td>Recall@10</td><td>Recall@3</td><td>Recall@10</td><td>Recall@3</td><td>Recall@10</td></tr><tr><td>CRIAGE</td><td>32.02</td><td>36.95</td><td>95.45</td><td>99.34</td><td>76.87</td><td>82.11</td><td>65.95</td><td>70.44</td></tr><tr><td>Keplie</td><td>31.87</td><td>36.55</td><td>93.69</td><td>99.51</td><td>66.91</td><td>75.52</td><td>67.26</td><td>75.34</td></tr><tr><td>DRUM</td><td>22.09</td><td>30.92</td><td>93.69</td><td>94.93</td><td>89.01</td><td>91.12</td><td>76.23</td><td>81.07</td></tr><tr><td>ELPE</td><td>35.17</td><td>41.34</td><td>93.11</td><td>95.23</td><td>89.76</td><td>93.21</td><td>80.21</td><td>83.15</td></tr><tr><td>PaGE-Link</td><td>31.77</td><td>38.13</td><td>88.32</td><td>92.20</td><td>87.32</td><td>89.04</td><td>78.65</td><td>83.26</td></tr><tr><td>KGExp-rand</td><td>33.44</td><td>43.97</td><td>92.47</td><td>94.61</td><td>57.12</td><td>64.31</td><td>58.37</td><td>62.59</td></tr><tr><td>KGExp-TransE</td><td>46.85</td><td>61.61</td><td>99.47</td><td>99.84</td><td>93.41</td><td>94.57</td><td>90.48</td><td>93.51</td></tr><tr><td>KGExp-DistMult</td><td>43.05</td><td>56.26</td><td>99.31</td><td>99.71</td><td>92.01</td><td>93.89</td><td>91.66</td><td>93.05</td></tr><tr><td>KGExp-RotatE</td><td>41.48</td><td>56.26</td><td>99.47</td><td>99.84</td><td>93.01</td><td>94.69</td><td>90.89</td><td>92.31</td></tr></table>
|
| 444 |
+
|
| 445 |
+
select top- $\cdot n = 2$ entities per hop and vary the size of $k$ -hop enclosing subgraph to $k = 1 , 2 , 3$ . The $F 1 @ 1$ performance of KGExplainer over various sizable subgraphs is depicted in Figure 6. Theoretically, the larger the subgraph to be searched, the more sufficient key information it contains, so that more effective explanatory subgraphs can be retrieved. We can observe that KGExp-RotatE performs better as the size of subgraphs increases on both Family-rr and WN-18 datasets, which indicates that KGExplainer based on RotatE has generalization and stability. However, KGExplainer over TransE and DistMult only fits this phenomenon on one of the datasets, showing they are limited in generalizing to other data distributions. Thus to achieve a fair comparison, we consider the KGExp-RotatE as the subgraph evaluator and assess other baseline methods.
|
| 446 |
+
|
| 447 |
+
# C.2 THE FULL RESULTS OF EXPLANATIONS
|
| 448 |
+
|
| 449 |
+
The full results (i.e., $F 1 @ [ 3 , 1 0 ]$ and Recall@[3, 10]) of the explanations are shown in Table 9 and Table 10. We can observe that KGExplainer is also the best.
|
| 450 |
+
|
| 451 |
+
# C.3 SPARISITY OF EXPLAINERS
|
| 452 |
+
|
| 453 |
+
We discuss the sparsity of the explanations from various explainers. For subgraph- and path-based methods, we directly adopt the edges and paths for further evaluation. Therefore the size of explanations depends on the number of edges and path lengths they explore. For KGExplainer, the users can adjust the sparsity of multiple synergistic paths by selecting different top- $\mathbf { \nabla } \cdot n$ nodes per hop (See Section 4.4.1). Once the model is trained, the user can directly adjust the value of $n$ without retraining. For various explainers, We present the average number of edges (i.e., Avg. #edges) and corresponding $F 1 @ 1$ performance on all datasets in Table 11. We see that the path-based method (e.g., PaGE-Link) with a complete reasoning chain is more effective than the fact-based method (e.g., Keplie) on fewer visible facts. Moreover, we observe that KGExplainer can dynamically ad-
|
| 454 |
+
|
| 455 |
+
Table 11: The sparsity and corresponding performance of different explainers.
|
| 456 |
+
|
| 457 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">Family-rr</td><td colspan="2">WN-18</td><td colspan="2">FB15k-237</td><td colspan="2">OGB-biokg</td></tr><tr><td>Avg. #edges</td><td>F1@1</td><td>Avg. #edges</td><td>F1@1</td><td>Avg. #edges</td><td>F1@1</td><td>Avg. #edges</td><td>F1@1</td></tr><tr><td>Keplie</td><td>8.297</td><td>20.33</td><td>4.794</td><td>66.37</td><td>11.19</td><td>36.64</td><td>37.58</td><td>49.32</td></tr><tr><td>Page-Link</td><td>3.085</td><td>21.89</td><td>3.64</td><td>67.7</td><td>4.993</td><td>66.12</td><td>12.87</td><td>68.29</td></tr><tr><td>KGExp-TransE (n=1)</td><td>3.182</td><td>28.77</td><td>2.263</td><td>96.4</td><td>5.142</td><td>75.67</td><td>9.75</td><td>79.28</td></tr><tr><td>KGExp-TransE (n=2)</td><td>9.782</td><td>30.47</td><td>4.772</td><td>97.1</td><td>13.661</td><td>82.04</td><td>45.27</td><td>81.97</td></tr><tr><td>KGExp-TransE (n=3)</td><td>15.132</td><td>30.49</td><td>9.223</td><td>96.91</td><td>26.146</td><td>83.21</td><td>112.37</td><td>80.33</td></tr></table>
|
| 458 |
+
|
| 459 |
+
just the size of the explanations and achieve superior performance compared with subgraph- and path-based methods.
|
| 460 |
+
|
| 461 |
+
# C.4 PERFORMANCE OF KGEXPLAINER ON VARIOUS ARCHITECTURES
|
| 462 |
+
|
| 463 |
+
The evaluators built on different architectures demonstrate robustness. The evaluation results of evaluators distilled from different base KGEs have minor differences. Specifically, we evaluate KGExplainer’s performance using different evaluator architectures across various KGEs. We use RotatE as the base KGE to generate explanations for the Family-rr dataset, and then assess these explanations using evaluators distilled from different teacher KGEs. Table 12 reveals two key findings:
|
| 464 |
+
|
| 465 |
+
• The evaluator distilled from RotatE achieves the best performance, with differences among evaluators due to variations in their predictive abilities.
|
| 466 |
+
• Evaluators based on R-GAT and GraiL Teru et al. (2020) (which applies R-GCN on subgraphs) show similar performance across different KGEs. This may be because that the architectural differences between R-GAT and R-GCN are minor.
|
| 467 |
+
|
| 468 |
+
These results highlight that an evaluator with strong predictive capability is essential for high-quality evaluations. Accordingly, we primarily select RotatE as the teacher KGE for distilling evaluators.
|
| 469 |
+
|
| 470 |
+
Table 12: The explainable performance of various evaluators on the Family-rr dataset.
|
| 471 |
+
|
| 472 |
+
<table><tr><td>teacher KGEs</td><td>KGExplainer (R-GAT)</td><td>KGExplainer (GraiL)</td></tr><tr><td>TransE</td><td>27.39</td><td>28.51</td></tr><tr><td>DistMult</td><td>23.43</td><td>21.15</td></tr><tr><td>RotatE</td><td>30.47</td><td>28.26</td></tr></table>
|
| 473 |
+
|
| 474 |
+
# C.5 COMPUTATIONAL TIME OF KGEXPLAINER ON DIFFERENT LOCAL PARAMETERS
|
| 475 |
+
|
| 476 |
+
To improve scalability for larger KGs, we can adjust the local enclosing subgraph size (e.g., reducing from a 2-hop to a 1-hop subgraph) to decrease path length and path count. Table 13 presents the distribution of node degree, path length, path number, and computation time across different subgraph scales over OGB-biokg, revealing a strong positive correlation between them, consistent with our theoretical analysis. In conclusion, the complexity of KGExplainer is driven primarily by local parameters—such as path length $L$ , path number $N$ , and average degree—rather than the overall size of the knowledge graph (KG).
|
| 477 |
+
|
| 478 |
+
Table 13: The distribution of average degree, path length, path number, and computation time over various subgraph scales.
|
| 479 |
+
|
| 480 |
+
<table><tr><td>Scale</td><td>avg. degree</td><td>avg. path_length</td><td>avg. path number</td><td>avg. time</td></tr><tr><td>1-hop</td><td>97.265</td><td>2.573</td><td>346.331</td><td>103.245</td></tr><tr><td>2-hop</td><td>101.579</td><td>3.982</td><td>457.234</td><td>157.28</td></tr></table>
|
| 481 |
+
|
| 482 |
+
# D DISCUSSION
|
| 483 |
+
|
| 484 |
+
# D.1 NOVELTY
|
| 485 |
+
|
| 486 |
+
Some related works Han et al. (2020); Joshi & Urbani (2020) mainly focus on pruning subgraphs to eliminate irrelevant facts and to improve the performance of link prediction on either temporal or static KGs. To some extent, the pruned subgraphs can be considered key information for predicted links. However, the pruned subgraphs are not connected but rather a collection of facts, which are fact-based explainable methods. Similarly, KE-X Zhao et al. (2023) and KGEx Baltatzis & Costabello (2024) are post-hoc explainable methods that identify key triples as explanations. The identified key triples are discrete facts and can not form a reasoning chain. Additionally, PaGE-Link Zhang et al. (2023) and Power-Link Chang et al. (2024) are path-based explainable methods that focus on exploring a single path and rely on selecting multiple discrete paths manually for complex scenes. In contrast, KGExplainer emphasizes exploring multiple synergistic paths globally to form connected subgraphs, which is novel and more expressive than previous models.
|
| 487 |
+
|
| 488 |
+
# D.2 DISCUSSION OF DISTILLED RESULTS
|
| 489 |
+
|
| 490 |
+
In Table 1, we can see that KGExplainer benefits the base model for some datasets. We observe the same behavior in Deng & Zhang (2020); Jiao et al. (2019). From their insights, we think the KGExplainer distilled from KGEs may remove some noise and irrelevant information to the KGC task, making KGExplainer more robust and having better generalization ability, which leads to KG-Explainer performing better than base KGEs to some extent.
|
paper_markdowns/bamboo-03549.md
ADDED
|
@@ -0,0 +1,1143 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Automated Benchmark Generation for Repository-Level Coding Tasks
|
| 2 |
+
|
| 3 |
+
Konstantinos Vergopoulos 1 * Mark Niklas Müller 1 * Martin Vechev 1 2
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Code Agent development is an extremely active research area, where a reliable performance metric is critical for tracking progress and guiding new developments. This demand is underscored by the meteoric rise in popularity of SWE-Bench. This benchmark challenges code agents to generate patches addressing GitHub issues given the full repository as context. The correctness of generated patches is then evaluated by executing a human-written test suite extracted from the repository after the issue’s resolution.
|
| 8 |
+
|
| 9 |
+
However, constructing benchmarks like SWE-Bench requires substantial manual effort to set up historically accurate execution environments for testing. Crucially, this severely limits the number of considered repositories, e.g., just 12 for SWE-Bench. Considering so few repositories, selected for their popularity runs the risk of leading to a distributional mismatch, i.e., the measured performance may not be representative of real-world scenarios potentially misguiding development efforts.
|
| 10 |
+
|
| 11 |
+
In this work, we address this challenge and introduce SETUPAGENT, a fully automated system capable of historically accurate dependency setup, test execution, and result parsing. Using SETUPAGENT, we generate two new datasets: (i) SWEE-Bench an extended version of SWE-Bench encompassing hundreds of repositories, and (ii) SWA-Bench a benchmark focusing on applications rather than libraries. Comparing these datasets to SWE-Bench with respect to their characteristics and code agent performance, we find significant distributional differences, including lower issue description quality and detail level, higher fix complexity, and most importantly up to $40 \%$ lower agent success rates.
|
| 12 |
+
|
| 13 |
+
# 1. Introduction
|
| 14 |
+
|
| 15 |
+
Code Agents are quickly becoming one of the most promising and actively researched applications of Large Language Models (LLMs); partly due to their potential to revolutionize the 700 billion dollar software industry (Statista, 2025). To measure progress and more importantly steer further developments in this field, high-quality datasets and benchmarks are crucial. In particular, it is essential that they are representative of real-world use cases, sufficiently large to allow meaningful statistical analysis, and diverse and recent enough to avoid unintentional overfitting and contamination.
|
| 16 |
+
|
| 17 |
+
Existing Benchmarks However, function-level benchmarks like HumanEval (Chen et al., 2021), popular for evaluating LLM’s coding performance, are unrepresentative of real-world use, lack diversity, and are becoming saturated. To address these limitations, SWE-Bench (Jimenez et al., 2024) was proposed as the first repository-level coding benchmark based on real-world tasks, i.e., resolving GitHub issues. Yet, it still suffers from several limitations. (i) It is limited to few repositories, potentially leading to overfitting to these specific codebases. (ii) Its sole focus on libraries in contrast to applications raises generalizability questions. (iii) Its focus on popular repositories not only makes it less representative but also increases the chances of contamination with general codebase knowledge. (iv) Its static nature leads to most or even all instances being created before recent models’ knowledge cutoff, allowing even the exact instances to be present in the training data.
|
| 18 |
+
|
| 19 |
+
Creating Repository-Level Benchmarks To address these challenges, we would like to create more diverse benchmarks and update them frequently with new tasks. However, while the GitHub Issues and Pull Requests (PRs), serving as task descriptions and reference solutions, respectively, for SWE-Bench-like benchmarks can be scraped automatically, evaluating the correctness of a solution, requires the repository’s test suite to be executed. This, in turn, requires setting up historically accurate execution environments, identifying the correct test commands, and parsing the results. Prior work addressed this problem either manually (Jimenez et al., 2024) or by aggressively filtering out instances where default commands were unsuccessful (Jain et al., 2024c). However, both approaches yield limited diversity and don’t lend themselves to frequent updates.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1. Overview of SETUPAGENT where a $\bigoplus _ { \mathcal { O } } ^ { \mathcal { \hat { O } } } { \boldsymbol { \hat { \rho } } }$ -icon represents an LLM driven step and a -icon represents execution feedback.
|
| 23 |
+
|
| 24 |
+
This Work: SETUPAGENT To address this challenge, we propose SETUPAGENT, the first method to automate this setup process, enabling us to create repository-level code benchmarks fully automatically from a list of GitHub repositories. SETUPAGENT works in three key phases (illustrated in Figure 1): (i) Command Extraction (green in Figure 1), (ii) Iterative Testing and Improvement (blue ), and (iii) Validation (purple ). In the extraction phase, SE-TUPAGENT analyzes relevant context, such as README.md files, CI/CD configurations, and referenced web pages, to propose installation and testing commands. During the iterative improvement phase, SETUPAGENT then executes these commands in a clean environment and leverages an LLM to systematically diagnose and resolve issues. Finally, in the validation phase,SETUPAGENT ensures that the generated commands are reliable by verifying the correctness of the setup based on test results, only accepting configurations that meet a predefined success threshold.
|
| 25 |
+
|
| 26 |
+
This Work: Generated Benchmarks We demonstrate SETUPAGENT’s capability to generate coding benchmarks from a list of repositories by creating SWA- and SWEE-Bench, each addressing specific shortcomings of SWE-Bench. Both are designed to be representative of real-world use cases, consider many repositories leading to diverse benchmarks, and can be frequently updated without manual effort to avoid contamination and overfitting. SWA-Bench focuses on software applications, containing 44 projects while SWEE-Bench focuses on diversity and less popular projects containing 366 Python repositories. Comparing SWA- and SWEE-Bench to SWE-Bench, we find significant distributional differences, including lower repository age and popularity at issue creation, a larger focus on recent issues, and significantly more complex reference code fixes (2-4x more modified files and lines). Evaluating popular code agents on these datasets, we find significant performance differences for some models and statistically significant signs of contamination, highlighting the importance of evaluating on representative benchmarks.
|
| 27 |
+
|
| 28 |
+
# Key Contributions of this work are:
|
| 29 |
+
|
| 30 |
+
• We propose SETUPAGENT, the first method for autonomously creating historically accurate execution environments.
|
| 31 |
+
• We leverage SETUPAGENT to create two datasets for repository-level code generation SWA- and SWEE-Bench, focusing on applications and diverse projects, respectively.
|
| 32 |
+
• We extensively analyze SWA- and SWEE-Bench in terms of their characteristics and corresponding code agent performance.
|
| 33 |
+
|
| 34 |
+
# 2. Related Work
|
| 35 |
+
|
| 36 |
+
Code Agents To fully leverage the potential of LLMs for code generation, they have been equipped with tools to interact with their environment without additional user input, e.g., by searching, viewing, and editing code, (Wang et al., 2024a). These so-called code agents have shown great promise on complex tasks (Bouzenia et al., 2024a; OpenDevin, 2024; Zhang et al., 2024; Yang et al., 2024; Xia et al., 2024; Aider, 2024; Ridnik et al., 2024; Wang et al., 2024b). In this work, we evaluate some of the bestperforming open-source agents.
|
| 37 |
+
|
| 38 |
+
Code Generation Benchmarks With the success of LLMs in the domain of code generation, an increasing variety of function-level code generation benchmarks were proposed to assess their capabilities (Chen et al., 2021; Hendrycks et al., 2021; Austin et al., 2021; Jain et al., 2024a; Huang et al., 2024). However, not only were these increasingly saturated by state-of-the-art models but their focus on interview-style function-level coding challenges makes them also unrepresentative of the complexities of real-world codebases and software engineering tasks.
|
| 39 |
+
|
| 40 |
+
To address these limitations, a range of repository-level code-generation benchmarks have been proposed recently (Liu et al., 2023; Jain et al., 2024b; Jimenez et al., 2024).
|
| 41 |
+
|
| 42 |
+
However, a repository-level context not only makes code generation more challenging but also dataset generation as it requires a historically accurate execution environment to be set up, the project’s test suite to be run, and detailed results to be extracted. The required manual effort led to existing datasets focusing on a relatively small number of popular repositories. As a result, they are prone to overfitting, often lack diversity, and can easily contaminate the training data.
|
| 43 |
+
|
| 44 |
+
Automatic Dataset Generation These challenges could be addressed via automatic dataset generation, which has been successfully applied to function-level benchmarks by scraping tasks from coding challenge websites and doing varying levels of manual post-processing (Hendrycks et al., 2021; Jain et al., 2024a; Huang et al., 2024).
|
| 45 |
+
|
| 46 |
+
Jimenez et al. (2024) transfer these ideas to repository-level benchmarks, automatically scraping GitHub repositories, issues, and corresponding pull requests resolving these issues to create SWE-Bench consisting of 12 repositories and 2294 instances. However, they still created the required execution environments and test commands manually.
|
| 47 |
+
|
| 48 |
+
Jain et al. (2024b) create R2E, a function-level synthesis benchmark with repository context by scraping GitHub repositories and masking out the function to be generated. They automated the setup by applying a default approach for projects with a setup.py or pyproject.toml file, automatically generating equivalence tests, and filtering out all instances where this approach fails. However, this approach aggressively filters projects with more complex installation procedures, not only introducing a selection bias but also yielding only 246 instances.
|
| 49 |
+
|
| 50 |
+
In this work, we combine the more interesting repositorylevel tasks with a fully automated benchmark generation process, by introducing and leveraging SETUPAGENT to automatically extract the installation and testing procedures for every task instance, allowing us to create larger and more diverse benchmarks efficiently.
|
| 51 |
+
|
| 52 |
+
Bouzenia & Pradel (2024), concurrently proposed EXECU-TIONAGENT, a tool to automatically set up and test repositories. However, it is 60 times slower than SETUPAGENT, does not support historical states, and does not extract results at test-level granularity. Even if the latter two shortcomings were addressed, it would remain infeasibly slow taking, e.g., over 4 months to generate SWEE-Bench1.
|
| 53 |
+
|
| 54 |
+
# 3. Autonomous Environment Setup
|
| 55 |
+
|
| 56 |
+
In this Section, we first outline the requirements for a setup and testing agent to be used for benchmark generation and then describe the agent we develop for this purpose.
|
| 57 |
+
|
| 58 |
+
# 3.1. Notation and Definitions
|
| 59 |
+
|
| 60 |
+
We first introduce notation to describe repository-level coding tasks, adapted from Mündler et al. (2024). Given a codebase $R$ , we obtain $R \circ X$ by applying the code patch $X$ . We similarly denote the test suite $T$ with $T \circ S$ after applying the test patch $S$ . A single test $t \in T$ can either pass (P) or fail (F) when executed against the codebase $R$ in an execution environment $E$ . We write: $\operatorname { e x e c } _ { E } ( t , R ) \in \{ P , F \}$ and let the order $P > F$ hold.
|
| 61 |
+
|
| 62 |
+
A repository-level coding task can be written as the tuple $( R , T , I , E , S ^ { * } , X ^ { * } )$ , where $R$ and $T$ are the original codebase and test suite, respectively, $I$ is the issue description, $E$ the execution environment, and $S ^ { * }$ and $X ^ { * }$ the reference test and code patch, respectively. By executing all tests $t _ { i } ~ \in ~ T \circ S ^ { * }$ in the execution environment $E$ , first against the original $( R )$ and then the patched codebase $( R \circ X ^ { * } )$ , we obtain the reference test behavior $b _ { i } ^ { * } = ( \mathrm { e x e c } _ { E } ( t _ { i } , R ) \mathrm { e x e c } _ { E } ( t _ { i } , R \circ X ^ { * } ) )$ . We call $t _ { i }$ with, e.g., $b _ { i } ^ { * } = F \to P$ a fail-to-pass test as it fails before the reference fix is applied but passes afterward. We let the partial order $F P > F F$ and $P \to P > P \to F$ hold.
|
| 63 |
+
|
| 64 |
+
The task is now to generate a patch $X ^ { \prime }$ , given only $( R , T , I , E )$ , such that the test behavior $\begin{array} { r l } { b _ { i } ^ { \prime } } & { { } = } \end{array}$ $\operatorname { e x e c } _ { E } ( t _ { i } , R ) \to \operatorname { e x e c } _ { E } ( t _ { i } , R \circ X ^ { \prime } )$ matches or improves on the reference result, i.e., $b _ { i } ^ { \prime } \geq b _ { i } ^ { * }$ for all tests $t _ { i } \in T \circ S ^ { * }$ .
|
| 65 |
+
|
| 66 |
+
# 3.2. Setup Agent Requirements
|
| 67 |
+
|
| 68 |
+
A generic setup agent targeting individual, up-to-date repositories only has to satisfy one main requirement: Correctness – It must extract and run the installation and testing commands before parsing the test results. However, benchmark generation, i.e., generating the execution environment $E$ given the remaining components of a coding task, imposes additional requirements: Historical Accuracy – Benchmark instances are based on specific, often outdated versions of a codebase $R$ . The execution environment $E$ must thus use historically accurate dependency versions to reproduce the original issue faithfully and avoid version incompatibilities. Efficiency – To generate a dataset of many hundreds of instances, the setup agent must be efficient enough to keep total runtime reasonable (hours or at most few days). Granularity – Evaluating agent success requires test-level results to be parsed from the test suite output.
|
| 69 |
+
|
| 70 |
+
# 3.3. SETUPAGENT
|
| 71 |
+
|
| 72 |
+
Overview SETUPAGENT works in three phases illustrated in Figure 1: (1) Extraction ( in Figure 1), (2) Iterative testing and imporvement ( ), and (3) Validation ( ). In the first phase, SETUPAGENT extracts a first version of the installation and testing commands from all relevant files, referenced webpages, and, if available, successful commands
|
| 73 |
+
|
| 74 |
+
from similar versions of this repository. In the second phase, SETUPAGENT iteratively executes first the installation and then testing commands, analyses the results and updates the commands. Finally, in the third phase, SETUPAGENT validates the resulting commands by executing them, extracting the test results, and rejecting the proposed commands, if too few tests pass. Validated commands are then returned to the user and saved in a reference database to facilitate installations of different versions of the same repository.
|
| 75 |
+
|
| 76 |
+
```txt
|
| 77 |
+
Input: Please extract all commands required to install <project_name> in a clean environment and run its test suite from the context below.
|
| 78 |
+
#README.md
|
| 79 |
+
<file_content>
|
| 80 |
+
#CONTRIBUTING.md
|
| 81 |
+
<file_content>
|
| 82 |
+
LMM Response:
|
| 83 |
+
'/'bash apt-get install -y graphviz #installation pip install -r req.txt #installation nox -e test # testing
|
| 84 |
+
Installation Commands: apt-get install -y graphviz uv pip install -r req.txt -exclude-newer 2022-04-11 Testing Commands: nox -e test
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
Figure 2. Illustration of the extraction phase of SETUPAGENT. Please see App. B for the full-length prompts.
|
| 88 |
+
|
| 89 |
+
Extraction Phase The goal of the Extraction Phase is to extract an initial version of the installation and testing commands. We illustrate it in Figure 2, using a significantly simplified prompt and shortened response for illustration purposes. In the first step, SETUPAGENT reviews all relevant files to identify the correct Python version. If available, it is directly parsed from the setup.py or pyproject.toml file, otherwise version constraints are extracted from different sources using an LLM and then resolved while taking issue creation time into account to ensure Historical Accuracy. Next, SETUPAGENT uses a heuristic to identify possibly relevant context like README.md and CONTRIBUTING.md files, CI/CD configurations, and referenced webpages. It then reviews these sources and directly rejects those not containing information relevant to installation or testing, thus keeping its context size small and improving Efficiency. Finally, SETUPAGENT prompts an LLM to extract the installation and testing commands from the chosen sources. To ensure Historical Accuracy, SETUPAGENT enforces the use of the uv environment manager for Python dependencies, configuring it to exclude dependency versions released after the issue creation.
|
| 90 |
+
|
| 91 |
+
Iterative Improvement Phase SETUPAGENT now tries to install and test the project in a clean Docker container using the extracted commands. If any of the installation steps fail, i.e., exit with a non-zero exit code, or the test
|
| 92 |
+
|
| 93 |
+
```txt
|
| 94 |
+
Input:
|
| 95 |
+
You are trying to install and test <project_name>
|
| 96 |
+
using the following commands.
|
| 97 |
+
```
|
| 98 |
+
```
|
| 99 |
+
```
|
| 100 |
+
```
|
| 101 |
+
```
|
| 102 |
+
```
|
| 103 |
+
```
|
| 104 |
+
```
|
| 105 |
+
```
|
| 106 |
+
```
|
| 107 |
+
```
|
| 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 |
+
``
|
| 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 |
+
```txt
|
| 203 |
+
LLM Response:
|
| 204 |
+
We have to install rustworks first:
|
| 205 |
+
```
|
| 206 |
+
``'bash
|
| 207 |
+
pip install rustworkx
|
| 208 |
+
``'
|
| 209 |
+
Updated Installation Commands:
|
| 210 |
+
apt-get install -y graphviz
|
| 211 |
+
uv pip install -r req.txt exclude-newer 2022-04-11
|
| 212 |
+
uv pip install rustworkx exclude-newer 2022-04-11
|
| 213 |
+
```
|
| 214 |
+
|
| 215 |
+
Figure 3. Illustration of the iterative improvement phase of SETU-PAGENT, where the error message was obtained by executing the commands from the previous iteration.
|
| 216 |
+
|
| 217 |
+
commands fail with an error, SETUPAGENT selects the relevant sections of the error messages and then prompts an LLM to identify the issue and propose a modification of the installation commands to fix it. We illustrate this in Figure 3, where SETUPAGENT adds a missing dependency. Now SE-TUPAGENT tries to resolve issues apparent in the test results, analyzing the logs to determine whether a failure is due to incorrect test commands, an incorrect installation, or a bug in the codebase. Depending on the result, SETUPAGENT prompts an LLM to modify the installation or testing commands to fix the issue or passes the repo on to the validation phase. This iterative improvement is repeated until all errors are resolved or an iteration limit is reached. Using a moderate iteration limit of 4 steps, we achieve significantly improved Correctness without sacrificing Efficiency.
|
| 218 |
+
|
| 219 |
+
```txt
|
| 220 |
+
Input:
|
| 221 |
+
Please assess whether <project_name> was installed and its test suite executed correctly given the resulting printout.
|
| 222 |
+
Answer YES or NO.
|
| 223 |
+
'
|
| 224 |
+
\(\equiv = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = \equiv = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
|
| 225 |
+
LLM Response:
|
| 226 |
+
YES
|
| 227 |
+
```
|
| 228 |
+
|
| 229 |
+
Figure 4. Illustration of the first step in the Validation phase.
|
| 230 |
+
|
| 231 |
+
Validation Phase In the validation phase, SETUPAGENT first queries an LLM to assess whether the installation and testing were successful, illustrated in Figure 4. If the LLM judges the installation to be successful, SETUPAGENT updates the test framework’s configuration to return test-level results, e.g., by adding $- \mathtt { r a }$ to a pytest command, thus ensuring Granularity. It then selects the correct parser from a pre-defined set to extract test-level results and checks the number of passing and failing tests. We consider the installation to be successful if at least $9 5 \%$ of tests pass.
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
Figure 5. PDFs (left and middle) and CDF (right) of PR creation dates (left), repository age at PR creation time (middle), and number of GitHub stars (right) for SWA, SWEE, and SWE-Bench.
|
| 239 |
+
|
| 240 |
+
# 4. Code Generation Benchmarks
|
| 241 |
+
|
| 242 |
+
In this Section, we describe how we leverage SETUPAGENT to create SWA- and SWEE-Bench, two new benchmarks addressing specific limitations of SWE-Bench. We compare these datasets with SWE-Bench and provide insights into distributional differences.
|
| 243 |
+
|
| 244 |
+
Automatically Generated Benchmarks By creating execution environments automatically, we address two core limitations of manually generated repository-level benchmarks: (i) we can consider many more repositories without requiring infeasible manual labor, thus improving diversity and reducing the risk of overfitting and (ii) we can easily update benchmarks by creating new tasks from recent PRs and issues, thus ensuring that models are not contaminated with benchmark instances (see Figures 5 and 6).
|
| 245 |
+
|
| 246 |
+
SWA-Bench Many practitioners using Code Agents develop software applications that suffer from different types of bugs compared to libraries due to architectural and structural differences. As SWE-Bench only considers libraries, we design SWA-Bench to focus only on applications.
|
| 247 |
+
|
| 248 |
+
SWEE-Bench We observe that more popular repositories tend to have higher-quality codebases and issue descriptions. This includes, e.g., a more consistent (file) structure and naming conventions, better documentation including detailed docstrings for most functions, and issue descriptions following a precise template (see Figures 7 and 8). As SWE-Bench focuses on particularly popular Python repositories, the resulting tasks can be unrepresentative of real-world use. Therefore, we design SWEE-Bench with a focus on diverse and less popular (median of 365 vs 16k stars) Python repositories (see Figure 5).
|
| 249 |
+
|
| 250 |
+
# 4.1. Dataset Creation
|
| 251 |
+
|
| 252 |
+
Source Repositories For SWA-Bench, we combine a list of 468 popular Python applications (Hashemi, 2024) with a list of 50 Python projects from Bouzenia et al. (2024b), leading to a total of 475 candidate repositories after deduplication. For SWEE-Bench, we consider the 8000 most
|
| 253 |
+
|
| 254 |
+
Table 1. SWEE pipeline from projects to tasks. A PR is valid if it resolves an issue, modifies a test file, and is merged. An instance valid, if it has additionally at least one $F P$ test.
|
| 255 |
+
|
| 256 |
+
<table><tr><td>Step</td><td># Repos</td><td># PRs</td></tr><tr><td>Initial Projects</td><td>8000</td><td></td></tr><tr><td>+ GH Repo Found</td><td>7057</td><td></td></tr><tr><td>+ Preprocessing</td><td>5097</td><td></td></tr><tr><td>+ Permissive License</td><td>3800</td><td></td></tr><tr><td>+ Has valid PR</td><td>2377</td><td></td></tr><tr><td>+ SETUPAGENT succeeds</td><td>514</td><td></td></tr><tr><td>+ Get n(per_repo) valid PRs</td><td></td><td>2115</td></tr><tr><td>+ SETUPAGENT succeeds</td><td></td><td>1513</td></tr><tr><td>+ valid instance</td><td></td><td>885</td></tr></table>
|
| 257 |
+
|
| 258 |
+
downloaded PyPi projects at the time (van Kemenade et al., 2024) with between 100k and 1.5B monthly downloads and 0 to 25k stars, leading to good diversity while focusing on relevant projects.
|
| 259 |
+
|
| 260 |
+
Dataset Creation with SETUPAGENT We combine the original PR filtering process from Jimenez et al. (2024) with our SETUPAGENT as follows: For every project, we first locate the corresponding repository, deduplicate the results, and filter out repositories that are not published under a permissive license. We then scrape issues and pull requests for each repository until we find the most recent PR that is merged, resolved an issue, and modified a test file. We call this a valid PR. We then use SETUPAGENT to set up an execution environment $E$ for the corresponding codebase $R$ (see Section 3). For repositories where this succeeds, we scrape additional PRs until we have $n _ { p e r \_ r e p o }$ valid ones or, for SWEE, reach a maximum of 500 PRs. We then use SETUPAGENT to create the execution environment $E$ for each corresponding codebase $R$ in reverse chronological order per repository, populating SETUPAGENT’s reference commands database to speed up the setup process. Finally, we split every PR into a reference code patch $X ^ { * }$ and test patch $S ^ { * }$ . We execute the full test suite $T \circ S ^ { * }$ before and after the code patch is applied, i.e., on $R$ and $R \circ X ^ { * }$ , respectively, to obtain the reference test behaviors $b _ { i } ^ { * }$ . We then filter out PRs, where test execution fails in one of these settings or which have no $F P$ test, i.e. $\nexists t \in$
|
| 261 |
+
|
| 262 |
+
$T \circ S ^ { * } : \operatorname { e x e c } _ { E } ( t , R ) \to \operatorname { e x e c } _ { E } ( t , R \circ X ^ { * } ) = F \to P$ . The remaining PRs form the valid instances of the generated benchmark. We choose $n _ { p e r \_ r e p o } = 5 0$ for SWA-Bench and $n _ { p e r \_ r e p o } = 1 0$ for SWEE-Bench to obtain the desired number of tasks and show the number of repositories and PRs this leads to in Tables 1 and 10, respectively.
|
| 263 |
+
|
| 264 |
+
Ease of Use To make benchmark generation and use as easy as possible, SETUPAGENT only requires a list of repositories to generate a dataset in a format compatible with SWE-Bench along with docker images with all dependencies installed.
|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
Figure 6. Comparison of the repository distribtuion of SWEE-, SWA-, and SWE-Bench across instances.
|
| 268 |
+
|
| 269 |
+
# 4.2. Benchmark Characteristics
|
| 270 |
+
|
| 271 |
+
Diversity We compare the distribution of instances over repositories in Figure 6 and observe that while instances in SWE are heavily concentrated in only a few repositories, with over $50 \%$ of instances belonging to only two out of 12 total repositories, SWA- and SWEE-Bench show much more diversity with 535 instances from 44 repositories and 885 from 366 repositories. See App. C for a full list.
|
| 272 |
+
|
| 273 |
+
Codebase Characteristics We compare benchmarks with respect to codebase characteristics in Table 2 and Figure 5 and observe that SWEE-Bench, compared to, SWA- and SWE-Bench contains significantly older and more popular (# GitHub stars) repositories and larger, more complex codebases (# files and # lines of code).
|
| 274 |
+
|
| 275 |
+
Issue Description Quality To assess the issue description quality, we measure the number of words, error messages, and code blocks they contain as well as the overlap between the files mentioned there and modified in the reference fix and the overlap between the issue description and the reference solution itself. We show cumulative distribution functions (CDFs) of the aforementioned characteristics in Figure 7. We observe that while SWA-Bench has more detailed issue descriptions (longer, more code blocks, and more error messages), they do not seem to be of higher quality (less overlap with the reference solution and equal file mentions). Comparing SWE-Bench and SWEE-Bench, we observe longer issue descriptions and slightly more overlap with the reference solution in SWE-Bench but otherwise similar characteristics.
|
| 276 |
+
|
| 277 |
+
Table 2. Comparison of mean dataset characteristics.
|
| 278 |
+
|
| 279 |
+
<table><tr><td></td><td></td><td>SWA</td><td>SWEE</td><td>SWE</td></tr><tr><td rowspan="2">Codebase</td><td># Files</td><td>899</td><td>77</td><td>1491</td></tr><tr><td># Lines</td><td>112k</td><td>14.8k</td><td>321k</td></tr><tr><td rowspan="3">Issue Descriptions</td><td># Words</td><td>240.2</td><td>125.1</td><td>181.3</td></tr><tr><td># Error Messages</td><td>0.20</td><td>0.13</td><td>0.19</td></tr><tr><td># Code Blocks</td><td>1.53</td><td>1.19</td><td>1.06</td></tr><tr><td rowspan="4">Tests</td><td># P → P</td><td>564.2</td><td>226.6</td><td>120.1</td></tr><tr><td># F → P</td><td>38.8</td><td>38.1</td><td>13.5</td></tr><tr><td># F → F</td><td>3.7</td><td>1.4</td><td>3.4</td></tr><tr><td># P → F</td><td>0.11</td><td>0.03</td><td>0.04</td></tr><tr><td rowspan="4">Test Patches</td><td># Edited Files</td><td>1.89</td><td>2.05</td><td>1.52</td></tr><tr><td># Edited Lines</td><td>74.8</td><td>91.5</td><td>39.2</td></tr><tr><td># Added Tests</td><td>9.10</td><td>23.78</td><td>6.37</td></tr><tr><td># Removed Tests</td><td>16.77</td><td>2.49</td><td>0.54</td></tr><tr><td rowspan="2">Fix Patches</td><td># Edited Files</td><td>3.26</td><td>3.26</td><td>1.66</td></tr><tr><td># Edited Lines</td><td>104.3</td><td>169.9</td><td>41.0</td></tr></table>
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
|
| 289 |
+

|
| 290 |
+
|
| 291 |
+

|
| 292 |
+
Figure 7. CDFs over issue description characteristics. Number of words (top left), number of code blocks (top middle), number of error messages (top right), number of filenames contained in the issue description and modified in the reference solution (bottom left), the overlap between the issue description and the reference solution in terms of longest string match (bottom middle) and complete lines (bottom right). A CDF further down and to the right indicates a higher value.
|
| 293 |
+
|
| 294 |
+
Fix Complexity To assess the complexity of required fixes, we measure the number of lines and files modified in the reference solution and the number of tests that flip from passing to failing (and vice versa). We show CDFs in Figure 8 and observe that while SWEE- and SWA-Bench have similar distributions across all these metrics, SWE-Bench fixes are significantly less complex by all metrics.
|
| 295 |
+
|
| 296 |
+
# 5. Experimental Evaluation
|
| 297 |
+
|
| 298 |
+
In this Section, we first evaluate the effectiveness of SETU-PAGENT for dataset creation and then analyze Code Agent performance across datasets.
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
Figure 8. CDFs over fix-complexity characteristics. Number of edited lines (left), number of edited files (top middle), number affected tests, i.e., $F P + P F$ (right). A CDF further down and to the right indicates higher characteristic values.
|
| 306 |
+
|
| 307 |
+
# 5.1. Experimental Setup
|
| 308 |
+
|
| 309 |
+
Models We consider a range of models across sizes, cost points, and model providers. For exact versions, see Table 9 in App. A. Unless otherwise specified, we use GPT-4O-MINI as the underlying model for all agents. For decoding, we use the default parameters for all Code Agents and greedy decoding for SETUPAGENT.
|
| 310 |
+
|
| 311 |
+
Code Agents We evaluate two state-of-the-art Code Agents from the top of the SWE-Bench leaderboard2 which most likely have been optimized for SWE-Bench (OpenHands (Wang et al., 2024b) and AutoCodeRover-v2.0 (Zhang et al., 2024)), and ZeroShot (Jimenez et al., 2024) with oracle context (files modified in the ground truth fix) which prompts LLMs directly without any optimization for SWE-Bench. We report the portion of resolved instances as accuracy (Acc.) for all Code Agents.
|
| 312 |
+
|
| 313 |
+
Code Execution We run all code execution (both for SE-TUPAGENT and all Code Agents) in separate Docker containers to improve reproducibility and security. For SETU-PAGENT, we use an Ubuntu 22.04 container as the base image and pre-install a range of common build dependencies but do not provide any Python dependencies.
|
| 314 |
+
|
| 315 |
+
Table 3. SETUPAGENT success rates at extracting installation and test commands as well as parsing the resulting test output.
|
| 316 |
+
|
| 317 |
+
<table><tr><td></td><td></td><td>Success</td></tr><tr><td rowspan="2">SWA</td><td>Repos</td><td>28.6%</td></tr><tr><td>Instances</td><td>58.5%</td></tr><tr><td rowspan="2">SWEE</td><td>Repos</td><td>21.6%</td></tr><tr><td>Instances</td><td>71.5%</td></tr></table>
|
| 318 |
+
|
| 319 |
+
# 5.2. Effectiveness of SETUPAGENT
|
| 320 |
+
|
| 321 |
+
We evaluate the effectiveness of SETUPAGENT in creating SWA- and SWEE-Bench by analyzing the frequency of fully successful environment and testing setups in Table 3. We observe SETUPAGENT is able to extract historically
|
| 322 |
+
|
| 323 |
+
Table 4. Ablation study on SETUPAGENT, reporting the number of successfully extracted execution environments for SWA-Bench.
|
| 324 |
+
|
| 325 |
+
<table><tr><td></td><td># Repositories</td></tr><tr><td>SETUPAGENT</td><td>44</td></tr><tr><td>only CI/CD Files</td><td>33</td></tr><tr><td>only Text Files</td><td>15</td></tr><tr><td>no Iterative Improvement</td><td>11</td></tr></table>
|
| 326 |
+
|
| 327 |
+
Table 5. Issue resolution rates (accuracy) of various agents on SWA-, SWEE-, and SWE-Bench, all with GPT-4O-MINI.
|
| 328 |
+
|
| 329 |
+
<table><tr><td></td><td>SWA</td><td>SWEE</td><td>SWE</td></tr><tr><td>Openhands</td><td>3.9%</td><td>4.4%</td><td>4.6%</td></tr><tr><td>AutoCodeRover v2</td><td>8.4%</td><td>8.9%</td><td>8.2%</td></tr><tr><td>ZeroShot(Oracle)</td><td>0.9%</td><td>2.2%</td><td>2.8%</td></tr></table>
|
| 330 |
+
|
| 331 |
+
correct execution environments for $20 { - } 3 0 \%$ of repositories without reference commands and for $5 5 \mathrm { - } 7 5 \%$ of instances for these repositories. Without reference commands, SE-TUPAGENT takes 76 minutes to attempt to install all 154 repositories considered for SWA after deduplication and license checks and thus takes only about 30s on average per repository. When creating SWEE-Bench, we deactivate the web browsing ability of SETUPAGENT.
|
| 332 |
+
|
| 333 |
+
Ablation We evaluate the impact of SETUPAGENT’s components in an ablation study on SWA-Bench, reporting results in Table 4. We observe that especially the use of CI/CD config files and the iterative improvement are crucial for SETUPAGENT’s success.
|
| 334 |
+
|
| 335 |
+
Failure Analaysis To understand SETUPAGENT’s failure cases, we conduct a small case study, manually inspecting five failed instances from SWA-Bench, and observe the following: In all instances, errors in the build process cause the failure. For all but one instance, finding the installation instructions requires following two or more links on web pages. In all but two instances, the only described way to test the application requires running docker containers, which SETUPAGENT does not support. In two instances, installation and/or testing requires the use of makefiles, referencing multiple substeps. Finally, in one instance SETUPAGENT chooses the wrong requirement file and then begins to install missing testing dependencies. We believe this points to exciting future work improving SETUPAGENT’s webbrowsing capabilities and docker support.
|
| 336 |
+
|
| 337 |
+
# 5.3. Agent Performance Across Datasets
|
| 338 |
+
|
| 339 |
+
We conduct all below experiments on the full SWA and uniformly subsampled versions of SWEE and SWE-Full of identical size (535 instances) due to cost constraints.
|
| 340 |
+
|
| 341 |
+
We report Code Agent performance in Table 5 and observe surprisingly small differences in performance between all
|
| 342 |
+
|
| 343 |
+
three datasets when using GPT-4O-MINI.
|
| 344 |
+
|
| 345 |
+
To assess the interaction of agent performance and model selection, we evaluate AutoCodeRover v2 (Zhang et al., 2024) across a range of LLMs, showing results in Table 6. Interestingly, we observe a large variance in the accuracy difference between SWE and SWA across models. While GPT-4O-MINI performs similarly well on all benchmarks, GPT-4O and HAIKU-3.5 perform much better on SWEEand SWE-Bench. We show later that this may be due to contamination of GPT-4O.
|
| 346 |
+
|
| 347 |
+
Table 6. Performance of AutocodeRover v2 (Zhang et al., 2024) using different underlying LLMs.
|
| 348 |
+
|
| 349 |
+
<table><tr><td></td><td>SWA</td><td>SWEE</td><td>SWE</td></tr><tr><td>GPT-4O-MINI</td><td>8.4%</td><td>9.0%</td><td>8.2%</td></tr><tr><td>GPT-4O</td><td>10.2%</td><td>15.1%</td><td>16.6%</td></tr><tr><td>HAIKU-3.5</td><td>10.8%</td><td>12.9%</td><td>13.6%</td></tr></table>
|
| 350 |
+
|
| 351 |
+
# 5.4. Benchmark Analaysis
|
| 352 |
+
|
| 353 |
+
In Section 4, we observe interesting distributional differences between the instance characteristics of SWA-, SWEE-, and SWE-Bench. Now, we explore how these characteristics correlate with agent performance, reporting Spearman’s rank correlation coefficients $\rho$ and p-values for AutoCodeRover v2 and GPT-4O in Table 7. We observe that only characteristics computed with knowledge of the solution have a statistically significant correlation with performance. In particular, the overlap of the issue with the reference code patch in terms of file names, and number of lines has a strong positive correlation with performance, while all fix complexity metrics have a strong negative correlation with performance.
|
| 354 |
+
|
| 355 |
+
Table 7. Spearman’s rank correlation coefficients $\rho$ and p-value between accuracy and instance characteristics, separated by whether statistic can be computed without axes to ground truth. Statistically significant $( p < 1 \%$ ) correlations are highlighted in bold. Positive $\rho$ indicate that a larger characteristic value is associated with better performance.
|
| 356 |
+
|
| 357 |
+
<table><tr><td rowspan="2">Characteristic</td><td colspan="2">SWA</td><td colspan="2">SWEE</td><td colspan="2">SWE</td></tr><tr><td>ρ</td><td>p-value</td><td>ρ</td><td>p-value</td><td>ρ</td><td>p-value</td></tr><tr><td>Repo Age</td><td>-0.06</td><td>2.0 × 10-1</td><td>-0.02</td><td>5.8 × 10-1</td><td>-0.02</td><td>7.0 × 10-1</td></tr><tr><td>#GitHub Stars</td><td>-0.03</td><td>4.8 × 10-1</td><td>-0.02</td><td>7.2 × 10-1</td><td>0.07</td><td>1.3 × 10-1</td></tr><tr><td>#Words in Issue</td><td>-0.06</td><td>1.8 × 10-1</td><td>-0.00</td><td>9.6 × 10-1</td><td>0.01</td><td>7.7 × 10-1</td></tr><tr><td>#Code Blocks in Issue</td><td>-0.00</td><td>9.7 × 10-1</td><td>0.04</td><td>3.4 × 10-1</td><td>-0.06</td><td>1.7 × 10-1</td></tr><tr><td>#Error Messages in Issue</td><td>0.03</td><td>4.6 × 10-1</td><td>0.09</td><td>3.7 × 10-2</td><td>-0.04</td><td>3.5 × 10-1</td></tr><tr><td>#Fix File Names in Issue</td><td>0.12</td><td>4.5 × 10-3</td><td>0.19</td><td>1.2 × 10-5</td><td>0.18</td><td>2.5 × 10-5</td></tr><tr><td>Longest Fix Substring in Issue</td><td>-0.04</td><td>3.7 × 10-1</td><td>-0.11</td><td>1.1 × 10-2</td><td>0.04</td><td>3.1 × 10-1</td></tr><tr><td>#Fix Lines in Issue</td><td>0.09</td><td>3.7 × 10-2</td><td>0.06</td><td>1.7 × 10-1</td><td>0.17</td><td>1.1 × 10-4</td></tr><tr><td>#Lines in Fix</td><td>-0.28</td><td>5.0 × 10-11</td><td>-0.40</td><td>1.3 × 10-21</td><td>-0.28</td><td>6.2 × 10-11</td></tr><tr><td>#Files in Fix</td><td>-0.12</td><td>6.2 × 10-3</td><td>-0.26</td><td>1.6 × 10-9</td><td>-0.16</td><td>1.4 × 10-4</td></tr><tr><td>#Affected Tests</td><td>-0.18</td><td>3.3 × 10-5</td><td>-0.25</td><td>4.0 × 10-9</td><td>-0.15</td><td>7.2 × 10-4</td></tr></table>
|
| 358 |
+
|
| 359 |
+
Data Contamination We analyze the accuracy (Acc) of AutoCodeRover v2 on SWA- and SWEE-Bench, depending on whether a PR was created before or after a model’s
|
| 360 |
+
|
| 361 |
+
Table 8. Accuracy of AutocodeRover v2 (Zhang et al., 2024) on SWA-Bench instances split between those created before and after the model’s knowledge cutoff (KC) and the p-value of the underlying resolution rate being the same or higher after the KC.
|
| 362 |
+
|
| 363 |
+
<table><tr><td>Dataset</td><td>Model</td><td># after KC</td><td>Acc before KC</td><td>Acc after KC</td><td>p-value</td></tr><tr><td rowspan="3">SWA</td><td>GPT-4O-MINI</td><td>249</td><td>9.4%</td><td>7.2%</td><td>17.90%</td></tr><tr><td>GPT-4O</td><td>249</td><td>12.2%</td><td>7.2%</td><td>2.65%</td></tr><tr><td>HAIKU-3.5</td><td>44</td><td>11.0%</td><td>9.1%</td><td>34.83%</td></tr><tr><td rowspan="3">SWEE</td><td>GPT-4O-MINI</td><td>230</td><td>8.2%</td><td>10.0%</td><td>76.50%</td></tr><tr><td>GPT-4O</td><td>230</td><td>15.4%</td><td>15.2%</td><td>47.56%</td></tr><tr><td>HAIKU-3.5</td><td>102</td><td>13.6%</td><td>9.8%</td><td>15.01%</td></tr></table>
|
| 364 |
+
|
| 365 |
+
knowledge cutoff (KC), showing results in Table 8. We report the (one-sided) p-value of observing these results under the null hypothesis that the success rate is not lower after the KC (computed using a t-test and normal approximation of the binomial distribution). We observe that on SWA-Bench all considered models have a lower success rate after the KC with the difference being statistically significant only for GPT-4O. Interestingly, we observe no such signs on SWEE-Bench which contains much less popular projects and is thus less prone to contamination. While all SWE instances are too old to conduct a similar analysis, we observe that the performance delta between SWE and SWA is correlated with the drop in accuracy over the KC on SWA.
|
| 366 |
+
|
| 367 |
+
# 6. Conclusion
|
| 368 |
+
|
| 369 |
+
We introduced SETUPAGENT, the first method for automated and historically accurate execution environment setup for Python codebases. SETUPAGENT enables us to create repository-level code benchmarks fully automatically from a simple list of GitHub repositories. We demonstrated its effectiveness by creating two new benchmarks, SWA- and SWEE-Bench, focusing on applications and diversity of codebases, respectively, and addressing several limitations of existing repository-level code benchmarks. In particular, their automated generation allows us to consider many more repositories, increasing diversity and reducing the risk of overfitting, and update the benchmarks over time, minimizing the risk of data contamination.
|
| 370 |
+
|
| 371 |
+
We extensively analyzed SWA- and SWEE-Bench, observing significant distributional differences compared to SWE-Bench in fix-complexity characteristics that are strongly correlated with agent success. We further found statistically significant performance degradation for SWA-Bench instances created after the knowledge cutoff for one model. Together, these findings highlight the importance of evaluating on diverse, representative, and frequently updated benchmarks and thus the value of our automated benchmark generation approach. We believe SETUPAGENT can facilitate this by enabling practitioners to quickly turn their specific target domain into a high-quality representative benchmark.
|
| 372 |
+
|
| 373 |
+
# References
|
| 374 |
+
|
| 375 |
+
Aider. Aider is SOTA for both SWE Bench and SWE Bench Lite, Jun 2024.
|
| 376 |
+
Anthropic. Model card addendum: Claude 3.5 haiku and upgraded claude 3.5 sonnet. https://assets.anthropic. com/m/1cd9d098ac3e6467/original/ Claude-3-Model-Card-October-Addendum. pdf, 2024.
|
| 377 |
+
Austin, J., Odena, A., Nye, M. I., Bosma, M., Michalewski, H., Dohan, D., Jiang, E., Cai, C. J., Terry, M., Le, Q. V., and Sutton, C. Program synthesis with large language models. CoRR, abs/2108.07732, 2021. URL https: //arxiv.org/abs/2108.07732.
|
| 378 |
+
Bouzenia, I. and Pradel, M. You name it, I run it: An LLM agent to execute tests of arbitrary projects. CoRR, abs/2412.10133, 2024. doi: 10.48550/ARXIV. 2412.10133. URL https://doi.org/10.48550/ arXiv.2412.10133.
|
| 379 |
+
Bouzenia, I., Devanbu, P. T., and Pradel, M. Repairagent: An autonomous, llm-based agent for program repair. CoRR, 2024a.
|
| 380 |
+
Bouzenia, I., Krishan, B. P., and Pradel, M. Dypybench: A benchmark of executable python software. Proc. ACM Softw. Eng., 1(FSE):338–358, 2024b. doi: 10.1145/3643742. URL https://doi.org/10. 1145/3643742.
|
| 381 |
+
Chen, M., Tworek, J., Jun, H., Yuan, Q., de Oliveira Pinto, H. P., Kaplan, J., Edwards, H., Burda, Y., Joseph, N., Brockman, G., Ray, A., Puri, R., Krueger, G., Petrov, M., Khlaaf, H., Sastry, G., Mishkin, P., Chan, B., Gray, S., Ryder, N., Pavlov, M., Power, A., Kaiser, L., Bavarian, M., Winter, C., Tillet, P., Such, F. P., Cummings, D., Plappert, M., Chantzis, F., Barnes, E., Herbert-Voss, A., Guss, W. H., Nichol, A., Paino, A., Tezak, N., Tang, J., Babuschkin, I., Balaji, S., Jain, S., Saunders, W., Hesse, C., Carr, A. N., Leike, J., Achiam, J., Misra, V., Morikawa, E., Radford, A., Knight, M., Brundage, M., Murati, M., Mayer, K., Welinder, P., Mc-Grew, B., Amodei, D., McCandlish, S., Sutskever, I., and Zaremba, W. Evaluating large language models trained on code. CoRR, abs/2107.03374, 2021. URL https://arxiv.org/abs/2107.03374.
|
| 382 |
+
Hashemi, M. Awesome python applications. https://github.com/mahmoud/ awesome-python-applications, 2024.
|
| 383 |
+
Hendrycks, D., Basart, S., Kadavath, S., Mazeika, M., Arora, A., Guo, E., Burns, C., Puranik, S., He,
|
| 384 |
+
|
| 385 |
+
H., Song, D., and Steinhardt, J. Measuring coding challenge competence with APPS. In Vanschoren, J. and Yeung, S. (eds.), Proceedings of the Neural Information Processing Systems Track on Datasets and Benchmarks 1, NeurIPS Datasets and Benchmarks 2021, December 2021, virtual, 2021. URL https: //datasets-benchmarks-proceedings. neurips.cc/paper/2021/hash/ c24cd76e1ce41366a4bbe8a49b02a028-Abstract-round2. html.
|
| 386 |
+
Huang, Y., Lin, Z., Liu, X., Gong, Y., Lu, S., Lei, F., Liang, Y., Shen, Y., Lin, C., Duan, N., and Chen, W. Competition-level problems are effective LLM evaluators. In Ku, L., Martins, A., and Srikumar, V. (eds.), Findings of the Association for Computational Linguistics, ACL 2024, Bangkok, Thailand and virtual meeting, August 11-16, 2024, pp. 13526–13544. Association for Computational Linguistics, 2024. doi: 10.18653/V1/2024. FINDINGS-ACL.803. URL https://doi.org/10. 18653/v1/2024.findings-acl.803.
|
| 387 |
+
Jain, N., Han, K., Gu, A., Li, W., Yan, F., Zhang, T., Wang, S., Solar-Lezama, A., Sen, K., and Stoica, I. Livecodebench: Holistic and contamination free evaluation of large language models for code. CoRR, abs/2403.07974, 2024a. doi: 10.48550/ARXIV.2403.07974. URL https: //doi.org/10.48550/arXiv.2403.07974.
|
| 388 |
+
Jain, N., Shetty, M., Zhang, T., Han, K., Sen, K., and Stoica, I. R2E: turning any github repository into a programming agent environment. In Forty-first International Conference on Machine Learning, ICML 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024b. URL https: //openreview.net/forum?id=kXHgEYFyf3.
|
| 389 |
+
Jain, N., Shetty, M., Zhang, T., Han, K., Sen, K., and Stoica, I. R2e: Turning any github repository into a programming agent test environment. In ICLR 2024, 2024c.
|
| 390 |
+
Jimenez, C. E., Yang, J., Wettig, A., Yao, S., Pei, K., Press, O., and Narasimhan, K. R. Swe-bench: Can language models resolve real-world github issues? In The Twelfth International Conference on Learning Representations, ICLR 2024, Vienna, Austria, May 7-11, 2024. OpenReview.net, 2024. URL https://openreview.net/ forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ VTF8yNQM66.
|
| 391 |
+
Liu, T., Xu, C., and McAuley, J. J. Repobench: Benchmarking repository-level code auto-completion systems. CoRR, abs/2306.03091, 2023. doi: 10.48550/ARXIV. 2306.03091.
|
| 392 |
+
Mündler, N., Mueller, M. N., He, J., and Vechev, M. Swtbench: Testing and validating real-world bug-fixes with code agents. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
|
| 393 |
+
|
| 394 |
+
OpenAI. Openai model docs. https://platform. openai.com/docs/models/gpt-4o, 2025.
|
| 395 |
+
OpenDevin. Opendevin: Code less, make more, 2024.
|
| 396 |
+
Ridnik, T., Kredo, D., and Friedman, I. Code generation with alphacodium: From prompt engineering to flow engineering. CoRR, abs/2401.08500, 2024. doi: 10.48550/ARXIV.2401.08500. URL https://doi. org/10.48550/arXiv.2401.08500.
|
| 397 |
+
Statista. Statista market insights. https: //www.statista.com/outlook/tmo/ software/worldwide, 2025.
|
| 398 |
+
van Kemenade, H., Paterson, C., Thoma, M., Si, R., and Dollenstein, Z. hugovk/top-pypi-packages: Release 2024.12, December 2024. URL https://doi.org/ 10.5281/zenodo.14252675.
|
| 399 |
+
Wang, L., Ma, C., Feng, X., Zhang, Z., Yang, H., Zhang, J., Chen, Z., Tang, J., Chen, X., Lin, Y., Zhao, W. X., Wei, Z., and Wen, J. A survey on large language model based autonomous agents. Frontiers Comput. Sci., 2024a.
|
| 400 |
+
Wang, X., Li, B., Song, Y., Xu, F. F., Tang, X., Zhuge, M., Pan, J., Song, Y., Li, B., Singh, J., Tran, H. H., Li, F., Ma, R., Zheng, M., Qian, B., Shao, Y., Muennighoff, N., Zhang, Y., Hui, B., Lin, J., Brennan, R., Peng, H., Ji, H., and Neubig, G. OpenHands: An Open Platform for AI Software Developers as Generalist Agents, 2024b. URL https://arxiv.org/abs/2407.16741.
|
| 401 |
+
Xia, C. S., Deng, Y., Dunn, S., and Zhang, L. Agentless: Demystifying llm-based software engineering agents. CoRR, abs/2407.01489, 2024. doi: 10.48550/ARXIV. 2407.01489. URL https://doi.org/10.48550/ arXiv.2407.01489.
|
| 402 |
+
Yang, J., Jimenez, C. E., Wettig, A., Lieret, K., Yao, S., Narasimhan, K., and Press, O. SWE-agent: Agent Computer Interfaces Enable Software Engineering Language Models, 2024.
|
| 403 |
+
Zhang, Y., Ruan, H., Fan, Z., and Roychoudhury, A. Autocoderover: Autonomous program improvement. CoRR, abs/2404.05427, 2024. doi: 10.48550/ARXIV.2404. 05427.
|
| 404 |
+
|
| 405 |
+
# A. Appendix: Experiments
|
| 406 |
+
|
| 407 |
+
Below, we provide the exact model versions we used in Table 9.
|
| 408 |
+
|
| 409 |
+
Table 9. LLM Details inlcuding Knowledge Cutoff (KC)
|
| 410 |
+
|
| 411 |
+
<table><tr><td>Model Name</td><td>Model ID</td><td>API Provider</td><td>KC</td><td>Reference</td></tr><tr><td>GPT-4o</td><td>gpt-4o-2024-08-06</td><td>OpenAI</td><td>Oct 2023</td><td>OpenAI (2025)</td></tr><tr><td>GPT-4o-MINI</td><td>gpt-4o-mini-2024-07-18</td><td>OpenAI</td><td>Oct 2023</td><td>OpenAI (2025)</td></tr><tr><td>HAIKU-3.5</td><td>claude-3-5-haiku-20241022</td><td>Anthropic</td><td>Jul 2024</td><td>Anthropic (2024)</td></tr></table>
|
| 412 |
+
|
| 413 |
+
# B. Appendix: Prompts
|
| 414 |
+
|
| 415 |
+
In this Section, we provide the full-length prompts used by SETUPAGENT.
|
| 416 |
+
|
| 417 |
+
# Prompt to suggest relevant files
|
| 418 |
+
|
| 419 |
+
You are a senior developer contributing to the www.github.com/<repo_id> project by solving issues. You have created a Docker environment with Ubuntu, and now you want to install the repository in development mode (meant for active development and testing) and run the tests. The first step is to locate the installation instructions and the test commands. I will provide you a list of filenames or file paths (e.g., README.md, contributing.md), which typically include instructions for installation and testing. The files can be either filenames (e.g., README.md) or file paths (e.g., docs/maintaining/installing/install-from-source.rst). From the provided list of filenames or file paths your task is: 1. Identify those likely related to installation or testing based on their names. 2. Exclude those that are clearly irrelevant. 3. If unsure, include the file/path in your response. 4. Return only the files/paths from the given list, exactly as they appear, without modifying their names or structure 5. If a full path is given, return the full path, not just the filename. 6. Use the following format for your response <ANSWER>: file 1, ...file n, filepath 1, ...filepath k
|
| 420 |
+
|
| 421 |
+
```txt
|
| 422 |
+
<REASONING>: <YOUR REASONING> Example input: readme.md, contributing.md, contributors.md, docs/maintaining/installing/install-from-source.rst docs/source/lib/install_datatypes.rst, docs/html/ux-research-design/contribute.md A reasonable output is: <ANSWER>: readme.md, contributing.md, docs/maintaining/installing/install-from-source.rst, <REASONING>: The files readme.md and contributing.md commonly contain installation and testing instructions, while docs/maintaining/installing/install-from-source.rst is likely related to installation as the name suggests Here are the file names <file 1>, <file 2>, ..., <file k> Please read the names carefully, ask yourself the purpose of each file based on the name before including it in your response. Use the given format for your answer and please do not add any extra comment or text.
|
| 423 |
+
```
|
| 424 |
+
|
| 425 |
+
Figure 9. Prompt for choosing relevant files to installation and testing
|
| 426 |
+
|
| 427 |
+
Table 10. SWA pipeline from projects to tasks. A PR is valid if it resolves an issue, modifies a test file, and is merged. An instance valid, if it has additionally at least one $F P$ test.
|
| 428 |
+
|
| 429 |
+
<table><tr><td>Step</td><td># Repos</td><td># PRs</td></tr><tr><td>Initial Projects</td><td>475</td><td></td></tr><tr><td>+ GH Repo Found</td><td>440</td><td></td></tr><tr><td>+ Preprocessing</td><td>427</td><td></td></tr><tr><td>+ Permissive License</td><td>227</td><td></td></tr><tr><td>+ Has valid PR</td><td>154</td><td></td></tr><tr><td>+ SETUPAGENT succeeds</td><td>44</td><td></td></tr><tr><td>+ Get up to 50 valid PRs</td><td></td><td>1527</td></tr><tr><td>+ SETUPAGENT succeeds</td><td></td><td>893</td></tr><tr><td>+ valid instance</td><td></td><td>535</td></tr></table>
|
| 430 |
+
|
| 431 |
+
# Prompt to suggest external sources of information
|
| 432 |
+
|
| 433 |
+
```txt
|
| 434 |
+
You are a senior developer contributing to the GitHub project at www.github.com/<repo_id> by solving issues. Your goal is to install the repository in development mode and run its tests.
|
| 435 |
+
You have created a Docker environment with Ubuntu, and now you are searching for the installation instructions and test commands.
|
| 436 |
+
I will provide you with the content of common repository files (e.g., README.md, CONTRIBUTING.md). Your task is to analyze the provided text and identify all external links that contain relevant information to 1. Installation instructions for this project.
|
| 437 |
+
2. Test commands or instructions for running the tests for this project.
|
| 438 |
+
3. Contribution guidelines.
|
| 439 |
+
Please provide the links you found following the criteria below. a. Exclude links to generalpurpose documentation for external tools (e.g., Tox, Pytest, or other frameworks/libraries).
|
| 440 |
+
b. If you are unsure about the relevance of a link, better include it.
|
| 441 |
+
c. Order the links from most to least relevant.
|
| 442 |
+
d. Do not add any comment or text.
|
| 443 |
+
e. Use the following format:
|
| 444 |
+
LINK: <LINK 1>
|
| 445 |
+
LINK: <LINK 2>
|
| 446 |
+
...LINK: <LINK n>
|
| 447 |
+
Here is the text:
|
| 448 |
+
```
|
| 449 |
+
```
|
| 450 |
+
<text_content>
|
| 451 |
+
```
|
| 452 |
+
|
| 453 |
+
Figure 10. Prompt to suggest potentially relevant external sources
|
| 454 |
+
|
| 455 |
+
# Prompt to determine importance of a url content
|
| 456 |
+
|
| 457 |
+
Figure 11. Prompt for determining if a link is relevant to installation and testing in the extraction phase of the SETUPAGENT
|
| 458 |
+
```txt
|
| 459 |
+
You are a senior developer working on the GitHub project at www.github.com/<repo_id>. You have set up a Docker environment with Ubuntu, and now your goal is to install the repository in development mode and run its tests. Your task is to carefully review the content of the following link: <current_link>, and determine if it includes installation instructions or test commands for the <repo_id> project. Please follow these steps: 1. Look carefully in the provided content for any potential installation commands or test commands related to the <repo_id> project. 2. Ask yourself if the located instructions are reasonable, legitimate and can be practically executed to install or to test the <repo_id> project only. Please provide your answer using the following format: INSTALLATION/TEST COMMANDS: <TRUE|FALSE> REASONING: <REASONING> **Important Notes** Answer with TRUE only if the content explicitly includes valid and usable installation or test commands. If you do not find any relevant commands, or if the instructions are vague, ambiguous, impractical, or unrelated answer FALSE. When in doubt, answer FALSE. Content of the link <current_link>:
|
| 460 |
+
```
|
| 461 |
+
```
|
| 462 |
+
<clean_content>
|
| 463 |
+
```
|
| 464 |
+
|
| 465 |
+
# Extract Install Command Prompt
|
| 466 |
+
|
| 467 |
+
You are a senior developer working on the project located at www.github.com/<repo_id>. You have created a Docker environment with Ubuntu, cloned the repository, and navigated to the directory <repo_dir>. Your next step is to install the project in development mode, which is intended for active development and testing. $\mathbb { T } ^ { \prime } \perp \mathbb { 1 }$ provide you with important text files (e.g., README.md) and important continuous integration (CI) configuration files, which typically contain instructions for developers on installation and testing. The format provided will be the file name followed by its content. Your task is to identify and return the bash commands necessary for the correct installation of the repository. This includes system dependencies, project installation in development mode, and any prerequisites or configuration commands.
|
| 468 |
+
|
| 469 |
+
# ** IMPORTANT NOTES **
|
| 470 |
+
|
| 471 |
+
1. Include system dependencies installation commands required for the project (e.g., via apt, yum, curl, etc.).
|
| 472 |
+
2. Include installation commands necessary for setting up the project in development mode.
|
| 473 |
+
3. Include prerequisites installation and configuration commands, such as those for npm or any other required setup.
|
| 474 |
+
3. If comprehensive installation instructions are provided, return them without any modifications.
|
| 475 |
+
4. Only exclude commands related to creating or activating virtual environments.
|
| 476 |
+
|
| 477 |
+
The returned commands should meet the following criteria:
|
| 478 |
+
|
| 479 |
+
1. Enclosed in quotes.
|
| 480 |
+
2. Focused strictly on commands necessary for both system dependency installation and development-mode installation of the project.
|
| 481 |
+
3. Free from any comments or text.
|
| 482 |
+
4. Accurate and executable without errors.
|
| 483 |
+
|
| 484 |
+
```txt
|
| 485 |
+
If no installation commands are present, return NONE.
|
| 486 |
+
Here is the text:
|
| 487 |
+
<context>
|
| 488 |
+
Take your time to carefully analyze the content. Make sure that your response includes only the necessary installation bash commands. Ask yourself if the provided content is sufficient for installation. And for each command, ask yourself what's the purpose of the command and if it is necessary.
|
| 489 |
+
An example of the expected response is: bash install_command_1 install_command_2
|
| 490 |
+
Please provide the installation commands in the above specified format.
|
| 491 |
+
```
|
| 492 |
+
|
| 493 |
+
Figure 12. Prompt used for extraction of installation commands in extraction phase of SETUPAGENT
|
| 494 |
+
|
| 495 |
+
# Extract Test Command Prompt
|
| 496 |
+
|
| 497 |
+
```txt
|
| 498 |
+
You are a senior developer working on the www.github.com/<repo_id> project. You have created a Docker environment with Ubuntu, cloned the repository, and installed it in development mode (meant for active development and testing).
|
| 499 |
+
You are now inside the <repo_dir> directory and your next goal is to run the unit tests. I will provide you with some important text files (e.g., README.md) and important continuous integration (CI) configuration files, which typically include instructions for running tests. The format provided will be the file name followed by its content.
|
| 500 |
+
Your task is to identify and return the exact bash commands required to run the tests.
|
| 501 |
+
The returned commands should meet the following criteria:
|
| 502 |
+
1. Enclosed in quotes.
|
| 503 |
+
2. Free from any comments or text.
|
| 504 |
+
3. Accurate and executable without errors.
|
| 505 |
+
If no test commands are present, return NONE.
|
| 506 |
+
Here is the text:
|
| 507 |
+
...
|
| 508 |
+
<context>
|
| 509 |
+
Take your time to analyze the content carefully. Ensure that only the necessary bash commands for running the tests are included. Ask yourself the purpose of each command before including it in your response.
|
| 510 |
+
An example of the expected response is:
|
| 511 |
+
``'bash
|
| 512 |
+
test_command_1
|
| 513 |
+
test_command_2
|
| 514 |
+
...
|
| 515 |
+
Please provide the test commands in the above specified format.
|
| 516 |
+
```
|
| 517 |
+
|
| 518 |
+
Figure 13. Prompt used for extraction of test commands in the extraction phase of SETUPAGENT
|
| 519 |
+
|
| 520 |
+
# Prompt for determining error causes
|
| 521 |
+
|
| 522 |
+
```txt
|
| 523 |
+
You are a developer working on the project at www.github.com/<repo_id>. You created an environment with python version <python_version>. Your goal is to install the repository in development mode (meant for active development and testing) and run the unit tests.
|
| 524 |
+
The installation commands are:
|
| 525 |
+
``'bash
|
| 526 |
+
<install_command_1>
|
| 527 |
+
<install_command_2>
|
| 528 |
+
...
|
| 529 |
+
<install_command_k>
|
| 530 |
+
``'
|
| 531 |
+
The testing commands are:
|
| 532 |
+
``'bash
|
| 533 |
+
<test_command_1>
|
| 534 |
+
<test_command_2>
|
| 535 |
+
...
|
| 536 |
+
<test_command_k>
|
| 537 |
+
``'
|
| 538 |
+
You received the following error message after executing the command
|
| 539 |
+
<error_command>:
|
| 540 |
+
``'
|
| 541 |
+
<error_message>
|
| 542 |
+
``'
|
| 543 |
+
Your task is to analyze the error message and determine its causes.
|
| 544 |
+
You can return one of the following answers:
|
| 545 |
+
1. <PYTHON>, if the error is caused by incompatibilities between the python version and any used package.
|
| 546 |
+
2. <INSTALLATION>, if the error is caused by an installation command or is related to any missing package, regardless if it a testing related framework or not. All the required packages must be installed in the installation phase.
|
| 547 |
+
3. <TESTING>, if the error is caused by any testing command (e.g., an invalid flag in the test command)
|
| 548 |
+
4. <UNDECIDABLE>, if you cannot determine what causes the error. Please read the error message carefully and try to spot the commands that are responsible for the error. Always provide the reasoning for your answer.
|
| 549 |
+
Use the following format:
|
| 550 |
+
RESULT: <PYTHON, INSTALLATION, TESTING, UNDECIDABLE>
|
| 551 |
+
REASONING: <YOUR REASONING>
|
| 552 |
+
```
|
| 553 |
+
|
| 554 |
+
Figure 14. Prompt for determining the error cause in the iterative improvement phase of the SETUPAGENT
|
| 555 |
+
|
| 556 |
+
# Prompt for fixing python version
|
| 557 |
+
|
| 558 |
+
```txt
|
| 559 |
+
You are a senior developer working on the project at
|
| 560 |
+
www.github.com/<repo_id>. Your goal is to install the repository in
|
| 561 |
+
development mode (meant for active development and testing) and run the
|
| 562 |
+
unit tests.
|
| 563 |
+
You created an environment with python version <python_version>, but you are
|
| 564 |
+
unsure if the python version is correct.
|
| 565 |
+
You received the following error message while testing the repository:
|
| 566 |
+
```
|
| 567 |
+
```
|
| 568 |
+
```
|
| 569 |
+
A senior software developer colleague has provided an explanation of why
|
| 570 |
+
things are not working as expected with the current commands:
|
| 571 |
+
<Reasoning from the answer to the prompt for determining the error cause>.
|
| 572 |
+
Use his reasoning to resolve the current error we are facing.
|
| 573 |
+
Your task is to determine a compatible Python version for the current state
|
| 574 |
+
of the repository. Carefully read the error message and identify the most
|
| 575 |
+
suitable Python version.
|
| 576 |
+
Please follow this answer format:
|
| 577 |
+
1. Return <NONE> if the error is unrelated to the Python version or you
|
| 578 |
+
cannot determine a compatible version.
|
| 579 |
+
2. If a specific Python version is compatible, return only the version
|
| 580 |
+
number (e.g., 2.7).
|
| 581 |
+
3. Do not include any additional comments or text in your response.
|
| 582 |
+
```
|
| 583 |
+
|
| 584 |
+
Figure 15. Prompt for fixing python version used in the iterative improvement phase of SETUPAGENT
|
| 585 |
+
|
| 586 |
+
# Prompt for fixing installation commands 1
|
| 587 |
+
|
| 588 |
+
```rst
|
| 589 |
+
You are a senior developer working on the project at
|
| 590 |
+
www.github.com/<repo_id>. You are working in an environment with python
|
| 591 |
+
version <python_version>. You have attempted to install the repository
|
| 592 |
+
in development mode (meant for active development and testing) using the
|
| 593 |
+
following bash commands:
|
| 594 |
+
``bash
|
| 595 |
+
<install_command_1>
|
| 596 |
+
<install_command_2>
|
| 597 |
+
...
|
| 598 |
+
<install_command_n>
|
| 599 |
+
However, the command <error_command> failed and we received the following
|
| 600 |
+
error message:
|
| 601 |
+
``
|
| 602 |
+
<error_message>
|
| 603 |
+
Your task is to fix the above error. Think carefully what causes the error
|
| 604 |
+
and try to spot the commands that are responsible for it. Please provide
|
| 605 |
+
the updated installation steps in a bash code block, following these rules:
|
| 606 |
+
1. You have to use always uv pip instead of regular pip.
|
| 607 |
+
2. Return <NONE> if you can not fix the command.
|
| 608 |
+
3. Do not add any comments or text.
|
| 609 |
+
For example:
|
| 610 |
+
``bash
|
| 611 |
+
apt-get install -y <package_name>
|
| 612 |
+
uv pip install -r requirements.txt
|
| 613 |
+
``
|
| 614 |
+
```
|
| 615 |
+
|
| 616 |
+
Figure 16. Prompt for fixing the installation commands used in the iterative improvement phase of SETUPAGENT when the error occurs in the building process of containers
|
| 617 |
+
|
| 618 |
+
# Prompt for fixing installation commands 2
|
| 619 |
+
|
| 620 |
+
```txt
|
| 621 |
+
You are a senior developer working on the project at
|
| 622 |
+
www.github.com/<repo_id>. You tried to install the repository in
|
| 623 |
+
development mode, which is intended for active development and testing,
|
| 624 |
+
however the installation failed.
|
| 625 |
+
You are working in an environoment with python version <python> and you tried
|
| 626 |
+
to use the following bash commands for the installation:
|
| 627 |
+
``'bash
|
| 628 |
+
<install_command_1>
|
| 629 |
+
<install_command_2>
|
| 630 |
+
...
|
| 631 |
+
<install_command_n>
|
| 632 |
+
During the execution of these commands, you received the following error
|
| 633 |
+
message:
|
| 634 |
+
``'
|
| 635 |
+
<error_message>
|
| 636 |
+
A senior software developer colleague has provided an explanation of why
|
| 637 |
+
things are not working as expected with the current commands:
|
| 638 |
+
<Reasoning from the answer to the prompt for determining the error cause>.
|
| 639 |
+
Use his reasoning to resolve the current error we are facing.
|
| 640 |
+
Your task is to carefully read the error message and determine which
|
| 641 |
+
commands are causing the error. Reason about every command if it is causing
|
| 642 |
+
the error. If you conclude that the problem is related to any of the
|
| 643 |
+
commands, update the installation bash script to solve the problem. Note
|
| 644 |
+
that you can also add new commands to fix the problem. If you decide to
|
| 645 |
+
update the installation bash script you have to follow these rules:
|
| 646 |
+
1. Provide the updated installation steps in a bash code block.
|
| 647 |
+
2. Use uv pip instead of regular pip.
|
| 648 |
+
2. Return NONE if the error is not related to the installation steps or you
|
| 649 |
+
are not able to fix it.
|
| 650 |
+
3. Do not add any comments or text.
|
| 651 |
+
For example:
|
| 652 |
+
The initial installation command is:
|
| 653 |
+
``'bash
|
| 654 |
+
uv pip install
|
| 655 |
+
However, the error message states that the <package_name> package is not
|
| 656 |
+
installed. Then you would update the installation command to:
|
| 657 |
+
``'bash
|
| 658 |
+
uv pip install
|
| 659 |
+
uv pip install <package_name>
|
| 660 |
+
``'
|
| 661 |
+
```
|
| 662 |
+
|
| 663 |
+
Figure 17. Prompt for fixing the installation commands used in the iterative improvement phase of SETUPAGENT
|
| 664 |
+
|
| 665 |
+
# Prompt for fixing testing commands
|
| 666 |
+
|
| 667 |
+
```rst
|
| 668 |
+
You are a senior developer working on the project at
|
| 669 |
+
www.github.com/<repo_id>. You installed the repository in an environoment
|
| 670 |
+
with python version <python_version> and now you are trying to run the unit
|
| 671 |
+
tests.
|
| 672 |
+
You run the tests using the following bash commands:
|
| 673 |
+
``bash
|
| 674 |
+
<test_command_1>
|
| 675 |
+
<test_command_2>
|
| 676 |
+
...
|
| 677 |
+
<test_command_k>
|
| 678 |
+
However, at the moment we receive the following error message:
|
| 679 |
+
``<error_message>
|
| 680 |
+
A senior software developer colleague has provided an explanation of why
|
| 681 |
+
things are not working as expected with the current commands:
|
| 682 |
+
<Reasoning from the answer to the prompt for determining the error cause>.
|
| 683 |
+
Use his reasoning to resolve the current error we are facing.
|
| 684 |
+
Your task is to read the produced error message carefully, determine what
|
| 685 |
+
the problem is and try to fix it. Ask yourself which test command could
|
| 686 |
+
cause this problem. If you conclude that the problem is related to the test
|
| 687 |
+
commands, update the test commands to solve the problem.
|
| 688 |
+
Please provide the updated test commands in a bash code block, following
|
| 689 |
+
these rules:
|
| 690 |
+
1. You have to always use uv pip instead of regular pip.
|
| 691 |
+
2. Return NONE if the error is not related to the test command or you
|
| 692 |
+
cannot fix it.
|
| 693 |
+
3. Do not add any comments or text.
|
| 694 |
+
4. Add a command only if you are sure that it is correct.
|
| 695 |
+
For example: The initial testing command was:
|
| 696 |
+
``bash
|
| 697 |
+
pytest test_file.py run all *** However, if in this case we would need the
|
| 698 |
+
flag '-v' and the maximal number of failing tests to be 1, we would have to
|
| 699 |
+
correct the command to:
|
| 700 |
+
``'bash
|
| 701 |
+
pytest test_file.py maxfail=1 v ***
|
| 702 |
+
```
|
| 703 |
+
|
| 704 |
+
Figure 18. Prompt for fixing the installation commands used in the iterative improvement phase of SETUPAGENT
|
| 705 |
+
|
| 706 |
+
# C. Appendix – Dataset Details
|
| 707 |
+
|
| 708 |
+
Below, we list all repositories along with the number of corresponding tasks in SWA-Bench.
|
| 709 |
+
|
| 710 |
+
# SWA-Bench– Repositories
|
| 711 |
+
|
| 712 |
+
1. iterative/dvc - 42
|
| 713 |
+
2. streamlink/streamlink - 35
|
| 714 |
+
3. spack/spack - 35
|
| 715 |
+
4. PrefectHQ/prefect - 34
|
| 716 |
+
5. xonsh/xonsh - 32
|
| 717 |
+
6. mitmproxy/mitmproxy - 31
|
| 718 |
+
7. python-pillow/Pillow - 29
|
| 719 |
+
8. mkdocs/mkdocs - 23
|
| 720 |
+
9. hynek/structlog - 22
|
| 721 |
+
10. pallets/click - 21
|
| 722 |
+
11. locustio/locust - 20
|
| 723 |
+
12. jpadilla/pyjwt - 17
|
| 724 |
+
13. elastic/elasticsearch-dsl-py - 17
|
| 725 |
+
14. pallets-eco/wtforms - 17
|
| 726 |
+
15. ipython/ipython - 16
|
| 727 |
+
16. python-poetry/poetry - 15
|
| 728 |
+
17. conan-io/conan - 15
|
| 729 |
+
18. sabnzbd/sabnzbd - 14
|
| 730 |
+
19. Zulko/moviepy - 14
|
| 731 |
+
20. nvbn/thefuck - 12
|
| 732 |
+
21. arrow-py/arrow - 11
|
| 733 |
+
22. benoitc/gunicorn - 8
|
| 734 |
+
|
| 735 |
+
23. cookiecutter/cookiecutter - 8
|
| 736 |
+
24. pypa/pipenv - 7
|
| 737 |
+
25. graphql-python/graphene - 6
|
| 738 |
+
26. pypa/bandersnatch - 5
|
| 739 |
+
27. AtsushiSakai/PythonRobotics - 4
|
| 740 |
+
28. hynek/doc2dash - 3
|
| 741 |
+
29. PythonCharmers/python-future - 3
|
| 742 |
+
30. aimhubio/aim - 2
|
| 743 |
+
31. dbcli/pgcli - 2
|
| 744 |
+
32. geopython/pycsw - 2
|
| 745 |
+
33. dbader/schedule - 2
|
| 746 |
+
34. kibitzr/kibitzr - 1
|
| 747 |
+
35. getnikola/nikola - 1
|
| 748 |
+
36. geopy/geopy - 1
|
| 749 |
+
37. Maratyszcza/PeachPy - 1
|
| 750 |
+
38. gawel/pyquery - 1
|
| 751 |
+
39. Suor/funcy - 1
|
| 752 |
+
40. simonw/datasette - 1
|
| 753 |
+
41. cowrie/cowrie - 1
|
| 754 |
+
42. pypa/pip - 1
|
| 755 |
+
43. StevenBlack/hosts - 1
|
| 756 |
+
44. jupyter/nbgrader - 1
|
| 757 |
+
|
| 758 |
+
# SWEE-Bench– Repositories Part I
|
| 759 |
+
|
| 760 |
+
1. python-attrs/attrs - 9
|
| 761 |
+
2. dgasmith/opt_einsum - 9
|
| 762 |
+
3. jazzband/tablib - 8
|
| 763 |
+
4. MartinThoma/flake8-simplify - 8
|
| 764 |
+
5. matthewwithanm/python-markdownify - 8
|
| 765 |
+
6. stephenhillier/starlette_exporter - 8
|
| 766 |
+
7. sciunto-org/python-bibtexparser - 8
|
| 767 |
+
8. davidhalter/parso - 8
|
| 768 |
+
9. marshmallow-code/flask-smorest - 7
|
| 769 |
+
10. adamchainz/blacken-docs - 7
|
| 770 |
+
11. MarketSquare/robotframework-tidy - 7
|
| 771 |
+
12. lundberg/respx - 7
|
| 772 |
+
13. seperman/deepdiff - 7
|
| 773 |
+
14. Stranger6667/hypothesis-graphql - 7
|
| 774 |
+
15. cantools/cantools - 7
|
| 775 |
+
16. didix21/mdutils - 7
|
| 776 |
+
17. marshmallow-code/apispec - 7
|
| 777 |
+
18. softlayer/softlayer-python - 6
|
| 778 |
+
19. gorakhargosh/watchdog - 6
|
| 779 |
+
20. pygments/pygments - 6
|
| 780 |
+
21. dask-contrib/dask-histogram - 6
|
| 781 |
+
22. andialbrecht/sqlparse - 6
|
| 782 |
+
23. mirumee/ariadne - 6
|
| 783 |
+
24. tableau/tabcmd - 6
|
| 784 |
+
25. gerrymanoim/exchange_calendars - 5
|
| 785 |
+
26. snowplow/snowplow-python-tracker - 5
|
| 786 |
+
27. joerick/pyinstrument - 5
|
| 787 |
+
28. scikit-rf/scikit-rf - 5
|
| 788 |
+
29. matthewwardrop/formulaic - 5
|
| 789 |
+
30. laspy/laspy - 5
|
| 790 |
+
31. python-control/python-control - 5
|
| 791 |
+
32. mwouts/itables - 5
|
| 792 |
+
33. AzureAD/microsoft-authentication-library-for-python
|
| 793 |
+
- 5
|
| 794 |
+
34. firebase/firebase-admin-python - 5
|
| 795 |
+
35. ethereum/eth-account - 5
|
| 796 |
+
36. davidhalter/jedi - 5
|
| 797 |
+
37. agronholm/typeguard - 5
|
| 798 |
+
38. Delgan/loguru - 5
|
| 799 |
+
39. pytransitions/transitions - 5
|
| 800 |
+
|
| 801 |
+
40. lovasoa/marshmallow_dataclass - 5
|
| 802 |
+
41. aio-libs/yarl - 5
|
| 803 |
+
42. PyCQA/pyflakes - 5
|
| 804 |
+
43. python/importlib_metadata - 5
|
| 805 |
+
44. konradhalas/dacite - 5
|
| 806 |
+
45. ilevkivskyi/typing_inspect - 5
|
| 807 |
+
46. jupyter/jupyter_core - 5
|
| 808 |
+
47. getsentry/responses - 5
|
| 809 |
+
48. beartype/plum - 4
|
| 810 |
+
49. open2c/bioframe - 4
|
| 811 |
+
50. developmentseed/morecantile - 4
|
| 812 |
+
51. nats-io/nats.py - 4
|
| 813 |
+
52. nipy/nipype - 4
|
| 814 |
+
53. python-quantities/python-quantities - 4
|
| 815 |
+
54. stac-utils/pystac-client - 4
|
| 816 |
+
55. luolingchun/flask-openapi3 - 4
|
| 817 |
+
56. sayanarijit/expandvars - 4
|
| 818 |
+
57. jpadilla/pyjwt - 4
|
| 819 |
+
58. NowanIlfideme/pydantic-yaml - 4
|
| 820 |
+
59. john-kurkowski/tldextract - 4
|
| 821 |
+
60. geopandas/geopandas - 4
|
| 822 |
+
61. cloudevents/sdk-python - 4
|
| 823 |
+
62. jupyter/nbformat - 4
|
| 824 |
+
63. matthew-brett/delocate - 4
|
| 825 |
+
64. iterative/shtab - 4
|
| 826 |
+
65. jsonpickle/jsonpickle - 4
|
| 827 |
+
66. ethereum/eth-utils - 4
|
| 828 |
+
67. mhe/pynrrd - 4
|
| 829 |
+
68. adamjstewart/fiscalyear - 4
|
| 830 |
+
69. pytest-dev/pytest-xdist - 4
|
| 831 |
+
70. facelessuser/wcmatch - 4
|
| 832 |
+
71. scikit-hep/awkward - 4
|
| 833 |
+
72. tomplus/kubernetes_asyncio - 4
|
| 834 |
+
73. ipython/traitlets - 4
|
| 835 |
+
74. David-Wobrock/sqlvalidator - 4
|
| 836 |
+
75. omry/omegaconf - 4
|
| 837 |
+
76. python-lsp/python-lsp-server - 4
|
| 838 |
+
77. cogeotiff/rio-tiler - 3
|
| 839 |
+
78. wjohnson/pyapacheatlas - 3
|
| 840 |
+
|
| 841 |
+
# SWEE-Bench – Repositories Part II
|
| 842 |
+
|
| 843 |
+
79. adamchainz/django-htmx - 3
|
| 844 |
+
80. mwclient/mwclient - 3
|
| 845 |
+
81. executablebooks/sphinx-book-theme - 3
|
| 846 |
+
82. scikit-hep/vector - 3
|
| 847 |
+
83. patrick-kidger/equinox - 3
|
| 848 |
+
84. christiansandberg/canopen - 3
|
| 849 |
+
85. regebro/pyroma - 3
|
| 850 |
+
86. nephila/giturlparse - 3
|
| 851 |
+
87. cookiecutter/cookiecutter - 3
|
| 852 |
+
88. serge-sans-paille/pythran - 3
|
| 853 |
+
89. tomasvotava/fastapi-sso - 3
|
| 854 |
+
90. jsvine/pdfplumber - 3
|
| 855 |
+
91. scrapy/protego - 3
|
| 856 |
+
92. SmileyChris/django-countries - 3
|
| 857 |
+
93. cscorley/whatthepatch - 3
|
| 858 |
+
94. pythological/kanren - 3
|
| 859 |
+
95. pypa/virtualenv - 3
|
| 860 |
+
96. fastavro/fastavro - 3
|
| 861 |
+
97. marshmallow-code/marshmallow-sqlalchemy - 3
|
| 862 |
+
98. gazpachoking/jsonref - 3
|
| 863 |
+
99. lepture/mistune - 3
|
| 864 |
+
100. scikit-learn-contrib/category_encoders 3
|
| 865 |
+
101. simonw/sqlite-utils - 3
|
| 866 |
+
102. executablebooks/mdit-py-plugins - 3
|
| 867 |
+
103. tsutsu3/linkify-it-py - 3
|
| 868 |
+
104. hhatto/autopep8 - 3
|
| 869 |
+
105. cubewise-code/mdxpy - 3
|
| 870 |
+
106. joblib/joblib - 3
|
| 871 |
+
107. python-trio/trio-typing - 3
|
| 872 |
+
108. nalepae/pandarallel - 3
|
| 873 |
+
109. tableau/server-client-python - 3
|
| 874 |
+
110. r1chardj0n3s/parse - 3
|
| 875 |
+
111. ipython/ipython - 3
|
| 876 |
+
112. pypa/readme_renderer - 3
|
| 877 |
+
113. jaraco/zipp - 3
|
| 878 |
+
114. docker/docker-py - 3
|
| 879 |
+
115. joshy/striprtf - 3
|
| 880 |
+
116. googleapis/python-pubsub - 3
|
| 881 |
+
117. TylerYep/torchinfo - 3
|
| 882 |
+
|
| 883 |
+
118. scrapy/w3lib - 3
|
| 884 |
+
119. googleapis/google-auth-library-python-oauthlib
|
| 885 |
+
120. agronholm/cbor2 - 3
|
| 886 |
+
121. weiwei/junitparser - 3
|
| 887 |
+
122. conan-io/conan - 3
|
| 888 |
+
123. python/importlib_resources - 3
|
| 889 |
+
124. timvink/mkdocs-git-authors-plugin - 3
|
| 890 |
+
125. agronholm/exceptiongroup - 3
|
| 891 |
+
126. magmax/python-inquirer - 3
|
| 892 |
+
127. PrefectHQ/prefect - 3
|
| 893 |
+
128. Yelp/detect-secrets - 3
|
| 894 |
+
129. Chilipp/autodocsumm - 3
|
| 895 |
+
130. jaraco/keyring - 3
|
| 896 |
+
131. Pylons/waitress - 3
|
| 897 |
+
132. pypa/setuptools - 3
|
| 898 |
+
133. barrust/pyspellchecker - 2
|
| 899 |
+
134. bluesky/ophyd - 2
|
| 900 |
+
135. OpenMath/py-openmath - 2
|
| 901 |
+
136. readthedocs/sphinx-notfound-page - 2
|
| 902 |
+
137. canonical/operator - 2
|
| 903 |
+
138. ekzhu/datasketch - 2
|
| 904 |
+
139. dhatim/python-license-check - 2
|
| 905 |
+
140. Shoobx/xmldiff - 2
|
| 906 |
+
141. ewels/rich-click - 2
|
| 907 |
+
142. jaraco/path - 2
|
| 908 |
+
143. yu-iskw/dbt-artifacts-parser - 2
|
| 909 |
+
144. symerio/pgeocode - 2
|
| 910 |
+
145. daggaz/json-stream - 2
|
| 911 |
+
146. jazzband/dj-database-url - 2
|
| 912 |
+
147. nipunsadvilkar/pySBD - 2
|
| 913 |
+
148. adamchainz/django-linear-migrations - 2
|
| 914 |
+
149. mwouts/jupytext - 2
|
| 915 |
+
150. MrBin99/django-vite - 2
|
| 916 |
+
151. ml31415/numpy-groupies - 2
|
| 917 |
+
152. regebro/svg.path - 2
|
| 918 |
+
153. gmr/flatdict - 2
|
| 919 |
+
154. aws-samples/sample-python-helper-aws-appconfig
|
| 920 |
+
155. behave/behave - 2
|
| 921 |
+
|
| 922 |
+
# SWEE-Bench – Repositories Part III
|
| 923 |
+
|
| 924 |
+
156. thesimj/envyaml - 2
|
| 925 |
+
157. codingjoe/django-select2 - 2
|
| 926 |
+
158. allisson/python-simple-rest-client - 2
|
| 927 |
+
159. christianhelle/autofaker - 2
|
| 928 |
+
160. esphome/aioesphomeapi - 2
|
| 929 |
+
161. oauthlib/oauthlib - 2
|
| 930 |
+
162. rustedpy/result - 2
|
| 931 |
+
163. graphql-python/graphene - 2
|
| 932 |
+
164. benmoran56/esper - 2
|
| 933 |
+
165. eerimoq/bincopy - 2
|
| 934 |
+
166. keleshev/schema - 2
|
| 935 |
+
167. PyCQA/flake8 - 2
|
| 936 |
+
168. kjd/idna - 2
|
| 937 |
+
169. jupyter/nbconvert - 2
|
| 938 |
+
170. scikit-hep/hist - 2
|
| 939 |
+
171. spulec/freezegun - 2
|
| 940 |
+
172. jupyter/nbclient - 2
|
| 941 |
+
173. PythonCharmers/python-future - 2
|
| 942 |
+
174. tortoise/pypika-tortoise - 2
|
| 943 |
+
175. rthalley/dnspython - 2
|
| 944 |
+
176. mkaranasou/pyaml_env - 2
|
| 945 |
+
177. terraform-compliance/cli - 2
|
| 946 |
+
178. googleapis/python-firestore - 2
|
| 947 |
+
179. googleapis/python-api-core - 2
|
| 948 |
+
180. scrapy/cssselect - 2
|
| 949 |
+
181. python-humanize/humanize - 2
|
| 950 |
+
182. jdepoix/youtube-transcript-api - 2
|
| 951 |
+
183. dedupeio/dedupe - 2
|
| 952 |
+
184. databricks/databricks-cli - 2
|
| 953 |
+
185. bluesky/event-model - 2
|
| 954 |
+
186. workos/workos-python - 2
|
| 955 |
+
187. kynan/nbstripout - 2
|
| 956 |
+
188. assertpy/assertpy - 2
|
| 957 |
+
189. dbt-labs/hologram - 2
|
| 958 |
+
190. sendgrid/python-http-client - 2
|
| 959 |
+
191. keis/base58 - 2
|
| 960 |
+
192. attwad/python-osc - 2
|
| 961 |
+
193. wireservice/csvkit - 2
|
| 962 |
+
194. adamchainz/time-machine - 2
|
| 963 |
+
195. MagicStack/immutables - 2
|
| 964 |
+
|
| 965 |
+
196. vinitkumar/json2xml - 2
|
| 966 |
+
197. frispete/keyrings.cryptfile - 2
|
| 967 |
+
198. swansonk14/typed-argument-parser - 2
|
| 968 |
+
199. scottwernervt/favicon - 2
|
| 969 |
+
200. slackapi/python-slack-sdk - 2
|
| 970 |
+
201. nginxinc/crossplane - 2
|
| 971 |
+
202. hetznercloud/hcloud-python - 2
|
| 972 |
+
203. dbader/schedule - 2
|
| 973 |
+
204. amplify-education/python-hcl2 - 2
|
| 974 |
+
205. jazzband/contextlib2 - 2
|
| 975 |
+
206. theskumar/python-dotenv - 2
|
| 976 |
+
207. raimon49/pip-licenses - 2
|
| 977 |
+
208. locustio/locust - 2
|
| 978 |
+
209. astanin/python-tabulate - 2
|
| 979 |
+
210. alecthomas/voluptuous - 2
|
| 980 |
+
211. django-crispy-forms/crispy-bootstrap5 - 2
|
| 981 |
+
212. geospace-code/pymap3d - 2
|
| 982 |
+
213. tedder/requests-aws4auth - 2
|
| 983 |
+
214. pyvisa/pyvisa-py - 1
|
| 984 |
+
215. nithinmurali/pygsheets - 1
|
| 985 |
+
216. mlenzen/collections-extended - 1
|
| 986 |
+
217. emcconville/wand - 1
|
| 987 |
+
218. rsalmei/alive-progress - 1
|
| 988 |
+
219. rycus86/prometheus_flask_exporter - 1
|
| 989 |
+
220. fastapi-users/fastapi-users - 1
|
| 990 |
+
221. google/mobly - 1
|
| 991 |
+
222. scrapy/itemadapter - 1
|
| 992 |
+
223. ncclient/ncclient - 1
|
| 993 |
+
224. google/duet - 1
|
| 994 |
+
225. di/calver - 1
|
| 995 |
+
226. beancount/smart_importer - 1
|
| 996 |
+
227. bridgecrewio/python-hcl2 - 1
|
| 997 |
+
228. construct/construct - 1
|
| 998 |
+
229. devrimcavusoglu/pybboxes - 1
|
| 999 |
+
230. richardpenman/whois - 1
|
| 1000 |
+
231. cvxpy/cvxpy - 1
|
| 1001 |
+
232. elastic/ecs-logging-python - 1
|
| 1002 |
+
233. pythonarcade/pytiled_parser - 1
|
| 1003 |
+
234. astropy/extension-helpers - 1
|
| 1004 |
+
|
| 1005 |
+
# SWEE-Bench – Repositories Part IV
|
| 1006 |
+
|
| 1007 |
+
235. SAP/python-pyodata - 1
|
| 1008 |
+
236. Azure/azure-functions-durable-python - 1
|
| 1009 |
+
237. IdentityPython/djangosaml2 - 1
|
| 1010 |
+
238. jwodder/check-wheel-contents - 1
|
| 1011 |
+
239. Zulko/moviepy - 1
|
| 1012 |
+
240. xhtml2pdf/xhtml2pdf - 1
|
| 1013 |
+
241. cknd/stackprinter - 1
|
| 1014 |
+
242. guillp/jwskate - 1
|
| 1015 |
+
243. jmcarp/flask-apispec - 1
|
| 1016 |
+
244. timofurrer/colorful - 1
|
| 1017 |
+
245. miso-belica/sumy - 1
|
| 1018 |
+
246. kvesteri/intervals - 1
|
| 1019 |
+
247. marcotcr/lime - 1
|
| 1020 |
+
248. wkentaro/gdown - 1
|
| 1021 |
+
249. realpython/codetiming - 1
|
| 1022 |
+
250. jaraco/tempora - 1
|
| 1023 |
+
251. jendrikseipp/vulture - 1
|
| 1024 |
+
252. pycontribs/ruyaml - 1
|
| 1025 |
+
253. albumentations-team/albumentations - 1
|
| 1026 |
+
254. nose-devs/nose2 - 1
|
| 1027 |
+
255. jongracecox/anybadge - 1
|
| 1028 |
+
256. patrys/httmock - 1
|
| 1029 |
+
257. maxfischer2781/asyncstdlib - 1
|
| 1030 |
+
258. pgzip/pgzip - 1
|
| 1031 |
+
259. arvkevi/kneed - 1
|
| 1032 |
+
260. rasterio/affine - 1
|
| 1033 |
+
261. circus-tent/circus - 1
|
| 1034 |
+
262. xchwarze/samsung-tv-ws-api - 1
|
| 1035 |
+
263. jaraco/portend - 1
|
| 1036 |
+
264. fabiocaccamo/python-benedict - 1
|
| 1037 |
+
265. numpy/numpy-financial - 1
|
| 1038 |
+
266. praw-dev/prawcore - 1
|
| 1039 |
+
267. scipy/oldest-supported-numpy - 1
|
| 1040 |
+
268. logtail/logtail-python - 1
|
| 1041 |
+
269. polkascan/py-scale-codec - 1
|
| 1042 |
+
270. Knio/pynmea2 - 1
|
| 1043 |
+
271. jazzband/django-configurations - 1
|
| 1044 |
+
272. allenai/cached_path - 1
|
| 1045 |
+
273. click-contrib/click-aliases - 1
|
| 1046 |
+
|
| 1047 |
+
274. Pylons/hupper - 1
|
| 1048 |
+
275. cloudscale-ch/cloudscale-python-sdk - 1
|
| 1049 |
+
276. alessandromaggio/pythonping - 1
|
| 1050 |
+
277. imageio/imageio-ffmpeg - 1
|
| 1051 |
+
278. podhmo/python-node-semver - 1
|
| 1052 |
+
279. netbox-community/pynetbox - 1
|
| 1053 |
+
280. kumar303/mohawk - 1
|
| 1054 |
+
281. SpamScope/mail-parser - 1
|
| 1055 |
+
282. perrygeo/python-rasterstats - 1
|
| 1056 |
+
283. pahaz/sshtunnel - 1
|
| 1057 |
+
284. python-hyper/h11 - 1
|
| 1058 |
+
285. razorpay/razorpay-python - 1
|
| 1059 |
+
286. zeroSteiner/rule-engine - 1
|
| 1060 |
+
287. mocobeta/janome - 1
|
| 1061 |
+
288. glut23/webvtt-py - 1
|
| 1062 |
+
289. benoitc/gunicorn - 1
|
| 1063 |
+
290. mcmtroffaes/pybtex-docutils - 1
|
| 1064 |
+
291. alexmojaki/executing - 1
|
| 1065 |
+
292. sigmavirus24/github3.py - 1
|
| 1066 |
+
293. ccpem/mrcfile - 1
|
| 1067 |
+
294. csinva/imodels - 1
|
| 1068 |
+
295. click-contrib/click-help-colors - 1
|
| 1069 |
+
296. srossross/rpmfile - 1
|
| 1070 |
+
297. hgrecco/pint - 1
|
| 1071 |
+
298. django-ses/django-ses - 1
|
| 1072 |
+
299. gmr/pamqp - 1
|
| 1073 |
+
300. spotify/annoy - 1
|
| 1074 |
+
301. PyCQA/pycodestyle - 1
|
| 1075 |
+
302. regebro/tzlocal - 1
|
| 1076 |
+
303. mapado/haversine - 1
|
| 1077 |
+
304. scientific-python/lazy-loader - 1
|
| 1078 |
+
305. grappa-py/grappa - 1
|
| 1079 |
+
306. flexmock/flexmock - 1
|
| 1080 |
+
307. jg-rp/liquid - 1
|
| 1081 |
+
308. prompt-toolkit/python-prompt-toolkit - 1
|
| 1082 |
+
309. jaraco/jaraco.context - 1
|
| 1083 |
+
310. aio-libs/multidict - 1
|
| 1084 |
+
311. rsheftel/pandas_market_calendars - 1
|
| 1085 |
+
|
| 1086 |
+
# SWEE-Bench – Repositories Part V
|
| 1087 |
+
|
| 1088 |
+
312. mkdocs/mkdocs - 1
|
| 1089 |
+
313. websocket-client/websocket-client - 1
|
| 1090 |
+
314. DataDog/datadog-lambda-python - 1
|
| 1091 |
+
315. iterative/dvclive - 1
|
| 1092 |
+
316. cogeotiff/rio-cogeo - 1
|
| 1093 |
+
317. erikrose/parsimonious - 1
|
| 1094 |
+
318. facelessuser/pymdown-extensions - 1
|
| 1095 |
+
319. pypa/build - 1
|
| 1096 |
+
320. mkdocs/mkdocs-redirects - 1
|
| 1097 |
+
321. dlint-py/dlint - 1
|
| 1098 |
+
322. klen/peewee_migrate - 1
|
| 1099 |
+
323. afq984/python-cxxfilt - 1
|
| 1100 |
+
324. kinverarity1/lasio - 1
|
| 1101 |
+
325. Turbo87/utm - 1
|
| 1102 |
+
326. django/daphne - 1
|
| 1103 |
+
327. executablebooks/sphinx-design - 1
|
| 1104 |
+
328. interpretml/slicer - 1
|
| 1105 |
+
329. google/yapf - 1
|
| 1106 |
+
330. sensein/etelemetry-client - 1
|
| 1107 |
+
331. MKuranowski/aiocsv - 1
|
| 1108 |
+
332. executablebooks/sphinx-tabs - 1
|
| 1109 |
+
333. pexpect/pexpect - 1
|
| 1110 |
+
334. pythological/etuples - 1
|
| 1111 |
+
335. frankie567/httpx-oauth - 1
|
| 1112 |
+
336. sarugaku/resolvelib - 1
|
| 1113 |
+
337. python273/telegraph - 1
|
| 1114 |
+
338. boolangery/py-lua-parser - 1
|
| 1115 |
+
339. Electrostatics/mmcif_pdbx - 1
|
| 1116 |
+
|
| 1117 |
+
340. pyca/service-identity - 1
|
| 1118 |
+
341. diff-match-patch-python/diff-match-patch -
|
| 1119 |
+
342. xlwings/jsondiff - 1
|
| 1120 |
+
343. mapbox/cligj - 1
|
| 1121 |
+
344. cthoyt/pystow - 1
|
| 1122 |
+
345. Rapptz/discord.py - 1
|
| 1123 |
+
346. gahjelle/pyplugs - 1
|
| 1124 |
+
347. Colin-b/pytest_httpx - 1
|
| 1125 |
+
348. LLNL/certipy - 1
|
| 1126 |
+
349. spec-first/connexion - 1
|
| 1127 |
+
350. Yelp/bravado - 1
|
| 1128 |
+
351. mkorpela/pabot - 1
|
| 1129 |
+
352. scrapy/parsel - 1
|
| 1130 |
+
353. alexmojaki/pure_eval - 1
|
| 1131 |
+
354. graphql-python/graphql-core - 1
|
| 1132 |
+
355. joke2k/faker - 1
|
| 1133 |
+
356. averbis/averbis-python-api - 1
|
| 1134 |
+
357. jupyter/jupyter_client - 1
|
| 1135 |
+
358. jaraco/inflect - 1
|
| 1136 |
+
359. GreyZmeem/python-logging-loki - 1
|
| 1137 |
+
360. suminb/base62 - 1
|
| 1138 |
+
361. youknowone/wirerope - 1
|
| 1139 |
+
362. xnuinside/simple-ddl-parser - 1
|
| 1140 |
+
363. executablebooks/sphinx-thebe - 1
|
| 1141 |
+
364. Pylons/webob - 1
|
| 1142 |
+
365. SethMMorton/fastnumbers - 1
|
| 1143 |
+
366. python-semver/python-semver - 1
|
paper_markdowns/bamboo-03997.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04032.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04097.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04153.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04217.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04333.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04427.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04457.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04507.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04533.md
ADDED
|
@@ -0,0 +1,425 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Overcoming Non-monotonicity in Transducer-based Streaming Generation
|
| 2 |
+
|
| 3 |
+
Zhengrui Ma 1 2 Yang Feng 1 2 Min Zhang
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Streaming generation models are utilized across fields, with the Transducer architecture being popular in industrial applications. However, its inputsynchronous decoding mechanism presents challenges in tasks requiring non-monotonic alignments, such as simultaneous translation. In this research, we address this issue by integrating Transducer’s decoding with the history of input stream via a learnable monotonic attention. Our approach leverages the forward-backward algorithm to infer the posterior probability of alignments between the predictor states and input timestamps, which is then used to estimate the monotonic context representations, thereby avoiding the need to enumerate the exponentially large alignment space during training. Extensive experiments show that our MonoAttn-Transducer effectively handles nonmonotonic alignments in streaming scenarios, offering a robust solution for complex generation tasks. Code is available at https://github. com/ictnlp/MonoAttn-Transducer.
|
| 8 |
+
|
| 9 |
+
# 1. Introduction
|
| 10 |
+
|
| 11 |
+
Streaming generation is a widely studied problem in fields such as speech recognition (Raffel et al., 2017; Zhang et al., 2020; Seide et al., 2024), simultaneous translation (Cho & Esipova, 2016; Gu et al., 2017; Seamless Communication et al., 2023), and speech synthesis (Ma et al., 2020a; Zhang et al., 2024; Wang et al., 2024). Unlike modern turn-based large language models, streaming models need to start generating the output before the input is completely read. This necessitates a careful balance between generation quality and latency.
|
| 12 |
+
|
| 13 |
+
1Institute of Computing Technology, Chinese Academy of Sciences 2University of Chinese Academy of Sciences 3School of Future Science and Engineering, Soochow University. Correspondence to: Zhengrui Ma <mazhengrui21b@ict.ac.cn>, Yang Feng (Corresponding Author) <fengyang@ict.ac.cn>.
|
| 14 |
+
|
| 15 |
+
Proceedings of the $4 2 ^ { n d }$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 16 |
+
|
| 17 |
+
Popular streaming generation methods can be broadly divided into two categories: Attention-based Encoder-Decoder (AED; Bahdanau et al., 2015) and Transducer (Graves, 2012). Streaming AED models adapt the conventional sequence-to-sequence framework (Bahdanau, 2014) to support streaming generation. They often rely on an external policy module to determine the READ/WRITE actions in inference and to direct the scope of cross-attention in training. Examples include Wait- $k$ policy (Ma et al., 2019) and monotonic attention-based methods (Raffel et al., 2017; Arivazhagan et al., 2019; Ma et al., 2020d; 2023a). On the other hand, Transducer models connect the encoder and predictor through a joiner rather than using cross-attention. The joiner is designed to synchronize the encoder and predictor by expanding its output vocabulary to include a blank symbol ϵ, which indicates a READ action. Due to the decoupling of the predictor state from the encoder state, READ/WRITE states in Transducer can be represented by a two-dimensional lattice. This allows for the computation of total probabilities using the forward-backward algorithm (Graves, 2012), facilitating end-to-end optimization. Benefited from joint optimization of all potential policies during training, Transducer often demonstrates better performance compared to AED models (Xue et al., 2022; Wang et al., 2023).
|
| 18 |
+
|
| 19 |
+
During the decoding process of Transducer, each target token is explicitly aligned with a corresponding source token. This input-synchronous decoding property makes the architecture well-suited for tasks like speech recognition, where the input and output align monotonically. However, it poses challenges for non-monotonic alignment tasks such as simultaneous translation (Chuang et al., 2021; Shao & Feng, 2022; Ma et al., 2023b;c). Due to the decoupled design, Transducer models have limited ability to attend to the input stream history during decoding, making it hard to manage reorderings. To address this issue, recent research (Liu et al., 2021; Tang et al., 2023) has started to explore the incorporation of cross-attention mechanism to enhance the capacity for handling complex non-monotonicity. Despite these efforts, the integration of cross-attention presents significant challenges. By integrating the predictor states with source history through attention, the representation of predictor states becomes relevant not only to the encoder states but also to the specific READ/WRITE path history
|
| 20 |
+
|
| 21 |
+
(Tang et al., 2023). This results in an exponentially large state space for Transducer, hindering the application of the forward-backward algorithm for end-to-end training.
|
| 22 |
+
|
| 23 |
+
In this research, we present an efficient training algorithm for Transducer models to learn the monotonic crossattention mechanism. This allows Transducer’s predictor to access source history in real-time inference, improving its ability to handle tasks with non-monotonic alignments. We leverage the forward-backward algorithm to infer the posterior probability of alignments between predictor and encoder states in training. This derived posterior alignment enables the estimation of context representation for each predictor state using expected soft attention. In this way, Transducer models adaptively adjust the scope of attention based on their predictions, avoiding the need to enumerate the exponentially large alignment space during training.
|
| 24 |
+
|
| 25 |
+
We conduct experiments on both speech-to-text/speech simultaneous translation to demonstrate the generality of our approach across various modalities. MonoAttn-Transducer shows significant improvements in generation quality without a noticeable increase in latency in both ideal and computation-aware settings (§5). Further analysis reveals that MonoAttn-Transducer is particularly effective in handling samples with higher levels of non-monotonicity (§6).
|
| 26 |
+
|
| 27 |
+
# 2. Background
|
| 28 |
+
|
| 29 |
+
# 2.1. Streaming Generation
|
| 30 |
+
|
| 31 |
+
Streaming generation models typically process a streaming input $\pmb { x } = \{ x _ { 1 } , . . . , x _ { T } \}$ and generate a target sequence $\pmb { y } = \{ y _ { 1 } , . . . , y _ { U } \}$ in a streaming manner. To measure the amount of source information utilized during generation, a monotonic non-decreasing function $g ( u )$ is introduced to represent the number of observed source tokens at the time of generating $y _ { u }$ .
|
| 32 |
+
|
| 33 |
+
# 2.2. Transducer
|
| 34 |
+
|
| 35 |
+
Transducer model (Graves, 2012) comprises three components: an encoder, a predictor, and a joiner. The encoder unidirectionally encodes the received input prefix $x _ { 1 : t }$ into a context representation $h _ { t }$ . The predictor functions similarly to an autoregressive language model, encoding the dependencies between tokens in the generated prefix $y _ { 1 : u }$ into $s _ { u }$ . The joiner makes predictions based on the current source representation $h _ { t }$ and target representation $s _ { u }$ . If the model needs to READ more information to update the source representation for continued generation, a blank token $\epsilon$ is generated. Otherwise, a WRITE operation is performed, and the generated token is fed back into the predictor to obtain a new target representation. Each time $h _ { t }$ or $s _ { u }$ is updated, the joiner performs a prediction step until the entire source has been processed. The encoder and predictor
|
| 36 |
+
|
| 37 |
+
are usually modeled using either a recurrent neural network (Graves, 2012) or Transformer layers (Zhang et al., 2020). The joiner is typically composed of a feed-forward network.
|
| 38 |
+
|
| 39 |
+
Since explicit alignment information for parallel pairs is not available during training, it is necessary to solve for the total probabilities of all READ/WRITE paths that can generate the target to perform maximum likelihood estimation. Given that the state space of Transducer form a two-dimensional lattice, the forward-backward algorithm can be utilized to compute the total probability. Define the forward and backward variables as:
|
| 40 |
+
|
| 41 |
+
$$
|
| 42 |
+
\begin{array}{l} \alpha (t, u) := p \left(y _ {1: u} \mid x _ {1: t}\right) \tag {1} \\ \beta (t, u) := p \left(y _ {u + 1: U} \mid x _ {t: T}\right) \\ \end{array}
|
| 43 |
+
$$
|
| 44 |
+
|
| 45 |
+
The forward and backward variables for all $1 \leq t \leq T$ and $0 \leq u \leq U$ can be calculated recursively:
|
| 46 |
+
|
| 47 |
+
$$
|
| 48 |
+
\begin{array}{l} \alpha (t, u) \\ = \alpha (t - 1, u) p (\epsilon | t - 1, u) + \alpha (t, u - 1) p \left(y _ {u} | t, u - 1\right) \\ \end{array}
|
| 49 |
+
$$
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\begin{array}{l} \beta (t, u) \\ = \beta (t + 1, u) p (\epsilon | t, u) + \beta (t, u + 1) p \left(y _ {u + 1} | t, u\right) \tag {2} \\ \end{array}
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
with initial condition $\alpha ( 1 , 0 ) = 1$ and $\beta ( T , U ) = p ( \epsilon | T , U )$ $p ( v | t , u )$ denotes the probability of generating token $v$ from $h _ { t }$ and $s _ { u }$ , $v \in \mathcal { V } \cup \{ \epsilon \}$ . The total output probability is:
|
| 56 |
+
|
| 57 |
+
$$
|
| 58 |
+
p (\boldsymbol {y} \mid \boldsymbol {x}) = \alpha (T, U) p (\epsilon \mid T, U). \tag {3}
|
| 59 |
+
$$
|
| 60 |
+
|
| 61 |
+
By leveraging the forward-backward algorithm, Transducer models are trained to implicitly acquire the READ/WRITE policy from the data.
|
| 62 |
+
|
| 63 |
+
# 3. Method
|
| 64 |
+
|
| 65 |
+
In this section, we provide a detailed introduction to our proposed MonoAttn-Transducer.
|
| 66 |
+
|
| 67 |
+
# 3.1. Overview
|
| 68 |
+
|
| 69 |
+
MonoAttn-Transducer works similarly to standard Transducer, with the key difference being that its predictor can attend to the encoder history using monotonic attention. During streaming generation, the scope of monotonic attention includes all source context representations that have already appeared. Formally, when the predictor encodes the $u$ -th target state, it depends on the representations of previous target states and the existing source context:
|
| 70 |
+
|
| 71 |
+
$$
|
| 72 |
+
s _ {u} = f _ {\theta} \left(s _ {0: u - 1}, h _ {1: g (u)}\right), \tag {4}
|
| 73 |
+
$$
|
| 74 |
+
|
| 75 |
+
where $1 \leq u \leq U$ and $g ( u )$ denotes the number of observed source tokens at the time of generating $y _ { u }$ . The edge case $s _ { 0 }$ is defined as $s _ { 0 } = f _ { \theta } ( h _ { 1 } )$ . In both Transducer and MonoAttn-Transducer, token $y _ { u }$ is generated based
|
| 76 |
+
|
| 77 |
+
on source representation $h _ { g ( u ) }$ and target representation $s _ { u - 1 }$ . Given $s _ { u - 1 }$ can only attend to source contexts up to $g ( u - 1 )$ through monotonic attention, related information in $x _ { g ( u - 1 ) + 1 : g ( u ) }$ should ideally be encoded within $h _ { g ( u ) }$ .
|
| 78 |
+
|
| 79 |
+
# 3.2. Training Algorithm
|
| 80 |
+
|
| 81 |
+
Training MonoAttn-Transducer is challenging as it exponentially expands Transducer’s state space. To address this issue, we firstly leverage the forward-backward algorithm to compute the posterior probability of aligning target representation $s _ { u }$ with source representation $h _ { t }$ (i.e., the probability of generating token $y _ { u }$ immediately after reading $x _ { t }$ ). This posterior alignment is then used to estimate the expected context vector in the monotonic cross-attention for each predictor state in training. Detailed explanations are provided in the following.
|
| 82 |
+
|
| 83 |
+
# 3.2.1. POSTERIOR ALIGNMENT
|
| 84 |
+
|
| 85 |
+
Suppose we have a probability lattice $p ( v | t , u )$ , representing the probability of generating token $v$ from $h _ { t }$ and $s _ { u }$ , for $1 \leq t \leq T$ , $0 \leq u \leq U$ , and $v \in \mathcal { V } \cup \{ \epsilon \}$ . The posterior probability of generating $y _ { u }$ at the moment $x _ { t }$ is read can be represented by:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\pi_ {u, t} = \frac {p \left(y _ {1 : u - 1} \mid x _ {1 : t}\right) p \left(y _ {u} \mid t , u - 1\right) p \left(y _ {u + 1 : U} \mid x _ {t : T}\right)}{p \left(y _ {1 : U} \mid x _ {1 : T}\right)} \tag {5}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
with the edge case:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
\pi_ {0, t} = \left\{ \begin{array}{l l} 1 & t = 1 \\ 0 & t \neq 1 \end{array} \right. \tag {6}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
which implies that the predictor state $s _ { 0 }$ is generated immediately after the first source token arrives. Using the forward and backward variables introduced in Section 2.2, Eq. 5 can be concisely expressed as follows:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\pi_ {u, t} = \frac {\alpha (t , u - 1) p \left(y _ {u} \mid t , u - 1\right) \beta (t , u)}{\alpha (T , U) p \left(\epsilon \mid T , U\right)}. \tag {7}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
This guarantees that the posterior alignment probability for all pairs $( t , u )$ can be solved in $O ( T U )$ time using the above forward-backward algorithm, facilitating the calculation of the expected context representation introduced later.
|
| 104 |
+
|
| 105 |
+
# 3.2.2. MONOTONIC ATTENTION
|
| 106 |
+
|
| 107 |
+
The incorporation of monotonic attention makes the representation of predictor states relevant to specific READ/WRITE history, leading to a prohibitively large state space for enumerating alignments. Therefore, we turn to estimate the context vector in monotonic attention based on the posterior alignment probability during training. This approach enables the model to adaptively adjust the scope of cross-attention according to its prediction. Consequently,
|
| 108 |
+
|
| 109 |
+
MonoAttn-Transducer learns a monotonic attention mechanism while maintaining the same time and space complexity as Transducer.
|
| 110 |
+
|
| 111 |
+
Formally, given the energy $e _ { u , t }$ for the pair consisting of encoder state $h _ { t }$ and predictor state $s _ { u }$ , as well as the posterior alignment probability $\pi _ { u , t }$ , the expected context representation $c _ { u }$ for predictor state $s _ { u }$ can be expressed as:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
c _ {u} = \sum_ {t = 1} ^ {T} \pi_ {u, t} \sum_ {t ^ {\prime} = 1} ^ {t} \frac {\exp \left(e _ {u , t ^ {\prime}}\right)}{\sum_ {t ^ {\prime \prime} = 1} ^ {t} \exp \left(e _ {u , t ^ {\prime \prime}}\right)} h _ {t ^ {\prime}}. \tag {8}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
This indicates that the expected context representation $c _ { u }$ is a weighted sum of context representations under various amount of source information, with the weights given by the posterior alignment probability $\pi _ { u , t }$ . The nested summation operations in Eq. 8 may lead to an increase in computational complexity. Fortunately, Arivazhagan et al. (2019) suggests that it can be rewritten as:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\phi_ {u, t} = \sum_ {t ^ {\prime} = t} ^ {T} \frac {\pi_ {u , t ^ {\prime}} \exp \left(e _ {u , t}\right)}{\sum_ {t ^ {\prime \prime} = 1} ^ {t ^ {\prime}} \exp \left(e _ {u , t ^ {\prime \prime}}\right)} \tag {9}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
c _ {u} = \sum_ {t = 1} ^ {T} \phi_ {u, t} h _ {t}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
Eq. 9 can then be computed efficiently using cumulative sum operations (Arivazhagan et al., 2019). Then in training, Eq. 4 can be estimated as
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
s _ {u} = f _ {\theta} \left(s _ {0: u - 1}, c _ {u}\right). \tag {10}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
# 3.2.3. TRAINING WITH PRIOR ALIGNMENT
|
| 134 |
+
|
| 135 |
+
The above algorithm facilitates MonoAttn-Transducer in learning monotonic cross-attention with posterior alignment probability. However, this presents a chicken-and-egg paradox: the posterior alignment is derived from an output probability lattice constructed using an estimated context representation, while the context vector is, in turn, estimated using a posterior alignment. We address this problem by using a prior alignment to construct a prior output probability lattice. This lattice is then used to infer the posterior alignment and train MonoAttn-Transducer’s monotonic attention.
|
| 136 |
+
|
| 137 |
+
There are several options for the prior alignment $p _ { u , t }$ . The simplest one is the uniform distribution, which assigns an equal probability of being generated at any timestep for all the target tokens:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
p _ {u, t} ^ {\mathrm {u n i}} = \frac {1}{T}, 1 \leq t \leq T, 1 \leq u \leq U. \tag {11}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
The edge case puni0,t $p _ { 0 , t } ^ { \mathrm { u n i } }$ is similar to the situation of $\pi _ { 0 , t }$ , where all the probability mass is concentrated at $t = 1$ .
|
| 144 |
+
|
| 145 |
+
However, it is preferable to select a more reasonable prior. An ideal prior alignment should ensure that the posterior alignment, derived from the lattice constructed using the prior, can accurately estimate the expected context representation. In streaming generation tasks, even though there may be reorderings in the mapping from source to target, a certain level of monotonic alignment is generally maintained. Therefore, we propose introducing a prior distribution $p _ { u , t } ^ { \mathrm { d i a } }$ which assumes that the number of tokens generated for each READ action is uniformly distributed:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
w _ {u, t} = \exp \left(- \left| u - \frac {t \cdot U}{T} \right|\right) \tag {12}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
$$
|
| 152 |
+
p _ {u, t} ^ {\mathrm {d i a}} = \frac {w _ {u , t}}{\sum_ {t ^ {\prime} = 1} ^ {T} w _ {u , t ^ {\prime}}}
|
| 153 |
+
$$
|
| 154 |
+
|
| 155 |
+
for $1 \leq t \leq T$ , $1 \leq u \leq U$ . The edge case $p _ { 0 , t } ^ { \mathrm { d i a } }$ is handled in the same manner as $p _ { 0 , t } ^ { \mathrm { u n i } }$ . This prior assumes a uniform mapping between the source and target, such that each target token is most likely generated at the time its corresponding source token is read. The probability decreases as the time difference from this moment increases.
|
| 156 |
+
|
| 157 |
+
# 3.2.4. CHUNK SYNCHRONIZATION
|
| 158 |
+
|
| 159 |
+
In speech audio, there often exists strong temporal dependencies between adjacent frames. Therefore, a chunk size $C$ is typically set, and the streaming model makes decisions only after receiving a speech chunk (Ma et al., 2020c). In terms of Transducer models, when a READ action is taken, the source representation is updated after a new speech chunk is read. The new source representation is then set as the representation of the last frame in the chunk (Liu et al., 2021; Tang et al., 2023). In such a situation, the receptive field of MonoAttn-Transducer’s cross-attention for predictor state $s _ { u }$ encompasses all hidden states in the received chunks, i.e., $h _ { 1 : C \cdot \tilde { g } ( u ) }$ , where $\tilde { g } ( u )$ denotes the number of received chunks when generating token $y _ { u }$ . To bridge the gap between training and inference, the posterior alignment probability utilized in training process is adjusted by transferring all the probability mass on encoder states within a chunk to the last state in the chunk:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\tilde {\pi} _ {u, t} = \left\{ \begin{array}{l l} \sum_ {t ^ {\prime} = (d - 1) \cdot C + 1} ^ {d \cdot C} \pi_ {u, t ^ {\prime}} & t = d \cdot C \\ 0 & t \neq d \cdot C \end{array} \right. \tag {13}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
$$
|
| 166 |
+
\begin{array}{l l} \text {f o r} & d = 1, 2, 3, \ldots \end{array}
|
| 167 |
+
$$
|
| 168 |
+
|
| 169 |
+
The prior alignment probability is adjusted in the same manner. We detail the entire training process in Alg. 1.
|
| 170 |
+
|
| 171 |
+
# 4. Related Work
|
| 172 |
+
|
| 173 |
+
Our work is closely related to researches in designing crossattention modules for Transducer models. Prabhavalkar et al. (2017) pioneered the use of attention to link the predictor and encoder. However, their design requires the entire
|
| 174 |
+
|
| 175 |
+
# Algorithm 1 Training Algorithm of MonoAttn-Transducer
|
| 176 |
+
|
| 177 |
+
# Input: Source $_ { \textbf { \em x } }$ , Target $\textbf { { y } }$ , Chunk Size $C$
|
| 178 |
+
|
| 179 |
+
Output: Training Loss $\mathcal { L }$
|
| 180 |
+
|
| 181 |
+
1: Compute prior alignment $p _ { u , t } ^ { \mathrm { d i a } }$ (Eq. 12)
|
| 182 |
+
2: Compute chunk-synchronized prior alignment $\tilde { p } _ { u , t } ^ { \mathrm { d i a } }$ based on chunk size $C$ (Eq. 13)
|
| 183 |
+
3: Estimate context $c _ { u } ^ { \mathrm { p r i o r } }$ with $\tilde { p } _ { u , t } ^ { \mathrm { d i a } }$ (Eq. 9)
|
| 184 |
+
4: Forward MonoAttn-Transducer with $c _ { u } ^ { \mathrm { p r i o r } }$
|
| 185 |
+
5: Infer posterior alignment $\pi _ { u , t }$ (Eq. 7)
|
| 186 |
+
6: Compute chunk-synchronized posterior alignment $\tilde { \pi } _ { u , t }$ based on chunk size $C$ (Eq. 13)
|
| 187 |
+
7: Estimate context $c _ { u }$ with $\tilde { \pi } _ { u , t }$ (Eq. 9)
|
| 188 |
+
8: Forward MonoAttn-Transducer with $c _ { u }$
|
| 189 |
+
9: Calculate total output probability $\mathcal { L }$ (Eq. 3)
|
| 190 |
+
10: return L
|
| 191 |
+
|
| 192 |
+
source to be available, limiting it to offline generation. For streaming generation, the receptive field of attention must synchronize with the input. This synchronization leads to an exponentially large state space, which significantly complicates the training process. To mitigate this issue, Liu et al. (2021) separated the predictor’s cross-attention from its selfattention, ensuring that cross-attention occurs only after self-attention. This approach maintains the independence of predictor states from READ/WRITE path history, allowing for standard training methods. However, this separation limits the richness of the predictor’s learned representations. Alternatively, Tang et al. (2023) proposed updating the representation of all predictor states whenever a new source token is received. While this method also preserves the independence of predictor states from READ/WRITE path history, it significantly increases both inference-time computational complexity and training-time memory requirements. It necessitates an additional $( T - 1 )$ forward passes of the predictor during decoding, which adversely affects latencysensitive streaming generation. Furthermore, the GPU memory usage for attention during training increases from $O ( 1 )$ to $O ( T )$ , leading to prohibitively high training costs and limiting the model’s scalability. In contrast to the above, the proposed MonoAttn-Transducer maintains the same time complexity and memory overhead as Transducer. A detailed comparison between these methods is summarized in Table 1.
|
| 193 |
+
|
| 194 |
+
Our work is also related to researches in designing attention modules for streaming AED models. These works often introduce Bernoulli variables to indicate READ/WRITE actions. The distribution of these variables is used to estimate monotonic alignment and to compute the expected context representation in training (Raffel et al., 2017). Depending on the setting of attention window, these works can be classified into monotonic hard attention (Raffel et al., 2017), monotonic chunkwise attention (MoChA; Chiu & Raffel,
|
| 195 |
+
|
| 196 |
+
Table 1. Comparison of Transducer-based streaming models. Computational Complexity refers to the number of forward passes executed by the predictor in inference. Memory Overhead refers to the memory consumption of the attention module in training.
|
| 197 |
+
|
| 198 |
+
<table><tr><td>Method</td><td>Merge Module</td><td>Computational Complexity</td><td>Memory Overhead</td></tr><tr><td>Transducer (Graves, 2012)</td><td>Joiner</td><td>O(U)</td><td>N/A</td></tr><tr><td>CAAT (Liu et al., 2021)</td><td>Joiner</td><td>O(U)</td><td>O(T)</td></tr><tr><td>TAED (Tang et al., 2023)</td><td>Predictor, Joiner</td><td>O(U + T)</td><td>O(T)</td></tr><tr><td>MonoAttn-Transducer (Ours)</td><td>Predictor, Joiner</td><td>O(U)</td><td>O(1)</td></tr></table>
|
| 199 |
+
|
| 200 |
+
2018), and monotonic infinite lookback attention (MILk; Arivazhagan et al., 2019). Ma et al. (2020d) subsequently introduced the MILk mechanism to Transformer models, and Ma et al. (2023a) further proposed a numerically-stable algorithm for estimating monotonic alignment. Unlike the aforementioned works, our approach learns monotonic attention based on the posterior alignment of Transducer, avoiding the use of unstable Bernoulli variables.
|
| 201 |
+
|
| 202 |
+
# 5. Experiments
|
| 203 |
+
|
| 204 |
+
We validate the performance of our MonoAttn-Transducer on two typical streaming generation tasks: speech-to-text and speech-to-speech simultaneous translation. The differences in grammatical structures between the source and target languages often necessitate word reordering during generating translation. This property makes the simultaneous translation task well-suited for evaluating the ability in handling non-monotonic alignments.
|
| 205 |
+
|
| 206 |
+
# 5.1. Experimental Setup
|
| 207 |
+
|
| 208 |
+
Datasets We conduct experiments on two language pairs of MuST-C speech-to-text translation datasets: English to German $_ \mathrm { E n \to D e }$ ) and English to Spanish $( \mathrm { E n \to E s } )$ ) (Di Gangi et al., 2019). For speech-to-speech experiments, we evaluate models on CVSS-C French to English $( \mathrm { F r } \mathrm { E n } _ { \ell }$ ) dataset (Jia et al., 2022).
|
| 209 |
+
|
| 210 |
+
Model Configuration We use the open-source implementation of Transformer-Transducer (Zhang et al., 2020) from Liu et al. (2021) as baseline and build our MonoAttn-Transducer upon it. The speech encoder consists of two layers of causal 2D-convolution followed by 16 chunk-wise Transformer layers with pre-norm. Each convolution layer has a $3 { \times } 3$ kernel with 64 channels and a stride size of 2, resulting in a downsampling ratio of 4. In chunk-wise Transformer layers, the speech encoder can access states from all previous chunks and one chunk ahead of the current chunk (Wu et al., 2020; Shi et al., 2021). The chunk size is adjusted within the set $\{ 3 2 0 , 6 4 0 , 9 6 0 , 1 2 8 0 \} \mathrm { m s }$ . Offline results are obtained by setting the chunk size longer than any utterance in the corpus. Both sinusoidal positional encoding (Vaswani et al., 2017) and relative positional attention (Shaw et al.,
|
| 211 |
+
|
| 212 |
+
2018) are incorporated into the speech encoder. Sinusoidal positional encoding is applied after the convolution layers. The predictor comprises two autoregressive Transformer layers with post-norm, utilizing only sinusoidal positional encoding. The monotonic attention is similar to standard cross-attention but differs in its receptive field. The joiner is implemented as a simple FFN. We incorporate the multistep decision mechanism (Liu et al., 2021) with a decision step of 4. All Transformer layers described above are configured with a 512 embedding dimension, 8 attention heads and a 2048 FFN dimension. The total number of parameters for the Transducer baseline and MonoAttn-Transducer are 65M and 67M, respectively. More implementation details are provided in App. A.
|
| 213 |
+
|
| 214 |
+
Evaluation We use SimulEval toolkit (Ma et al., 2020b) for evaluation. Translation quality is assessed using casesensitive detokenized BLEU (Papineni et al., 2002; Post, 2018) and neural-based COMET-22 score. Latency is measured by word-level Average Lagging (AL; Ma et al., 2019; 2020c) and Length-Adaptive Average Lagging (LAAL; Papi et al., 2022).1 For speech-to-speech tasks, translation quality is assessed using ASR-BLEU and latency is measured by delay of generated waveform chunks (Ma et al., 2022).
|
| 215 |
+
|
| 216 |
+
# 5.2. Main Results
|
| 217 |
+
|
| 218 |
+
We evaluate the performance of MonoAttn-Transducer against Transducer baseline across various latency conditions obtained by varying the chunk size. In this comparison, we consider two configurations of MonoAttn-Transducer. The first, referred to as MonoAttn-Transducer-Posterior, is trained strictly according to Algorithm 1. The second, termed MonoAttn-Transducer-Prior, is optimized directly using prior alignment, without inferring the posterior (calculate total output probability $\mathcal { L }$ using $c _ { u } ^ { \mathrm { p r i o r } }$ ). Results are shown in Table 2.
|
| 219 |
+
|
| 220 |
+
It can be observed that MonoAttn-Transducer-Posterior significantly outperforms the Transducer baseline across var-
|
| 221 |
+
|
| 222 |
+

|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 1. An example of diagonal prior and posterior alignment from MuST-C English-to-Spanish training corpus. The vertical axis represents the target subword sequence and the horizontal axis represents the speech waveform. Darker areas indicate higher alignment probabilities. Chunk size in this example is set to $6 4 0 \mathrm { m s }$ . More examples are provided in App. D.
|
| 226 |
+
|
| 227 |
+
ious settings of chunk size in both translation directions. Specifically, in En-Es, it shows an average improvement of 0.75 BLEU or 0.95 COMET score in generation quality under different latency conditions. In En-De, it achieves an even more significant improvement, with an average increase of as much as 2.06 COMET score, while latency remains nearly unchanged. Further analysis reveals that the benefits of learning monotonic attention are more pronounced with a larger chunk size. Notably, in scenarios where latency exceeds 1.5s and during offline generation, the average improvement reaches 0.88 BLEU or 1.77 COMET score. This can be attributed to MonoAttn-Transducer benefiting more from monotonic attention to handle reorderings when it has flexibility to wait for more source information.
|
| 228 |
+
|
| 229 |
+
Moreover, we have observed some notable results of MonoAttn-Transducer-Prior. With a larger chunk size, the performance of MonoAttn-Transducer-Prior is comparable to that of MonoAttn-Transducer-Posterior, and even slightly outperforming the latter in En-De. However, there exists a significant performance drop with a smaller chunk size. Specifically, with a chunk size of 320ms, MonoAttn-Transducer-Prior’s generation quality is on average 1.03 BLEU lower than Transducer baseline under similar latency conditions. This phenomenon highlights the importance of learning monotonic attention through inferring posterior
|
| 230 |
+
|
| 231 |
+
alignment. From the chunk synchronization mechanism described in Eq. 13, smaller chunk sizes require finer alignment granularity between the predictor and encoder states. This increased granularity necessitates more precise alignment to estimate the expected context representation during training. Figure 1 provides an example of diagonal prior and posterior alignment. While the diagonal prior generally captures the trend of the alignment information, it can be skewed by the uneven distribution of speech information and possible local reorderings. In contrast, the inferred posterior offers a more confident and accurate alignment probability. For instance, the diagonal prior assigns a high probability to aligning the word “si (if)” with the timestep preceding the waveform of “ $\psi ^ { , }$ , while the inferred posterior corrects this misalignment. Therefore, learning monotonic attention with posterior alignment leads to a more accurate estimation of context representation and improved performance.2 In subsequent experiments, we represent MonoAttn-Transducer using the results of MonoAttn-Transducer-Posterior.
|
| 232 |
+
|
| 233 |
+
Table 2. Comparison of MonoAttn-Transducer and Transducer across various chunk size settings on MuST-C English to German and English to Spanish datasets.
|
| 234 |
+
|
| 235 |
+
<table><tr><td></td><td colspan="5">En-Es</td><td colspan="5">En-De</td></tr><tr><td></td><td>Chunk Size (ms)</td><td>320</td><td>640</td><td>960</td><td>1280</td><td>∞</td><td>320</td><td>640</td><td>960</td><td>1280</td></tr><tr><td rowspan="3">Transducer</td><td>LAAL (ms)</td><td>1168</td><td>1466</td><td>1847</td><td>2220</td><td>-</td><td>1258</td><td>1563</td><td>1942</td><td>2312</td></tr><tr><td>BLEU (↑)</td><td>24.33</td><td>25.82</td><td>26.36</td><td>26.40</td><td>26.75</td><td>19.99</td><td>22.10</td><td>22.20</td><td>22.96</td></tr><tr><td>COMET (↑)</td><td>67.94</td><td>69.92</td><td>70.48</td><td>70.65</td><td>71.14</td><td>62.81</td><td>65.01</td><td>65.75</td><td>66.26</td></tr><tr><td rowspan="3">MonoAttn-Transducer (Posterior)</td><td>LAAL (ms)</td><td>1230</td><td>1475</td><td>1837</td><td>2204</td><td>-</td><td>1317</td><td>1582</td><td>1957</td><td>2305</td></tr><tr><td>BLEU (↑)</td><td>24.72</td><td>26.74</td><td>27.05</td><td>27.41</td><td>27.48</td><td>20.22</td><td>22.47</td><td>22.94</td><td>23.74</td></tr><tr><td>COMET (↑)</td><td>68.98</td><td>70.71</td><td>71.21</td><td>71.90</td><td>72.24</td><td>64.24</td><td>67.06</td><td>68.22</td><td>68.54</td></tr><tr><td rowspan="3">MonoAttn-Transducer (Prior)</td><td>LAAL (ms)</td><td>1123</td><td>1419</td><td>1815</td><td>2184</td><td>-</td><td>1231</td><td>1535</td><td>1929</td><td>2286</td></tr><tr><td>BLEU (↑)</td><td>23.00</td><td>26.46</td><td>27.07</td><td>27.42</td><td>27.48</td><td>19.26</td><td>22.62</td><td>23.51</td><td>24.01</td></tr><tr><td>COMET (↑)</td><td>68.24</td><td>70.45</td><td>71.33</td><td>71.99</td><td>72.24</td><td>63.85</td><td>67.63</td><td>68.65</td><td>69.27</td></tr></table>
|
| 236 |
+
|
| 237 |
+

|
| 238 |
+
(a) En→De
|
| 239 |
+
|
| 240 |
+

|
| 241 |
+
(b) En→Es
|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
(c) En Es Subsets
|
| 245 |
+
Figure 2. (a), (b): Results of translation quality (BLEU) against latency (Average Lagging, AL) on MuST-C English to German and English to Spanish datasets. (c): Performance on MuST-C English to Spanish test subsets categorized by non-monotonicity. In the figures above, MA-T denotes MonoAttn-Transducer.
|
| 246 |
+
|
| 247 |
+
# 5.3. Comparison with State-of-the-Art
|
| 248 |
+
|
| 249 |
+
We compare MonoAttn-Transducer with state-of-the-art open-source approaches in simultaneous translation, including Wait- $k$ (Ma et al., 2020c), RealTrans (Zeng et al., 2021), CAAT (Liu et al., 2021), MU-ST (Zhang et al., 2022), EDAtt (Papi et al., 2023a), AlignAtt (Papi et al., 2023b), Seg2Seg (Zhang & Feng, 2023), NAST (Ma et al., 2024) and LLMbased LSG (Guo et al., 2025). Further details about baselines are available in App. B. Results are plotted in Figure 2a and 2b. We observe that learning monotonic attention significantly enhances the performance of Transducer, achieving leading streaming generation quality. Compared to CAAT, another Transducer-based model, MonoAttn-Transducer demonstrates superiority in scenarios with less stringent latency requirements. This clearly demonstrates the advantage of MonoAttn-Transducer’s tightly coupled self-attention and cross-attention modules in the predictor, which facilitates the learning of richer representations.
|
| 250 |
+
|
| 251 |
+
TAED is another Transducer-based model highly relevant to
|
| 252 |
+
|
| 253 |
+
our work. However, the code and distilled data used to train TAED in Tang et al. (2023) have not been made publicly available. This lack of open access hinders a fair comparison of TAED with our MonoAttn-Transducer. Despite this, we attempt to analyze the performance by comparing each with Transducer baseline in their respective experimental settings. The comparison is shown in Table 7 in App. C. We have observed that the improvement from TAED is more pronounced with smaller chunk sizes, which contrasts with the results of MonoAttn-Transducer. We speculate that this is because, in TAED, the representations of all generated predictor states are updated every time the encoder receives a new speech chunk. This helps TAED generate more accurate representations when the chunk size is small. However, this mechanism in TAED incurs an $O ( T + U )$ forward propagation cost during simultaneous inference, which can significantly increase latency in practice due to heavy computational overhead when the chunk size is small. In contrast, MonoAttn-Transducer maintains an $O ( U )$ complexity as Transducer baseline. As shown in Table 6, this property
|
| 254 |
+
|
| 255 |
+
Table 3. Performance on CVSS-C French to English speech-tospeech translation.
|
| 256 |
+
|
| 257 |
+
<table><tr><td></td><td>Chunk Size (ms)</td><td>320</td><td>Offline</td></tr><tr><td rowspan="3">Transducer</td><td>ASR-BLEU (↑)</td><td>17.1</td><td>18.0</td></tr><tr><td>LAAL (ms)</td><td>984</td><td>-</td></tr><tr><td>StartOffset (ms)</td><td>1520</td><td>-</td></tr><tr><td rowspan="3">MonoAttn-Transducer</td><td>ASR-BLEU (↑)</td><td>18.3</td><td>19.3</td></tr><tr><td>LAAL (ms)</td><td>918</td><td>-</td></tr><tr><td>StartOffset (ms)</td><td>1491</td><td>-</td></tr></table>
|
| 258 |
+
|
| 259 |
+
minimizes the gap between ideal and computation-aware latency, offering advantages in real-time applications.
|
| 260 |
+
|
| 261 |
+
# 5.4. Results of Speech Generation
|
| 262 |
+
|
| 263 |
+
Speech-to-speech simultaneous translation requires implicitly performing ASR, MT and TTS simultaneously, and also handling the non-monotonic alignments between languages, making it suitable to evaluate models on streaming speech generation. We adopted a textless setup in our experiments, directly modeling the mapping between speech (Zhao et al., 2024). Results are provided in Table 3.
|
| 264 |
+
|
| 265 |
+
The results demonstrate that MonoAttn-Transducer significantly reduces generation latency (AL). With a chunk size of 320ms, it achieves Transducer’s offline generation quality, but reducing lagging to 118ms. For offline settings, our approaches further improves speech generation quality (19.3 vs. 18.0). These results highlight the effectiveness of our approach in achieving a better quality-latency trade-off also for streaming speech generation.
|
| 266 |
+
|
| 267 |
+
# 6. Analysis
|
| 268 |
+
|
| 269 |
+
# 6.1. Handling Non-monotonicity
|
| 270 |
+
|
| 271 |
+
To illustrate MonoAttn-Transducer’s capability in handling reorderings through learning monotonic attention, we evaluate its performance against the Transducer baseline across samples with varying levels of non-monotonicity. Intuitively, samples with a higher number of crosses in the alignments between source transcription and reference text pose greater challenges. We therefore evenly partition the test set based on the number of cross-alignments, labeling them as easy, medium and hard.3 The results are presented in Figure 2c. We observe that MonoAttn-Transducer shows a more substantial improvement over Transducer in the medium and hard subsets across most chunk size settings. However, with a chunk size of 320ms, the improvement is particularly notable in the easy subset. These findings
|
| 272 |
+
|
| 273 |
+
highlight the unique capabilities of MonoAttn-Transducer in managing non-monotonic alignments. As analyzed in Section 5.2, MonoAttn-Transducer benefits more from learning monotonic attention with a larger chunk size, and this enhanced ability is evident in subsets with higher levels of non-monotonicity. On the other hand, when the chunk size is extremely small, MonoAttn-Transducer has limited flexibility to wait for more source information before processing, thus showing more significant improvement in the easy subset under the condition.
|
| 274 |
+
|
| 275 |
+
# 6.2. Training Efficiency
|
| 276 |
+
|
| 277 |
+
Training Time: We analyze each step in Algorithm 1 to compare the training time differences between MonoAttn-Transducer and baseline. We observe that Lines 1, 2, 6 involve naive matrix computation without requiring gradients. The additional time overhead introduced by our method arises from Lines 3, 4, 5. Specifically, this includes an additional forward pass of the predictor and the computation for the posterior alignment. The overhead from the posterior calculation is approximately equivalent to that incurred during loss calculation, as both rely on the forward-backward algorithm. Empirically, we found MonoAttn-Trasducer is 1.33 times slower than Transducer baseline with the same configuration on Nvidia L40 GPU.
|
| 278 |
+
|
| 279 |
+
Memory Consumption: Compared to baseline, the additional memory overhead of MonoAttn-Transducer comes solely from its monotonic attention module. The extra forward pass of the predictor is performed without requiring gradients, so it is excluded from the computation graph. Empirically, we observed that the peak memory usage of Transducer baseline is 28GB, while MonoAttn-Transducer exhibits a slightly higher peak usage of 32GB when the total number of source frames is fixed at 40,000 on a single Nvidia L40 GPU.
|
| 280 |
+
|
| 281 |
+
# 7. Conclusion
|
| 282 |
+
|
| 283 |
+
In this paper, we propose an efficient algorithm to handle the non-monotonicity problem in Transducer-based streaming generation. Extensive experiments demonstrate that our MonoAttn-Transducer significantly improves the ability in handling non-monotonic alignments in streaming generation, offering a robust solution for Transducer-based frameworks to tackle more complex streaming generation tasks.
|
| 284 |
+
|
| 285 |
+
# Impact Statement
|
| 286 |
+
|
| 287 |
+
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none which we feel must be specifically highlighted here.
|
| 288 |
+
|
| 289 |
+
# References
|
| 290 |
+
|
| 291 |
+
Arivazhagan, N., Cherry, C., Macherey, W., Chiu, C.-C., Yavuz, S., Pang, R., Li, W., and Raffel, C. Monotonic infinite lookback attention for simultaneous machine translation. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 1313– 1323, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1126. URL https://aclanthology.org/P19-1126.
|
| 292 |
+
Bahdanau, D. Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473, 2014.
|
| 293 |
+
Bahdanau, D., Cho, K., and Bengio, Y. Neural machine translation by jointly learning to align and translate. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7- 9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1409.0473.
|
| 294 |
+
Chiu, C.-C. and Raffel, C. Monotonic chunkwise attention. In International Conference on Learning Representations, 2018. URL https://openreview.net/forum? id=Hko85plCW.
|
| 295 |
+
Cho, K. and Esipova, M. Can neural machine translation do simultaneous translation? CoRR, abs/1606.02012, 2016. URL http://arxiv.org/abs/1606.02012.
|
| 296 |
+
Chuang, S.-P., Chuang, Y.-S., Chang, C.-C., and Lee, H.-y. Investigating the reordering capability in CTCbased non-autoregressive end-to-end speech translation. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 1068– 1077, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.findings-acl. 92. URL https://aclanthology.org/2021. findings-acl.92.
|
| 297 |
+
Di Gangi, M. A., Cattoni, R., Bentivogli, L., Negri, M., and Turchi, M. MuST-C: a Multilingual Speech Translation Corpus. In Proceedings of the 2019 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long and Short Papers), pp. 2012–2017, Minneapolis, Minnesota, June 2019. Association for Computational Linguistics. doi: 10.18653/v1/N19-1202. URL https://aclanthology.org/N19-1202.
|
| 298 |
+
Graves, A. Sequence transduction with recurrent neural networks. CoRR, abs/1211.3711, 2012. URL http: //arxiv.org/abs/1211.3711.
|
| 299 |
+
Graves, A., Fernandez, S., Gomez, F., and Schmidhu-´ ber, J. Connectionist temporal classification: Labelling
|
| 300 |
+
|
| 301 |
+
unsegmented sequence data with recurrent neural networks. In Proceedings of the 23rd International Conference on Machine Learning, ICML ’06, pp. 369–376, New York, NY, USA, 2006. Association for Computing Machinery. ISBN 1595933832. doi: 10.1145/ 1143844.1143891. URL https://doi.org/10. 1145/1143844.1143891.
|
| 302 |
+
Gu, J., Neubig, G., Cho, K., and Li, V. O. Learning to translate in real-time with neural machine translation. In Proceedings of the 15th Conference of the European Chapter of the Association for Computational Linguistics: Volume 1, Long Papers, pp. 1053–1062, Valencia, Spain, April 2017. Association for Computational Linguistics. URL https://aclanthology.org/E17-1099.
|
| 303 |
+
Guo, S., Zhang, S., Ma, Z., and Feng, Y. Large language models are read/write policy-makers for simultaneous generation, 2025. URL https://arxiv.org/abs/ 2501.00868.
|
| 304 |
+
Jia, Y., Tadmor Ramanovich, M., Wang, Q., and Zen, H. CVSS corpus and massively multilingual speechto-speech translation. In Proceedings of Language Resources and Evaluation Conference (LREC), pp. 6691– 6703, 2022.
|
| 305 |
+
Kim, Y. and Rush, A. M. Sequence-level knowledge distillation. In Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing, pp. 1317– 1327, Austin, Texas, November 2016. Association for Computational Linguistics. doi: 10.18653/v1/D16-1139. URL https://aclanthology.org/D16-1139.
|
| 306 |
+
Kingma, D. P. and Ba, J. Adam: A method for stochastic optimization. In 3rd International Conference on Learning Representations, ICLR 2015, San Diego, CA, USA, May 7-9, 2015, Conference Track Proceedings, 2015. URL http://arxiv.org/abs/1412.6980.
|
| 307 |
+
Kudo, T. and Richardson, J. SentencePiece: A simple and language independent subword tokenizer and detokenizer for neural text processing. In Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 66–71, Brussels, Belgium, November 2018. Association for Computational Linguistics. doi: 10.18653/v1/D18-2012. URL https://aclanthology.org/D18-2012.
|
| 308 |
+
Liu, D., Du, M., Li, X., Li, Y., and Chen, E. Cross attention augmented transducer networks for simultaneous translation. In Proceedings of the 2021 Conference on Empirical Methods in Natural Language Processing, pp. 39–55, Online and Punta Cana, Dominican Republic, November 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.emnlp-main.4. URL https: //aclanthology.org/2021.emnlp-main.4.
|
| 309 |
+
|
| 310 |
+
Ma, M., Huang, L., Xiong, H., Zheng, R., Liu, K., Zheng, B., Zhang, C., He, Z., Liu, H., Li, X., Wu, H., and Wang, H. STACL: Simultaneous translation with implicit anticipation and controllable latency using prefix-to-prefix framework. In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, pp. 3025–3036, Florence, Italy, July 2019. Association for Computational Linguistics. doi: 10.18653/v1/P19-1289. URL https://aclanthology.org/P19-1289.
|
| 311 |
+
Ma, M., Zheng, B., Liu, K., Zheng, R., Liu, H., Peng, K., Church, K., and Huang, L. Incremental text-to-speech synthesis with prefix-to-prefix framework. In Findings of the Association for Computational Linguistics: EMNLP 2020, pp. 3886–3896, Online, November 2020a. Association for Computational Linguistics. doi: 10.18653/v1/2020.findings-emnlp. 346. URL https://aclanthology.org/2020. findings-emnlp.346.
|
| 312 |
+
Ma, X., Dousti, M. J., Wang, C., Gu, J., and Pino, J. SIMULEVAL: An evaluation toolkit for simultaneous translation. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, pp. 144–150, Online, October 2020b. Association for Computational Linguistics. doi: 10.18653/v1/2020.emnlp-demos.19. URL https:// aclanthology.org/2020.emnlp-demos.19.
|
| 313 |
+
Ma, X., Pino, J., and Koehn, P. SimulMT to SimulST: Adapting simultaneous text translation to end-to-end simultaneous speech translation. In Proceedings of the 1st Conference of the Asia-Pacific Chapter of the Association for Computational Linguistics and the 10th International Joint Conference on Natural Language Processing, pp. 582–587, Suzhou, China, December 2020c. Association for Computational Linguistics. URL https: //aclanthology.org/2020.aacl-main.58.
|
| 314 |
+
Ma, X., Pino, J. M., Cross, J., Puzon, L., and Gu, J. Monotonic multihead attention. In International Conference on Learning Representations, 2020d. URL https: //openreview.net/forum?id $\underline { { \underline { { \mathbf { \Pi } } } } } =$ Hyg96gBKPS.
|
| 315 |
+
Ma, X., Gong, H., Liu, D., Lee, A., Tang, Y., Chen, P.-J., Hsu, W.-N., Koehn, P., and Pino, J. Direct simultaneous speech-to-speech translation with variational monotonic multihead attention, 2022.
|
| 316 |
+
Ma, X., Sun, A., Ouyang, S., Inaguma, H., and Tomasello, P. Efficient monotonic multihead attention, 2023a. URL https://arxiv.org/abs/2312.04515.
|
| 317 |
+
Ma, Z., Shao, C., Gui, S., Zhang, M., and Feng, Y. Fuzzy alignments in directed acyclic graph for nonautoregressive machine translation. In International
|
| 318 |
+
|
| 319 |
+
Conference on Learning Representations, 2023b. URL https://arxiv.org/abs/2303.06662.
|
| 320 |
+
Ma, Z., Zhang, S., Guo, S., Shao, C., Zhang, M., and Feng, Y. Non-autoregressive streaming transformer for simultaneous translation. In Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 5177–5190, Singapore, December 2023c. Association for Computational Linguistics. doi: 10.18653/v1/2023.emnlp-main.314. URL https:// aclanthology.org/2023.emnlp-main.314.
|
| 321 |
+
Ma, Z., Fang, Q., Zhang, S., Guo, S., Feng, Y., and Zhang, M. A non-autoregressive generation framework for endto-end simultaneous speech-to-any translation. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 1557–1575, Bangkok, Thailand, August 2024. Association for Computational Linguistics. URL https: //aclanthology.org/2024.acl-long.85.
|
| 322 |
+
McAuliffe, M., Socolof, M., Mihuc, S., Wagner, M., and Sonderegger, M. Montreal forced aligner: Trainable textspeech alignment using kaldi. In Interspeech 2017, pp. 498–502, 2017. doi: 10.21437/Interspeech.2017-1386.
|
| 323 |
+
Papi, S., Gaido, M., Negri, M., and Turchi, M. Overgeneration cannot be rewarded: Length-adaptive average lagging for simultaneous speech translation. In Proceedings of the Third Workshop on Automatic Simultaneous Translation, pp. 12–17, Online, July 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022. autosimtrans-1.2. URL https://aclanthology. org/2022.autosimtrans-1.2.
|
| 324 |
+
Papi, S., Negri, M., and Turchi, M. Attention as a guide for simultaneous speech translation. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 13340–13356, Toronto, Canada, July 2023a. Association for Computational Linguistics. doi: 10.18653/v1/ 2023.acl-long.745. URL https://aclanthology. org/2023.acl-long.745.
|
| 325 |
+
Papi, S., Turchi, M., and Negri, M. AlignAtt: Using Attention-based Audio-Translation Alignments as a Guide for Simultaneous Speech Translation. In Proc. INTERSPEECH 2023, pp. 3974–3978, 2023b. doi: 10.21437/Interspeech.2023-170.
|
| 326 |
+
Papineni, K., Roukos, S., Ward, T., and Zhu, W.-J. Bleu: a method for automatic evaluation of machine translation. In Proceedings of the 40th Annual Meeting of the Association for Computational Linguistics, pp. 311– 318, Philadelphia, Pennsylvania, USA, July 2002. Association for Computational Linguistics. doi: 10.3115/
|
| 327 |
+
|
| 328 |
+
1073083.1073135. URL https://aclanthology. org/P02-1040.
|
| 329 |
+
Park, D. S., Chan, W., Zhang, Y., Chiu, C.-C., Zoph, B., Cubuk, E. D., and Le, Q. V. Specaugment: A simple data augmentation method for automatic speech recognition. Interspeech 2019, 2019.
|
| 330 |
+
Post, M. A call for clarity in reporting BLEU scores. In Proceedings of the Third Conference on Machine Translation: Research Papers, pp. 186–191, Belgium, Brussels, October 2018. Association for Computational Linguistics. URL https://www.aclweb.org/ anthology/W18-6319.
|
| 331 |
+
Prabhavalkar, R., Rao, K., Sainath, T. N., Li, B., Johnson, L., and Jaitly, N. A Comparison of Sequence-to-Sequence Models for Speech Recognition. In Proc. Interspeech 2017, pp. 939–943, 2017. doi: 10.21437/Interspeech. 2017-233.
|
| 332 |
+
Raffel, C., Luong, M.-T., Liu, P. J., Weiss, R. J., and Eck, D. Online and linear-time attention by enforcing monotonic alignments. In Proceedings of the 34th International Conference on Machine Learning, volume 70 of Proceedings of Machine Learning Research, pp. 2837–2846. PMLR, 06–11 Aug 2017. URL https://proceedings. mlr.press/v70/raffel17a.html.
|
| 333 |
+
Seamless Communication, Barrault, L., Chung, Y.-A., Meglioli, M. C., Dale, D., Dong, N., Duppenthaler, M., Duquenne, P.-A., Ellis, B., Elsahar, H., Haaheim, J., Hoffman, J., Hwang, M.-J., Inaguma, H., Klaiber, C., Kulikov, I., Li, P., Licht, D., Maillard, J., Mavlyutov, R., Rakotoarison, A., Sadagopan, K. R., Ramakrishnan, A., Tran, T., Wenzek, G., Yang, Y., Ye, E., Evtimov, I., Fernandez, P., Gao, C., Hansanti, P., Kalbassi, E., Kallet, A., Kozhevnikov, A., Mejia, G., Roman, R. S., Touret, C., Wong, C., Wood, C., Yu, B., Andrews, P., Balioglu, C., Chen, P.-J., Costa-jussa, M. R., Elbayad, M., Gong, H., ` Guzman, F., Heffernan, K., Jain, S., Kao, J., Lee, A., ´ Ma, X., Mourachko, A., Peloquin, B., Pino, J., Popuri, S., Ropers, C., Saleem, S., Schwenk, H., Sun, A., Tomasello, P., Wang, C., Wang, J., Wang, S., and Williamson, M. Seamless: Multilingual expressive and streaming speech translation. In ArXiv, 2023.
|
| 334 |
+
Seide, F., Doulaty, M., Shi, Y., Gaur, Y., Jia, J., and Wu, C. Speech reallm – real-time streaming speech recognition with multimodal llms by teaching the flow of time, 2024. URL https://arxiv.org/abs/2406.09569.
|
| 335 |
+
Shao, C. and Feng, Y. Non-monotonic latent alignments for ctc-based non-autoregressive machine translation. In Advances in Neural Information Processing Systems, volume 35, pp. 8159–8173. Curran Associates, Inc., 2022. URL https://arxiv.org/abs/2210.03953.
|
| 336 |
+
|
| 337 |
+
Shaw, P., Uszkoreit, J., and Vaswani, A. Self-attention with relative position representations. In Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 2 (Short Papers), pp. 464– 468, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-2074. URL https://aclanthology.org/N18-2074.
|
| 338 |
+
Shi, Y., Wang, Y., Wu, C., Yeh, C.-F., Chan, J., Zhang, F., Le, D., and Seltzer, M. Emformer: Efficient memory transformer based acoustic model for low latency streaming speech recognition. In ICASSP 2021 - 2021 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 6783–6787, 2021. doi: 10.1109/ICASSP39728.2021.9414560.
|
| 339 |
+
Tang, Y., Sun, A., Inaguma, H., Chen, X., Dong, N., Ma, X., Tomasello, P., and Pino, J. Hybrid transducer and attention based encoder-decoder modeling for speech-totext tasks. In Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 12441–12455, Toronto, Canada, July 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.acl-long.695. URL https:// aclanthology.org/2023.acl-long.695.
|
| 340 |
+
Vaswani, A., Shazeer, N., Parmar, N., Uszkoreit, J., Jones, L., Gomez, A. N., Kaiser, L. u., and Polosukhin, I. Attention is all you need. In Advances in Neural Information Processing Systems, volume 30. Curran Associates, Inc., 2017. URL https://arxiv.org/abs/1706. 03762.
|
| 341 |
+
Wang, P., Sun, E., Xue, J., Wu, Y., Zhou, L., Gaur, Y., Liu, S., and Li, J. LAMASSU: A Streaming Language-Agnostic Multilingual Speech Recognition and Translation Model Using Neural Transducers. In Proc. IN-TERSPEECH 2023, pp. 57–61, 2023. doi: 10.21437/ Interspeech.2023-2004.
|
| 342 |
+
Wang, Z., Chen, Y., Wang, X., Xie, L., and Wang, Y. StreamVoice: Streamable context-aware language modeling for real-time zero-shot voice conversion. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 7328–7338, Bangkok, Thailand, August 2024. Association for Computational Linguistics. URL https: //aclanthology.org/2024.acl-long.396.
|
| 343 |
+
Wu, C., Wang, Y., Shi, Y., Yeh, C.-F., and Zhang, F. Streaming Transformer-Based Acoustic Models Using Self-Attention with Augmented Memory. In Proc. Interspeech 2020, pp. 2132–2136, 2020. doi: 10.21437/ Interspeech.2020-2079.
|
| 344 |
+
|
| 345 |
+
Xue, J., Wang, P., Li, J., Post, M., and Gaur, Y. Large-Scale Streaming End-to-End Speech Translation with Neural Transducers. In Proc. Interspeech 2022, pp. 3263–3267, 2022. doi: 10.21437/Interspeech.2022-10953.
|
| 346 |
+
Zeng, X., Li, L., and Liu, Q. RealTranS: End-to-end simultaneous speech translation with convolutional weightedshrinking transformer. In Findings of the Association for Computational Linguistics: ACL-IJCNLP 2021, pp. 2461– 2474, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.findings-acl. 218. URL https://aclanthology.org/2021. findings-acl.218.
|
| 347 |
+
Zhang, Q., Lu, H., Sak, H., Tripathi, A., McDermott, E., Koo, S., and Kumar, S. Transformer transducer: A streamable speech recognition model with transformer encoders and rnn-t loss. In ICASSP 2020 - 2020 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), pp. 7829–7833, 2020. doi: 10.1109/ICASSP40776.2020.9053896.
|
| 348 |
+
Zhang, R., He, Z., Wu, H., and Wang, H. Learning adaptive segmentation policy for end-to-end simultaneous translation. In Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 7862–7874, Dublin, Ireland, May 2022. Association for Computational Linguistics. doi: 10.18653/v1/2022.acl-long.542. URL https: //aclanthology.org/2022.acl-long.542.
|
| 349 |
+
Zhang, S. and Feng, Y. Unified segment-to-segment framework for simultaneous sequence generation. In Advances in Neural Information Processing Systems, volume 36, pp. 45235–45258. Curran Associates, Inc., 2023. URL https://arxiv.org/abs/2310.17940.
|
| 350 |
+
Zhang, S., Fang, Q., Guo, S., Ma, Z., Zhang, M., and Feng, Y. Streamspeech: Simultaneous speech-to-speech translation with multi-task learning. In Proceedings of the 62th Annual Meeting of the Association for Computational Linguistics (Long Papers). Association for Computational Linguistics, 2024. URL https://aclanthology. org/2024.acl-long.485/.
|
| 351 |
+
Zhao, J., Moritz, N., Lakomkin, E., Xie, R., Xiu, Z., Zmolikova, K., Ahmed, Z., Gaur, Y., Le, D., and Fuegen, C. Textless streaming speech-to-speech translation using semantic speech tokens. arXiv preprint arXiv:2410.03298, 2024.
|
| 352 |
+
|
| 353 |
+
# A. Implementation Details
|
| 354 |
+
|
| 355 |
+
Pre-processing The input speech is represented as 80-dimensional log mel-filterbank coefficients computed every 10ms with a 25ms window. Global channel mean and variance normalization is applied to the input speech. During training, SpecAugment (Park et al., 2019) data augmentation with the LB policy is additionally employed. We use SentencePiece (Kudo & Richardson, 2018) to generate a unigram vocabulary of size 10000 for the source and target text jointly. Sequencelevel knowledge distillation (Kim & Rush, 2016) is applied for fair comparison (Liu et al., 2021). For speech-to-speech experiments, we resample the source audio to 16kHz and apply identical preprocessing steps as those used in speech-to-text experiments. For the target speech, we also downsample the audio and extract discrete units utilizing the publicly available pre-trained mHuBERT model and K-means quantizer.4 No training data manipulation is applied in speech-to-speech experiments.
|
| 356 |
+
|
| 357 |
+
Training Details Considering that training MonoAttn-Transducer involves two critical processes: inferring the posterior alignment and estimating the context vector, instability in either step can lead to training failure. Therefore, we introduce a curriculum learning strategy for MonoAttn-Transducer. We first pretrain the model in an offline setting. In pretraining, all predictor states can attend to the complete source input, and the model is trained as an offline Transducer. This pretraining phase allows the monotonic attention module to warm up by learning full-sentence attention, thereby enhancing its stability during subsequent adaptation to a streaming scenario. In finetuning, we apply Algorithm 1 to adjust MonoAttn-Transducer with various chunk size configurations. During both training phases, we set the dropout rate to 0.1, weight decay to 0.01, and clip gradient norms exceeding 5.0. The dropout rates for activation and attention are both set to 0.1. The pretraining spans $5 0 k$ updates with a batch size of $1 6 0 k$ tokens. The learning rate gradually warms up to 5e-4 within $4 k$ steps. Finetuning involves training for $2 0 k$ updates and other hyper-parameters remain consistent. Throughout the training, we optimize models using the Adam optimizer (Kingma & Ba, 2015). Automatic mixed precision training is applied. It takes approximately one day to pretrain in an offline setting and another day for streaming adaptation on a server with 4 Nvidia L40 GPUs.
|
| 358 |
+
|
| 359 |
+
# B. Baselines
|
| 360 |
+
|
| 361 |
+
We compare our proposed MonoAttn-Transducer with the following state-of-the-art open-source approaches (without using pretrained encoder or any data augmentation method for fair comparison).
|
| 362 |
+
|
| 363 |
+
# AED-based Models
|
| 364 |
+
|
| 365 |
+
Wait- $k$ (Ma et al., 2020c): It executes wait- $k$ policy (Ma et al., 2019) by setting the pre-decision window size to 280 ms.
|
| 366 |
+
|
| 367 |
+
RealTrans (Zeng et al., 2021): It detects word number in the streaming speech by counting blanks in CTC transcription and applies wait- $k$ -stride- $^ n$ strategy accordingly.
|
| 368 |
+
|
| 369 |
+
MU-ST (Zhang et al., 2022): It trains an external segmentation model, which is then utilized to detect meaningful units for guiding generation.
|
| 370 |
+
|
| 371 |
+
Seg2Seg (Zhang & Feng, 2023): It alternates between waiting for a source segment and generating a target segment in an autoregressive manner.
|
| 372 |
+
|
| 373 |
+
EDAtt (Papi et al., 2023a): It calculates the attention scores towards the latest received frames of speech, serving as guidance for an offline-trained translation model during simultaneous inference.
|
| 374 |
+
|
| 375 |
+
AlignAtt (Papi et al., 2023b): It exploits the attention information to generate source-target alignments that guide the model during inference. AlignAtt demonstrates superior performance for delays exceeding 2 seconds, whereas our study primarily focuses on scenarios involving delays shorter than 2 seconds.
|
| 376 |
+
|
| 377 |
+
# CTC-based Models
|
| 378 |
+
|
| 379 |
+
NAST (Ma et al., 2024): It introduces a streaming generation model with fast computation speed by leveraging a nonautoregressive transformer and CTC decoding (Graves et al., 2006).
|
| 380 |
+
|
| 381 |
+
# Transducer-based Models
|
| 382 |
+
|
| 383 |
+
Transducer: It adopts the standard Transducer framework (Graves, 2012) and utilizes Transformer as its backend network (Zhang et al., 2020).
|
| 384 |
+
|
| 385 |
+
CAAT (Liu et al., 2021): It incorporates a cross-attention module within Transducer’s joiner to alleviate its strong monotonic constraint.
|
| 386 |
+
|
| 387 |
+
# LLM-based Models
|
| 388 |
+
|
| 389 |
+
LSG (Guo et al., 2025): It enables the LLM to devise a streaming generation policy that balances latency and generation quality by referring a baseline policy.
|
| 390 |
+
|
| 391 |
+
# C. Numerical Results
|
| 392 |
+
|
| 393 |
+
In addition to Average Lagging (AL; Ma et al., 2020c), we also incorporate Average Proportion (AP; Cho & Esipova, 2016), Differentiable Average Lagging (DAL; Arivazhagan et al., 2019) and Length-Adaptive Average Lagging (LAAL; Papi et al., 2022) as metrics to evaluate the latency. AL, DAL and LAAL are all reported with milliseconds. The trade-off between latency and translation quality is attained by adjusting the chunk size $C$ . The offline results are obtained by setting the chunk size to be longer than any utterance in the dataset $C = \infty$ ). We use SimulEval v1.1.4 for evaluation in all the experiments. The numerical results of MonoAttn-Transducer are presented in Table 4 and 5. A comparison of the computation-aware latency metrics for AL and LAAL between the Transducer and MonoAttn-Transducer models is presented in Table 6.
|
| 394 |
+
|
| 395 |
+
Table 4. Numerical results of MonoAttn-Transducer on MuST-C English to German dataset.
|
| 396 |
+
|
| 397 |
+
<table><tr><td colspan="6">MonoAttn-Transducer on En→De</td></tr><tr><td>C(ms)</td><td>AP</td><td>AL</td><td>DAL</td><td>LAAL</td><td>BLEU</td></tr><tr><td>320</td><td>0.67</td><td>1215</td><td>1497</td><td>1317</td><td>20.22</td></tr><tr><td>640</td><td>0.77</td><td>1470</td><td>1872</td><td>1582</td><td>22.47</td></tr><tr><td>960</td><td>0.83</td><td>1860</td><td>2309</td><td>1957</td><td>22.94</td></tr><tr><td>1280</td><td>0.86</td><td>2215</td><td>2719</td><td>2305</td><td>23.74</td></tr><tr><td>∞</td><td>-</td><td>-</td><td>-</td><td>-</td><td>24.42</td></tr></table>
|
| 398 |
+
|
| 399 |
+
Table 5. Numerical results of MonoAttn-Transducer on MuST-C English to Spanish dataset.
|
| 400 |
+
|
| 401 |
+
<table><tr><td colspan="6">MonoAttn-Transducer on En→Es</td></tr><tr><td>C(ms)</td><td>AP</td><td>AL</td><td>DAL</td><td>LAAL</td><td>BLEU</td></tr><tr><td>320</td><td>0.74</td><td>997</td><td>1534</td><td>1230</td><td>24.72</td></tr><tr><td>640</td><td>0.81</td><td>1239</td><td>1854</td><td>1475</td><td>26.74</td></tr><tr><td>960</td><td>0.88</td><td>1606</td><td>2304</td><td>1837</td><td>27.05</td></tr><tr><td>1280</td><td>0.93</td><td>1991</td><td>2725</td><td>2204</td><td>27.41</td></tr><tr><td>∞</td><td>-</td><td>-</td><td>-</td><td>-</td><td>27.48</td></tr></table>
|
| 402 |
+
|
| 403 |
+
Table 6. Comparison of MonoAttn-Transducer and Transducer across various chunk size settings on MuST-C English to German and English to Spanish datasets.
|
| 404 |
+
|
| 405 |
+
<table><tr><td></td><td colspan="4">En-Es</td><td colspan="4">En-De</td></tr><tr><td></td><td>Chunk Size (ms)</td><td>320</td><td>640</td><td>960</td><td>1280</td><td>320</td><td>640</td><td>960</td></tr><tr><td rowspan="4">Transducer</td><td>AL (ms,↓)</td><td>886</td><td>1193</td><td>1591</td><td>1997</td><td>1126</td><td>1434</td><td>1830</td></tr><tr><td>AL_CA (ms,↓)</td><td>1121</td><td>1330</td><td>1699</td><td>2085</td><td>1323</td><td>1551</td><td>1920</td></tr><tr><td>LAAL (ms,↓)</td><td>1168</td><td>1466</td><td>1847</td><td>2220</td><td>1258</td><td>1563</td><td>1942</td></tr><tr><td>LAAL_CA (ms,↓)</td><td>1381</td><td>1589</td><td>1944</td><td>2300</td><td>1444</td><td>1673</td><td>2028</td></tr><tr><td rowspan="4">MonoAttn-Transducer</td><td>AL (ms,↓)</td><td>997</td><td>1239</td><td>1606</td><td>1991</td><td>1215</td><td>1470</td><td>1860</td></tr><tr><td>AL_CA (ms,↓)</td><td>1239</td><td>1385</td><td>1724</td><td>2089</td><td>1407</td><td>1596</td><td>1964</td></tr><tr><td>LAAL (ms,↓)</td><td>1230</td><td>1475</td><td>1837</td><td>2204</td><td>1317</td><td>1582</td><td>1957</td></tr><tr><td>LAAL_CA (ms,↓)</td><td>1453</td><td>1607</td><td>1945</td><td>2295</td><td>1501</td><td>1702</td><td>2056</td></tr></table>
|
| 406 |
+
|
| 407 |
+
Table 7. Comparison of results reported in Tang et al. (2023) and our work on MuST-C English to German dataset.
|
| 408 |
+
|
| 409 |
+
<table><tr><td></td><td>Chunk Size (ms)</td><td>160</td><td>320</td><td>480</td><td>640</td></tr><tr><td rowspan="2">Transducer (Tang et al., 2023)</td><td>BLEU (↑)</td><td>20.76</td><td>21.80</td><td>22.52</td><td>23.32</td></tr><tr><td>AL (ms, ↓)</td><td>1282</td><td>1252</td><td>1306</td><td>1498</td></tr><tr><td rowspan="2">TAED (Tang et al., 2023)</td><td>BLEU (↑)</td><td>21.57</td><td>22.63</td><td>23.48</td><td>23.47</td></tr><tr><td>AL (ms, ↓)</td><td>1263</td><td>1354</td><td>1369</td><td>1903</td></tr><tr><td></td><td>Chunk Size (ms)</td><td>320</td><td>640</td><td>960</td><td>1280</td></tr><tr><td rowspan="2">Transducer (Our implementation)</td><td>BLEU (↑)</td><td>19.99</td><td>22.10</td><td>22.20</td><td>22.96</td></tr><tr><td>AL (ms, ↓)</td><td>1126</td><td>1434</td><td>1830</td><td>2215</td></tr><tr><td rowspan="2">MonoAttn-Transducer</td><td>BLEU (↑)</td><td>20.22</td><td>22.47</td><td>22.94</td><td>23.74</td></tr><tr><td>AL (ms, ↓)</td><td>1215</td><td>1470</td><td>1860</td><td>2215</td></tr></table>
|
| 410 |
+
|
| 411 |
+
# D. Visualization
|
| 412 |
+
|
| 413 |
+
In this section, we present more examples of diagonal prior and its posterior from training corpus. We have observed that, even with significant differences in the prior distribution, the posterior remains fairly robust when the chunk size is constant. The vertical axis represents the target subword sequence and the horizontal axis represents the speech waveform. Darker areas indicate higher alignment probabilities. We use Montreal Forced Alignment tools (McAuliffe et al., 2017) to obtain speech-transcription alignments for illustration.
|
| 414 |
+
|
| 415 |
+

|
| 416 |
+
Figure 3. Chunk size in this example is set to 320ms. (Diagonal Prior)
|
| 417 |
+
|
| 418 |
+

|
| 419 |
+
Figure 4. Chunk size in this example is set to 640ms. (Diagonal Prior)
|
| 420 |
+
|
| 421 |
+

|
| 422 |
+
Figure 5. Chunk size in this example is set to 960ms. (Diagonal Prior)
|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
Figure 6. Chunk size in this example is set to 1280ms. (Diagonal Prior)
|
paper_markdowns/bamboo-04542.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04596.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04886.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04894.md
ADDED
|
@@ -0,0 +1,587 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Lan Feng 1 * Fan Nie 2 * Yuejiang Liu 2 Alexandre Alahi 1
|
| 2 |
+
|
| 3 |
+
# Abstract
|
| 4 |
+
|
| 5 |
+
We propose TAROT, a Targeted data selection framework grounded in Optimal Transport theory. Previous targeted data selection methods primarily use influence-based greedy heuristics to enhance domain-specific performance. These methods perform well on limited, unimodal data (i.e., data following a single pattern) but become less effective as target data increases in complexity. Specifically, in multimodal distributions, these heuristics fail to account for multiple inherent patterns, leading to suboptimal data selection. This work identifies two primary factors contributing to this limitation: (i) the disproportionate impact of dominant feature components in high-dimensional influence estimation, and (ii) the restrictive linear additive assumptions inherent in greedy selection strategies. To address these challenges, TAROT incorporates whitened feature distance to mitigate dominant feature bias, offering a more reliable measure of data influence. Building on this, TAROT uses whitened feature distance to quantify and minimize the optimal transport distance between the selected data and target domains. Notably, this minimization also facilitates the estimation of optimal selection ratios. We evaluate TAROT across multiple tasks, including semantic segmentation, motion prediction, and instruction tuning. Results consistently show that TAROT outperforms state-of-the-art methods, highlighting its versatility across various deep learning tasks. Code is available at: https: //github.com/vita-epfl/TAROT.
|
| 6 |
+
|
| 7 |
+
# 1. Introduction
|
| 8 |
+
|
| 9 |
+
Expanding model capacity and data volume has emerged as a key strategy in both computer vision (CV) and large
|
| 10 |
+
|
| 11 |
+
*Equal contribution 1EPFL, Switzerlanzd 2Stanford, USA. Correspondence to: Yuejiang Liu <yuejiang.liu@stanford.edu>, Alexandre Alahi <alexandre.alahi@epfl.ch>.
|
| 12 |
+
|
| 13 |
+
Proceedings of the $4 2 ^ { n d }$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1: Left: the selection objective of TAROT, designed to minimize optimal transport costs. The method operates on a target distribution and a candidate data pool, selecting a subset from the candidate data to reduce transport costs. Right: the approximate performance improvements and data efficiency achieved by TAROT across various tasks. It illustrates that TAROT consistently enhances task performance in different domains while requiring less data. Detailed experimental results are provided in Section 4.
|
| 17 |
+
|
| 18 |
+
language models (LLMs) (Achiam et al., 2023; Zou et al., 2024; Oquab et al., 2023; Feng et al., 2024). However, training a model on all available data may not be optimal or feasible, as data quality varies and computational resources are often limited (Albalak et al., 2024; Liu et al., 2024; Engstrom et al., 2024; Kang et al., 2024). To address this, recent research has introduced targeted data selection methods. These methods aim to select data from a candidate pool that maximizes model performance on specific target tasks. Recent methods (Xia et al.; Engstrom et al., 2024) address this challenge using a two-step approach: (1) influence estimation, which calculates data influence scores between the candidate and target datasets, and (2) greedy heuristics, which selects data with the highest average influence scores for the target dataset.
|
| 19 |
+
|
| 20 |
+
Although these selection paradigms have shown to be effective in LLM applications (Engstrom et al., 2024; Xia et al.), they rely heavily on the assumption that influence functions are additive. This means that the influence of multiple training samples on a target sample can be added together. However, as noted by Hu et al. (2024), this assumption, while efficient and broadly applicable, fails even in simple linear regression scenarios. One main reason why the additivity assumption works well in some cases is the simple and unimodal distribution of the target domain, such
|
| 21 |
+
|
| 22 |
+

|
| 23 |
+
Candidate Data
|
| 24 |
+
Data to be Selected
|
| 25 |
+
★Target Data
|
| 26 |
+
→Transport Plan
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
1) Gradient Feature Whitening
|
| 30 |
+
Initial Gradient Features
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
Whitened Gradient Features
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
2) OT Distance Minimization Selection
|
| 37 |
+
Iteration 1 Costs: 4,continue
|
| 38 |
+
|
| 39 |
+

|
| 40 |
+
Iteration 2 Costs: 6, stop
|
| 41 |
+
|
| 42 |
+

|
| 43 |
+
Final Selection
|
| 44 |
+
Figure 2: Overview of TAROT. Left: Raw gradient features are whitened and projected onto a unit hypersphere. Right: A greedy algorithm iteratively selects candidate samples. During the second iteration, adding two new distant data points increases the overall transport cost, prompting the algorithm to stop. As a result, only in-distribution data points are selected to minimize the OT distance.
|
| 45 |
+
|
| 46 |
+
as a single task (e.g. code generation) in LLMs. In these situations, adding up the influences provides a good estimate of how a candidate sample impacts the entire target task. However, in other contexts like motion prediction, where data distributions are often complex and multimodal, this approach falls short. In such cases, the summed influence does not capture the diverse nature of the target distribution, reducing its effectiveness.
|
| 47 |
+
|
| 48 |
+
To this end, we adopt a distribution-matching approach for targeted data selection. We first introduce whitened feature distance (WFD), an influence estimation method designed to mitigate the bias from dominant features. The benefits of feature whitening are also discussed in (Ermolov et al., 2021). Using WFD as pairwise cost estimation between data points, we develop TAROT, an Optimal Transport (OT)-based targeted selection framework. This method selects data that minimizes the OT distance between the target distribution and the selected samples. Figure 1 illustrates the selection objective of our approach. Our choice of OT is also supported by findings in (Just et al., 2023), which demonstrate that training models on source data with smaller OT distances to the target domain improves domain-specific performance.
|
| 49 |
+
|
| 50 |
+
To validate the general effectiveness of our method, we conduct experiments on semantic segmentation, motion prediction, and instruction tuning tasks. Extensive results demonstrate that our approach consistently outperforms previous methods. Notably, models trained on smaller, domainrelevant datasets often surpass those trained on larger, less relevant datasets. In summary, our contributions are:
|
| 51 |
+
|
| 52 |
+
• Improved influence estimation: we present WFD as a reliable measure of data influence.
|
| 53 |
+
• Distribution matching-based data selection: we propose TAROT, an OT-based pipeline for targeted data selection that reduces distributional differences between the target and selected datasets.
|
| 54 |
+
|
| 55 |
+
• Broad applicability and improved performance: extensive experiments in CV and LLMs demonstrate that TAROT consistently outperforms existing methods, allowing models trained on smaller, targeted datasets to match or surpass the performance of those trained on full datasets.
|
| 56 |
+
|
| 57 |
+
# 2. Preliminary
|
| 58 |
+
|
| 59 |
+
# 2.1. Data Influence Formulation
|
| 60 |
+
|
| 61 |
+
Following Pruthi et al. (2020), we summarize how to estimate the influence of a training data point on held-out data using a first-order approximation of training dynamics.
|
| 62 |
+
|
| 63 |
+
First-order Approximation to Per-step Influence. Suppose $x _ { i }$ is the only training sample at time step $t$ , and the model $\theta ^ { t }$ is updated based on the loss $\mathcal { L } ( x _ { i } ; \theta ^ { t } )$ using SGD with learning rate $\eta _ { t }$ . The per-step influence of $x _ { i }$ on a target sample $x$ is defined as the reduction in the loss of $x$ caused by training on $x _ { i }$ . This can be approximated using a first-order Taylor expansion. The per-step influence is:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
- \eta_ {t} \left\langle \nabla \mathcal {L} \left(x _ {i}; \theta^ {t}\right), \nabla \mathcal {L} \left(x; \theta^ {t}\right) \right\rangle , \tag {1}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $\nabla \mathcal { L } ( x _ { i } , x ; \theta ^ { t } )$ is the loss gradient.
|
| 70 |
+
|
| 71 |
+
Trajectory Influence via Checkpoints. For practicality, Pruthi et al. (2020) compute the trajectory influence by summing the per-step influences over epochs:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\operatorname {I n f} _ {\mathrm {S G D}} \left(x _ {i}, x\right) \triangleq \sum_ {i = 1} ^ {N} \bar {\eta} _ {i} \left\langle \nabla \mathcal {L} \left(x; \theta_ {i}\right), \nabla \mathcal {L} \left(x _ {i}; \theta_ {i}\right) \right\rangle . \tag {2}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
# 2.2. Background on Optimal Transport
|
| 78 |
+
|
| 79 |
+
Given a complete, separable metric space $\mathcal { X }$ and probability measures $\alpha , \beta \in { \mathcal { P } } ( { \mathcal { X } } )$ , the Kantorovich formulation (Kantorovitch, 1958) of OT is defined as:
|
| 80 |
+
|
| 81 |
+
$$
|
| 82 |
+
\mathrm {O T} (\alpha , \beta) \triangleq \min _ {\pi \in \Pi (\alpha , \beta)} \int_ {\mathcal {X} \times \mathcal {X}} c (x, y) \mathrm {d} \pi (x, y), \tag {3}
|
| 83 |
+
$$
|
| 84 |
+
|
| 85 |
+
where $c ( \cdot , \cdot ) : \mathcal { X } \times \mathcal { X } \to \mathbb { R } ^ { + }$ is a cost function, and $\Pi ( \alpha , \beta )$ is the set of couplings with marginals $\alpha$ and $\beta$ .
|
| 86 |
+
|
| 87 |
+
In practice, the measures $\alpha$ and $\beta$ are approximated using finite samples $\{ \mathbf { x } ^ { ( i ) } \}$ and $\{ \mathbf { y } ^ { ( j ) } \}$ , with corresponding discrete measures $\textstyle \alpha = \sum _ { i = 1 } ^ { n } a _ { i } \delta _ { \mathbf { x } ^ { ( i ) } }$ and $\begin{array} { r } { \beta = \sum _ { j = 1 } ^ { m } b _ { j } \delta _ { \mathbf { y } ^ { ( j ) } } } \end{array}$ . The pairwise costs form an $n \times m$ matrix C, where $\mathbf { C } _ { i j } =$ $c ( \mathbf { x } ^ { ( i ) } , \mathbf { y } ^ { ( j ) } )$ . Solving this problem as a linear program is computationally expensive, with cubic complexity. In implementation, we use the Sinkhorn algorithm (Cuturi, 2013) for efficient calculation.
|
| 88 |
+
|
| 89 |
+
# 3. Method
|
| 90 |
+
|
| 91 |
+
The failure modes of influence-based greedy heuristics have been systematically studied in (Hu et al., 2024). Specifically, errors in the influence function and the inability to account for the non-additive nature of collective influence can cause these heuristics to fail even in simple linear regression tasks.
|
| 92 |
+
|
| 93 |
+
In contrast, we formulate targeted data selection as a distribution matching problem, aiming to select a subset of candidate data that closely aligns with the target distribution. We employ the OT distance to quantify the discrepancy between distributions.
|
| 94 |
+
|
| 95 |
+
Sections 3.1 and 3.2 demonstrate how to measure the OT distance between datasets, and Section 3.3 discusses strategies for selecting data to minimize the OT distance. An overview of these processes is illustrated in Figure 2.
|
| 96 |
+
|
| 97 |
+
# 3.1. Optimal Transport Between Datasets
|
| 98 |
+
|
| 99 |
+
As discussed in (Alvarez-Melis & Fusi, 2020), estimating OT distance between datasets begins with defining a distance metric between data pairs $( x , y )$ and $( x ^ { \prime } , y ^ { \prime } )$ . In Section 2.1, we introduced a gradient-based method for estimating data influence, which embeds both input features and labels into the model’s gradient. This gradient feature captures the task-specific relationship between data points and the model’s loss. By computing distances such as the L2 distance, it provides a viable metric for the OT problem. Furthermore, it aligns with the model’s optimization objective, ensuring that the OT distance reflects meaningful differences between datasets in terms of their impact on model training.
|
| 100 |
+
|
| 101 |
+
Formally, we define a dataset $\mathcal { D }$ as a set of feature-label pairs $( x , y ) \in \mathcal { X } \times \mathcal { Y }$ , where $\mathcal { X }$ is the feature space and $\mathcal { V }$ is the label set. For convenience, we use the shorthand $z \triangleq ( x , y )$ and ${ \mathcal { Z } } \triangleq \chi \times \qquad $ . We consider a candidate dataset $\mathcal { D } _ { c } = \left\{ z _ { c } ^ { ( i ) } \right\} _ { i = 1 } ^ { N }$ z c ( i ) o N i=1 and a target dataset $\mathcal { D } _ { t } = \left\{ z _ { t } ^ { ( i ) } \right\} _ { i = 1 } ^ { M } .$ ( i ) o M
|
| 102 |
+
|
| 103 |
+
We embed $z$ using the model’s parameters trained on $\mathcal { D } _ { c }$ :
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\phi (z) = \sum_ {i = 1} ^ {T} \nabla \mathcal {L} (z; \theta_ {i}), \tag {4}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $T$ is the total number of checkpoints, and $\nabla { \mathcal { L } } ( z ; \theta _ { i } )$ represents the gradient of the loss function with respect to the model parameters at the $i$ -th checkpoint $\theta _ { i }$ .
|
| 110 |
+
|
| 111 |
+
The distance between two samples is then defined as:
|
| 112 |
+
|
| 113 |
+
$$
|
| 114 |
+
d _ {\mathcal {Z}} \left(z, z ^ {\prime}\right) = \left\| \phi (z) - \phi \left(z ^ {\prime}\right) \right\| _ {2}. \tag {5}
|
| 115 |
+
$$
|
| 116 |
+
|
| 117 |
+
# 3.2. Whitened Feature Distance
|
| 118 |
+
|
| 119 |
+
Directly computing the distance $d _ { \mathcal { Z } } \left( z , z ^ { \prime } \right)$ as defined in Equation (5) presents significant challenges due to the correlation of gradient features. This correlation results in an ill-conditioned covariance matrix, allowing certain feature space directions to dominate distance estimation and distort sample relationships. Additionally, varying gradient component scales bias distance measurements, impairing the accuracy of distance estimation.
|
| 120 |
+
|
| 121 |
+
To address these issues, we propose a novel application of whitening to the gradient features. Whitening effectively decorrelates the features and scales them to have unit variance, ensuring that each feature contributes equally to the distance computation. Our method comprises three steps:
|
| 122 |
+
|
| 123 |
+
1. Random projection. We adopt the same random projection technique from (Xia et al.; Park et al., 2023) to reduce the dimensionality of the gradients. The projected gradient $\phi ( z ) _ { i } ^ { \mathrm { p r o j } }$ is computed as:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\phi (z) _ {i} ^ {\operatorname {p r o j}} = \mathcal {P} ^ {T} \cdot \phi (z) _ {i}, \tag {6}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $\mathcal { P } ^ { T }$ is the projection matrix. We leverage the efficient CUDA implementation from Park et al. (2023).
|
| 130 |
+
|
| 131 |
+
2. Whitening. Despite dimensionality reduction, projected gradients remain correlated, creating an anisotropic feature space. To address this, we perform Cholesky whitening to decorrelate features. First, we center the projected gradients $\Phi ( z ) ^ { \mathrm { p r o j } } = [ \phi ( z ) _ { 1 } ^ { \mathrm { p r o j } } , \dots , \phi ( z ) _ { N } ^ { \mathrm { p r o j } } ]$ :
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
\tilde {\phi} (z) _ {i} ^ {\operatorname {p r o j}} = \phi (z) _ {i} ^ {\operatorname {p r o j}} - \frac {1}{N} \sum_ {i = 1} ^ {N} \phi (z) _ {i} ^ {\operatorname {p r o j}}. \tag {7}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
Next, we compute the covariance matrix $\Sigma$ and apply Cholesky decomposition, $\Sigma = L L ^ { \top }$ , where $L$ is lower triangular. The gradients are whitened as:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\phi (z) ^ {w} = L ^ {- 1} \tilde {\phi} (z) ^ {\text {p r o j}}, \tag {8}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
ensuring decorrelation.
|
| 144 |
+
|
| 145 |
+
3. Normalization. Each whitened gradient vector $\phi ( z ) _ { i } ^ { w }$ is normalized to unit length to ensure consistent gradient scales:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\hat {\phi} (z) _ {i} = \frac {\phi (z) _ {i} ^ {w}}{| \phi (z) _ {i} ^ {w} |}. \tag {9}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
The WFD $d _ { \mathcal { Z } } ^ { w } \left( z , z ^ { \prime } \right)$ is then calculated as:
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
d _ {\mathcal {Z}} ^ {w} \left(z, z ^ {\prime}\right) = \left\| \hat {\phi} (z) - \hat {\phi} \left(z ^ {\prime}\right) \right\| _ {2}. \tag {10}
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
This gradient-based distance also applies to data influence estimation. Our experiments show that WFD outperforms the state-of-the-art method (Park et al., 2023), as detailed in Section 4.1.
|
| 158 |
+
|
| 159 |
+
Using $d _ { \mathcal { Z } } ^ { w }$ , we lift the metric to a dataset-level OT distance:
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
d _ {\mathrm {O T}} \left(\mathcal {D} _ {c}, \mathcal {D} _ {t}\right) = \min _ {\pi \in \Pi (\alpha , \beta)} \int_ {\mathcal {Z} \times \mathcal {Z}} d _ {\mathcal {Z}} ^ {w} \left(z, z ^ {\prime}\right) \pi \left(z, z ^ {\prime}\right). \tag {11}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
# 3.3. Data Selection via OT Distance Minimization
|
| 166 |
+
|
| 167 |
+
Our objective is to select a subset $\mathcal { D } _ { s } \subseteq \mathcal { D } _ { c }$ of size $S \leq N$ , such that the OT distance between the selected subset $\mathcal { D } _ { s }$ and $\mathcal { D } _ { t }$ is minimized.
|
| 168 |
+
|
| 169 |
+
Formally, let $\mathcal { D } _ { s } = \left\{ z _ { s } ^ { ( i ) } \right\} _ { i = 1 } ^ { S }$ z s be a subset of $\mathcal { D } _ { c }$ . We aim to find $\mathcal { D } _ { s }$ such that:
|
| 170 |
+
|
| 171 |
+
$$
|
| 172 |
+
d _ {\mathrm {O T}} \left(\mathcal {D} _ {s}, \mathcal {D} _ {t}\right) < d _ {\mathrm {O T}} \left(\mathcal {D} _ {c}, \mathcal {D} _ {t}\right), \tag {12}
|
| 173 |
+
$$
|
| 174 |
+
|
| 175 |
+
where $d _ { \mathrm { O T } }$ is subject to the constraint that the masses for each point are normalized.
|
| 176 |
+
|
| 177 |
+
Solving the subset selection problem to minimize the OT distance is inherently combinatorial, as the number of possible subsets $\mathcal { D } _ { s } \subseteq \mathcal { D } _ { c }$ grows exponentially with the size of $\mathcal { D } _ { c }$ . An exhaustive search incurs prohibitive computational costs. To address this, we propose a greedy algorithm that efficiently approximates the solution by iteratively selecting elements that locally minimize the OT distance.
|
| 178 |
+
|
| 179 |
+
Our method exploits the sparsity of gradient-based features in high-dimensional space, which results in a sparse coupling matrix in the OT problem. Specifically, most of the transport mass in the OT plan is concentrated on the nearest neighbors of target points in $\mathcal { D } _ { t }$ . Leveraging this property, the algorithm iteratively selects the nearest neighbors from $\mathcal { D } _ { c }$ for each point in $\mathcal { D } _ { t }$ , providing a computationally efficient solution.
|
| 180 |
+
|
| 181 |
+
Based on this, we introduce two selection schemes tailored for different scenarios: (1) fixed-size selection for maximizing performance under a limited budget, and (2) OT distance minimization selection to find a potentially optimal selection ratio.
|
| 182 |
+
|
| 183 |
+
Fixed-Size Selection. This scheme selects a fixed number of points $S$ from $\mathcal { D } _ { c }$ . For $M$ target samples, we iteratively add their nearest candidates from $\mathcal { D } _ { c }$ to the selected set $\mathcal { D } _ { s }$ . In iteration $k$ , the $k$ -th nearest samples are considered. If adding all of them keeps $| \mathcal { D } _ { s } | \le S$ , they are directly added, and the process continues. Otherwise, we compute the potential $\phi _ { i }$ of the new candidates using the dual OT problem:
|
| 184 |
+
|
| 185 |
+
$$
|
| 186 |
+
\min _ {\pi \in \Pi \left(\mathcal {D} _ {s} \cup \left\{z _ {i} \right\}, \mathcal {D} _ {t}\right)} \int_ {\mathcal {D} _ {s} \cup \left\{z _ {i} \right\} \times \mathcal {D} _ {t}} c \left(z, z _ {t}\right) \mathrm {d} \pi \left(z, z _ {t}\right), \tag {13}
|
| 187 |
+
$$
|
| 188 |
+
|
| 189 |
+
where $\Pi ( \mathcal { D } _ { s } \cup \{ z _ { i } \} , \mathcal { D } _ { t } )$ is the set of couplings between $\mathcal { D } _ { s } \cup$ $\left\{ z _ { i } \right\}$ and $\mathcal { D } _ { t }$ . As noted in (Just et al., 2023), $\phi _ { i }$ estimates the benefit of adding $z _ { i }$ for minimizing the OT distance. We rank candidates by potential and select the top $S - \left. \mathcal { D } _ { s } \right.$ samples. The process ends once these samples are added.
|
| 190 |
+
|
| 191 |
+
OT-Distance Minimization Selection (OTM). This scheme minimizes the OT distance between the selected data $\mathcal { D } _ { s }$ and the target distribution. To avoid overfitting to specific points in $\mathcal { D } _ { t }$ , we use a $k$ -fold selection strategy with crossvalidation. The target dataset $\mathcal { D } _ { t }$ is randomly split into $k$ equal subsets. In each fold, $1 / k$ of $\mathcal { D } _ { t }$ is used for selection,
|
| 192 |
+
|
| 193 |
+
while the OT distance is evaluated against the remaining $( k - 1 ) / k$ data.
|
| 194 |
+
|
| 195 |
+
At each iteration, points from $\mathcal { D } _ { c }$ are selected based on their nearest-neighbor distances to $1 / k$ of $\mathcal { D } _ { t }$ , and the OT distance is monitored. The process stops when the OT distance increases:
|
| 196 |
+
|
| 197 |
+
$$
|
| 198 |
+
d _ {\mathrm {O T}} \left(\mathcal {D} _ {s}, \mathcal {D} _ {t} \backslash \mathcal {D} _ {t} ^ {(f o l d)}\right) > d _ {\mathrm {O T}} \left(\mathcal {D} _ {s} ^ {(p r e v)}, \mathcal {D} _ {t} \backslash \mathcal {D} _ {t} ^ {(f o l d)}\right), \tag {14}
|
| 199 |
+
$$
|
| 200 |
+
|
| 201 |
+
where $\mathcal { D } _ { t } ^ { ( f o l d ) }$ is the $1 / k$ subset used for selection.
|
| 202 |
+
|
| 203 |
+
After processing all $k$ folds, the selected subsets are combined to form the final dataset $\mathcal { D } _ { s }$ . The choice of $k$ balances distribution alignment and generalization. In our experiments, $k = 1 0$ ensures a good match with the target distribution while avoiding overfitting.
|
| 204 |
+
|
| 205 |
+
# 3.4. Data Weighting with OT Potential
|
| 206 |
+
|
| 207 |
+
To highlight the importance of individual data points, we assign weights based on their OT potentials from Equation (13). These potentials are scaled to positive integer weights, determining the number of times each point is duplicated within annormalized to satisfy $\textstyle \sum _ { i = 1 } ^ { S } w _ { i } = R$ led wwhere $R$ ghts is a $\{ w _ { i } \}$ $R$ $N + M$ to match the same training steps as using the full dataset, or adjusted based on specific training requirements, e.g., limited training budget.
|
| 208 |
+
|
| 209 |
+
# 4. Experiments
|
| 210 |
+
|
| 211 |
+
This section starts by evaluating the influence estimation performance of WFD in Section 4.1. Following that, we evaluate TAROT across diverse tasks, including semantic segmentation (Section 4.2), motion prediction (Section 4.3), and instruction tuning (Section 4.4).
|
| 212 |
+
|
| 213 |
+
# 4.1. WFD for Influence Estimation
|
| 214 |
+
|
| 215 |
+
Evaluation Metric. Following Park et al. (2023), we use the Linear Data Modeling Score (LDS) as our evaluation metric. LDS measures the effectiveness of an attribution or influence estimation method in predicting changes in model outputs when the training set is altered. Further details of LDS are provided in the supplementary materials.
|
| 216 |
+
|
| 217 |
+
Target and Candidate Datasets. Following Park et al. (2023), we evaluate image classification using ResNet-9 classifiers trained on the CIFAR-10 dataset. For motion prediction, we adopt AutoBots (Girgis et al., 2021), training on the nuScenes (Caesar et al., 2020) dataset (32k samples) and validating on 9k target samples.
|
| 218 |
+
|
| 219 |
+
Baselines. We compare WFD against the state-of-the-art data attribution method TRAK (Park et al., 2023) using the same ensemble approach. Since WFD quantifies distance (where smaller values indicate greater influence), we evaluate it with the LDS score by considering negative WFD
|
| 220 |
+
|
| 221 |
+

|
| 222 |
+
Figure 3: Illustration of target examples and their corresponding closest (most helpful) and furthest (most detracting) candidate examples, identified by WFD. Top two rows: Visualization of motion prediction tasks using the nuScenes and Waymo datasets. The dark-to-light blue lines indicate the past (input) and future (ground truth) trajectories for the target vehicle, while green lines represent surrounding vehicle trajectories. Bottom two rows: Semantic segmentation tasks with examples from the Cityscapes and GTA5 datasets. For each target example, the top image shows the RGB scene, and the bottom image depicts the corresponding ground truth semantic segmentation mask. The WFD method selects training examples that are semantically aligned with the target, demonstrating its effectiveness in identifying positive and negative samples across different tasks.
|
| 223 |
+
|
| 224 |
+

|
| 225 |
+
Figure 4: WFD outperforms baseline methods on both tasks. The x-axis indicates the number of model checkpoints that a given method uses to compute attribution scores. The y-axis indicates the method’s efficacy as measured by LDS.
|
| 226 |
+
|
| 227 |
+
values. Additionally, we employ ZCA whitening instead of Cholesky whitening to preserve data structure for improved LDS performance. Differences between these two whitening methods are discussed in the supplementary materials.
|
| 228 |
+
|
| 229 |
+
Main Results. Figure 4 compares the performance of WFD with TRAK on the LDS score. Key findings include:
|
| 230 |
+
|
| 231 |
+
• WFD outperforms TRAK regardless of ensemble sizes.
|
| 232 |
+
|
| 233 |
+
This indicates that WFD exhibits a higher correlation with datamodels, which serves as an “oracle” of sorts for the LDS objective.
|
| 234 |
+
|
| 235 |
+
• Inspecting WFD-identified examples. In Figure 3 we display, for four randomly selected target samples from the nuScenes (Caesar et al., 2020) and Cityscapes (Cordts et al., 2016) dataset, the training examples from WOMD (Ettinger et al., 2021) and GTA5 (Richter et al., 2016) dataset corresponding to the smallest (most positive) and largest (most negative) whitened feature distance.
|
| 236 |
+
|
| 237 |
+
# 4.2. TAROT for Semantic Segmentation
|
| 238 |
+
|
| 239 |
+
Semantic segmentation involves assigning semantic labels to every pixel in an image. Prior studies show that synthetic data can significantly boost segmentation model performance on real-world data (Richter et al., 2016). We then address the following research question: Can TAROT identify synthetic data that better align with real-world distributions to enhance model performance?
|
| 240 |
+
|
| 241 |
+
Datasets. The GTA5 dataset (Richter et al., 2016) serves
|
| 242 |
+
|
| 243 |
+

|
| 244 |
+
|
| 245 |
+

|
| 246 |
+
Figure 5: Results of Targeted Selection for Semantic Segmentation. Performance curves of DeepLabV3 trained using different data selection methods.
|
| 247 |
+
Figure 6: Data selection visualization in gradient feature space with T-SNE. We select $10 \%$ of Cityscapes’ training set, with validation split as the target. Left: Samples selected by DsDm cluster tightly around the target distribution center. Right: Samples selected by TAROT are distributed more broadly, capturing the target distribution’s complexity. as the candidate dataset, while the Cityscapes (Cordts et al., 2016) training split (2975 samples) is used as the target dataset, with its validation split for evaluation. GTA5 contains 24,966 synthetic images with pixel-level annotations of urban scenes, whereas Cityscapes provides finely annotated real-world urban images.
|
| 248 |
+
|
| 249 |
+
Baselines. We compare TAROT with state-of-the-art targeted selection methods LESS and DsDm (Xia et al.; Engstrom et al., 2024), as well as random selection.
|
| 250 |
+
|
| 251 |
+
Data Selection and Model Training. We employ DeepLabV3 (Chen, 2017) with a ResNet50 (He et al., 2016) backbone, using gradients from the last four checkpoints to guide data selection. We evaluate selection ratios of $5 \%$ $20 \%$ , $50 \%$ and OTM (Section 3.3). OTM selects approximately $24 \%$ of the data. The repetition factor is set as: $R = N + M$ for data selected by TAROT (Section 3.4), while other methods employ uniform repetition to match the same size. A new DeepLabV3 model is then trained from scratch on the selected subsets.
|
| 252 |
+
|
| 253 |
+
Evaluation Metric. Mean Intersection over Union (mIoU) is used as the primary evaluation metric. We report the best validation performance during training.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
Figure 7: Results of Targeted Selection for Motion Prediction. The figure illustrates the performance of Wayformer under various data selection methods.
|
| 257 |
+
|
| 258 |
+
Main Results. Figure 5 compares the performance of TAROT and other baselines. Key findings include:
|
| 259 |
+
|
| 260 |
+
• Some synthetic data can degrade model performance. Training model on the full synthetic GTA5 dataset lowers mIoU from 58.98 to 58.21, highlighting the negative impact of misaligned synthetic data.
|
| 261 |
+
• Targeted data selection enhances domain-specific performance. Model performance improves with increased selection ratios but declines beyond an optimal point. Notably, TAROT consistently outperforms baselines, achieving the highest mIoU with about $24 \%$ of the GTA5 dataset. This demonstrates the effectiveness of OT distance in guiding optimal selection ratios.
|
| 262 |
+
• Additional insights from T-SNE visualizations. Figure 6 shows T-SNE visualizations of gradient features for selected data. The visualizations reveal differing selection behaviors: DsDm tightly clusters around the target distribution center, failing to capture its complexity. In contrast, TAROT selects data that better aligns with the broader target distribution, highlighting a key limitation of averaging-based influence methods in handling complex distributions.
|
| 263 |
+
|
| 264 |
+
# 4.3. TAROT for Motion Prediction
|
| 265 |
+
|
| 266 |
+
Motion prediction, the task of forecasting future trajectories from past data, is a critical component of autonomous driving. This section addresses two key research questions:
|
| 267 |
+
|
| 268 |
+
• Is TAROT generic? Compared to traditional computer vision tasks (e.g., image classification), motion prediction involves more complex inputs (e.g., maps, trajectories) and outputs (e.g., predicted trajectories and confidence scores). Is TAROT still effective in a more challenging setting?
|
| 269 |
+
• Is TAROT transferable? For example, can a model trained on data selected by a smaller model improve the performance of a larger model?
|
| 270 |
+
|
| 271 |
+
Datasets. We use the UniTraj framework (Feng et al., 2024) for unified training and evaluation across multiple datasets, including Waymo Open Motion (WOMD) (Ettinger et al.,
|
| 272 |
+
|
| 273 |
+
Table 1: Performance of TAROT on instruction tuning for LLMs. ‘Transfer’ indicates that QWEN-2.5-7B is trained on data selected by LLAMA-3.1-8B. Otherwise, the same base model is used for both selection and fine-tuning. ‘All’ denotes employing the full dataset. $5 \%$ indicates a selection ratio of $5 \%$ . The percentages within parentheses represent the selection ratios determined by OT-Minimization. ‘Subtask label’ specifies whether subtask labels are required during data selection.
|
| 274 |
+
|
| 275 |
+
<table><tr><td rowspan="2">Dataset</td><td colspan="2">LLAMA-3.1-8B</td><td colspan="2">QWEN-2.5-7B</td><td colspan="3">Transfer</td></tr><tr><td>MMLU ↑</td><td>BBH ↑</td><td>MMLU ↑</td><td>BBH ↑</td><td>MMLU ↑</td><td>BBH ↑</td><td>Subtask label</td></tr><tr><td>All</td><td>63.8</td><td>63.3</td><td>74.1</td><td>63.8</td><td>74.1</td><td>63.8</td><td>-</td></tr><tr><td>5% Random</td><td>64.7</td><td>60.8</td><td>74.1</td><td>63.5</td><td>74.1</td><td>63.5</td><td>X</td></tr><tr><td>5% LESS (Xia et al.)</td><td>65.7</td><td>62.6</td><td>74.3</td><td>66.3</td><td>74.3</td><td>65.0</td><td>✓</td></tr><tr><td>5% TAROT</td><td>66.0</td><td>65.0</td><td>74.1</td><td>66.9</td><td>74.2</td><td>65.3</td><td>X</td></tr><tr><td>TAROT-OTM</td><td>65.7 (0.13%)</td><td>63.6 (0.21%)</td><td>74.3 (0.09%)</td><td>68.9 (0.13%)</td><td>74.3 (0.13%)</td><td>68.7 (0.21%)</td><td>X</td></tr></table>
|
| 276 |
+
|
| 277 |
+
2021), Argoverse 2 (Wilson et al., 2021), nuScenes (Caesar et al., 2020), and nuPlan (H. Caesar, 2021). The nuScenes training set $3 2 k$ samples) serves as the target dataset, while the candidate pool comprises WOMD, Argoverse 2, and nuPlan. From nuPlan, we filter trajectories with a moving distance over 2 meters, yielding $1 0 0 0 k$ samples. We use the official training splits of WOMD and Argoverse 2, including $2 0 0 0 k$ samples. The evaluation is conducted on the nuScenes validation set. This cross-dataset task involves challenges like non-overlapping geographic regions and varying annotation formats. We explore whether TAROT can effectively curate multi-source data to enhance nuScenes validation performance.
|
| 278 |
+
|
| 279 |
+
Baselines. We utilize the same baselines in Section 4.2.
|
| 280 |
+
|
| 281 |
+
Data Selection and Model Training. We employ Auto-Bots (Girgis et al., 2021), a lightweight $( 1 . 5 M$ parameters) attention-based prediction model, for data selection. Autobots is pretrained on candidate and target datasets for 50 epochs, and gradients from the final checkpoint guide selection. We evaluate selection ratios of $5 \%$ , $20 \%$ , $50 \%$ , and OTM. OTM selects approximately $31 \%$ , $53 \%$ , and $22 \%$ from WOMD, Argoverse 2, and nuPlan, covering $2 9 . 8 \%$ of the full dataset. The selected data is used to train the Wayformer (Nayakanti et al., 2023) model ( $1 5 M$ parameters) for 100 epochs. To highlight that TAROT can also achieve performance gains with reduced training data and iterations, the data weighting method (Section 3.4) is not applied.
|
| 282 |
+
|
| 283 |
+
Evaluation Metric. We use Brier Minimum Final Displacement Error (Brier-minFDE) metric for evaluation, which is used in the Argoverse 2 (Wilson et al., 2021) challenge. We report the best validation performance for each method.
|
| 284 |
+
|
| 285 |
+
Main Results. Figure 7 compares the performance of Wayformer trained on datasets with different selection ratios. Key findings include:
|
| 286 |
+
|
| 287 |
+
• Effectiveness of TAROT: TAROT consistently outperforms other baselines. Influence-estimation based heuristics, such as LESS and DsDm, perform well at low selection ratios $( 5 \% )$ but lose effectiveness as the ratio increases, emphasizing the benefits of the distribution-matching ap-
|
| 288 |
+
|
| 289 |
+
proach. Additionally, OTM selection outperforms training on the entire dataset and other selection ratios, delivering global optimal results. Moreover, TAROT archives the top 1 performance on the nuScenes leaderboard. Results are shown in the Appendix D.
|
| 290 |
+
|
| 291 |
+
• Transferability of TAROT: Data selected by Autobots significantly enhances the performance of Wayformer, a model with $1 0 \times$ the capacity. Furthermore, despite differences in loss functions and model architectures between the two models, the selected data still yields performance improvements. This highlights that although TAROT leverages a pretrained model for selection, the selected dataset retains strong model-agnostic properties.
|
| 292 |
+
|
| 293 |
+
# 4.4. TAROT for Instruction Tuning
|
| 294 |
+
|
| 295 |
+
Previous experiments demonstrate that TAROT is particularly effective when dealing with complex target distributions. In this section, we evaluate whether TAROT can also deliver strong performance in LLM tasks, where the target distribution is relatively simple and existing methods have already shown high effectiveness.
|
| 296 |
+
|
| 297 |
+
Datasets. To ensure a fair comparison and maintain consistency with established benchmarks, we replicate the experimental setup described by Xia et al.. We utilize the same candidate dataset, comprising FLAN V2 (Longpre et al., 2023), COT (Wei et al., 2022), DOLLY (Conover et al., 2023) and OPEN ASSISTANT 1 (Kopf et al. ¨ , 2024), with MMLU (Hendrycks et al., 2021b;a) and BBH (Suzgun et al., 2023) serving as the target tasks for evaluation.
|
| 298 |
+
|
| 299 |
+
Data Selection and Model Training. We conduct experiments using LLAMA-3.1-8B (Dubey et al., 2024) and QWEN-2.5-7B (Team, 2024) as the base models for both data selection and fine-tuning. To evaluate the transferability of our selection method, we also fine-tune a QWEN-2.5-7B using data samples selected by LLAMA-3.1-8B. Data selected by TAROT-OTM is weighted using OT potentials (Section 3.4) with $R = 0 . 5 \% N$ . More details are provided in the supplementary materials.
|
| 300 |
+
|
| 301 |
+
Evaluation Metric. We employ Exact Matching (EM) for BBH and Accuracy for MMLU as evaluation metrics.
|
| 302 |
+
|
| 303 |
+
Table 2: Ablation Study of WFD on nuScenes with ensemble size ranging from 1 to 50. Evaluation metric is LDS.
|
| 304 |
+
|
| 305 |
+
<table><tr><td>Ensemble size</td><td>1</td><td>10</td><td>50</td></tr><tr><td>w/o whitened</td><td>0.007</td><td>0.010</td><td>0.017</td></tr><tr><td>w/o norm</td><td>0.024</td><td>0.060</td><td>0.097</td></tr><tr><td>w/o whitened+norm</td><td>0.005</td><td>0.008</td><td>0.015</td></tr><tr><td>WFD</td><td>0.028</td><td>0.065</td><td>0.098</td></tr></table>
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
Figure 8: Ablation study for the choice of k. The figure shows the performance of Wayformer under different k.
|
| 309 |
+
|
| 310 |
+
Main Results. Table 1 represents the performance of TAROT compared with baselines. Among them, LESS requires the subtask labels of target samples, whereas TAROT operates without this requirement. Our key findings include:
|
| 311 |
+
|
| 312 |
+
• TAROT is effective, generalizable, and transferable. TAROT consistently outperforms all baseline methods and models trained on the full dataset without relying on subtask labels. Besides, data samples selected by LLAMA-3.1- 8B enhances performance for QWEN-2.5-7b, indicating strong transferability across different model architectures.
|
| 313 |
+
• Effectiveness of OTM. Remarkably, TAROT-OTM selects less than $0 . 5 \%$ of the data while achieving performance that is comparable to or even surpasses that of methods selecting $5 \%$ of the data. The results suggest that only a small fraction of the candidate dataset is pertinent to the target tasks, and TAROT-OTM successfully identifies these critical samples, thereby significantly reducing training costs without compromising performance.
|
| 314 |
+
|
| 315 |
+
# 4.5. Computational Complexity
|
| 316 |
+
|
| 317 |
+
The computational complexity of TAROT mainly arises from two aspects: (1) gradient feature computation and (2) data selection. The former shares the same complexity as previous methods that use projected gradients (Park et al., 2023; Liu et al., 2024; Engstrom et al., 2024). The latter introduces additional computational overhead due to computation of OT distance. We compare the wall-clock runtime of TAROT with baselines and provide a detailed asymptotic complexity analysis in the Appendix G.
|
| 318 |
+
|
| 319 |
+
# 4.6. Ablation Study
|
| 320 |
+
|
| 321 |
+
Whitened Feature Distance. We conduct an ablation study to analyze the impact of key components on WFD. The
|
| 322 |
+
|
| 323 |
+
results are presented in Table 2. Specifically, w/o whitened indicates that we skip the whitening step and instead use the original projected gradients to compute the distance. w/o norm means that we compute the L2 distance of the gradient vectors without normalization. The results demonstrate that removing these proposed components leads to a performance drop, highlighting the effectiveness of our influence estimation design.
|
| 324 |
+
|
| 325 |
+
K-Fold Selection in OTM. As introduced in Section 3.3, TAROT employs $\mathbf { k }$ -fold cross-validation for OTM, where a larger $k$ results in less alignment with the target distribution. We investigate how the choice of $k$ affects data selection in the motion prediction setting (Section 4.3). Specifically, we perform experiments with OTM selection using $k$ values ranging from 1 to 20, evaluating the model’s performance on both the test set and the target set. The results, shown in Figure 8, indicate that as $k$ increases, the model’s performance on the test set improves, reaching its peak at $k = 1 0$ . Meanwhile, performance on the target set steadily declines, suggesting that the selected data becomes less aligned with the target distribution as $k$ increases.
|
| 326 |
+
|
| 327 |
+
# 5. Related Work
|
| 328 |
+
|
| 329 |
+
We review the progress on data selection in this section. More related work is deferred to App. A. Coreset selection aims to identify a dataset subset for optimal in-domain performance (Xia et al., 2022; Mirzasoleiman et al., 2020; Borsos et al., 2020; Killamsetty et al., 2021; Guo et al., 2022; Xiao et al., 2024), assuming validation and candidate data share the same distribution. Our work shifts focus to targeted selection, optimizing performance on a distinct target domain. Prior methods often rely on influence-estimation heuristics: Engstrom et al. (2024) leveraged linear datamodel scores (Park et al., 2023) to select data for LLMs pretraining; Xia et al. leveraged influence estimation to select data for LLMs fine tuning. Hu et al. (2024) highlighted these methods’ limitations and proposed iterative heuristics. A concurrent work (Liu et al.) also frames data selection as an optimal transport problem. However it still follows the same gradient distance estimation in (Xia et al.) and uses a continuous OT-based formulation, making it less efficient and effective. Our approach introduces a novel distance estimation method and a greedy subset selection pipeline to address these challenges.
|
| 330 |
+
|
| 331 |
+
# 6. Conclusion
|
| 332 |
+
|
| 333 |
+
This paper presents TAROT, a general targeted data selection framework leveraging OT theory. By introducing WFD, TAROT mitigates biases from dominant features and enhances influence estimation. Through OT-based selection, it aligns subsets closely with target distributions, consistently outperforming traditional methods in tasks such as semantic segmentation, motion prediction, and instruction tuning. These results demonstrate TAROT’s effectiveness
|
| 334 |
+
|
| 335 |
+
in improving domain-specific performance with smaller, more relevant datasets. Limitations: In cases with small or highly specific target datasets, TAROT may overfit by overly tailoring the selected data, potentially compromising generalization. A promising future direction is incorporating distribution diversification into the selection objective.
|
| 336 |
+
|
| 337 |
+
# Acknowledgments
|
| 338 |
+
|
| 339 |
+
The project was partially funded by Honda R&D Co., Ltd, Valeo Paris, and the Swiss National Science Foundation under the Grant P500PT 222293.
|
| 340 |
+
|
| 341 |
+
# Impact Statement
|
| 342 |
+
|
| 343 |
+
This paper presents TAROT, a targeted data selection framework using Optimal Transport to improve model efficiency and performance across diverse tasks. By addressing biases in influence-based heuristics, TAROT enables better dataset alignment with target distributions, reducing computational costs and potential environmental impact. This approach can enhance data efficiency, benefiting scenarios where data privacy or accessibility is a concern. However, like any selection strategy, it may introduce biases if not carefully managed. Future research should explore its implications on fairness and generalization, but overall, TAROT represents a step toward more efficient and responsible data selection in machine learning.
|
| 344 |
+
|
| 345 |
+
# References
|
| 346 |
+
|
| 347 |
+
Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F. L., Almeida, D., Altenschmidt, J., Altman, S., Anadkat, S., et al. Gpt-4 technical report. arXiv preprint arXiv:2303.08774, 2023.
|
| 348 |
+
Albalak, A., Elazar, Y., Xie, S. M., Longpre, S., Lambert, N., Wang, X., Muennighoff, N., Hou, B., Pan, L., Jeong, H., et al. A survey on data selection for language models. arXiv preprint arXiv:2402.16827, 2024.
|
| 349 |
+
Alvarez-Melis, D. and Fusi, N. Geometric dataset distances via optimal transport. Advances in Neural Information Processing Systems, 33:21428–21439, 2020.
|
| 350 |
+
Borsos, Z., Mutny, M., and Krause, A. Coresets via bilevel optimization for continual learning and streaming. Advances in neural information processing systems, 33: 14879–14890, 2020.
|
| 351 |
+
Caesar, H., Bankiti, V., Lang, A. H., Vora, S., Liong, V. E., Xu, Q., Krishnan, A., Pan, Y., Baldan, G., and Beijbom, O. nuscenes: A multimodal dataset for autonomous driving. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11621–11631, 2020.
|
| 352 |
+
|
| 353 |
+
Chen, L.-C. Rethinking atrous convolution for semantic image segmentation. arXiv preprint arXiv:1706.05587, 2017.
|
| 354 |
+
Choe, S. K., Ahn, H., Bae, J., Zhao, K., Kang, M., Chung, Y., Pratapa, A., Neiswanger, W., Strubell, E., Mitamura, T., et al. What is your data worth to gpt? llm-scale data valuation with influence functions. arXiv preprint arXiv:2405.13954, 2024.
|
| 355 |
+
Conover, M., Hayes, M., Mathur, A., Xie, J., Wan, J., Shah, S., Ghodsi, A., Wendell, P., Zaharia, M., and Xin, R. Free dolly: Introducing the world’s first truly open instructiontuned llm. Company Blog of Databricks, 2023.
|
| 356 |
+
Cordts, M., Omran, M., Ramos, S., Rehfeld, T., Enzweiler, M., Benenson, R., Franke, U., Roth, S., and Schiele, B. The cityscapes dataset for semantic urban scene understanding. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 3213–3223, 2016.
|
| 357 |
+
Cuturi, M. Sinkhorn distances: Lightspeed computation of optimal transport. Advances in neural information processing systems, 26, 2013.
|
| 358 |
+
Deng, J., Li, T.-W., Zhang, S., and Ma, J. Efficient ensembles improve training data attribution. arXiv preprint arXiv:2405.17293, 2024.
|
| 359 |
+
Dubey, A., Jauhri, A., Pandey, A., Kadian, A., Al-Dahle, A., Letman, A., Mathur, A., Schelten, A., Yang, A., Fan, A., et al. The llama 3 herd of models. arXiv preprint arXiv:2407.21783, 2024.
|
| 360 |
+
Engstrom, L., Feldmann, A., and Madry, A. Dsdm: Modelaware dataset selection with datamodels. arXiv preprint arXiv:2401.12926, 2024.
|
| 361 |
+
Ermolov, A., Siarohin, A., Sangineto, E., and Sebe, N. Whitening for self-supervised representation learning. In International conference on machine learning, pp. 3015– 3024. PMLR, 2021.
|
| 362 |
+
Ettinger, S., Cheng, S., Caine, B., Liu, C., Zhao, H., Pradhan, S., Chai, Y., Sapp, B., Qi, C. R., Zhou, Y., Yang, Z., Chouard, A., Sun, P., Ngiam, J., Vasudevan, V., Mc-Cauley, A., Shlens, J., and Anguelov, D. Large scale interactive motion forecasting for autonomous driving: The waymo open motion dataset. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 9710–9719, October 2021.
|
| 363 |
+
Feng, L., Bahari, M., Amor, K. M. B., Zablocki, E., Cord, ´ M., and Alahi, A. Unitraj: A unified framework for scalable vehicle trajectory prediction. arXiv preprint arXiv:2403.15098, 2024.
|
| 364 |
+
|
| 365 |
+
Girgis, R., Golemo, F., Codevilla, F., Weiss, M., D’Souza, J. A., Kahou, S. E., Heide, F., and Pal, C. Latent variable sequential set transformers for joint multi-agent motion prediction. arXiv preprint arXiv:2104.00563, 2021.
|
| 366 |
+
Guo, C., Zhao, B., and Bai, Y. Deepcore: A comprehensive library for coreset selection in deep learning. In International Conference on Database and Expert Systems Applications, pp. 181–195. Springer, 2022.
|
| 367 |
+
H. Caesar, J. Kabzan, K. T. e. a. Nuplan: A closed-loop ml-based planning benchmark for autonomous vehicles. In CVPR ADP3 workshop, 2021.
|
| 368 |
+
He, K., Zhang, X., Ren, S., and Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 770–778, 2016.
|
| 369 |
+
Hendrycks, D., Burns, C., Basart, S., Critch, A., Li, J., Song, D., and Steinhardt, J. Aligning ai with shared human values. Proceedings of the International Conference on Learning Representations (ICLR), 2021a.
|
| 370 |
+
Hendrycks, D., Burns, C., Basart, S., Zou, A., Mazeika, M., Song, D., and Steinhardt, J. Measuring massive multitask language understanding. Proceedings of the International Conference on Learning Representations (ICLR), 2021b.
|
| 371 |
+
Hu, Y., Hu, P., Zhao, H., and Ma, J. W. Most influential subset selection: Challenges, promises, and beyond. arXiv preprint arXiv:2409.18153, 2024.
|
| 372 |
+
Ilyas, A., Park, S. M., Engstrom, L., Leclerc, G., and Madry, A. Datamodels: Predicting predictions from training data. In Proceedings of the 39th International Conference on Machine Learning, 2022.
|
| 373 |
+
Just, H. A., Kang, F., Wang, T., Zeng, Y., Ko, M., Jin, M., and Jia, R. Lava: Data valuation without pre-specified learning algorithms. In The Eleventh International Conference on Learning Representations. OpenReview, 2023.
|
| 374 |
+
Kang, F., Just, H. A., Sahu, A. K., and Jia, R. Performance scaling via optimal transport: Enabling data selection from partially revealed sources. Advances in Neural Information Processing Systems, 36, 2024.
|
| 375 |
+
Kantorovitch, L. On the translocation of masses. Management science, 5(1):1–4, 1958.
|
| 376 |
+
Killamsetty, K., Sivasubramanian, D., Ramakrishnan, G., and Iyer, R. Glister: Generalization based data subset selection for efficient and robust learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 35, pp. 8110–8118, 2021.
|
| 377 |
+
|
| 378 |
+
Kopf, A., Kilcher, Y., von R ¨ utte, D., Anagnostidis, S., ¨ Tam, Z. R., Stevens, K., Barhoum, A., Nguyen, D., Stanley, O., Nagyfi, R., et al. Openassistant conversationsdemocratizing large language model alignment. Advances in Neural Information Processing Systems, 36, 2024.
|
| 379 |
+
Liu, Z., Karbasi, A., and Rekatsinas, T. Tsds: Data selection for task-specific model finetuning. In The Thirty-eighth Annual Conference on Neural Information Processing Systems.
|
| 380 |
+
Liu, Z., Zhou, K., Zhao, W. X., Gao, D., Li, Y., and Wen, J.-R. Less is more: Data value estimation for visual instruction tuning. arXiv preprint arXiv:2403.09559, 2024.
|
| 381 |
+
Longpre, S., Hou, L., Vu, T., Webson, A., Chung, H. W., Tay, Y., Zhou, D., Le, Q. V., Zoph, B., Wei, J., et al. The flan collection: Designing data and methods for effective instruction tuning. In International Conference on Machine Learning, pp. 22631–22648. PMLR, 2023.
|
| 382 |
+
Mirzasoleiman, B., Bilmes, J., and Leskovec, J. Coresets for data-efficient training of machine learning models. In International Conference on Machine Learning, pp. 6950–6960. PMLR, 2020.
|
| 383 |
+
Nayakanti, N., Al-Rfou, R., Zhou, A., Goel, K., Refaat, K. S., and Sapp, B. Wayformer: Motion forecasting via simple & efficient attention networks. In 2023 IEEE International Conference on Robotics and Automation (ICRA), pp. 2980–2987. IEEE, 2023.
|
| 384 |
+
Oquab, M., Darcet, T., Moutakanni, T., Vo, H., Szafraniec, M., Khalidov, V., Fernandez, P., Haziza, D., Massa, F., El-Nouby, A., et al. Dinov2: Learning robust visual features without supervision. arXiv preprint arXiv:2304.07193, 2023.
|
| 385 |
+
Park, S. M., Georgiev, K., Ilyas, A., Leclerc, G., and Madry, A. Trak: Attributing model behavior at scale. In International Conference on Machine Learning, pp. 27074– 27113. PMLR, 2023.
|
| 386 |
+
Pruthi, G., Liu, F., Kale, S., and Sundararajan, M. Estimating training data influence by tracing gradient descent. Advances in Neural Information Processing Systems, 33: 19920–19930, 2020.
|
| 387 |
+
Richter, S. R., Vineet, V., Roth, S., and Koltun, V. Playing for data: Ground truth from computer games. In Computer Vision–ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11-14, 2016, Proceedings, Part II 14, pp. 102–118. Springer, 2016.
|
| 388 |
+
Sun, Z., Wang, Z., Halilaj, L., and Luettin, J. Semanticformer: Holistic and semantic traffic scene representation for trajectory prediction using knowledge graphs. arXiv preprint arXiv:2404.19379, 2024.
|
| 389 |
+
|
| 390 |
+
Suzgun, M., Scales, N., Scharli, N., Gehrmann, S., Tay, Y.,¨ Chung, H. W., Chowdhery, A., Le, Q., Chi, E., Zhou, D., et al. Challenging big-bench tasks and whether chain-ofthought can solve them. In Findings of the Association for Computational Linguistics: ACL 2023, pp. 13003–13051, 2023.
|
| 391 |
+
Team, Q. Qwen2.5: A party of foundation models, September 2024. URL https://qwenlm.github.io/ blog/qwen2.5/.
|
| 392 |
+
Wei, J., Wang, X., Schuurmans, D., Bosma, M., Xia, F., Chi, E., Le, Q. V., Zhou, D., et al. Chain-of-thought prompting elicits reasoning in large language models. Advances in neural information processing systems, 35:24824–24837, 2022.
|
| 393 |
+
Wilson, B., Qi, W., Agarwal, T., Lambert, J., Singh, J., Khandelwal, S., Pan, B., Kumar, R., Hartnett, A., Pontes, J. K., Ramanan, D., Carr, P., and Hays, J. Argoverse 2: Next generation datasets for self-driving perception and forecasting. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), 2021. URL https://openreview. net/forum?id=vKQGe36av4k.
|
| 394 |
+
Xia, M., Malladi, S., Gururangan, S., Arora, S., and Chen, D. Less: Selecting influential data for targeted instruction tuning. In Forty-first International Conference on Machine Learning.
|
| 395 |
+
Xia, X., Liu, J., Yu, J., Shen, X., Han, B., and Liu, T. Moderate coreset: A universal method of data selection for real-world data-efficient deep learning. In The Eleventh International Conference on Learning Representations, 2022.
|
| 396 |
+
Xiao, W., Chen, Y., Shan, Q., Wang, Y., and Su, J. Feature distribution matching by optimal transport for effective and robust coreset selection. Proceedings of the AAAI Conference on Artificial Intelligence, 38 (8):9196–9204, Mar. 2024. doi: 10.1609/aaai.v38i8. 28771. URL https://ojs.aaai.org/index. php/AAAI/article/view/28771.
|
| 397 |
+
Yao, Z., Li, X., Lang, B., and Chuah, M. C. Goal-lbp: Goal-based local behavior guided trajectory prediction for autonomous driving. IEEE Transactions on Intelligent Transportation Systems, 2023.
|
| 398 |
+
Zhang, H., Yan, B., Cao, L., Madden, S., and Rundensteiner, E. Metastore: Analyzing deep learning meta-data at scale. Proceedings of the VLDB Endowment, 17(6):1446–1459, 2024.
|
| 399 |
+
Zou, X., Yang, J., Zhang, H., Li, F., Li, L., Wang, J., Wang, L., Gao, J., and Lee, Y. J. Segment everything everywhere
|
| 400 |
+
|
| 401 |
+
all at once. Advances in Neural Information Processing Systems, 36, 2024.
|
| 402 |
+
|
| 403 |
+
# A. More Related Work
|
| 404 |
+
|
| 405 |
+
Data Influence Estimation. Pruthi et al. (2020) proposed a method to estimate data influence by tracing the gradient descent process. Another approach utilizes datamodels: Ilyas et al. (2022) showed that simple linear datamodels can predict model outputs effectively. Building on this, Park et al. (2023) introduced a scalable technique for estimating datamodel scores. Subsequent works have optimized these methods, focusing on checkpoint ensembles (Deng et al., 2024), efficient gradient storage (Zhang et al., 2024), and scalable gradient projection (Choe et al., 2024). Our method extends Pruthi et al. (2020) by enhancing estimation robustness through feature covariance whitening.
|
| 406 |
+
|
| 407 |
+
Optimal Transport for Data Selection. Optimal transport has been used for dataset similarity estimation (Alvarez-Melis & Fusi, 2020) and sensitivity analysis in data valuation (Just et al., 2023). Kang et al. (2024) applied it to optimize data selection ratios across multiple sources. We integrate influence estimation with optimal transport, enabling effective subset selection to boost target domain performance.
|
| 408 |
+
|
| 409 |
+
# B. More Implementation Details
|
| 410 |
+
|
| 411 |
+
# B.1. Influence Estimation
|
| 412 |
+
|
| 413 |
+
ZCA Whitening. As discussed in Section 4.1, we use ZCA whitening to achieve higher LDS scores due to its ability to preserve the data structure. However, our empirical analysis revealed that ZCA whitening has minimal impact on data selection performance. Therefore, for the data selection experiments, we opted for the more computationally efficient Cholesky whitening.
|
| 414 |
+
|
| 415 |
+
To apply ZCA whitening, we first compute the covariance matrix:
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\Sigma = \frac {1}{N} \sum_ {i = 1} ^ {N} \tilde {\phi} (z) _ {i} \left(\tilde {\phi} (z) _ {i}\right) ^ {\top}, \tag {15}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
where $\tilde { \phi } ( z ) _ { i }$ represents the centered input features. Next, we perform eigenvalue decomposition:
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\Sigma = U \bar {\Lambda} U ^ {\top}, \tag {16}
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
where $U$ is the matrix of eigenvectors, and $\Lambda$ is the diagonal matrix of eigenvalues. The ZCA whitening transformation is then defined as:
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\phi (z) ^ {\mathrm {Z C A}} = U \Lambda^ {- \frac {1}{2}} U ^ {\top} \tilde {\phi} (z), \tag {17}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
which ensures that the transformed features are uncorrelated and have unit variance.
|
| 434 |
+
|
| 435 |
+
The key difference between ZCA whitening and Choleskybased whitening lies in the structure of the transformation matrix. In Cholesky whitening, the lower triangular matrix $L$ introduces decorrelation sequentially, while ZCA whitening uses a symmetric transformation to minimize distortion
|
| 436 |
+
|
| 437 |
+
Table 3: Training Hyperparameters for Semantic Segmentation
|
| 438 |
+
|
| 439 |
+
<table><tr><td>Hyperparameter</td><td>Value</td></tr><tr><td>Batch Size</td><td>16</td></tr><tr><td>Learning Rate</td><td>1 × 10-4</td></tr><tr><td>Optimizer</td><td>SGD</td></tr><tr><td>Momentum</td><td>0.9</td></tr><tr><td>Weight Decay</td><td>1 × 10-4</td></tr><tr><td>Learning Rate Scheduler</td><td>WarmupPolyLR</td></tr><tr><td>Warmup Factor</td><td>1/3</td></tr><tr><td>Warmup Method</td><td>Linear</td></tr></table>
|
| 440 |
+
|
| 441 |
+
Table 4: Experiment Settings for Motion Prediction
|
| 442 |
+
|
| 443 |
+
<table><tr><td colspan="2">Data Configurations</td></tr><tr><td>History Trajectory Time Length</td><td>2.1 seconds</td></tr><tr><td>Future Trajectory Time Length</td><td>6 seconds</td></tr><tr><td>Object Type</td><td>Vehicle</td></tr><tr><td>Line Type</td><td>Center Lane</td></tr><tr><td colspan="2">Model Configurations</td></tr><tr><td>Autobots</td><td></td></tr><tr><td>Batch Size</td><td>256</td></tr><tr><td>Learning Rate</td><td>0.00075</td></tr><tr><td>Optimizer</td><td>Adam</td></tr><tr><td>Gradient Clipping</td><td>5</td></tr><tr><td>Wayformer</td><td></td></tr><tr><td>Batch Size</td><td>128</td></tr><tr><td>Learning Rate</td><td>1 × 10-4</td></tr><tr><td>Optimizer</td><td>AdamW</td></tr><tr><td>Gradient Clipping</td><td>5</td></tr><tr><td>Learning Rate Schedule</td><td>[10, 20, 30, 40, 50]</td></tr></table>
|
| 444 |
+
|
| 445 |
+
of the original data structure. This preservation of the data’s original geometric structure may result in a better LDS score. However, this structural similarity has a limited impact on data selection tasks, where the primary goal is to identify representative or diverse samples. Since both whitening methods achieve decorrelation and normalization, the relative distances and informativeness of the samples, which are key factors in data selection, remain largely unaffected by the choice of whitening method.
|
| 446 |
+
|
| 447 |
+
Linear Data Modeling Score (LDS). As mentioned in Sec. 4.1, we employ LDS as evaluation metric for influence estimation. LDS is computed by the Spearman rank correlation between the model outputs of models trained on randomly selected subsets and the average of attribution scores as predictions of those model outputs. For Cifar-10, we directly reuse the provided outputs of models trained on different subsets in the Github repository of TRAK (Park et al., 2023), and utilize these outputs to calculate LDS. For
|
| 448 |
+
|
| 449 |
+
Table 5: Training Hyperparameters for Instruction Tuning
|
| 450 |
+
|
| 451 |
+
<table><tr><td>Hyperparameter</td><td>Value</td></tr><tr><td>Batch Size</td><td>128</td></tr><tr><td>Learning Rate</td><td>2 × 10-5</td></tr><tr><td>Optimizer</td><td>Adam</td></tr><tr><td>LoRA rank</td><td>128</td></tr><tr><td>LoRA α</td><td>512</td></tr><tr><td>dropout</td><td>0.1</td></tr><tr><td>Warmup Epoch</td><td>4</td></tr></table>
|
| 452 |
+
|
| 453 |
+
nuScences, we randomly select 100 subsets of the candidate datasets. Each subset is sampled to be $50 \%$ of the size of the candidate dataset. Then we independently train 100 models on these subsets and utilize their model outputs to calculate LDS.
|
| 454 |
+
|
| 455 |
+
# Algorithm 1 Fixed-Size Selection
|
| 456 |
+
|
| 457 |
+
Require: • Candidate dataset $\mathcal { D } _ { c } = \{ z _ { c } ^ { ( i ) } \} _ { i = 1 } ^ { N }$
|
| 458 |
+
|
| 459 |
+
$\mathcal { D } _ { t } = \{ z _ { t } ^ { ( i ) } \} _ { i = 1 } ^ { M }$
|
| 460 |
+
• Desired subset size $S = N$
|
| 461 |
+
• Distance metric $d _ { \mathcal { Z } }$
|
| 462 |
+
|
| 463 |
+
Ensure: Selected subset $\mathcal { D } _ { s } \subseteq \mathcal { D } _ { c }$ of size $S$
|
| 464 |
+
|
| 465 |
+
1: Initialize $\mathcal { D } _ { s } \gets \emptyset$
|
| 466 |
+
2: Initialize iteration counter $k \gets 1$
|
| 467 |
+
3: while $| \mathcal { D } _ { s } | < S$ do
|
| 468 |
+
4: Identify the $k$ -th nearest candidates for each $z _ { t } \in \mathcal { D } _ { t }$ based on $d _ { \mathcal { Z } }$
|
| 469 |
+
5: Let $\mathcal { D } _ { k }$ be the set of these candidates
|
| 470 |
+
6: if $\left| \mathcal { D } _ { s } \right| + \left| \mathcal { D } _ { k } \right| \leq S$ then
|
| 471 |
+
7: $\mathcal { D } _ { s } \gets \mathcal { D } _ { s } \cup \mathcal { D } _ { k }$
|
| 472 |
+
8: else
|
| 473 |
+
9: Compute potential $\phi _ { i }$ for each $z _ { i } \in \mathcal { D } _ { k }$ using:
|
| 474 |
+
|
| 475 |
+
$$
|
| 476 |
+
\phi_ {i} = \min _ {\pi \in \Pi \left(\mathcal {D} _ {s} \cup \{z _ {i} \}, \mathcal {D} _ {t}\right)} \int_ {\mathcal {D} _ {s} \cup \{z _ {i} \} \times \mathcal {D} _ {t}} d _ {\mathcal {Z}} \left(z, z _ {t}\right) \mathrm {d} \pi \left(z, z _ {t}\right)
|
| 477 |
+
$$
|
| 478 |
+
|
| 479 |
+
10: Rank candidates in $\mathcal { D } _ { k }$ by $\phi _ { i }$ in ascending order
|
| 480 |
+
11: Add $z _ { i } \in \mathcal { D } _ { k }$ to $\mathcal { D } _ { s }$ if it is among the top $S - \left. \mathcal { D } _ { s } \right.$ candidates in $\mathcal { D } _ { k }$
|
| 481 |
+
12: Break the loop
|
| 482 |
+
13: end if
|
| 483 |
+
14: $k \gets k + 1$
|
| 484 |
+
15: end while
|
| 485 |
+
16: Compute potential $\phi _ { i }$ for each $z _ { i } ~ \in ~ \mathcal { D } _ { s }$ to serve as weight $w _ { i }$ and scale to integers.
|
| 486 |
+
17: return $\mathcal { D } _ { s }$ , $\{ w _ { i } \}$
|
| 487 |
+
|
| 488 |
+
# B.2. Semantic Segmentation
|
| 489 |
+
|
| 490 |
+
Table 3 shows detailed hyperparameters for the semantic segmentation experiments.
|
| 491 |
+
|
| 492 |
+
# Algorithm 2 OT-Distance Minimization Selection (OTM)
|
| 493 |
+
|
| 494 |
+
Require: • Candidate dataset $\mathcal { D } _ { c } = \{ z _ { c } ^ { ( i ) } \} _ { i = 1 } ^ { N }$
|
| 495 |
+
|
| 496 |
+
• Target dataset $\mathcal { D } _ { t } = \{ z _ { t } ^ { ( i ) } \} _ { i = 1 } ^ { M }$
|
| 497 |
+
• Number of folds K
|
| 498 |
+
• Distance metric $d _ { \mathrm { O T } }$
|
| 499 |
+
|
| 500 |
+
Ensure: Selected subset $\mathcal { D } _ { s } \subseteq \mathcal { D } _ { c }$
|
| 501 |
+
|
| 502 |
+
1: Initialize $\mathcal { D } _ { s } \gets \emptyset$
|
| 503 |
+
2: Split $\mathcal { D } _ { t }$ into $K$ equal subsets: $\mathcal { D } _ { t } ^ { ( 1 ) } , \mathcal { D } _ { t } ^ { ( 2 ) } , \ldots , \mathcal { D } _ { t } ^ { ( K ) }$
|
| 504 |
+
3: for $f o l d = 1$ to $K$ do
|
| 505 |
+
|
| 506 |
+
4: Let D(f old) $\mathcal { D } _ { t } ^ { ( f o l d ) }$ be the current fold
|
| 507 |
+
|
| 508 |
+
5: Let $\mathcal { D } _ { t } ^ { ( \mathrm { t a r } ) } \mathcal { D } _ { t } \setminus \mathcal { D } _ { t } ^ { ( f o l d ) }$
|
| 509 |
+
6: Initialize temporary subset $\mathcal { D } _ { s } ^ { ( f o l d ) } \emptyset$
|
| 510 |
+
7: Initialize iteration counter $k \gets 1$
|
| 511 |
+
8: Initialize Distance $d _ { p r e } \gets$ ‘inf’
|
| 512 |
+
9: while True do
|
| 513 |
+
|
| 514 |
+
10: Let $\mathcal { D } _ { k }$ be the set of $k$ -th nearest candidates for each $\boldsymbol { z } _ { t } \in \mathcal { D } _ { t } ^ { ( \mathrm { t a r } ) }$ based on $d _ { \mathcal { Z } }$
|
| 515 |
+
11: if $d _ { \mathrm { O T } } ( \mathcal { D } _ { s } ^ { ( f o l d ) } \cup \mathcal { D } _ { k } , \mathcal { D } _ { t } ^ { ( f o l d ) } ) > d _ { p r e }$
|
| 516 |
+
12: Break the loop
|
| 517 |
+
13: end if
|
| 518 |
+
14:
|
| 519 |
+
15:
|
| 520 |
+
16:
|
| 521 |
+
17: end while
|
| 522 |
+
18: Ds ← Ds ∪ D(fold)s $\mathcal { D } _ { s } \gets \mathcal { D } _ { s } \cup \mathcal { D } _ { s } ^ { ( f o l d ) }$
|
| 523 |
+
19: end for
|
| 524 |
+
20: Compute potential $\phi _ { i }$ for each $z _ { i } ~ \in ~ \mathcal { D } _ { s }$ to serve as weight $w _ { i }$ and scale to integers.
|
| 525 |
+
21: return $\mathcal { D } _ { s }$ , $\{ w _ { i } \}$
|
| 526 |
+
|
| 527 |
+
# B.3. Motion Prediction
|
| 528 |
+
|
| 529 |
+
We use the UniTraj (Feng et al., 2024) framework for motion prediction experiments. Detailed experiment settings are provided in Table 4.
|
| 530 |
+
|
| 531 |
+
# B.4. Instruction Tuning
|
| 532 |
+
|
| 533 |
+
We follow the settings and hyperparameters in LESS (Xia et al.). Details are provided in Table 5.
|
| 534 |
+
|
| 535 |
+
# C. Details for Algorithms
|
| 536 |
+
|
| 537 |
+
We present the detailed data selection algorithm described in Section 3.3 in Algorithms 1 and 2
|
| 538 |
+
|
| 539 |
+
# D. NuScenes Leaderboard Performance
|
| 540 |
+
|
| 541 |
+
In the motion prediction task, TAROT helps Wayformer achieve the first place on the nuScenes leaderboard (Table 7). surpassing MTR-UniTraj (Feng et al., 2024), which relies on large-scale datasets $2 0 0 0 k$ samples). These results
|
| 542 |
+
|
| 543 |
+

|
| 544 |
+
Figure 9: More Qualitative Results of WFD in Motion Prediction. Visualization of motion prediction tasks using the nuScenes and Waymo datasets. The dark-to-light blue lines indicate the past (input) and future (ground truth) trajectories for the target vehicle, while green lines represent surrounding vehicle trajectories.
|
| 545 |
+
|
| 546 |
+

|
| 547 |
+
Figure 10: More Qualitative Results of WFD in Semantic Segmentation. Semantic segmentation tasks with examples from the Cityscapes and GTA5 datasets. For each target example, the top image shows the RGB scene, and the bottom image depicts the corresponding ground truth semantic segmentation mask.
|
| 548 |
+
|
| 549 |
+
Table 6: Performance comparison (↑ means higher is better). All methods use $5 \%$ of the full training data. TAROT-OTM shows relative improvement over TAROT-Fixed in parentheses.
|
| 550 |
+
|
| 551 |
+
<table><tr><td>Dataset</td><td>LLaMA-3.1-8B MMLU ↑</td><td>LLaMA-3.1-8B BBH ↑</td><td>Qwen-2.5-7B MMLU ↑</td><td>Qwen-2.5-7B BBH ↑</td></tr><tr><td>5% LESS</td><td>65.7</td><td>62.6</td><td>74.3</td><td>66.3</td></tr><tr><td>5% TSDS</td><td>65.2</td><td>63.1</td><td>73.9</td><td>66.2</td></tr><tr><td>5% TAROT</td><td>66.0</td><td>65.0</td><td>74.1</td><td>66.9</td></tr><tr><td>TAROT-OTM</td><td>65.7 (0.13%)</td><td>63.6 (0.21%)</td><td>74.3 (0.09%)</td><td>68.9 (0.13%)</td></tr></table>
|
| 552 |
+
|
| 553 |
+
demonstrate that targeted data selection offers a promising alternative to data scaling for breaking performance boundaries.
|
| 554 |
+
|
| 555 |
+
# E. Discussion and Comparison with TSDS
|
| 556 |
+
|
| 557 |
+
TSDS frames data selection as an optimal transport (OT) problem, incorporating a diversity regularizer via kernel density estimation. It selects samples based on distances in gradient embedding space.
|
| 558 |
+
|
| 559 |
+
In contrast, TAROT uses Whitened Feature Distance (WFD), which removes the confounding effects of gradient covariance and scale. This provides more robust and accurate feature distance estimates, leading to better influence estimation—surpassing the state-of-the-art TRAK
|
| 560 |
+
|
| 561 |
+
Table 7: nuScenes Leaderboard. Evaluated with minADE5 metric: the average of L2 distances between the predicted trajectory and ground truth over the 5 most likely predictions. Wayformer-All denotes Wayformer trained with the full candidate dataset (WOMD, Argoverse 2 and nu-Plan).
|
| 562 |
+
|
| 563 |
+
<table><tr><td>Method</td><td colspan="2">Ranking (↓)minADE5 (↓)</td></tr><tr><td>Wayformer-TAROT</td><td>1</td><td>0.92</td></tr><tr><td>Wayformer-All (Nayakanti et al., 2023)</td><td>2</td><td>0.94</td></tr><tr><td>MTR-UniTraj (Feng et al., 2024)</td><td>3</td><td>0.96</td></tr><tr><td>Goal-LBP (Yao et al., 2023)</td><td>4</td><td>1.02</td></tr><tr><td>SemanticFormer (Sun et al., 2024)</td><td>5</td><td>1.14</td></tr></table>
|
| 564 |
+
|
| 565 |
+
Table 8: The wall clock runtime (measured as single H100 GPU hours) of TAROT compared with LESS and TSDS on instruction tuning task. The gradient feature computation stage is the same for all the methods.
|
| 566 |
+
|
| 567 |
+
<table><tr><td></td><td>Gradient Features Computation</td><td>Data Selection</td></tr><tr><td>LESS</td><td></td><td>46 Seconds</td></tr><tr><td>TAROT-Fixed</td><td>32 Hours</td><td>59 Seconds</td></tr><tr><td>TAROT-OTM</td><td></td><td>118 Seconds</td></tr><tr><td>TSDS</td><td></td><td>10 Hours</td></tr></table>
|
| 568 |
+
|
| 569 |
+
Table 9: Asymptotic complexity analysis.
|
| 570 |
+
|
| 571 |
+
<table><tr><td></td><td>Gradient Features Computation</td><td>Fixed-Size/OTM Selection</td></tr><tr><td>Complexity</td><td>O(|D|·N)</td><td>O(|D|·Dtar|·d)</td></tr></table>
|
| 572 |
+
|
| 573 |
+
method. Besides, while TSDS uses a continuous OT-based formulation and supports subset size control via sampling, TAROT differs in its greedy, deterministic subset selection that explicitly minimizes the empirical OT distance at each iteration. This enables stronger control over the selected subset and much faster speed for data selection. Indeed, we empirically found that TSDS costs significantly more time than TAROT. The wall-clock time analysis is shown in Table 8. Finally, TAROT introduces an early stopping criterion for OT-based selection via tracking OT distance increase, allowing estimation of optimal selection ratios, which TSDS does not address.
|
| 574 |
+
|
| 575 |
+
We also include experimental comparisons with TSDS, following the same evaluation settings as described in Section 4.4. The results are shown in Table 6.
|
| 576 |
+
|
| 577 |
+
# F. More Qualitative Results of WFD
|
| 578 |
+
|
| 579 |
+
We provide additional qualitative results of WFD in Figures 9 and 10. One clear observation is that the most supportive samples tend to closely resemble the target sample in both the input and output spaces. In motion prediction, the most negative samples also share similarities with the target sample in the input space (e.g., map and history trajectories); however, their ground truth trajectories often exhibit minor differences. For instance, in the first row of samples, the most negative examples demonstrate behaviors such as turning left or driving in the right-most lanes, whereas the target sample follows a trajectory in the lane adjacent to the right-most lane. These qualitative findings align with the definition of influence estimation: the most positive samples guide the model to make predictions similar to the target sample, while the negative samples encourage divergent predictions.
|
| 580 |
+
|
| 581 |
+
# G. Computational Complexity Analysis
|
| 582 |
+
|
| 583 |
+
Table 9 presents the asymptotic complexity of TAROT. The most computationally expensive step is the computation of gradient features, with its cost scaling linearly with the candidate dataset size $| \mathcal D |$ , the number of checkpoints $N$ , and the gradient dimension $d$ . However, the computational costs incurred during these two stages are one-time expenses that can be amortized across multiple target tasks. The data
|
| 584 |
+
|
| 585 |
+
selection process requires minimal computation.
|
| 586 |
+
|
| 587 |
+
Table 8 demonstrates the wall-clock runtime (in single H100 GPU hours) of TAROT compared to LESS and TSDS for the instruction tuning task. The gradient feature computation time is identical for both methods. For data selection, both TAROT-Fixed and LESS complete in under one minute, while TAROT-OTM incurs an additional runtime of approximately one minute.
|
paper_markdowns/bamboo-04909.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04942.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-04984.md
ADDED
|
@@ -0,0 +1,544 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Towards Graph Foundation Models: Learning Generalities Across Graphs via Task-Trees
|
| 2 |
+
|
| 3 |
+
Zehong Wang 1 Zheyuan Zhang 1 Tianyi Ma 1 Nitesh V Chawla 1 Chuxu Zhang 2 Yanfang Ye 1 *
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Foundation models are pretrained on large-scale corpora to learn generalizable patterns across domains and tasks—such as contours, textures, and edges in images, or tokens and sentences in text. In contrast, discovering such generalities in graph-structured data, especially across heterogeneous graph tasks, remains an open challenge. To address this, we propose a novel approach to cross-task generalization in graphs via task-trees, which serve as unified learning instances aligning node-, edge-, and graph-level tasks. We theoretically analyze the stability, transferability, and generalization properties of tasktrees, showing that pretraining a graph neural network (GNN) on diverse task-trees with a reconstruction objective induces transferable knowledge. This enables efficient adaptation to downstream tasks with minimal fine-tuning. To validate our framework, we introduce Graph Generality Identifier on Task-Trees (GIT), a graph foundation model that demonstrates strong performance on over 30 graphs across five domains via finetuning, in-context learning, and zero-shot generalization. Code and data are available at https: //github.com/Zehong-Wang/GIT.
|
| 8 |
+
|
| 9 |
+
# 1. Introduction
|
| 10 |
+
|
| 11 |
+
Foundation models have emerged as a cornerstone of general-purpose machine learning, enabling cross-task and cross-domain generalization. Representative examples include large language models (LLMs) for text (Achiam et al., 2023; Touvron et al., 2023) and large vision models (LVMs) for images (He et al., 2022; Yuan et al., 2021). Pretrained on massive datasets, these models capture trans-
|
| 12 |
+
|
| 13 |
+
1University of Notre Dame 2University of Connecticut. Correspondence to: Zehong Wang <zwang43@nd.edu>, Yanfang Ye <yye7@nd.edu>.
|
| 14 |
+
|
| 15 |
+
Proceedings of the $4 2 ^ { n d }$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 16 |
+
|
| 17 |
+
ferable patterns—such as contours and textures in images, or tokens and sentences in text—that reflect modality-specific generalities. This broad knowledge base allows for efficient adaptation to downstream tasks via in-context learning (Xie et al., 2022; Chen et al., 2024c) and zero-shot generalization (Wei et al., 2021).
|
| 18 |
+
|
| 19 |
+
Despite the success of foundation models in text and vision, their extension to graph-structured data remains nascent (Liu et al., 2024a), primarily due to the high variability across graph datasets (Mao et al., 2024). Graphs from different domains often encode distinct phenomena—e.g., social networks model human relationships (Freeman, 2004), whereas molecular graphs represent chemical structures (Zeng et al., 2022)—leading to both feature (Wang et al., 2024b) and structural heterogeneity (Qiu et al., 2020; Wang et al., 2024c). Crucially, graph tasks operate on different learning units, such as nodes, edges, or entire graphs, limiting cross-task compatibility within a unified model (Wang et al., 2024b). These challenges hinder the development of graph foundation models capable of capturing transferable generalities. In this work, we specifically address the challenge of task heterogeneity.
|
| 20 |
+
|
| 21 |
+
Is it possible to identify cross-task generalities across graphs? Despite inherent challenges, prior work has explored this question via two main approaches. (1) A graphtheoretic perspective employs the concept of graphons (Ruiz et al., 2020) to model transferable patterns across graphs. If graphs are sampled from the same graphon, they are expected to share structural properties, enabling effective transfer (Ruiz et al., 2020; Cao et al., 2023). However, graphon-based methods rely on strong generative assumptions that rarely hold in real-world settings (Levie et al., 2021), and inferring a shared graphon from diverse graphs remains computationally intractable. (2) A substructurebased perspective seeks recurring motifs—such as triangles, stars, or $k$ -cliques—across domains (Zhao et al., 2023; Mao et al., 2024). These motifs appear in various contexts (e.g., social, citation, and molecular networks), motivating methods that sample subgraphs consisting of substructures and encode them via GNNs (Sun et al., 2023; Liu et al., 2024a). However, message-passing GNNs are fundamentally limited in capturing such substructures (Garg et al., 2020; Esser
|
| 22 |
+
|
| 23 |
+
et al., 2021; Zhang et al., 2024a), restricting their efficacy in learning transferable subgraph representations.
|
| 24 |
+
|
| 25 |
+
Given the limitations of prior approaches, we introduce a novel perspective centered on the learning dynamics of message-passing GNNs (Kipf & Welling, 2017; Hamilton et al., 2017). In such models, predictions are made based on task-relevant nodes: the target node in node-level tasks, edge endpoints in edge-level tasks, and all nodes in graphlevel tasks (Srinivasan & Ribeiro, 2020). Regardless of task type, GNNs aggregate embeddings over these task-relevant nodes, which can be conceptualized as introducing a virtual task node connected to all task-relevant nodes. We define the computation tree rooted at this virtual node as a tasktree (Figure 1). Task-trees offer three key advantages: (1) Learnability: tree-structured information can be effectively captured by message-passing GNNs (Gupta et al., 2024); (2) Uniformity: task-trees apply seamlessly across node-, edge-, and graph-level tasks, mitigating task heterogeneity; (3) Efficiency: encoding task-trees operationally equals to encoding the virtual nodes appended to original graphs. Analogous to images in vision or sentences in language, task-trees serve as unified learning instances and may encode transferable patterns across graph tasks, leading to the assumption:
|
| 26 |
+
|
| 27 |
+
Task-Tree Generality Assumption. The generalities shared across graphs are (at least partially) preserved within the task-trees of the involved graphs.
|
| 28 |
+
|
| 29 |
+
To evaluate this assumption, we conduct a theoretical analysis of task-trees with respect to stability, transferability, and generalization. Our main result shows that pretraining a GNN on diverse task-trees via a reconstruction objective yields transferable representations that adapt well to downstream tasks with moderate fine-tuning. Furthermore, the model can be specialized to specific domains via posttraining (Wei et al., 2021) on domain-specific task-trees.
|
| 30 |
+
|
| 31 |
+
To empirically validate our theoretical insights, we introduce Graph Generality Identifier on Task-Trees (GIT), a graph foundation model pretrained on task-trees extracted from diverse graphs spanning multiple domains and tasks. GIT is evaluated on 32 graphs across 5 domains under three paradigms: fine-tuning, in-context learning (few-shot without fine-tuning), and zero-shot learning. Results show that pretraining on a small set of graphs significantly improves performance on a broad range of downstream tasks, supporting the hypothesis that task-trees capture transferable generalities. Additionally, we propose an instruction tuning method to adapt the general model to specific domains, yielding performance comparable to or exceeding domainspecific expert models. Our key contributions are:
|
| 32 |
+
|
| 33 |
+
• We introduce task-trees as unified learning instances for aligning heterogeneous graph tasks, demonstrating advantages over conventional units such as subgraphs.
|
| 34 |
+
|
| 35 |
+
• We present the first theoretical framework addressing task heterogeneity in graph learning, establishing the effectiveness of task-trees for cross-task generalization.
|
| 36 |
+
• We propose GIT, a graph foundation model pretrained on task-trees to acquire generalizable knowledge and support domain specialization.
|
| 37 |
+
• Extensive experiments across 32 graphs and five domains validate the effectiveness of GIT under finetuning, in-context, and zero-shot settings.
|
| 38 |
+
|
| 39 |
+
# 2. Task-Trees: Rethinking Basic Learning Instances on Graphs
|
| 40 |
+
|
| 41 |
+
# 2.1. Preliminary
|
| 42 |
+
|
| 43 |
+
We begin with a brief introduction to message-passing GNNs and some related concepts. Let $\mathcal { G } = ( \nu , \mathcal { E } )$ represent a graph with node set $\nu$ and edge set $\mathcal { E }$ , where each node $v \in \mathcal V$ is associated with a feature vector $\mathbf { x } \in \mathbb { R } ^ { d }$ . A GNN encoder $\phi$ takes the graph as input and performs message passing to learn node embeddings $\boldsymbol { Z } = \phi ( \boldsymbol { \nu } , \boldsymbol { \mathcal { E } } )$ . Specifically, a GNN encoder can be defined as:
|
| 44 |
+
|
| 45 |
+
$$
|
| 46 |
+
\boldsymbol {z} _ {i} ^ {(l)} = \sigma \left(\boldsymbol {W} _ {1} \boldsymbol {z} _ {i} ^ {(l - 1)} + \boldsymbol {W} _ {2} \rho \left(\sum_ {j \in \mathcal {N} (i)} g \left(\boldsymbol {z} _ {j} ^ {(l - 1)}\right)\right)\right), \tag {1}
|
| 47 |
+
$$
|
| 48 |
+
|
| 49 |
+
where ${ \mathcal { N } } _ { i }$ denotes the 1-hop neighbors of node $i$ , $\boldsymbol { z } ^ { ( l ) }$ represents the node embedding at the l-th GNN layer with ${ z ^ { ( 0 ) } = x }$ , and $W _ { 1 }$ , $W _ { 2 }$ are learnable matrices. The functions σ, ρ, and $g$ are the activation function, aggregation function and update function, respectively. To simplify the analysis, we assume $\rho$ is an averaging operation and $g$ is the identity function. Without loss of generality (WLOG), these functions can be replaced with any permutation-invariant and Lipschitz-continuous functions, respectively, without affecting the analysis in the paper.
|
| 50 |
+
|
| 51 |
+
Definition 2.1 (Task-Relevant Nodes). Graph tasks can be roughly categorized into node-level, edge-level, and graphlevel tasks, where the basic learning instances are nodes, edges, and entire graphs, respectively. For node classification, the task-relevant node $\boldsymbol { v } _ { i } ^ { t }$ is the node to be classified. In edge classification, the task-relevant nodes are the start and end nodes $\{ v _ { i } ^ { t } , v _ { j } ^ { t } \}$ of the target edge $e _ { i j }$ . For graph classification, the task-relevant nodes $\{ v _ { i } ^ { t } \} _ { i = 1 } ^ { | \nu | }$ include all nodes in the target graph $\mathcal { G }$ .
|
| 52 |
+
|
| 53 |
+
For any graph task instance, the prediction relies solely on the embeddings of the corresponding task-relevant nodes. These node embeddings capture the surrounding subtree structures, which are also known as computation trees.
|
| 54 |
+
|
| 55 |
+
Definition 2.2 (Computation Trees (Chuang & Jegelka, 2022)). Given a node $v$ in graph $\mathcal { G }$ , the $L$ -layer computation tree $T _ { v } ^ { L }$ is constructed by recursively expanding the subtrees of its neighboring nodes, starting with $T _ { v } ^ { 1 } = v$ .
|
| 56 |
+
|
| 57 |
+
# 2.2. Task-Tree Construction and Encoding
|
| 58 |
+
|
| 59 |
+
The learning process of message-passing GNNs can be interpreted as recursive aggregation over computation trees, where the representation of a node $v$ produced by an $L$ -layer GNN corresponds to the embedding of its $L$ -hop computation tree $T _ { v } ^ { L }$ . Since predictions in graph tasks rely exclusively on the embeddings of task-relevant nodes, and those embeddings are determined by their respective computation trees, we construct a unified task-tree for each learning instance—whether a node, edge, or entire graph—by merging the relevant computation trees, as illustrated in Figure 1.
|
| 60 |
+
|
| 61 |
+
Definition 2.3 (Task-Trees). For any graph instance— whether a node, edge, or graph—we have a set of taskrelevant nodes $\{ v _ { 1 } ^ { t } , . . . , v _ { n } ^ { t } \}$ and their corresponding $L$ -layer computation trees $\{ T _ { 1 } , . . . , T _ { n } \}$ . These computation trees can be reformulated into a larger task-tree $T ^ { t }$ by introducing a virtual node that connects all task-relevant nodes.
|
| 62 |
+
|
| 63 |
+
To encode a task-tree, we adopt a simple yet effective aggregation strategy. Given a task-tree $T ^ { t }$ composed of a virtual node $v ^ { t }$ and task-relevant nodes $\{ v _ { 1 } ^ { t } , \ldots , v _ { n } ^ { t } \}$ , we compute its representation using a MEAN aggregator over the embeddings of the individual computation trees:
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\boldsymbol {z} ^ {t} = \phi (T ^ {t}) = \frac {1}{n} \sum_ {i = 1} ^ {n} \phi (T _ {i}), \tag {2}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
where $T _ { i }$ denotes the computation tree rooted at $\boldsymbol { v } _ { i } ^ { t }$ , and $\phi$ is a shared GNN encoder. This representation serves as the input for downstream objectives such as reconstruction, classification, or alignment.
|
| 70 |
+
|
| 71 |
+
# 2.3. Comparison to Existing Works
|
| 72 |
+
|
| 73 |
+
Unlike our proposed task-trees, several existing approaches (Qiu et al., 2020; Sun et al., 2023; Huang et al., 2023; Liu et al., 2024a; He & Hooi, 2024) utilize $k$ -hop subgraphs extracted from graphs as the basic learning instances. For instance, in node classification, ego-graphs are constructed around each node, where the label of the central node is assigned to the induced subgraph, effectively reformulating node classification as a subgraph classification task. A similar transformation can be applied to edge-level and graph-level tasks by converting them into subgraph-level learning problems. This method involves: (1) extracting ego-graphs centered around task-relevant nodes and (2) applying GNNs to learn graph-level embeddings for classification. However, this subgraph extraction process incurs substantial computational overhead, increasing both time and memory requirements due to the necessity of storing and processing induced subgraphs. Moreover, information within these subgraphs is not always effectively captured by message-passing GNNs, as GNNs may struggle to learn essential substructures preserved in graphs (Garg et al., 2020; Chen et al., 2020; Zhang et al., 2024a), thereby limiting the efficacy of subgraphs as learning instances.
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
Figure 1: The formulation of task-trees.
|
| 77 |
+
|
| 78 |
+
In contrast, our proposed task-trees offer both greater efficiency and improved learnability (Table 1). Specifically, encoding task-trees for node, link, or graph-level tasks involves: (1) augmenting the original graph by adding virtual task nodes and connecting them to task-relevant nodes and (2) applying GNNs over the augmented graph to encode the embeddings of these virtual nodes for prediction. For example, in node classification, we first introduce virtual nodes connected to each node in the original graph and subsequently apply GNNs to this augmented structure, allowing virtual node embeddings to be learned for classification. Consequently, our method requires only the addition of nodes and edges to the existing graph, making it significantly more efficient than extracting and storing subgraphs. Furthermore, encoding task-trees is equivalent to directly encoding virtual nodes through message passing, ensuring that task-tree information remains fully learnable by standard GNNs. Empirically, task-trees consistently outperform subgraphs in both effectiveness and efficiency (Section 5.6 and Appendix I).
|
| 79 |
+
|
| 80 |
+
The most closely related work to our task-tree framework is GFT (Wang et al., 2024b), which introduces computation trees to align heterogeneous graph tasks. While both approaches share the core intuition of structuring task-specific trees, GFT adopts a model-centric perspective, featuring a learnable vocabulary, a multi-faceted reconstruction objective, and specialized adaptation classifiers. In contrast, our task-tree framework is theory-driven and emphasizes the design of learning instances rather than model complexity. Notably, GFT empirically demonstrates the potential of computation trees for transferability, while our work complements it with a formal theoretical foundation, offering a principled understanding of task alignment in graph learning. Together, these works represent complementary advances toward general-purpose graph foundation models. We present additional discussions on related work in Appendix A.
|
| 81 |
+
|
| 82 |
+
Table 1: Comparison of task alignment methods on graphs.
|
| 83 |
+
|
| 84 |
+
<table><tr><td></td><td colspan="3">Without Task Alignment</td><td colspan="3">Alignment via Subgraph Tasks</td><td colspan="3">Alignment via Task-Tree Tasks (Ours)</td></tr><tr><td></td><td>Node Task</td><td>Edge Task</td><td>Graph Task</td><td>Node Task</td><td>Edge Task</td><td>Graph Task</td><td>Task Node</td><td>Edge Task</td><td>Graph Task</td></tr><tr><td></td><td>Node Property: 2</td><td>Edge Exist: 2</td><td>Graph Property: 2</td><td></td><td>(Sub)graph Property: 2</td><td></td><td>Task-Tree Property: 2</td><td></td><td></td></tr><tr><td>Input</td><td colspan="3">Original graphs</td><td colspan="3">Extracted subgraphs</td><td colspan="3">Original graphs with task nodes</td></tr><tr><td>Pre-processing</td><td colspan="3">N/A</td><td colspan="3">Extract subgraphs for each learning instance (node/link/graph)</td><td colspan="3">Append task nodes to the original graphs, connecting each to task-relevant nodes</td></tr><tr><td>Encoding</td><td colspan="3">Apply GNNs to learn node embeddings</td><td colspan="3">Apply GNNs on induced subgraphs to obtain subgraph embeddings</td><td colspan="3">Apply GNNs directly on original graphs to learn task node embeddings</td></tr><tr><td>Prediction</td><td colspan="3">Use node embeddings to derive node/link/graph representations</td><td colspan="3">Use subgraph embeddings as representations for corresponding instances (node/link/graph)</td><td colspan="3">Use task node (task-tree) embeddings as instance representations (node/link/graph) for predictions</td></tr><tr><td>Learnability</td><td colspan="3">-</td><td colspan="3">GNNs struggle to capture fundamental substructures preserved in (sub)graphs</td><td colspan="3">GNNs inherently learn from tree structures, such as computation trees</td></tr><tr><td>Efficiency</td><td colspan="3">-</td><td colspan="3">Storing and encoding subgraphs introduce additional computational overhead</td><td colspan="3">Encoding task-trees involves encoding augmented virtual nodes in the original graphs with minimal computational cost</td></tr><tr><td>Theoretical Basis</td><td colspan="3">-</td><td colspan="3">Lack of a well-established theoretical foundation</td><td colspan="3">Supported by a rigorous theoretical framework</td></tr></table>
|
| 85 |
+
|
| 86 |
+
# 3. Theoretical Analysis of Task-Trees
|
| 87 |
+
|
| 88 |
+
In this section, we present a theoretical analysis of task-trees, focusing on their stability, transferability, and generalization as foundational learning instances. This analysis provides formal support for the Task-Tree Generality Assumption, which posits that transferable patterns across graph tasks are preserved within task-tree structures.
|
| 89 |
+
|
| 90 |
+
Our goal is not to assert the universal superiority of tasktrees over other learning units such as subgraphs, but rather to establish the theoretical plausibility of using task-trees to capture cross-task generalities. By grounding the construction and use of task-trees in formal guarantees, we lay the foundation for principled pretraining and transfer learning across heterogeneous graph tasks.
|
| 91 |
+
|
| 92 |
+
We begin by examining the stability of GNNs in learning task-tree representations, showing that task-trees with similar subtree structures produce analogous embeddings. To facilitate this analysis, we first define the notation for describing subtree information:
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\boldsymbol {x} _ {i} ^ {(l)} = \frac {1}{\left| \mathcal {N} _ {i} \right|} \sum_ {j \in \mathcal {N} _ {i}} \boldsymbol {x} _ {j} ^ {(l - 1)}, \tag {3}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
where ${ \pmb x } _ { i } ^ { ( 0 ) } = { \pmb x } _ { i }$ denotes the original node feature, and $x ^ { ( l ) }$ denotes the subtree information of nodes in l-th layer, as illustrated in Figure 2. In this figure, for $l = 1$ , only the nodes in the first layer of the tree are considered, and for $l = 2$ , only the nodes in the second layer are considered.
|
| 99 |
+
|
| 100 |
+
Theorem 3.1 (Stability on Task-Trees). Given two $L$ -layer
|
| 101 |
+
|
| 102 |
+
task-trees $T _ { t } ^ { 1 }$ and $T _ { t } ^ { 2 }$ , with task-relevant nodes $\{ v _ { 1 } , . . . , v _ { n } \}$ and $\{ v _ { 1 } , . . . , v _ { m } \}$ , respectively. The distance between tasktrees is defined as $\Delta : = \lVert \phi ( T _ { 1 } ^ { t } ) - \phi ( T _ { 2 } ^ { t } ) \rVert$ with
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
\begin{array}{l} \Delta = \| \phi \left(T _ {1} ^ {t}\right) - \phi \left(T _ {2} ^ {t}\right) \| = \| \frac {1}{n} \sum_ {i = 1} ^ {n} \phi \left(T _ {i}\right) - \frac {1}{m} \sum_ {j = 1} ^ {m} \phi \left(T _ {j}\right) \| \\ \leq \frac {1}{n m} \sum_ {i = 1} ^ {n} \sum_ {j = 1} ^ {m} \left(\mathcal {C} _ {1} \left\| \boldsymbol {x} _ {i} ^ {(0)} - \boldsymbol {x} _ {j} ^ {(0)} \right\| + \dots \right. \tag {4} \\ \left. + \mathcal {C} _ {1} \mathcal {C} _ {2} ^ {L - 1} \left\| \boldsymbol {x} _ {i} ^ {(L - 1)} - \boldsymbol {x} _ {j} ^ {(L - 1)} \right\|\right) \leq 2 \mathcal {B} _ {\boldsymbol {x}} \cdot \mathcal {C} _ {1} \frac {\mathcal {C} _ {2} ^ {L} - 1}{\mathcal {C} _ {2} - 1}, \\ \end{array}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
where $\phi$ is the GNN encoder, $T _ { i }$ is the computation tree corresponding to node $i$ , and $\mathcal { C } _ { 1 } , \mathcal { C } _ { 2 }$ are constants related to the encoder, and $B _ { x }$ represents the bounded norm of $_ { \textbf { \em x } }$ .
|
| 109 |
+
|
| 110 |
+
Theorem 3.1 (proved in Appendix D.1) suggests that two task-trees are likely to have similar representations if their subtrees are similar. This theorem highlights the significance of similarity between pairs of subtrees, while downplaying the impact of the number of subtrees (i.e., the width of the task-trees), despite having more subtrees could potentially increase diversity and thus magnify discrepancy. The theorem also implies that increasing the number of GNN layers may lead to a loose bound, which aligns with previous analyses (Garg et al., 2020; Ju et al., 2023a).
|
| 111 |
+
|
| 112 |
+
Illustration 3.2. This theorem provides theoretical support for using task-trees as basic learning instances in graph tasks. Consider two task-trees: one representing a node (with a single subtree) and the other representing a graph
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
|
| 116 |
+

|
| 117 |
+
Figure 2: subtree information examples.
|
| 118 |
+
|
| 119 |
+
(with multiple subtrees). While the widths of these task-trees differ significantly, if their subtrees share some degree of similarity, they can produce similar representations. Thus, this theorem ensures that task-trees of nodes, edges, or graphs can potentially be similar, making it possible to use a GNN encoder to capture the shared patterns among them.
|
| 120 |
+
|
| 121 |
+
We now examine the transferability of task-trees. Specifically, assuming a model is pretrained on a task-tree reconstruction task1, we aim to quantify how the knowledge acquired during pretraining can be transferred to downstream tasks. The pretraining objective is defined as $\mathcal { L } _ { \mathcal { P } } ( g \circ \phi ) : = \mathbb { E } _ { ( \hat { T } , T ) \sim \mathcal { P } } \Vert g ( \phi ( \bar { T } ) ) \stackrel { \sim } { - } \phi ( T ) \Vert ^ { 2 }$ , where $\mathcal { P }$ represents the task-tree distribution used for pretraining, $\phi ~ \in ~ \Phi$ and $g \in G$ are the GNN encoder and the reconstruction head, respectively. $T$ denotes the task-tree and $\hat { T }$ is the corrupted version of $T$ , generated using arbitrary augmentations. Note that the reconstruction head $g$ is used only during pretraining and is discarded during fine-tuning. Then, we define the risk on downstream task as $\mathscr { R } _ { \mathcal { T } } ( f \circ \phi ) : = \mathbb { E } _ { ( T , y ) \sim \mathcal { T } } \kappa ( f ( \phi ( T ) ) , y )$ , where $f \in { \mathcal { F } }$ is a linear head for predictions, $\tau$ represents the downstream task distribution with task-tree $T$ and label $y$ , and $\kappa$ denotes the loss function.
|
| 122 |
+
|
| 123 |
+
Theorem 3.3 (Transferability on Task-Trees). Given two task-tree encoders $\phi , \phi ^ { \prime } \in \Phi$ , we have
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\begin{array}{l} \min _ {f \in \mathcal {F}} \mathcal {R} _ {\mathcal {T}} (f \circ \phi) - \min _ {f ^ {\prime} \in \mathcal {F}} \mathcal {R} _ {\mathcal {T}} (f ^ {\prime} \circ \phi^ {\prime}) \\ \leq \mathcal {C} _ {\delta} \left(\min _ {g \in G} \mathcal {L} _ {\mathcal {P}} \left(g \circ \phi\right) - \min _ {g ^ {\prime} \in G} \mathcal {L} _ {\mathcal {P}} \left(g ^ {\prime} \circ \phi^ {\prime}\right)\right) ^ {\delta}, \tag {5} \\ \end{array}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
where $\mathcal { C } _ { \delta } \approx O ( 1 )$ and $\begin{array} { r } { \delta = \frac { 1 } { 2 } } \end{array}$ .
|
| 130 |
+
|
| 131 |
+
The proof is provided in Appendix D.2. In summary, Theorem 3.3 demonstrates that knowledge gained through pretraining on task-tree reconstruction tasks is transferable to downstream tasks, and it quantifies the extent of this transfer. The left-hand side (LHS) of the theorem shows how different representations impact performance on downstream tasks, while the right-hand side (RHS) reflects the difference in pretraining losses between two encoders. Therefore, if
|
| 132 |
+
|
| 133 |
+
two encoders exhibit similar losses during pretraining, their transferability to a new task should be comparable.
|
| 134 |
+
|
| 135 |
+
Illustration 3.4. To give a better understanding on why Theorem 3.3 imply the model pretrained on task-trees can bring transferable information to downstream tasks, we present an example. Let’s consider the case where $\phi$ is the pretrained encoder and $\phi ^ { \prime }$ is a randomly initialized encoder. The LHS term $\begin{array} { r } { \operatorname* { m i n } _ { f \in \mathcal { F } } \mathcal { R } _ { \mathcal { T } } ( f \circ \phi ) - \operatorname* { m i n } _ { f ^ { \prime } \in \mathcal { F } } \mathcal { R } _ { \mathcal { T } } ( f ^ { \prime } \circ \phi ^ { \prime } ) } \end{array}$ measures the amount of knowledge that is acquired during pretraining and is capable to be transferred to downstream tasks, and the RHS term $\begin{array} { r } { \operatorname* { m i n } _ { g \in G } \mathcal { L } _ { \mathcal { P } } ( g \circ \phi ) - \operatorname* { m i n } _ { g ^ { \prime } \in G } \mathcal { L } _ { \mathcal { P } } ( g ^ { \prime } \circ \phi ^ { \prime } ) } \end{array}$ measures the total knowledge acquired during pretraining. Thus, the constants $\mathcal { C } _ { \delta }$ and $\delta$ quantify how much of this knowledge is transferable to downstream tasks. Since both $\mathcal { C } _ { \delta }$ and δ are reasonably small, we conclude that pretraining on task-trees provides sufficient knowledge to benefit downstream tasks.
|
| 136 |
+
|
| 137 |
+
To further explain why the task-tree-based pretraining and fine-tuning framework is effective for downstream tasks, we derive the following generalization bound.
|
| 138 |
+
|
| 139 |
+
Theorem 3.5 (Generalization on Task-Trees). Given two task-tree distributions, $\mathcal { P }$ for pretraining and $\tau$ for finetuning, suppose the encoder $\phi$ is pretrained on a set of task-trees $\{ T _ { i } \} _ { i = 1 } ^ { m }$ sampled from $\mathcal { P }$ and finetuned on tasktrees $\{ T _ { i } \} _ { i = 1 } ^ { n }$ sampled from $\tau$ , the generalization bound of the finetuned model, with probability at least $1 - v$ , is
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
\begin{array}{l} \mathcal {R} _ {\mathcal {T}} (f \circ \phi) \leq \min _ {f ^ {\prime} \in \mathcal {F}} \mathcal {R} _ {\mathcal {T}} (f ^ {\prime} \circ \phi^ {*}) \\ + 2 \mathcal {C} _ {2} \Big (\sum_ {x \in \mathcal {X} _ {\phi}} \left\| \mathcal {T} _ {\phi} (x) - \mathcal {P} _ {\phi} (x) \right\| + 2 \sqrt {\frac {\log (1 / v)}{n}} \Big) \\ + \mathcal {C} _ {\delta} \left(\mathcal {E} _ {\mathcal {P}} (g, \phi)\right) ^ {\delta} + \frac {4 \mathcal {C} _ {1}}{n} \sqrt {\sum_ {i = 1} ^ {n} \left\| \phi \left(T _ {i}\right) \right\| ^ {2}}, \tag {6} \\ \end{array}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $\begin{array} { r } { \phi ^ { * } = \arg \operatorname* { m i n } _ { \phi \in \Phi } \operatorname* { m i n } _ { g \in G } \mathcal { L } _ { \mathcal { P } } ( g \circ \phi ) } \end{array}$ is the optimal task-tree encoder obtained on $\mathcal { P }$ , $\begin{array} { r } { \mathcal { E } _ { \mathcal { P } } ( g , \phi ) = \mathcal { L } _ { \mathcal { P } } ( g \circ h ) - } \end{array}$ $\begin{array} { r } { \operatorname* { m i n } _ { g ^ { \prime } \in G , \phi ^ { \prime } \in \Phi } \mathcal { L } _ { \mathcal { P } } ( g ^ { \prime } \circ \phi ^ { \prime } ) } \end{array}$ defines the excess risk during pretraining. Constants $\mathcal { C } _ { 1 }$ and $\mathcal { C } _ { 2 }$ are related to downstream tasks, while ${ \mathcal C } _ { \delta } \approx { O } \left( 1 \right)$ and $\begin{array} { r } { \delta = \frac { 1 } { 2 } } \end{array}$ are the same as Theorem 3.3. $\mathcal { X } _ { \phi }$ denotes the distribution of task-tree embeddings encoded via $\phi$ , and $\| T _ { \phi } ( x ) - \mathcal { P } _ { \phi } ( x ) \|$ measures the distance between task-tree distributions of pretraining and fine-tuning data.
|
| 146 |
+
|
| 147 |
+
The proof can be found in Appendix D.3. This theorem outlines key factors affecting model generalization on downstream tasks, such as the transferability of task-trees $( \mathcal { C } _ { \delta } ( \mathcal { E _ { P } } ( g , \phi ) ) ^ { \delta } )$ and the quality of the pretrained encoder $( { \mathcal { E } } _ { \mathcal { P } } ( g , \phi ) )$ . With regard to the number of task-trees, we find that while increasing the number of fine-tuning samples contributes to more stable optimization $\begin{array} { r } { ( \frac { 4 \mathcal { C } _ { 1 } } { n } \sqrt { \sum _ { i = 1 } ^ { n } \| \phi ( T _ { i } ) \| ^ { 2 } } ) } \end{array}$ , it does not significantly reduce the generalization bound
|
| 148 |
+
|
| 149 |
+
$( 2 { \sqrt { \frac { \log ( 1 / v ) } { n } } } )$ log(1/v)n ). This provides theoretical evidence that a reasonable number of fine-tuning samples can be sufficient for training a model with strong generalization capabilities. Moreover, the discrepancy between the pretraining and fine-tuning distributions $\begin{array} { r } { ( \sum _ { x \in \mathcal { X } _ { \phi } } \| \mathcal { T } _ { \phi } ( x ) - \mathcal { P } _ { \phi } ( x ) \| ) } \end{array}$ is crucial—smaller distribution gaps lead to better generalization. This highlights the importance of increasing the diversity of pretraining data, which provides a boarder pretraining distribution $\mathcal { P }$ . It also supports the potential of developing specialized models for specific domains based on a pretrained general model, discussed in Section 4.2.
|
| 150 |
+
|
| 151 |
+
# 4. Graph Generality Identifier on Task-Trees
|
| 152 |
+
|
| 153 |
+
The theoretical analysis establishes the feasibility of constructing graph foundation models based on task-trees. Building on these insights, we develop the GIT model to empirically validate the Task-Tree Generality Assumption.
|
| 154 |
+
|
| 155 |
+
To focus on aligning task spaces across heterogeneous graph tasks, we adopt widely used text-attributed graph benchmarks (Chen et al., 2024b; Zhang et al., 2024b; Feng et al., 2024), which simplify feature alignment across datasets. Specifically, we follow Liu et al. (2024a) and encode all node features into a shared 768-dimensional embedding space using Sentence-BERT (Reimers & Gurevych, 2019). This design allows us to isolate and examine the effect of task-tree-based pretraining while holding node features consistent across domains.
|
| 156 |
+
|
| 157 |
+
# 4.1. GIT-G: Pretraining to Acquire General Knowledge
|
| 158 |
+
|
| 159 |
+
We propose a task-tree reconstruction task as a pretext for pretraining. The key is to use two corrupted task-trees to reconstruct each other, thereby capturing corruptioninvariant semantics. Given a set of task-trees $\{ T _ { 1 } ^ { t } , . . . , T _ { n } ^ { t } \}$ sampled from a graph database, we apply corruption techniques to generate two views of each task-tree, denoted as $\big \{ \hat { T } _ { 1 } ^ { t } , . . . , \hat { T } _ { n } ^ { t } \big \}$ and $\{ \tilde { T } _ { 1 } ^ { t } , . . . , \tilde { T } _ { n } ^ { t } \}$ . For corruption, we use random edge masking and random attribute masking (Zhu et al., 2020; Wang et al., 2025c) due to its computational efficiency. We then use an encoder $\phi$ to obtain embeddings for the corrupted task-trees, resulting in $\{ \hat { z } _ { 1 } , . . . , \hat { z } _ { n } \}$ and $\{ \tilde { z } _ { 1 } , . . . , \tilde { z } _ { n } \}$ . Inspired by (Thakoor et al., 2022), we perform reconstruction as
|
| 160 |
+
|
| 161 |
+
$$
|
| 162 |
+
\begin{array}{l} \mathcal {L} = \frac {1}{2 n} \sum_ {i = 1} ^ {n} \left[ \left\| \rho \left(g \left(\hat {\boldsymbol {z}} _ {i}\right)\right) - \operatorname {s g} \left[ \rho \left(\tilde {\boldsymbol {z}} _ {i}\right) \right] \right\| ^ {2} \right. \\ \left. + \left\| \rho \left(g \left(\tilde {\boldsymbol {z}} _ {i}\right)\right) - \operatorname {s g} \left[ \rho \left(\hat {\boldsymbol {z}} _ {i}\right) \right] \right\| ^ {2} \right] + \sum_ {i = 1} ^ {n} D _ {\mathrm {K L}} \left(\boldsymbol {h} \right\| \boldsymbol {z} _ {i}), \tag {7} \\ \end{array}
|
| 163 |
+
$$
|
| 164 |
+
|
| 165 |
+
where $g$ is a non-linear MLP projector, $\rho ( z ) = ( z / \| z \| )$ serves for normalization, sg is the stop-gradient operation, and $^ { h }$ is the average of all instances $_ z$ . The reconstruction
|
| 166 |
+
|
| 167 |
+
loss captures the semantics of the task-trees in a predictive manner, while the KL regularizer ensures the embeddings are projected into a shared space by minimizing the KL divergence between individual instances and their center.
|
| 168 |
+
|
| 169 |
+
# 4.2. GIT-S: Specification via Instruction Tuning
|
| 170 |
+
|
| 171 |
+
Theorem 3.5 highlights the relationship between model generalization and the distribution gap between pretraining data $\mathcal { P }$ and fine-tuning data $\tau$ , showing that a smaller gap leads to better generalization. Based on this finding, it is feasible to develop a specialized model for specific domains from a pretrained general model. This is based on the mild assumption that graphs from the same domain have similar task-tree distributions $\{ \mathcal { T } _ { 1 } , . . , \mathcal { T } _ { n } \}$ . If the pretrained model is post-trained on a task-tree distribution $\mathcal { P } _ { p o s t }$ sampled from $\{ \mathcal { T } _ { 1 } , . . , \mathcal { T } _ { n } \}$ , the pretraining data distribution $\mathcal { P }$ can be adjusted towards these task-tree distributions. This reduces the discrepancy $\begin{array} { r } { \sum _ { x \in \mathcal { X } _ { \phi } } \| \mathcal { T } _ { \phi } ( x ) - \mathcal { P } _ { \phi } ( x ) \| } \end{array}$ in Theorem 3.5, thereby improving model generalization on the target domain. To achieve this, we propose an instruction-tuning method for post-training the pretrained model.
|
| 172 |
+
|
| 173 |
+
Instruction tuning is a supervised fine-tuning (SFT) technique designed to enhance the capabilities of a pretrained model by post-training it on a small dataset. Our goal is to fine-tune the model using instructions to specialize it for a particular domain of interest. Given a pretrained model $\phi ^ { * }$ and a set of task-trees $\{ T _ { 1 } , . . . , T _ { n } \}$ from the target domain, we post-train the model using the SFT loss:
|
| 174 |
+
|
| 175 |
+
$$
|
| 176 |
+
\mathcal {L} _ {S F T} = \frac {1}{n} \sum_ {i = 1} ^ {n} \kappa \left(\phi^ {*} \left(T _ {i}\right), \psi \left(T _ {i}\right)\right), \tag {8}
|
| 177 |
+
$$
|
| 178 |
+
|
| 179 |
+
where $\psi$ is the instruction generation function for each tasktree, and $\kappa$ is the corresponding loss function. In this paper, as we use text-attributed graphs in our experiments, we define instructions as the embeddings of label descriptions encoded by a LLM, which is similar to Liu et al. (2024a), and we use mean squared error as the loss function $\kappa$ . Additional model analysis is provided in Appendix B.
|
| 180 |
+
|
| 181 |
+
# 5. Experiment
|
| 182 |
+
|
| 183 |
+
# 5.1. Experimental Setup
|
| 184 |
+
|
| 185 |
+
Datasets. We conduct experiments on over 30 textattributed graphs spanning five domains: academic networks, e-commerce networks, knowledge graphs, molecular graphs, and temporal graphs. Pretraining is performed on a diverse subset including Arxiv (academic), Products (e-commerce), WN18RR and FB15K237 (knowledge), and Chemblpre and PCBA (molecular). Specialization is evaluated on representative datasets for each domain: Arxiv, Products, FB15K237, and PCBA. For temporal graphs, which are e-commerce temporal graphs, we also use
|
| 186 |
+
|
| 187 |
+
Table 2: We report the model performance across five graph domains: academia, e-commerce, knowledge base, molecular, and temporal graphs, with results averaged over all graphs within each domain. Note that -G and -S represent the general and specialized versions of GIT, respectively. The comprehensive results can be found in Appendix F.
|
| 188 |
+
|
| 189 |
+
<table><tr><td></td><td>Domain</td><td>Academic</td><td>E-commerce</td><td>KG</td><td>Molecule</td><td>Temporal</td><td>Held-out Avg.</td><td>Avg.</td></tr><tr><td rowspan="5">0-shot</td><td>Sup. GNN</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>GraphMAE</td><td>15.42</td><td>8.19</td><td>-</td><td>47.19</td><td>-</td><td>26.67</td><td>25.11</td></tr><tr><td>OFA</td><td>13.98</td><td>8.73</td><td>-</td><td>50.49</td><td>-</td><td>27.20</td><td>26.14</td></tr><tr><td>GIT - G</td><td>14.88</td><td>8.79</td><td>-</td><td>53.34</td><td>-</td><td>28.56</td><td>27.50</td></tr><tr><td>GIT - S</td><td>23.45</td><td>17.06</td><td>-</td><td>62.83</td><td>-</td><td>35.19</td><td>36.32</td></tr><tr><td rowspan="5">3-shot</td><td>Sup. GNN</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td><td>-</td></tr><tr><td>GraphMAE</td><td>49.25</td><td>48.20</td><td>56.56</td><td>56.01</td><td>40.31</td><td>50.15</td><td>52.07</td></tr><tr><td>OFA</td><td>45.93</td><td>57.06</td><td>56.97</td><td>57.03</td><td>38.92</td><td>51.84</td><td>53.70</td></tr><tr><td>GIT - G</td><td>54.00</td><td>57.22</td><td>67.55</td><td>55.96</td><td>39.95</td><td>56.09</td><td>57.82</td></tr><tr><td>GIT - S</td><td>55.18</td><td>58.01</td><td>67.80</td><td>62.82</td><td>41.38</td><td>58.69</td><td>60.15</td></tr><tr><td rowspan="5">Finetune</td><td>Sup. GNN</td><td>73.57</td><td>78.21</td><td>66.86</td><td>73.65</td><td>62.61</td><td>71.14</td><td>72.25</td></tr><tr><td>GraphMAE</td><td>73.81</td><td>76.57</td><td>72.61</td><td>71.41</td><td>62.75</td><td>71.37</td><td>72.79</td></tr><tr><td>OFA</td><td>72.18</td><td>76.64</td><td>72.38</td><td>74.03</td><td>62.31</td><td>71.48</td><td>73.08</td></tr><tr><td>GIT - G</td><td>75.82</td><td>78.55</td><td>75.73</td><td>74.57</td><td>64.59</td><td>73.84</td><td>75.37</td></tr><tr><td>GIT - S</td><td>75.88</td><td>78.83</td><td>76.15</td><td>75.20</td><td>64.68</td><td>74.19</td><td>75.72</td></tr></table>
|
| 190 |
+
|
| 191 |
+

|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
|
| 197 |
+

|
| 198 |
+
|
| 199 |
+

|
| 200 |
+
Figure 3: The model performance on all datasets in the fine-tuning setting. For GIT, the best result is selected between GIT-G and GIT-S, while the best baseline performance is chosen among GCN/GAT/GIN, BGRL, GraphMAE, and OFA.
|
| 201 |
+
|
| 202 |
+
Products for SFT to assess robustness under temporal distribution shifts. We provide the full dataset details in Appendix E.1.
|
| 203 |
+
|
| 204 |
+
Baselines. We compare against a broad spectrum of baselines, including supervised GNNs (GCN (Kipf & Welling, 2017), GAT (Velickovi ˇ c et al. ´ , 2018), GIN (Xu et al., 2019)), self-supervised models (BGRL (Thakoor et al., 2022), GraphMAE (Hou et al., 2022)), and graph foundation models (OFA (Liu et al., 2024a), GraphPrompt+ (Liu et al., 2023), All in One (Sun et al., 2023), OpenGraph (Xia et al., 2024), AnyGraph (Xia & Huang, 2024)). We also include domain-specific expert models for comparison. See Appendix E.2 for full descriptions.
|
| 205 |
+
|
| 206 |
+
Experimental Protocols. We use GraphSAGE (Hamilton et al., 2017) as the encoder and repeat each experiment
|
| 207 |
+
|
| 208 |
+
five times with different random seeds. We evaluate three paradigms: fine-tuning, in-context learning, and zero-shot learning. Fine-tuning updates all model parameters on downstream data. In in-context learning (few-shot without finetuning), we randomly sample $k$ instances per class, compute prototype embeddings via averaging, and classify using nearest-prototype inference. Following Liu et al. (2024a); He & Hooi (2024), we sample 500 5-way 3-shot tasks; if the number of classes is fewer than 5, we use the actual number of classes as the number of ways. Zero-shot learning replaces prototypes with class description embeddings generated by an LLM. For evaluation, we report accuracy for node classification and edge classification, and AUC for graph classification and link prediction. Additional details are provided in Appendix E.
|
| 209 |
+
|
| 210 |
+
Table 3: Performance comparison to SOTA methods.
|
| 211 |
+
|
| 212 |
+
<table><tr><td></td><td>Academic</td><td>KG</td><td>Molecule</td></tr><tr><td>GraphPrompt+</td><td>74.80</td><td>74.78</td><td>72.99</td></tr><tr><td>All in one</td><td>75.25</td><td>74.92</td><td>71.87</td></tr><tr><td>OpenGraph</td><td>74.64</td><td>71.38</td><td>72.84</td></tr><tr><td>AnyGraph</td><td>75.01</td><td>74.30</td><td>72.49</td></tr><tr><td>GIT - G</td><td>75.82</td><td>75.73</td><td>74.57</td></tr></table>
|
| 213 |
+
|
| 214 |
+
# 5.2. Main Results
|
| 215 |
+
|
| 216 |
+
Domain-Wise Performance. Table 2 reports average performance across five domains, with detailed per-dataset results provided in Appendix F. The “held-out avg.” denotes the average score on all graphs excluded from pretraining and specialization, offering an unbiased evaluation of generalization. Notably, the general-purpose model GIT-G already outperforms strong baselines in several domains. With domain-specific specialization, GIT-S achieves further gains—especially in zero-shot and in-context settings— highlighting the benefits of post-training in adapting pretrained models to specific domains. These results align with our theoretical findings, demonstrating enhanced adaptability through specialization.
|
| 217 |
+
|
| 218 |
+
Dataset-Wise Performance. Figure 3 shows fine-tuning performance across all datasets. GIT consistently outperforms the strongest baseline in the majority of cases, validating the effectiveness of task-trees as generalizable learning units across heterogeneous graph tasks.
|
| 219 |
+
|
| 220 |
+
Effect of Specialization. We summarize three key observations: (1) Specialization (GIT-S) enhances the performance of GIT-G across most settings (Table 2). However, the impact of specialization varies depending on the dataset used (Appendix Figure 9 and Table 25). (2) Specialization does not significantly degrade model performance on other domains (Table 27). (3) Applying the proposed specialization approach to other models also yields performance improvements in specific domains (Table 4), showing the generalization of post-training in enhancing model capacity.
|
| 221 |
+
|
| 222 |
+
# 5.3. Comparison to State-of-The-Art Methods
|
| 223 |
+
|
| 224 |
+
To evaluate the effectiveness of GIT, we compare it against recent graph foundation models, including GraphPrompt+ (Liu et al., 2023), All in One (Sun et al., 2023), OpenGraph (Xia et al., 2024), and AnyGraph (Xia & Huang, 2024), under the pretrain-then-finetune paradigm. As shown in Table 3, we benchmark GIT-G and all baselines across three representative domains: academic networks (node classification), knowledge graphs (edge classification), and molecular graphs (graph classification). GIT-G consistently outperforms all competing methods across tasks and domains. While many existing models pursue broad generalization by
|
| 225 |
+
|
| 226 |
+
Table 4: Ablation study on training strategies, where the performance is averaged across all academic networks.
|
| 227 |
+
|
| 228 |
+
<table><tr><td></td><td colspan="3">Base Model</td><td colspan="3">Expert Model</td></tr><tr><td></td><td>0-shot</td><td>3-shot</td><td>Finetune</td><td>0-shot</td><td>3-shot</td><td>Finetune</td></tr><tr><td>GraphMAE</td><td>15.30</td><td>51.51</td><td>75.57</td><td>17.89</td><td>55.88</td><td>75.26</td></tr><tr><td>OFA</td><td>14.19</td><td>50.15</td><td>75.12</td><td>17.26</td><td>54.88</td><td>75.97</td></tr><tr><td>GIT</td><td>15.36</td><td>53.31</td><td>75.53</td><td>18.38</td><td>55.10</td><td>75.47</td></tr><tr><td></td><td colspan="3">General Model</td><td colspan="3">Specialized Model</td></tr><tr><td></td><td>0-shot</td><td>3-shot</td><td>Finetune</td><td>0-shot</td><td>3-shot</td><td>Finetune</td></tr><tr><td>GraphMAE</td><td>15.42</td><td>49.25</td><td>73.81</td><td>20.31</td><td>51.21</td><td>74.05</td></tr><tr><td>OFA</td><td>13.98</td><td>45.93</td><td>72.18</td><td>20.05</td><td>46.87</td><td>73.04</td></tr><tr><td>GIT</td><td>14.88</td><td>54.00</td><td>75.82</td><td>23.45</td><td>55.18</td><td>75.88</td></tr></table>
|
| 229 |
+
|
| 230 |
+
addressing multiple aspects—e.g., domain shifts, modality fusion, and prompt engineering—GIT adopts a targeted approach centered on task alignment. Its core innovation lies in the use of task-trees, which provide a unified abstraction across graph tasks.
|
| 231 |
+
|
| 232 |
+
# 5.4. Ablation on Training Strategies
|
| 233 |
+
|
| 234 |
+
We conduct an ablation study on academic networks to evaluate the impact of different training strategies. Specifically, we examine four approaches: (1) Base Model: Pretraining on the target graph. (2) Expert Model: Pretraining on all academic networks. (3) General Model: Pretraining on the default pretraining datasets. (4) Specialized Model: Pretraining on the default datasets followed by specialization on Arxiv. The results, averaged across all academic graphs, are reported in Table 4. Notably, the general model of GIT maintains stable performance relative to both the base and expert models. In contrast, GraphMAE and OFA exhibit performance degradation when transitioning from the base and expert models to the general model. This finding underscores the potential of task-trees in mitigating such negative transfer. Furthermore, specialization in GIT allows its performance to closely approximate that of expert models trained exclusively on academic graphs.
|
| 235 |
+
|
| 236 |
+
# 5.5. Comparison to Domain Experts
|
| 237 |
+
|
| 238 |
+
We compare GIT to domain experts in molecular and knowledge graphs, as these domains require domain-specific knowledge. Our findings indicate that the specialized GIT (GIT-S) closely approximates the performance of these experts. In molecular graphs, GIT-S achieves an average performance of 62.83, ranking second to the state-of-the-art GIMLET (64.15) (Zhao et al., 2023) while outperforming other domain experts (Zeng et al., 2022; Su et al., 2022; Taylor et al., 2022), whose best performance is 55.82 (Table 24). Similarly, in knowledge graphs, GIT-S attains an average score of 67.80, approaching the KG expert ULTRA (68.53) (Galkin et al., 2024), as shown in Table 23 in Appendix.
|
| 239 |
+
|
| 240 |
+
Table 5: Performance comparison between methods with different basic learning instances.
|
| 241 |
+
|
| 242 |
+
<table><tr><td>Instances</td><td colspan="2">Subgraph</td><td>Tree</td></tr><tr><td>Domains</td><td>OFA</td><td>GIT - SubG</td><td>GIT - Tree</td></tr><tr><td>Academia</td><td>72.18</td><td>73.48</td><td>75.82</td></tr><tr><td>KG</td><td>72.38</td><td>73.59</td><td>75.73</td></tr><tr><td>Molecule</td><td>74.03</td><td>72.67</td><td>75.73</td></tr><tr><td>Held-out Avg.</td><td>71.31</td><td>70.88</td><td>73.81</td></tr><tr><td>Avg.</td><td>72.93</td><td>73.01</td><td>75.33</td></tr></table>
|
| 243 |
+
|
| 244 |
+
Table 6: Results on non-text-attributed graphs.
|
| 245 |
+
|
| 246 |
+
<table><tr><td>Setting</td><td>GraphMAE</td><td>GIT-G</td></tr><tr><td>w/o SVD + w/o pretrain</td><td>95.02</td><td>94.27</td></tr><tr><td>w. SVD + w/o pretrain</td><td>94.89</td><td>95.50</td></tr><tr><td>w. SVD + w. pretrain</td><td>95.10</td><td>95.70</td></tr></table>
|
| 247 |
+
|
| 248 |
+
# 5.6. Task-Trees vs. Subgraphs: Efficiency and Performance
|
| 249 |
+
|
| 250 |
+
We compare the efficiency and effectiveness of task-trees against subgraph-based learning units in the fine-tuning setting, as shown in Figure 4 and Table 5. For a fair comparison, we implement a subgraph-based variant of our model, denoted GIT-SubG, by substituting task-trees with subgraphs while keeping all other components unchanged.
|
| 251 |
+
|
| 252 |
+
Experimental results across three domains—academic (node classification), knowledge graphs (edge classification), and molecular graphs (graph classification)—demonstrate that task-trees consistently outperform subgraphs in both computational efficiency (Figure 4) and predictive performance (Table 5). This highlights the advantage of task-trees in serving as compact, expressive, and structurally aligned learning instances, especially in cross-task and cross-domain generalization scenarios.
|
| 253 |
+
|
| 254 |
+
# 5.7. Results on Non-Text-Attributed Graphs
|
| 255 |
+
|
| 256 |
+
While prior experiments use text-attributed graphs, GIT does not inherently rely on textual information. We adopt textattributed datasets to isolate the impact of task heterogeneity, while sidestepping the confounding effects of feature heterogeneity. Textual attributes enable feature alignment across graphs via a shared encoder, allowing us to more clearly assess the benefits of task-tree generalization. Importantly, GIT is compatible with non-textual graphs. To demonstrate this, we introduce a lightweight module that addresses feature heterogeneity by applying SVD to project features into a shared space. As shown in Table 6, we pretrain GIT-G on non-text-attributed datasets—PubMed (node classification), Citeseer (link prediction), and IMDB-
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
Figure 4: Training efficiency between task-tree and subgraph versions of GIT.
|
| 260 |
+
|
| 261 |
+
B (graph classification)—and fine-tune on Cora (link prediction). Results, evaluated via AUC, confirm that GIT-G remains effective without relying on textual information, validating its broader applicability.
|
| 262 |
+
|
| 263 |
+
# 6. Conclusion and Limitations
|
| 264 |
+
|
| 265 |
+
We introduce task-trees as unified learning instances for aligning heterogeneous graph-based tasks, supported by both theoretical and empirical analyses. Based on this abstraction, we develop GIT, a pretrained graph foundation model that leverages a small set of source graphs to generalize across over 30 datasets spanning five diverse domains. Our results demonstrate that task-trees preserve transferable patterns across tasks, offering a scalable and principled pathway for cross-domain generalization in graph learning.
|
| 266 |
+
|
| 267 |
+
Limitations and Future Work. While task-trees serve as a promising abstraction—analogous to images in vision and sentences in language—several challenges remain. First, although our results suggest that task-trees capture generalities across tasks, pinpointing the precise transferable patterns remains an open question. Future work should explore this from both theoretical and empirical perspectives. Second, transforming graph neighborhoods into tree structures may lead to information loss due to the limitations of message-passing GNNs. This can affect model expressiveness, especially for graphs with complex higher-order structures. Incorporating more expressive architectures, such as higher-order GNNs (Morris et al., 2019; 2023) or advanced graph modeling (Wang et al., 2025b), may help mitigate this issue. Finally, while GIT demonstrates strong performance with a lightweight design, exploring more sophisticated variants—e.g., incorporating attention mechanisms, graph prompting, or task-conditioned decoders—offers exciting directions for extending the generality and adaptability of graph foundation models. We outline several of these opportunities in Appendix C.
|
| 268 |
+
|
| 269 |
+
# Acknowledgments
|
| 270 |
+
|
| 271 |
+
This work was partially supported by the NSF under grants IIS-2321504, IIS-2334193, IIS-2340346, IIS-2217239, CNS-2426514, and CMMI-2146076, and Notre Dame Strategic Framework Research Grant (2025). Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the sponsors.
|
| 272 |
+
|
| 273 |
+
# Impact Statement
|
| 274 |
+
|
| 275 |
+
From an industry perspective, we offer GIT as a foundational tool for graph-structured data. Additionally, since GIT can be quickly adapted to specific domains, we hope it will support applications where label acquisition is difficult and model training is time-consuming. There is no clear ethical considerations on the model architecture itself.
|
| 276 |
+
|
| 277 |
+
# References
|
| 278 |
+
|
| 279 |
+
Achiam, J., Adler, S., Agarwal, S., Ahmad, L., Akkaya, I., Aleman, F. L., Almeida, D., Altenschmidt, J., Altman, S., Anadkat, S., et al. Gpt-4 technical report. arXiv, 2023.
|
| 280 |
+
Cao, Y., Xu, J., Yang, C., Wang, J., Zhang, Y., Wang, C., Chen, L., and Yang, Y. When to pre-train graph neural networks? from data generation perspective! In KDD, 2023.
|
| 281 |
+
Chen, R., Zhao, T., JAISWAL, A. K., Shah, N., and Wang, Z. Llaga: Large language and graph assistant. In ICML, 2024a.
|
| 282 |
+
Chen, Z., Chen, L., Villar, S., and Bruna, J. Can graph neural networks count substructures? In NeurIPS, 2020.
|
| 283 |
+
Chen, Z., Mao, H., Liu, J., Song, Y., Li, B., Jin, W., Fatemi, B., Tsitsulin, A., Perozzi, B., Liu, H., et al. Text-space graph foundation models: Comprehensive benchmarks and new insights. arXiv, 2024b.
|
| 284 |
+
Chen, Z., Wang, S., Shen, C., and Li, J. Fastgas: Fast graph-based annotation selection for in-context learning. In ACL 2024 (Findings), 2024c.
|
| 285 |
+
Chuang, C.-Y. and Jegelka, S. Tree mover’s distance: Bridging graph metrics and stability of graph neural networks. In NeurIPS, 2022.
|
| 286 |
+
Deng, Y., Hong, J., Zhou, J., and Mahdavi, M. On the generalization ability of unsupervised pretraining. In AISTATS, 2024.
|
| 287 |
+
Ding, K., Wang, J., Li, J., Shu, K., Liu, C., and Liu, H. Graph prototypical networks for few-shot learning on attributed networks. In CIKM, 2020.
|
| 288 |
+
|
| 289 |
+
Esser, P., Chennuru Vankadara, L., and Ghoshdastidar, D. Learning theory can (sometimes) explain generalisation in graph neural networks. In NeurIPS, 2021.
|
| 290 |
+
Fan, Y., Ju, M., Zhang, C., and Ye, Y. Heterogeneous temporal graph neural network. In SDM, 2022.
|
| 291 |
+
Feng, J., Liu, H., Kong, L., Chen, Y., and Zhang, M. Taglas: An atlas of text-attributed graph datasets in the era of large graph and language models. arXiv, 2024.
|
| 292 |
+
Freeman, L. The development of social network analysis. A Study in the Sociology of Science, 2004.
|
| 293 |
+
Galkin, M., Yuan, X., Mostafa, H., Tang, J., and Zhu, Z. Towards foundation models for knowledge graph reasoning. In ICLR, 2024.
|
| 294 |
+
Garg, V., Jegelka, S., and Jaakkola, T. Generalization and representational limits of graph neural networks. In ICML, 2020.
|
| 295 |
+
Guo, J., Du, L., and Liu, H. Gpt4graph: Can large language models understand graph structured data? an empirical evaluation and benchmarking. arXiv, 2023.
|
| 296 |
+
Gupta, M., Manchanda, S., Ranu, S., and Kodamana, H. Mirage: Model-agnostic graph distillation for graph classification. In ICLR, 2024.
|
| 297 |
+
Hamilton, W., Ying, Z., and Leskovec, J. Inductive representation learning on large graphs. In NeurIPS, 2017.
|
| 298 |
+
Hashemi, M., Gong, S., Ni, J., Fan, W., Prakash, B. A., and Jin, W. A comprehensive survey on graph reduction: Sparsification, coarsening, and condensation. In IJCAI, 2024.
|
| 299 |
+
He, K., Chen, X., Xie, S., Li, Y., Dollar, P., and Girshick,´ R. Masked autoencoders are scalable vision learners. In CVPR, 2022.
|
| 300 |
+
He, Y. and Hooi, B. Unigraph: Learning a cross-domain graph foundation model from natural language. arXiv preprint arXiv:2402.13630, 2024.
|
| 301 |
+
Hou, Z., Liu, X., Cen, Y., Dong, Y., Yang, H., Wang, C., and Tang, J. Graphmae: Self-supervised masked graph autoencoders. In KDD, 2022.
|
| 302 |
+
Hu, W., Liu, B., Gomes, J., Zitnik, M., Liang, P., Pande, V., and Leskovec, J. Strategies for pre-training graph neural networks. In ICLR, 2020.
|
| 303 |
+
Hu, Z., Fan, C., Chen, T., Chang, K.-W., and Sun, Y. Pretraining graph neural networks for generic structural feature extraction. arXiv, 2019.
|
| 304 |
+
|
| 305 |
+
Huang, Q., Ren, H., Chen, P., Krzmanc, G., Zeng, D., Liang, ˇ P. S., and Leskovec, J. Prodigy: Enabling in-context learning over graphs. In NeurIPS, 2023.
|
| 306 |
+
Jin, W., Derr, T., Liu, H., Wang, Y., Wang, S., Liu, Z., and Tang, J. Self-supervised learning on graphs: Deep insights and new direction. arXiv, 2020.
|
| 307 |
+
Ju, H., Li, D., Sharma, A., and Zhang, H. R. Generalization in graph neural networks: Improved pac-bayesian bounds on graph diffusion. In AISTATS, 2023a.
|
| 308 |
+
Ju, M., Zhao, T., Wen, Q., Yu, W., Shah, N., Ye, Y., and Zhang, C. Multi-task self-supervised graph neural networks enable stronger task generalization. In ICLR, 2023b.
|
| 309 |
+
Kipf, T. N. and Welling, M. Semi-supervised classification with graph convolutional networks. In ICLR, 2017.
|
| 310 |
+
Levie, R., Isufi, E., and Kutyniok, G. On the transferability of spectral graph filters. In SampTA, 2019.
|
| 311 |
+
Levie, R., Huang, W., Bucci, L., Bronstein, M., and Kutyniok, G. Transferability of spectral graph convolutional neural networks. JMLR, 2021.
|
| 312 |
+
Li, Y., Wang, P., Li, Z., Yu, J. X., and Li, J. Zerog: Investigating cross-dataset zero-shot transferability in graphs. In KDD, 2024.
|
| 313 |
+
Liu, H., Feng, J., Kong, L., Liang, N., Tao, D., Chen, Y., and Zhang, M. One for all: Towards training one graph model for all classification tasks. In ICLR, 2024a.
|
| 314 |
+
Liu, Z., Yu, X., Fang, Y., and Zhang, X. Graphprompt: Unifying pre-training and downstream tasks for graph neural networks. In WWW, 2023.
|
| 315 |
+
Liu, Z., He, X., Tian, Y., and Chawla, N. V. Can we soft prompt llms for graph learning tasks? In WWW, 2024b.
|
| 316 |
+
Luan, S., Hua, C., Lu, Q., Zhu, J., Zhao, M., Zhang, S., Chang, X.-W., and Precup, D. Revisiting heterophily for graph neural networks. In NeurIPS, 2022.
|
| 317 |
+
Ma, T., Qian, Y., Zhang, C., and Ye, Y. Hypergraph contrastive learning for drug trafficking community detection. In ICDM, 2023.
|
| 318 |
+
Ma, Y., Liu, X., Shah, N., and Tang, J. Is homophily a necessity for graph neural networks? In ICLR, 2022.
|
| 319 |
+
Mao, H., Chen, Z., Tang, W., Zhao, J., Ma, Y., Zhao, T., Shah, N., Galkin, M., and Tang, J. Graph foundation models are already here. In ICML, 2024.
|
| 320 |
+
Morris, C., Ritzert, M., Fey, M., Hamilton, W. L., Lenssen, J. E., Rattan, G., and Grohe, M. Weisfeiler and leman go neural: Higher-order graph neural networks. In AAAI, 2019.
|
| 321 |
+
|
| 322 |
+
Morris, C., Geerts, F., Tonshoff, J., and Grohe, M. Wl meet¨ vc. In ICML, 2023.
|
| 323 |
+
Ni, B., Liu, Z., Wang, L., Lei, Y., Zhao, Y., Cheng, X., Zeng, Q., Dong, L., Xia, Y., Kenthapadi, K., et al. Towards trustworthy retrieval augmented generation for large language models: A survey. arXiv, 2025.
|
| 324 |
+
Qian, Y., Ma, T., Zhang, C., and Ye, Y. Dual-level hypergraph contrastive learning with adaptive temperature enhancement. In WWW, 2024.
|
| 325 |
+
Qian, Y., Ma, T., Zhang, C., and Ye, Y. Adaptive graph enhancement for imbalanced multi-relation graph learning. In CIKM, 2025.
|
| 326 |
+
Qiu, J., Chen, Q., Dong, Y., Zhang, J., Yang, H., Ding, M., Wang, K., and Tang, J. Gcc: Graph contrastive coding for graph neural network pre-training. In KDD, 2020.
|
| 327 |
+
Reimers, N. and Gurevych, I. Sentence-bert: Sentence embeddings using siamese bert-networks. In EMNLP, 2019.
|
| 328 |
+
Ruhe, A. Perturbation bounds for means of eigenvalues and invariant subspaces. BIT Numerical Mathematics, 1970.
|
| 329 |
+
Ruiz, L., Chamon, L., and Ribeiro, A. Graphon neural networks and the transferability of graph neural networks. In NeurIPS, 2020.
|
| 330 |
+
Sohn, K., Berthelot, D., Carlini, N., Zhang, Z., Zhang, H., Raffel, C. A., Cubuk, E. D., Kurakin, A., and Li, C.-L. Fixmatch: Simplifying semi-supervised learning with consistency and confidence. In NeurIPS, 2020.
|
| 331 |
+
Song, F., Yu, B., Li, M., Yu, H., Huang, F., Li, Y., and Wang, H. Preference ranking optimization for human alignment. In AAAI, 2024.
|
| 332 |
+
Srinivasan, B. and Ribeiro, B. On the equivalence between positional node embeddings and structural graph representations. In ICLR, 2020.
|
| 333 |
+
Su, B., Du, D., Yang, Z., Zhou, Y., Li, J., Rao, A., Sun, H., Lu, Z., and Wen, J.-R. A molecular multimodal foundation model associating molecule graphs with natural language. arXiv, 2022.
|
| 334 |
+
Sun, M., Zhou, K., He, X., Wang, Y., and Wang, X. Gppt: Graph pre-training and prompt tuning to generalize graph neural networks. In KDD, 2022.
|
| 335 |
+
Sun, X., Cheng, H., Li, J., Liu, B., and Guan, J. All in one: Multi-task prompting for graph neural networks. In KDD, 2023.
|
| 336 |
+
Sun, Y., Zhu, Q., Yang, Y., Wang, C., Fan, T., Zhu, J., and Chen, L. Fine-tuning graph neural networks by preserving graph generative patterns. In AAAI, 2024.
|
| 337 |
+
|
| 338 |
+
Tan, Z., Wang, S., Ding, K., Li, J., and Liu, H. Transductive linear probing: a novel framework for few-shot node classification. In LoG, 2022.
|
| 339 |
+
Tang, J., Yang, Y., Wei, W., Shi, L., Su, L., Cheng, S., Yin, D., and Huang, C. Graphgpt: Graph instruction tuning for large language models. In SIGIR, 2024.
|
| 340 |
+
Taylor, R., Kardas, M., Cucurull, G., Scialom, T., Hartshorn, A., Saravia, E., Poulton, A., Kerkez, V., and Stojnic, R. Galactica: A large language model for science. arXiv, 2022.
|
| 341 |
+
Thakoor, S., Tallec, C., Azar, M. G., Azabou, M., Dyer, E. L., Munos, R., Velickovi ˇ c, P., and Valko, M. Large- ´ scale representation learning on graphs via bootstrapping. In ICLR, 2022.
|
| 342 |
+
Touvron, H., Lavril, T., Izacard, G., Martinet, X., Lachaux, M.-A., Lacroix, T., Roziere, B., Goyal, N., Hambro, E., ` Azhar, F., et al. Llama: Open and efficient foundation language models. arXiv, 2023.
|
| 343 |
+
Velickoviˇ c, P., Cucurull, G., Casanova, A., Romero, A., Li´ o,` P., and Bengio, Y. Graph attention networks. In ICLR, 2018.
|
| 344 |
+
Wang, H., Feng, S., He, T., Tan, Z., Han, X., and Tsvetkov, Y. Can language models solve graph problems in natural language? In NeurIPS, 2024a.
|
| 345 |
+
Wang, S., Chen, C., and Li, J. Graph few-shot learning with task-specific structures. NeurIPS, 2022a.
|
| 346 |
+
Wang, S., Ding, K., Zhang, C., Chen, C., and Li, J. Taskadaptive few-shot node classification. In KDD, 2022b.
|
| 347 |
+
Wang, Z., Zhang, Z., Chawla, N. V., Zhang, C., and Ye, Y. Gft: Graph foundation model with transferable tree vocabulary. In NeurIPS, 2024b.
|
| 348 |
+
Wang, Z., Zhang, Z., Zhang, C., and Ye, Y. Subgraph pooling: Tackling negative transfer on graphs. In IJCAI, 2024c.
|
| 349 |
+
Wang, Z., Liu, S., Zhang, Z., Ma, T., Zhang, C., and Ye, Y. Can llms convert graphs to text-attributed graphs? In NAACL, 2025a.
|
| 350 |
+
Wang, Z., Zhang, Z., Ma, T., Chawla, N. V., Zhang, C., and Ye, Y. Neural graph pattern machine. arXiv, 2025b.
|
| 351 |
+
Wang, Z., Zhang, Z., Zhang, C., and Ye, Y. Training mlps on graphs without supervision. In WSDM, 2025c.
|
| 352 |
+
Wei, J., Bosma, M., Zhao, V. Y., Guu, K., Yu, A. W., Lester, B., Du, N., Dai, A. M., and Le, Q. V. Finetuned language models are zero-shot learners. arXiv, 2021.
|
| 353 |
+
|
| 354 |
+
Wen, Q., Ju, M., Ouyang, Z., Zhang, C., and Ye, Y. From coarse to fine: enable comprehensive graph selfsupervised learning with multi-granular semantic ensemble. In ICML, 2024.
|
| 355 |
+
Xia, L. and Huang, C. Anygraph: Graph foundation model in the wild. arXiv, 2024.
|
| 356 |
+
Xia, L., Kao, B., and Huang, C. Opengraph: Towards open graph foundation models. arXiv, 2024.
|
| 357 |
+
Xie, S. M., Raghunathan, A., Liang, P., and Ma, T. An explanation of in-context learning as implicit bayesian inference. In ICLR, 2022.
|
| 358 |
+
Xu, K., Hu, W., Leskovec, J., and Jegelka, S. How powerful are graph neural networks? In ICLR, 2019.
|
| 359 |
+
Yu, X., Zhou, C., Fang, Y., and Zhang, X. Text-free multidomain graph pre-training: Toward graph foundation models. arXiv, 2024.
|
| 360 |
+
Yuan, L., Chen, D., Chen, Y.-L., Codella, N., Dai, X., Gao, J., Hu, H., Huang, X., Li, B., Li, C., et al. Florence: A new foundation model for computer vision. arXiv, 2021.
|
| 361 |
+
Zeng, Z., Yao, Y., Liu, Z., and Sun, M. A deep-learning system bridging molecule structure and biomedical text with comprehension comparable to human professionals. Nature communications, 2022.
|
| 362 |
+
Zhang, B., Gai, J., Du, Y., Ye, Q., He, D., and Wang, L. Beyond weisfeiler-lehman: A quantitative framework for gnn expressiveness. In ICLR, 2024a.
|
| 363 |
+
Zhang, C., Song, D., Huang, C., Swami, A., and Chawla, N. V. Heterogeneous graph neural network. In KDD, 2019.
|
| 364 |
+
Zhang, J., Chen, J., Yang, M., Feng, A., Liang, S., Shao, J., and Ying, R. Dtgb: A comprehensive benchmark for dynamic text-attributed graphs. arXiv, 2024b.
|
| 365 |
+
Zhang, M., Li, P., Xia, Y., Wang, K., and Jin, L. Labeling trick: A theory of using graph neural networks for multinode representation learning. NeurIPS, 2021.
|
| 366 |
+
Zhang, Z., Wang, Z., Hou, S., Hall, E., Bachman, L., White, J., Galassi, V., Chawla, N. V., Zhang, C., and Ye, Y. Dietodin: A novel framework for opioid misuse detection with interpretable dietary patterns. In KDD, 2024c.
|
| 367 |
+
Zhao, H., Liu, S., Chang, M., Xu, H., Fu, J., Deng, Z., Kong, L., and Liu, Q. Gimlet: A unified graph-text model for instruction-based molecule zero-shot learning. In NeurIPS, 2023.
|
| 368 |
+
Zhao, H., Chen, A., Sun, X., Cheng, H., and Li, J. All in one and one for all: A simple yet effective method towards cross-domain graph pretraining. In KDD, 2024a.
|
| 369 |
+
|
| 370 |
+
Zhao, J., Mostafa, H., Galkin, M., Bronstein, M., Zhu, Z., and Tang, J. Graphany: A foundation model for node classification on any graph. arXiv, 2024b.
|
| 371 |
+
Zhu, Q., Yang, C., Xu, Y., Wang, H., Zhang, C., and Han, J. Transfer learning of graph neural networks with egograph information maximization. In NeurIPS, 2021.
|
| 372 |
+
Zhu, Y., Xu, Y., Yu, F., Liu, Q., Wu, S., and Wang, L. Deep graph contrastive representation learning. In ICML Workshop, 2020.
|
| 373 |
+
|
| 374 |
+
# A. Related Work
|
| 375 |
+
|
| 376 |
+
Graph Neural Networks. GNNs are a class of learning models specifically designed to operate on graph-structured data and have demonstrated substantial success across a variety of domains. Their strength lies in their ability to perform relational learning, where information from neighboring nodes is aggregated and used to enhance node representations. For instance, GCN (Kipf & Welling, 2017) utilizes message-passing to aggregate information from neighboring nodes to central nodes. Building on this, models such as GraphSAGE (Hamilton et al., 2017) and GAT (Velickovi ˇ c et al. ´ , 2018) introduce innovative techniques like neighborhood sampling and attention mechanisms, respectively, further advancing performance on graph learning tasks. However, these methods are limited to solving a single task by training from the scratch (Zhang et al., 2019; Fan et al., 2022; Qian et al., 2025; Ma et al., 2023; Qian et al., 2024).
|
| 377 |
+
|
| 378 |
+
Transferability of GNNs. Existing works that analyze the shared concepts (generalities) across different graphs primarily follow two approaches. The first is graphon theory, which provides bounds on the distance between graphs generated from the same graphon. This method has been used to study transferability in pretraining and fine-tuning settings (Cao et al., 2023), to develop more expressive fine-tuning techniques (Sun et al., 2024), and to design new model architectures (Ruiz et al., 2020). However, despite its theoretical advantages, graphon-based approaches face practical challenges, particularly the strong assumptions required and the difficulty of identifying graphons in large-scale graphs, which limits their applicability in building graph foundation models. The second approach involves leveraging substructures within graphs to identify transferable patterns (Mao et al., 2024). This method focuses on extracting subgraphs composed of meaningful substructures for prediction tasks. While this approach offers theoretical insights into stability (Levie et al., 2019; Zhu et al., 2021), it struggles to fully capture substructures that are beneficial for downstream tasks (Zhang et al., 2024a).
|
| 379 |
+
|
| 380 |
+
Graph Foundation Models. Foundation models are designed as general-purpose solvers capable of handling various tasks across different domains. For instance, LLMs, the foundation models in natural language processing, are capable of performing tasks such as summarization, translation, and entity recognition, as well as question-answering. However, building such versatile foundation models for graphs presents unique challenges due to the inherent feature, structural, and task heterogeneity across different graph domains and tasks. To address these challenges, Qiu et al. (2020) pretrained GNNs using subgraphs as basic units, mitigating structural heterogeneity. Building on this, Sun et al. (2023) reformulated node-, edge-, and graph-level tasks into subgraph-level tasks, tackling task heterogeneity. Additionally, Huang et al. (2023) and Liu et al. (2024a) applied LLMs to unify the feature spaces of cross-domain graphs, addressing feature heterogeneity. These approaches enable models to operate on cross-domain and cross-task graphs. Further advancements, such as He & Hooi (2024) and Li et al. (2024), improve node embeddings by jointly optimizing GNN and LLM encoders, facilitating various downstream tasks like few-shot learning and zero-shot learning. However, most of these approaches rely on subgraphs as the primary learning instances, which can result in inefficient training and reduced expressiveness, as discussed in the main paper. Other efforts to resolve feature heterogeneity include methods like singular vector decomposition (SVD) (Zhao et al., 2024a; Yu et al., 2024), non-parametric encoders (Zhao et al., 2024b), or synthesizing text-attributed graphs (Wang et al., 2025a). Notably, a recent study by Wang et al. (2024b) explores computation trees as transferable patterns in graphs. However, our work differs in three key aspects: (1) While Wang et al. (2024b) focus on identifying transferable patterns across graphs, our approach is centered on designing fundamental learning instances. (2) Our theoretical framework also serves as a foundational basis for Wang et al. (2024b). (3) Our proposed GIT significantly simplifies the model proposed by Wang et al. (2024b), demonstrating a minimally applicable design that retains effectiveness.
|
| 381 |
+
|
| 382 |
+
Another line of research focuses on designing GFMs for single tasks or domains, thereby avoiding the complexities of feature, structural, or task heterogeneity. For example, Galkin et al. (2024) propose a foundation model for reasoning tasks on knowledge graphs, using triplets as basic transferable patterns. Zhao et al. (2023) introduce a foundation model for molecular graphs, employing LLMs to align semantics between datasets and encode key motifs. In node classification, Li et al. (2024) propose a zero-shot learning foundation model, while Zhao et al. (2024a) present a feature alignment method based on SVD for node-level graph foundation models. Recently, Zhao et al. (2024b) designed a foundation model for node classification using a non-parametric classifier. Meanwhile, Chen et al. (2024a), Tang et al. (2024), Guo et al. (2023), Liu et al. (2024b), and Wang et al. (2024a) have explored using LLMs as graph reasoners to solve graph tasks, similar to their role in vision language models. While these methods excel at specific tasks or domains, they are not suitable as general graph solvers across diverse tasks. In contrast to these approaches, our proposed GIT model is pretrained on diverse task trees to acquire general reasoning capabilities, allowing it to quickly specialize in specific domains through instruction tuning.
|
| 383 |
+
|
| 384 |
+

|
| 385 |
+
|
| 386 |
+

|
| 387 |
+
(a) Similiarity between different datasets with varying weights.
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
|
| 391 |
+

|
| 392 |
+
(b) w.o. Reg
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
(c) w. Reg
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
(d) The regularizer marginally affects the task structures for each dataset.
|
| 399 |
+
Figure 5: The domain regularizer controls the distance between datasets while preserving the structure within each of them.
|
| 400 |
+
|
| 401 |
+
Table 7: Model performance across settings with different scaling weights of domain regularizer.
|
| 402 |
+
|
| 403 |
+
<table><tr><td></td><td>λ = 0</td><td>λ = 1</td><td>λ = 10</td></tr><tr><td>0-shot</td><td>20.39</td><td>27.55</td><td>29.60</td></tr><tr><td>3-shot</td><td>53.10</td><td>57.53</td><td>60.21</td></tr><tr><td>Finetune</td><td>74.78</td><td>75.41</td><td>75.37</td></tr></table>
|
| 404 |
+
|
| 405 |
+
# B. Additional Model Discussion
|
| 406 |
+
|
| 407 |
+
# B.1. Why Does the General Model Need Specialization?
|
| 408 |
+
|
| 409 |
+
It is challenging for a single graph model to handle tasks across various domains due to pattern conflicts, where the same structural pattern can have different meanings in different domains. To illustrate this issue, we provide an intuitive example2. Consider a pretraining process involving datasets from multiple domains, such as social networks, molecular networks, academic networks, and knowledge graphs. Suppose the model learns triangle structures during pretraining. In social networks, the semantic meaning of these triangles is stable, following the principle of “the friend of my friend is my friend”. However, in molecular graphs, the meaning of triangle patterns may be unstable due to chemical properties. This pattern conflict can significantly degrade the performance of graph models (Cao et al., 2023; Mao et al., 2024). Specialization helps resolve this issue by aligning the meanings of certain structural patterns with the semantics specific to the target domain.
|
| 410 |
+
|
| 411 |
+
# B.2. More Analysis on Domain Regularizer
|
| 412 |
+
|
| 413 |
+
The Necessity of Domain Alignment. Datasets from multiple domains are often projected into different subspaces, potentially due to misalignment of node attributes (Chen et al., 2024b) and the frequent patterns across domains. As a result, the model may “memorize” information specific to each domain rather than learning transferable patterns. This can lead to misunderstandings when the same pattern appeared across different graphs is projected into different subspaces. Consequently, the model struggles to acquire transferable knowledge that would benefit unseen tasks and specialized domains. Properly aligning the embedding spaces of different domains is crucial for obtaining transferable knowledge and improving performance on unseen graphs and specialized domains.
|
| 414 |
+
|
| 415 |
+
How to Regulate Domain Distances? We propose a domain regularizer to control domain distances by projecting crossdomain graphs with different characteristics into a shared embedding space. Specifically, we define a shared subspace across domains and pull the subspaces of other domains into alignment with this defined space. The shared subspace should be positioned at the center of the cross-domain datasets to minimize the effort required to adjust the subspaces of all domains. In particular, the basis vector of the shared subspace is defined as the average of all instances:
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\boldsymbol {h} _ {\text {B a s i s}} = \mathbb {E} _ {D \sim P (\mathcal {D})} \mathbb {E} _ {\mathcal {T} _ {i} \sim P \left(\mathcal {T} _ {D}\right)} \phi \left(T _ {i}\right), \tag {9}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
where $P ( \mathcal D )$ represents the domain distribution, $\mathcal { T } _ { D }$ is a distribution of task-trees within domain $D$ , and $\phi ( T _ { i } )$ is the embedding of the task-tree $T _ { i }$ . Given the shared subspace basis, we optimize the KL divergence between each instance and the basis. However, obtaining the global basis vector $h _ { B a s i s }$ directly is impractical due to dataset size, so we approximate it by averaging the embeddings of all instances within a batch to compute the local basis $\hat { h } _ { B a s i s }$ . We then optimize the KL divergence for all instances in the batch. To mitigate randomness, we empirically use a relatively large batch size (4,096). Formally, the domain regularizer is defined as
|
| 422 |
+
|
| 423 |
+
$$
|
| 424 |
+
\mathcal {L} _ {\text {a l i g n}} = \lambda \cdot \frac {1}{| \mathcal {B} |} \sum_ {i \in \mathcal {B}} \mathrm {K L} (H \| Z _ {i}) = - \lambda \cdot \frac {1}{| \mathcal {B} |} \sum_ {i \in \mathcal {B}} \sum_ {j} H (j) \log \left(\frac {H (j)}{Z _ {i} (j)}\right), \tag {10}
|
| 425 |
+
$$
|
| 426 |
+
|
| 427 |
+
where $\boldsymbol { B }$ denotes the batch, and $H$ and $Z _ { i }$ represent the distributions of the local basis vector $\hat { h } _ { B a s i s }$ and instance embedding $z _ { i }$ , respectively.
|
| 428 |
+
|
| 429 |
+
How the Domain Regularizer Works? To better understand how the domain regularizer functions, we conduct an analysis to demonstrate its benefits in regulating domain distances while preserving task structures for each dataset. We use eight datasets provided by Liu et al. (2024a) for pretraining: Cora, Pubmed, Arxiv, WikiCS, WN18RR, FB15K237, CHEMHIV, and CHEMPCBA. The analysis results are presented in Figure 5.
|
| 430 |
+
|
| 431 |
+
In the figure, we display (a) a heatmap of similarity between different datasets with varying weights, and visualizations of the embedding space before (b) and after (c) applying the domain regularizer. The results show that the domain regularizer effectively adjusts the distances between datasets by pushing apart overly similar graphs and bringing closer those that are too distinct. Furthermore, we show that the regularizer does not significantly alter the task structures of each dataset, as illustrated in subfigure (d). In this subfigure, we apply $k$ -means algorithm on each dataset, setting $k$ to the number of classes, and compare to the ground-truth by using NMI as the metric. The assumption is that if two sets of vectors yield similar clustering results, the classification outcomes of the same classifier will be similar, indicating that the task structure across the two sets is consistent. The results demonstrate that changing the regularizer weight does not significantly affect task structures. This may be because the regularizer acts by translating vectors toward a central point without altering the relationships between individual pairs of vectors. To further evaluate the impact of domain regularizer for the downstream tasks, we present the model performance average over the used eight datasets across all settings in Table 7. We observe the use of domain regularizer can boost the model performance, especially in in-context and zero-shot settings. In addition, we empirically find that $\lambda = 1 0$ can lead to better performance. Thus, we set $\lambda = 1 0$ as the default weight in this paper.
|
| 432 |
+
|
| 433 |
+
# B.3. Discussion on Homophily and Heterophily
|
| 434 |
+
|
| 435 |
+
In node-level tasks, it is important to consider both graph homophily and heterophily (Ma et al., 2022). Homophily describes the close relationships between connected entities, while heterophily refers to distant relationships between connected entities. Empirically, basic message-passing GNNs tend to perform well on homophily graphs but struggle with heterophily graphs (Luan et al., 2022). Despite using GraphSAGE as the backbone in our GIT, it still performs well on heterophily graphs, such as Children and Ratings3. The experimental results for node classification and link prediction on these two graphs are presented in Table 17 and Table 18, where GIT generally achieves the best performance. We hypothesize that the proposed task-tree structure captures not only homophily relationships but also heterophily relationships. A potential question is whether our message-passing GNN can effectively capture these heterophily relationships, despite Ma et al. (2022) suggesting that basic GNNs may handle heterophily graphs by memorizing the patterns between the target node and its neighbors. We plan to use more advanced GNNs capable of encoding heterophily structures to further validate our hypothesis.
|
| 436 |
+
|
| 437 |
+
# B.4. Discussion on Model Expressiveness
|
| 438 |
+
|
| 439 |
+
Node-level Task. The task-tree structure is an approximation of the original graph structure, but converting graphs into tree structures inevitably results in some loss of information. To better preserve the structural details of the original graph, one could use more expressive or advanced GNNs, thereby expanding the potential tree vocabulary (Mao et al., 2024).
|
| 440 |
+
|
| 441 |
+
Edge-level Task. Existing message-passing GNNs struggle with the edge isomorphism problem (Srinivasan & Ribeiro, 2020). For instance, in Figure 6, the links $( v _ { 1 } , v _ { 2 } )$ and $( v _ { 3 } , v _ { 4 } )$ are isomorphic, while $( v _ { 1 } , v _ { 2 } )$ and $( v _ { 1 } , v _ { 3 } )$ are not. However, when using a mean aggregator to learn edge embeddings, the embeddings of $( v _ { 1 } , v _ { 2 } )$ and $( v _ { 1 } , v _ { 3 } )$ become indistinguishable. We consider that GIT may still encounter this issue, as the task-tree encoding currently averages the embeddings of taskrelevant nodes. Addressing this challenge could involve techniques like Zhang et al. (2021), which ensure that isomorphic edges have distinct embeddings without impairing the model’s basic inductive learning capabilities.
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 6: Edge Isomorphic (Figure 1, (Zhang et al., 2021)).
|
| 445 |
+
|
| 446 |
+
Graph-level Task. Message-passing GNNs are limited by the 1-WL test (Xu et al., 2019), which can restrict their performance on graph-level tasks. As we apply GraphSAGE as the backbone, our GIT also encounters this limitation. Zhang et al. (2024a) analyze the ability of different GNNs to detect graph substructures and conclude that more expressive GNNs, beyond the 1-WL test, can learn graph embeddings with richer information. Therefore, to improve model expressiveness, one can employ more expressive GNNs in our GIT. Additionally, techniques like Zhang et al. (2021) can be used to further enhance the model’s discriminative capabilities.
|
| 447 |
+
|
| 448 |
+
# B.5. Scaling Law
|
| 449 |
+
|
| 450 |
+
Model Size. We evaluated the model’s performance with different hidden dimensions, with results by domain presented in Figure 7. The results cover both basic fine-tuning and in-context learning, and comprehensive details are provided in Appendix K. We observe that increasing the number of hidden dimensions from 128 to 2,048 significantly improves model performance across all domains. We hypothesize that this improvement is due to the additional parameters, which enhance the model’s ability to memorize shared patterns across graphs. The observation indicates the potential existence of scaling laws when using task-trees as the basic learning instances.
|
| 451 |
+
|
| 452 |
+

|
| 453 |
+
(a) In-context Learning
|
| 454 |
+
|
| 455 |
+

|
| 456 |
+
(b) Finetune
|
| 457 |
+
Figure 7: The impact of model sizes on performance.
|
| 458 |
+
|
| 459 |
+
Data Size. We attempted to evaluate the scaling law by increasing the pretraining data, but unfortunately, we did not
|
| 460 |
+
|
| 461 |
+
observe a clear trend where more data led to better performance. We consider there are three potential reasons. (1) From a model perspective, we use a GraphSAGE encoder with limited layers and parameters, which may not fully capture the knowledge contained in the pretraining data. Additionally, we apply basic mean pooling to derive task-tree embeddings from task-relevant node embeddings, which may prevent the model from identifying the relative importance of task-relevant nodes, thereby limiting its expressiveness. (2) From a training paradigm perspective, we employ a negative-free contrastive learning framework similar to Thakoor et al. (2022), but this basic approach may not be expressive enough to extract meaningful knowledge from the pretraining graphs. (3) From a data perspective, despite using over 30 graphs in this study, the number of instances is still significantly lower than that of textual or visual instances extracted from the Internet. Furthermore, the pretraining datasets may not be well-aligned. Although we used a textual encoder to align node features, we cannot guarantee that the encoded node features are in the same embedding space (Chen et al., 2024b).
|
| 462 |
+
|
| 463 |
+
# C. Potential Model Extensions
|
| 464 |
+
|
| 465 |
+
# C.1. Pretraining
|
| 466 |
+
|
| 467 |
+
How to Design Reconstruction Tasks? Theorem 3.5 suggests that a well-designed encoder, capable of effectively handling reconstruction tasks during pretraining, can improve the model’s generalization ability. One approach is to use more powerful encoders to enhance reconstruction performance. Another approach is to introduce additional reconstruction losses to further refine the encoder. For example, methods such as those proposed by Qiu et al. (2020), and Hou et al. (2022), Ju et al. (2023b), and Wen et al. (2024), or designing more comprehensive reconstruction objectives could be explored.
|
| 468 |
+
|
| 469 |
+
How to Improve Transferability? The pretraining task, i.e., task-tree reconstruction, differs from the downstream task of task-tree classification, as the task heterogeneity may hinder model transferability (Hu et al., 2020). To mitigate this, one could develop more effective adaptation methods, such as graph prompt learning (Sun et al., 2022), to reduce task heterogeneity.
|
| 470 |
+
|
| 471 |
+
# C.2. Specialization via Instruction Tuning
|
| 472 |
+
|
| 473 |
+
How to Define Instructions? In this paper, as we focus on experiments with text-attributed graphs, we define instructions as label descriptions encoded by LLMs. However, this approach is not applicable to non-textual graphs. Other methods could be explored to define instructions, such as using proxy models (Hu et al., 2019) or graph heuristics (Jin et al., 2020) to generate instructions.
|
| 474 |
+
|
| 475 |
+
How to Choose SFT Data? We manually select graphs as supervised fine-tuning datasets for each domain, though the selected graphs may not be fully representative. Unlike textual data, evaluating the quality of graph datasets poses a challenge. Improved dataset selection methods could enhance the SFT process by identifying more representative or diverse data from graph databases. Additionally, while we perform instruction tuning over entire graphs, it is possible that only specific subgraphs are beneficial (Hashemi et al., 2024). Developing data selection methods that focus on high-quality subgraphs within a single SFT dataset could improve task-tree selection. Another worthy research line is to select SFT data that aligns with user preferences (Song et al., 2024).
|
| 476 |
+
|
| 477 |
+
How to Leverage SFT Data? In scenarios with limited instructions, standard supervised fine-tuning may struggle to capture sufficient knowledge of the target domain. To address this, methods could be proposed to better utilize the unlabeled instances in the SFT dataset, thus enhancing model adaptation (Sohn et al., 2020; Ni et al., 2025).
|
| 478 |
+
|
| 479 |
+
How to Maintain General Inference Capability? While instruction tuning specializes the model for a specific domain, it may compromise the model’s general inference capabilities across other domains. This could hinder the model’s performance when it needs to function both as a domain expert and a general reasoner. To mitigate this, regularization techniques could be designed to preserve the general knowledge encoded in the model during the instruction tuning process.
|
| 480 |
+
|
| 481 |
+
Why SFT Works on Graphs? Instruction tuning is a common post-training process in modern large language models (e.g., LLAMA, GPT) that significantly improves instruction-following capabilities. The success of this method in LLMs may stem from the fact that natural language serves as an interface between humans and models (Wei et al., 2021). However, the reason instruction tuning works for graphs remains an open question and presents a potential direction for future research.
|
| 482 |
+
|
| 483 |
+
# C.3. More Scenarios.
|
| 484 |
+
|
| 485 |
+
The paper leverages text-attributed graphs to align node features. However, the pre-processing of TAGs can be timeconsuming, raising the challenge of how to effectively apply the model to graphs without aligned node features. Furthermore, while we primarily focus on homogeneous graphs in this work, most real-world applications involve heterogeneous graphs. Addressing the question of how to design a single model capable of handling various types of graphs remains an open challenge. Finally, applying the model to specific applications Zhang et al. (2024c), which may exhibit unique characteristics, is another important consideration for future research.
|
| 486 |
+
|
| 487 |
+
# D. Proof
|
| 488 |
+
|
| 489 |
+
# D.1. Proof of Theorem 3.1
|
| 490 |
+
|
| 491 |
+
Proof. We begin by introducing the basic GNN architecture used in the proof. Given a GNN encoder $\phi ( \cdot )$ with parameters $\pmb { W } = ( \pmb { W } _ { 1 } , \pmb { W } _ { 2 } )$ , we use a GraphSAGE-like architecture, defined as follows (with some notation abuse):
|
| 492 |
+
|
| 493 |
+
$$
|
| 494 |
+
\boldsymbol {z} _ {i} = \phi (T _ {i} ^ {L}) = \sigma \Big (\boldsymbol {W} _ {1} \boldsymbol {x} _ {i} + \boldsymbol {W} _ {2} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k \in \mathcal {N} _ {i}} \phi (T _ {k} ^ {L - 1}) \Big),
|
| 495 |
+
$$
|
| 496 |
+
|
| 497 |
+
where $\sigma$ is the non-linear activation function, $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { i } }$ is the node feature of node $i$ , and ${ \mathcal { N } } _ { i }$ represents the neighbors of node $i$ , corresponding to its children in the computation tree. $T _ { i } ^ { L }$ denotes the computation tree of node $i$ with $L$ layers. Neighborhood information is incorporated by averaging the embeddings of neighboring nodes. WLOG, the averaging operation can be replaced with any permutation-invariant set operation without affecting the analysis in this paper. For simplicity, we assume all GNN layers share the same parameters; this assumption does not affect the validity of our proofs. Since these functions and neural networks exhibit Lipschitz continuity, we denote the Lipschitz constant of $\sigma ( \cdot )$ as $\scriptstyle { \mathcal { C } } _ { \sigma }$ . Additionally, we assume the norm of node features is bounded by $\| { \pmb x } \| \leq B _ { { \pmb x } }$ , and the model weights by $\| \boldsymbol { W } _ { 1 } \| \le \boldsymbol { B } _ { W _ { 1 } }$ and $\| \boldsymbol { W } _ { 2 } \| \le \boldsymbol { B } _ { W _ { 2 } }$ . While real-world graphs typically exhibit varied node features, standard techniques (as employed in this paper) like normalization can ensure that $B _ { x }$ remains a small value. We define the distance between task-trees $T _ { 1 } ^ { t }$ with $n$ task-relevant nodes $\{ v _ { 1 } , . . . , v _ { n } \}$ and $T _ { 2 } ^ { t }$ with $m$ task-relevant nodes $\{ v _ { 1 } , . . . , v _ { m } \}$ as:
|
| 498 |
+
|
| 499 |
+
$$
|
| 500 |
+
\Delta := \left\| \phi (T _ {1} ^ {t}) - \phi (T _ {2} ^ {t}) \right\| = \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \phi (T _ {i}) - \frac {1}{m} \sum_ {j = 1} ^ {m} \phi (T _ {j}) \right\|,
|
| 501 |
+
$$
|
| 502 |
+
|
| 503 |
+
where $\| \cdot \|$ is the L2 distance. Following, we expand the stability term $\Delta$ as:
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
\begin{array}{l} \Delta = \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \phi (T _ {i}) - \frac {1}{m} \sum_ {j = 1} ^ {m} \phi (T _ {j}) \right\| \\ = \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \sigma \Big (\pmb {W} _ {1} \pmb {x} _ {i} + \pmb {W} _ {2} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k \in \mathcal {N} _ {i}} \phi (T _ {k} ^ {L - 1}) \Big) - \frac {1}{m} \sum_ {j = 1} ^ {m} \sigma \Big (\pmb {W} _ {1} \pmb {x} _ {j} + \pmb {W} _ {2} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k \in \mathcal {N} _ {j}} \phi (T _ {k} ^ {L - 1}) \Big) \right\| \\ \leq \mathcal {C} _ {\sigma} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \Big (\boldsymbol {W} _ {1} \boldsymbol {x} _ {i} + \boldsymbol {W} _ {2} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k \in \mathcal {N} _ {i}} \phi (T _ {k} ^ {L - 1}) \Big) - \frac {1}{m} \sum_ {j = 1} ^ {m} \Big (\boldsymbol {W} _ {1} \boldsymbol {x} _ {j} + \boldsymbol {W} _ {2} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k \in \mathcal {N} _ {j}} \phi (T _ {k} ^ {L - 1}) \Big) \right\| \\ \leq \underbrace {\mathcal {C} _ {\sigma} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \boldsymbol {W} _ {1} \boldsymbol {x} _ {i} - \frac {1}{m} \sum_ {j = 1} ^ {m} \boldsymbol {W} _ {1} \boldsymbol {x} _ {j} \right\|} _ {(a)} \\ + \underbrace {\mathcal {C} _ {\sigma} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \boldsymbol {W} _ {2} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k \in \mathcal {N} _ {i}} \phi (T _ {k} ^ {L - 1}) - \frac {1}{m} \sum_ {j = 1} ^ {m} \boldsymbol {W} _ {2} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k \in \mathcal {N} _ {j}} \phi (T _ {k} ^ {L - 1}) \right\|} _ {(b)}. \\ \end{array}
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
Then, we separately analyze the term (a) and term (b). The term (a) can be bounded as follows:
|
| 510 |
+
|
| 511 |
+
$$
|
| 512 |
+
\text {T e r m} (\mathrm {a}) = \mathcal {C} _ {\sigma} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \boldsymbol {W} _ {1} \boldsymbol {x} _ {i} - \frac {1}{m} \sum_ {j = 1} ^ {m} \boldsymbol {W} _ {1} \boldsymbol {x} _ {j} \right\| \leq \mathcal {C} _ {\sigma} \mathcal {B} _ {\boldsymbol {W} _ {1}} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \boldsymbol {x} _ {i} - \frac {1}{m} \sum_ {j = 1} ^ {m} \boldsymbol {x} _ {j} \right\|.
|
| 513 |
+
$$
|
| 514 |
+
|
| 515 |
+
That is, term (a) is bounded by the distance between the average features of nodes in the first layer of the task-trees (i.e., the nodes directly connected to the root). Next, we bound term (b):
|
| 516 |
+
|
| 517 |
+
$$
|
| 518 |
+
\begin{array}{l} \text {T e r m} (\mathrm {b}) = \mathcal {C} _ {\sigma} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \boldsymbol {W} _ {2} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k 1 \in \mathcal {N} _ {i}} \phi \left(T _ {k 1} ^ {L - 1}\right) - \frac {1}{m} \sum_ {j = 1} ^ {m} \boldsymbol {W} _ {2} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k 2 \in \mathcal {N} _ {j}} \phi \left(T _ {k 2} ^ {L - 1}\right) \right\| \\ \leq \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {2}} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k 1 \in \mathcal {N} _ {i}} \phi \left(T _ {k 1} ^ {L - 1}\right) - \frac {1}{m} \sum_ {j = 1} ^ {m} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k 2 \in \mathcal {N} _ {j}} \phi \left(T _ {k 2} ^ {L - 1}\right) \right\| \\ = \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {2}} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k 1 \in \mathcal {N} _ {i}} \sigma \left(\mathbf {W} _ {1} \mathbf {x} _ {k 1} + \mathbf {W} _ {2} \frac {1}{| \mathcal {N} _ {k 1} |} \sum_ {s 1 \in \mathcal {N} _ {k 1}} \phi \left(T _ {s 1} ^ {L - 2}\right)\right) \right. \\ \left. - \frac {1}{m} \sum_ {j = 1} ^ {m} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k 2 \in \mathcal {N} _ {j}} \sigma \left(\boldsymbol {W} _ {1} \boldsymbol {x} _ {k 2} + \boldsymbol {W} _ {2} \frac {1}{| \mathcal {N} _ {k 2} |} \sum_ {s 2 \in \mathcal {N} _ {k 2}} \phi \left(T _ {s 2} ^ {L - 2}\right)\right) \right\| \\ \leq \underbrace {\mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {2}} \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {1}} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k 1 \in \mathcal {N} _ {i}} \boldsymbol {x} _ {k 1} - \frac {1}{m} \sum_ {j = 1} ^ {m} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k 2 \in \mathcal {N} _ {j}} \boldsymbol {x} _ {k 2} \right\|} _ {(c)} \\ + \underbrace {\mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {2}} \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {2}} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k 1 \in \mathcal {N} _ {i}} \frac {1}{| \mathcal {N} _ {k 1} |} \sum_ {s 1 \in \mathcal {N} _ {k 1}} \phi \left(T _ {s 1} ^ {L - 2}\right) - \frac {1}{m} \sum_ {j = 1} ^ {m} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k 2 \in \mathcal {N} _ {j}} \frac {1}{| \mathcal {N} _ {k 2} |} \sum_ {s 2 \in \mathcal {N} _ {k 2}} \phi \left(T _ {s 2} ^ {L - 2}\right) \right\| .} _ {(d)} \\ \end{array}
|
| 519 |
+
$$
|
| 520 |
+
|
| 521 |
+
Term (c) describes the distance between the average features of nodes in the second layer of the task-trees, while term (d) follows a recursive formula, similar to term (b). By combining terms (a) and (b), we have:
|
| 522 |
+
|
| 523 |
+
$$
|
| 524 |
+
\begin{array}{l} \Delta \leq \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {1}} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \mathbf {x} _ {i} - \frac {1}{m} \sum_ {j = 1} ^ {m} \mathbf {x} _ {j} \right\| \\ + \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {2}} \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {1}} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k 1 \in \mathcal {N} _ {i}} \boldsymbol {x} _ {k 1} - \frac {1}{m} \sum_ {j = 1} ^ {m} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k 2 \in \mathcal {N} _ {j}} \boldsymbol {x} _ {k 2} \right\| \\ + \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {2}} \mathcal {C} _ {\sigma} \mathcal {B} _ {\mathbf {W} _ {2}} \left\| \frac {1}{n} \sum_ {i = 1} ^ {n} \frac {1}{| \mathcal {N} _ {i} |} \sum_ {k 1 \in \mathcal {N} _ {i}} \frac {1}{| \mathcal {N} _ {k 1} |} \sum_ {s 1 \in \mathcal {N} _ {k 1}} \phi \left(T _ {s 1} ^ {L - 2}\right) - \frac {1}{m} \sum_ {j = 1} ^ {m} \frac {1}{| \mathcal {N} _ {j} |} \sum_ {k 2 \in \mathcal {N} _ {j}} \frac {1}{| \mathcal {N} _ {k 2} |} \sum_ {s 2 \in \mathcal {N} _ {k 2}} \phi \left(T _ {s 2} ^ {L - 2}\right) \right\|. \\ \end{array}
|
| 525 |
+
$$
|
| 526 |
+
|
| 527 |
+
We can extend the formula recursively through all layers until the final layer. The recursive nature of the formula allows us to more easily reformulate the bound:
|
| 528 |
+
|
| 529 |
+
$$
|
| 530 |
+
\Delta \leq \mathcal {C} _ {1} \Delta_ {1} + \mathcal {C} _ {2} \Delta_ {2} + \dots + \mathcal {C} _ {L - 1} \Delta_ {L - 1}, \tag {11}
|
| 531 |
+
$$
|
| 532 |
+
|
| 533 |
+
where $\Delta _ { l }$ denotes the distance between task-trees at the $l$ -th layer. For clarity, we can interpret $\mathcal { C } _ { 1 } \Delta _ { 1 }$ as corresponding to Term (a) and $\mathcal { C } _ { 2 } \Delta _ { 2 }$ as corresponding to Term (c). Next, we explain how to determine $\mathcal { C } _ { l }$ and $\Delta _ { l }$ for each layer.
|
| 534 |
+
|
| 535 |
+
By analyzing the recursive formula, we determine $\mathcal { C } _ { l }$ as follows:
|
| 536 |
+
|
| 537 |
+
$$
|
| 538 |
+
\left\{ \begin{array}{l l} \mathcal {C} _ {1} & = \mathcal {C} _ {\sigma} \mathcal {B} _ {\boldsymbol {W} _ {1}}, \\ \mathcal {C} _ {2} & = \mathcal {C} _ {\sigma} \mathcal {B} _ {\boldsymbol {W} _ {2}} \times \mathcal {C} _ {\sigma} \mathcal {B} _ {\boldsymbol {W} _ {1}}, \\ \dots \\ \mathcal {C} _ {l} & = (\mathcal {C} _ {\sigma} \mathcal {B} _ {\boldsymbol {W} _ {2}}) ^ {l} \times \mathcal {C} _ {\sigma} \mathcal {B} _ {\boldsymbol {W} _ {1}}. \end{array} \right.
|
| 539 |
+
$$
|
| 540 |
+
|
| 541 |
+
|
| 542 |
+
|
| 543 |
+
<!-- [chunk 2/2 failed] -->
|
| 544 |
+
|
paper_markdowns/bamboo-04995.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-05040.md
ADDED
|
@@ -0,0 +1,487 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Understanding the Skill Gap in Recurrent Language Models: The Role of the Gather-and-Aggregate Mechanism
|
| 2 |
+
|
| 3 |
+
Aviv Bick
|
| 4 |
+
|
| 5 |
+
Carnegie Mellon University abick@cs.cmu.edu
|
| 6 |
+
|
| 7 |
+
Eric P. Xing
|
| 8 |
+
|
| 9 |
+
Carnegie Mellon University MBZUAI
|
| 10 |
+
|
| 11 |
+
Albert Gu
|
| 12 |
+
|
| 13 |
+
Carnegie Mellon University Cartesia.ai
|
| 14 |
+
|
| 15 |
+
# Abstract
|
| 16 |
+
|
| 17 |
+
State-space models (SSMs) offer efficient alternatives to Transformers for long sequences, but their fixed-size recurrent state limits capability on algorithmic tasks, such as retrieving past context. In this work, we examine how in-context retrieval operates in Transformer- and SSM-based language models and find that both rely on a similar Gather-and-Aggregate (G&A) mechanism: a Gather Head extracts relevant information pieces from context, which an Aggregate Head integrates into a single representation. In both architectures, G&A concentrates in a few heads, forming critical bottlenecks even for simple retrieval. For example, we show that disabling a single Gather or Aggregate Head in a pruned Llama-3.1-8B impairs retrieving the correct answer letter in MMLU, reducing its accuracy from $66 \%$ to $2 5 \%$ (random guessing). Moreover, this retrieval bottleneck can obscure limited knowledge demands of tasks as the pruned model succeeds on MMLU with functioning G&A heads yet fails on other knowledge benchmarks. The bottleneck similarly extends to tasks where SSMs typically underperform, such as GSM8K, BBH, and dialogue comprehension. We show that SSMs’ retrieval challenges manifest in these heads, creating smoother attention patterns instead of the sharp token transitions effective G&A requires. Thus, the Transformer-SSM retrieval gap exists in just a few heads, rather than the entire language model. This suggests a unified explanation for Transformer vs. SSM performance gap while showing how to merge their strengths. We find that pretrained hybrid models, where SSMs are combined with a few attention layers, delegate the role of Aggregate Heads to attention. Similarly, replacing a single G&A head in a pretrained SSM with an attention variant boosts retrieval and benchmark scores. Experiments are publicly available.1
|
| 18 |
+
|
| 19 |
+
# 1 Introduction
|
| 20 |
+
|
| 21 |
+
Transformers have driven major breakthroughs in language modeling, but their quadratic scaling with sequence length has renewed interest in recurrent alternatives like state-space models (SSMs). SSMs offer linear scaling with a fixed-size memory while remaining competitive across many tasks. However, replacing a large, explicit history cache with a compact state representation poses a fundamental tradeoff. SSM-based language models often struggle with the skill of “in-context retrieval”—the ability to precisely locate and extract tokens presented earlier in the sequence, such as recalling a phone number mentioned several paragraphs ago [Jelassi et al., 2024]. This “algorithmic” challenge, which Transformers handle effectively with direct access to past tokens, has been identified as a key factor in the performance gap between Transformer models and SSM variants [Arora et al., 2023].
|
| 22 |
+
|
| 23 |
+
Previous work on SSM retrieval limitations has treated language models as black boxes or focused on simplified theoretical setups [Wen et al., 2024, Jelassi et al., 2024]. Meanwhile, Transformer research shows that algorithmic capabilities, including retrieval, often concentrate in specific attention heads [Lieberum et al., 2023, Wu et al., 2024]. This raises a key question: Can the Transformer-SSM performance gap be traced to algorithmic capabilities in a few specific heads? Clarifying this will enable a more targeted comparison of the two architectures, helping determine whether SSMs can serve as viable building blocks for language modeling or require fundamental modifications.
|
| 24 |
+
|
| 25 |
+
The MMLU benchmark [Hendrycks et al., 2021] exemplifies this performance gap. While SSMs match Transformers on many knowledge benchmarks, they significantly underperform on MMLU unless trained substantially longer [Waleffe et al., 2024]. This gap stems from MMLU’s evaluation format: rather than scoring the likelihood of full-text answers,
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
(a) Gather Head
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
is the central node of 802.11 wireless operations.\n
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
(b) Aggregate Head
|
| 37 |
+
Figure 1: An illustration of Gather Head (left matrix) at L16H22 and Aggregate Head (right matrix) at L17H24 of Llama-3.1-8B for a multiple-choice question. The Gather Head identifies critical segments and summarizes each segment to its last token $" \mathrm { \Phi } \mathrm { \Phi } \backslash \ \mathrm { n } ^ { \prime \prime }$ as shown in Figure 1(a), condensing key information into the residual stream. The Aggregate Head then combines these summaries as illustrated in Figure 1(b), giving a significantly higher score to the second “\n,” which corresponds to the correct answer (B).
|
| 38 |
+
|
| 39 |
+
models must select letter labels (A, B, C, or D) corresponding to the correct option. This creates a dual challenge requiring both factual knowledge and retrieval capabilities [Lieberum et al., 2023].
|
| 40 |
+
|
| 41 |
+
To isolate these distinct challenges, we show that both architectures have a clear division of labor: factual knowledge extracted across layers and heads, but only a small number of specialized heads retrieve the correct labels from input context. This becomes particularly evident in our experiments where a 4B-parameter pruned Llama-3.1-8B achieves a strong MMLU score of $66 \%$ , which plummets to $2 5 \%$ when disabling a single retrieval head. Moreover, these heads obscure the true knowledge demands of such tasks—despite strong MMLU performance, the pruned model performs poorly on knowledge-focused benchmarks. Similar dependence extends beyond MMLU to mathematical reasoning (GSM8K), multi-step logical reasoning (BBH), and dialogue formats (ARC-C Chat), demonstrating that retrieval capabilities, not knowledge deficits, drive SSM underperformance in these domains.
|
| 42 |
+
|
| 43 |
+
To understand how these specialized heads function, we investigate their underlying mechanism. We find that both Transformer- and SSM-based language models converge on a similar retrieval framework: a Gather-and-Aggregate (G&A) mechanism. Specifically, a Gather Head identifies and condenses segments of input tokens into a single vector representation (Figure 1(a)), which an Aggregate Head subsequently processes to extract the necessary information (Figure 1(b)). This finding indicates that the two language models rely on similar retrieval strategies, despite architectural differences. Consequently, their retrieval gap reduces to the effectiveness with which a few specific heads implement the G&A mechanism.
|
| 44 |
+
|
| 45 |
+
Comparing G&A implementations, we find SSMs’ known retrieval challenges manifest in how key heads implement G&A. SSMs exhibit smoother attention patterns, making sharp token shifts difficult and requiring more heads to achieve comparable performance. Moreover, we show how hybrid models [Glorioso et al., 2024, Lieber et al., 2024], which integrate a few attention layers into predominantly SSM-based architectures, overcome SSM’s limitations. When trained from scratch, hybrid models naturally delegate Aggregate Head functionality to attention layers. Conversely, in
|
| 46 |
+
|
| 47 |
+
pretrained SSM models, replacing a single G&A instance with an attention-based one yields a significantly greater MMLU improvement than any other attention placement. While attention appears better suited for G&A, the results also highlight the mechanism’s concentrated nature, suggesting that efficient architectures can store past tokens in fewer components.
|
| 48 |
+
|
| 49 |
+
Overall, our contributions are as follows.
|
| 50 |
+
|
| 51 |
+
1. Gather-and-Aggregate (G&A) Retrieval Framework. We formalize a unified mechanism—comprising Gather Heads and Aggregate Heads—that enables in-context retrieval, extending previous work by Lieberum et al. [2023], Wu et al. [2024] from Transformers to SSMs. Our analysis reveals that G&A functionality is highly concentrated in SSMs as well, with just a few heads among thousands performing this function. Furthermore, we demonstrate that SSMs’ inherent retrieval limitations significantly impair their ability to implement G&A as effectively as Transformers.
|
| 52 |
+
2. Empirical Analysis of G&A across Benchmarks. We analyze Transformers, SSMs, and hybrid architectures, showing that a small set of G&A heads critically drives performance on retrieval-heavy benchmarks such as GSM8K, BBH, and dialogue comprehension. This pattern is especially evident in MMLU, where we show that the difficulty stems more from in-context retrieval than from knowledge: models can succeed on MMLU despite struggling elsewhere, yet fail completely without functional G&A heads. These results suggest the Transformer–SSM gap stems from algorithmic limits in a few specific heads, not broad modeling deficiencies.
|
| 53 |
+
3. Understanding the Effectiveness of Hybrid Models: Hybrid models address the G&A limitations of SSMs by offloading Aggregate Head functionality to attention layers. When trained from scratch, attention heads often emerge near the middle of the network, suggesting a natural fit for aggregation. In pretrained SSMs, replacing a single G&A head with attention significantly improves performance, highlighting effective placement for such hybrids.
|
| 54 |
+
|
| 55 |
+
# 2 Related Work
|
| 56 |
+
|
| 57 |
+
Sequence Models. Transformer-based models with self-attention [Vaswani et al., 2023, Brown et al., 2020, Touvron et al., 2023] dominate language modeling for their scalability and performance. Recently, recurrent models like structured state-space models (SSMs) [Gu et al., 2022, Gu and Dao, 2023, Dao and Gu, 2024] gained interest for their sub-quadratic efficiency and competitive results on long sequences. Other recurrent models include [Dao et al., 2022, Sun et al., 2023, Katharopoulos et al., 2020, Yang et al., 2024a, Zhang et al., 2024b, Beck et al., 2024, Qin et al., 2024, Peng et al., 2024, Yang et al., 2024b]. We use ”SSM” to refer to these models as well, since our findings broadly apply to them.
|
| 58 |
+
|
| 59 |
+
Despite SSMs’ efficiency, they struggle with tasks requiring precise token interactions, such as in-context retrieval. Their fixed-size hidden state limits memory capacity, making it difficult to retain detailed past information. To address these limitations, recent work [Lieber et al., 2024, Glorioso et al., 2024, Waleffe et al., 2024, Ren et al., 2024, Wang et al., 2024a, Paliotta et al., 2025] has adopted a hybrid approach, integrating attention layers with a majority of SSM layers, trading efficiency for improved capabilities such as retrieval.
|
| 60 |
+
|
| 61 |
+
Throughout this study, we examine four architectures: Llama-3.1-8B-Instruct [Touvron et al., 2023], a standard Transformer; Falcon-Mamba-7B-Instruct [Zuo et al., 2024], a Mamba-1 SSM without MLP layers; Llamba-8B-Untied [Bick et al., 2025], a Mamba-2 SSM distilled from Llama-3.1-8B using MOHAWK [Bick et al., 2024]; and Zamba-2- 7B-Instruct [Glorioso et al., 2024], a hybrid model with a 6:1 ratio of Mamba2 to attention layers and only two shared attention layers. For brevity, we refer to these as Llama-3.1-8B, Falcon-Mamba-7B, Llamba-8B, and Zamba-2-7B, respectively.
|
| 62 |
+
|
| 63 |
+
Central to understanding the performance differences between these architectures is token mixing: how models propagate and combine information across token positions. In self-attention, tokens selectively aggregate context via learned weights, while SSMs use structured recurrences with more restricted patterns. Ali et al. [2024], Dao and Gu [2024] connect SSM token mixing to attention’s matrix-multiplication form, showing Mamba-1 mimics many low-dimensional attention heads. Mamba-2 [Dao and Gu, 2024, Bick et al., 2025, Waleffe et al., 2024] uses fewer, larger heads, increasing expressivity. These insights allow us to view all sequence models as structured matrices over time. Thus, we generalize
|
| 64 |
+
|
| 65 |
+
token mixing beyond self-attention, referring to these mechanisms as Temporal Mixing Heads (or simply Mixing Heads).
|
| 66 |
+
|
| 67 |
+
Retrieval Tradeoffs Between Transformers and SSMs. SSMs rely on compressed, continuously updated hidden states, unlike Transformers, which cache full context. This structural difference impacts retrieval performance across benchmarks. Waleffe et al. [2024] found that Mamba-based models require extensive training to perform well on MMLU, while Wen et al. [2024] identified weaknesses in in-context retrieval tasks, such as associative recall. Jelassi et al. [2024] theoretically and empirically confirmed that SSMs have difficulty with precise copying. Arora et al. [2023] demonstrated that associative recall capabilities account for the majority of performance differences between attention-based and gated-convolution models. Park et al. [2024] shows that SSMs underperform on tasks requiring non-standard retrieval, and proposed a hybrid architecture to address this limitation. Arora et al. [2025b] highlighted a recall-throughput tradeoff, with attention offering stronger recall at higher cost. Blouir et al. [2025] complemented this view by enhancing retrieval in SSMs through training improvements without architectural changes. Unlike previous work, we show these limitations originate from a small subset of retrieval heads rather than the entire model.
|
| 68 |
+
|
| 69 |
+
Mechanistic Interpretability of Mixing Heads. Most interpretability studies focus on attention heads in LLMs [Elhage et al., 2021, Lieberum et al., 2023, Zhang et al., 2024a, Olsson et al., 2022, Yu et al., 2024, Merullo et al., 2024, Rai et al., 2024, Zheng et al., 2024, Wu et al., 2024, Tulchinskii et al., 2024, Sanford et al., 2024], while relatively little attention has been given to recurrent mechanisms [Ali et al., 2024]. Olsson et al. [2022] and Elhage et al. [2021] showed that induction heads emerge to support in-context learning. Subsequent work traced their training dynamics [Bietti et al., 2023], and mapped factual recall circuits [Meng et al., 2023].
|
| 70 |
+
|
| 71 |
+
Lieberum et al. [2023] identified two key heads in Chinchilla-70B—Content Gatherer and Correct Letter—that, with MLPs, support label prediction in multiple-choice tasks. Wu et al. [2024] found that fewer than $5 \%$ of heads, termed Retrieval Heads, are critical for retrieval, Chain-of-thought, and reasoning.
|
| 72 |
+
|
| 73 |
+
We refine the understanding of how heads support retrieval by showing that, in both Transformers and SSMs, retrieval arises from a coordinated mechanism—not a single head. One head identifies the target location, while another aggregates its content. This view extends prior work in three ways. First, the “Correct Letter” heads identified by Lieberum et al. [2023] exhibit broader retrieval behavior than previously reported, going beyond multiple-choice selection. Second, retrieval depends on coordinated interactions between heads, challenging the interpretation in Wu et al. [2024] that treated individual heads as independently responsible. Third, we demonstrate that this mechanism also arises in SSMs—despite their lack of attention—highlighting its architectural generality. We introduce the term Aggregate Head to better reflect these empirical findings, while retaining “Gather” as shorthand for the “Content-Gatherer” heads described Lieberum et al. [2023].
|
| 74 |
+
|
| 75 |
+
Concurrent with our work, two lines of research investigate similar mechanisms. Wiegreffe et al. [2025] extend Lieberum et al. [2023] by analyzing training dynamics and failure modes in multiple-choice tasks. They introduce synthetic setups to separate knowledge from answer formatting and study how models adapt to symbolic answer spaces. While their goals align with ours, they focus on symbolic reasoning and performance variation, whereas we study the algorithmic basis of in-context retrieval across architectures.
|
| 76 |
+
|
| 77 |
+
Arora et al. [2025a] demonstrate that Transformers achieve in-context retrieval through key–value associations, whereas SSMs rely on direct retrieval. However, we find that both Transformer- and SSM-based models develop the same G&A mechanism, rather than differing mechanistically. This apparent contradiction stems from a key difference in setup: they train and evaluate shallow models (up to three layers) on synthetic tasks, while we study pretrained language models on natural benchmarks—leading to different mechanistic conclusions. While this distinction highlights that synthetic setups may reveal mechanisms that do not generalize to broader language modeling, we believe they remain valuable for probing model expressivity, such as understanding G&A head structure across architectures.
|
| 78 |
+
|
| 79 |
+
# 3 A Case Study: Retrieval in MMLU
|
| 80 |
+
|
| 81 |
+
The MMLU benchmark [Hendrycks et al., 2021] spans 57 diverse tasks and is often viewed as a test of world knowledge. However, its multiple-choice format also demands retrieval, requiring models to map question-answer context to the
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
Figure 2: Performance of Llama-3.1-8B on knowledge tasks and MMLU as layers are gradually pruned, starting from the last. The leftmost bar shows the full 32-layer model, while subsequent bars represent pruned versions. Key observations: (1) MMLU scores stay stable despite declining knowledge tasks performance; (2) a sharp MMLU drop identifies a critical skill-encoding layer. (3) $30 \%$ of the model’s original score on knowledge tasks is sufficient to reach a state-of-the-art MMLU score.
|
| 85 |
+
|
| 86 |
+
correct letter label (A–D), as illustrated below:
|
| 87 |
+
|
| 88 |
+
is the central node of 802.11 wireless operations.
|
| 89 |
+
|
| 90 |
+
A. WPA
|
| 91 |
+
B. Access Point
|
| 92 |
+
C. WAP
|
| 93 |
+
D. Access Port
|
| 94 |
+
|
| 95 |
+
# Answer:
|
| 96 |
+
|
| 97 |
+
Despite matching Transformers performance on many knowledge benchmarks, SSMs underperform on MMLU unless trained substantially longer [Waleffe et al., 2024]. Given their known retrieval limitations [Jelassi et al., 2024], we ask whether this gap stems from a failure of knowledge or retrieval. To investigate, we analyze three representative models: Llama-3.1-8B-Instruct (Transformer), Falcon-Mamba-7B-Instruct (Mamba-1), and Llamba-8B-Untied (Mamba-2). We compare their performance on MMLU versus benchmarks that emphasize factual reasoning with minimal reliance on in-context retrieval. For clarity, we omit instructional and embedding-tying suffixes from model names in our discussion.
|
| 98 |
+
|
| 99 |
+
Our investigation reveals two key findings:
|
| 100 |
+
|
| 101 |
+
1. Models can perform well on MMLU with limited knowledge, suggesting that the task primarily reflects in-context retrieval for the evaluated models. This adds to concerns raised by prior work [Wang et al., 2024b, Zhao et al., 2024].
|
| 102 |
+
2. Both Transformer- and SSM-based models encode retrieval abilities in a small set of specialized heads, extending prior work that focused solely on Transformers [Lieberum et al., 2023, Wu et al., 2024].
|
| 103 |
+
|
| 104 |
+
These insights, combined with earlier findings about perplexity gaps between attention-based models and SSM variants [Arora et al., 2023], support our main claim: the general performance gap between Transformer- and SSM-based language models can be traced to specific algorithmic capabilities within a small subset of heads.
|
| 105 |
+
|
| 106 |
+
Our analysis proceeds bottom-up: we begin by contrasting MMLU with these knowledge-focused tasks (Section 3.1), then localize MMLU performance to a single critical layer (Section 3.2). We show coordination between two layers (Section 3.3), narrow the effect to a small set of heads (Section 3.4), and demonstrate that these implement a shared retrieval mechanism across models (Section 3.5).
|
| 107 |
+
|
| 108 |
+
# 3.1 Evaluation Benchmarks.
|
| 109 |
+
|
| 110 |
+
Throughout the paper, we evaluate performance on two categories of benchmarks: MMLU and what we term Knowledge-Focused Tasks. MMLU’s format distinctively presents multiple-choice questions, requiring models to process lengthy contexts, then identify the correct option by outputting the corresponding letter label (A, B, C, or D). While MMLU is widely used, studies have noted that strong performance may not reflect true understanding or knowledge [Alzahrani et al., 2024, Wang et al., 2024b, Zhao et al., 2024].
|
| 111 |
+
|
| 112 |
+

|
| 113 |
+
Figure 3: Performance of Llama-3.1-8B-Minimal with layers removed and restored. We remove one layer at a time, evaluate performance on MMLU and knowledge tasks’ score, and then restore the layer before proceeding to the next. The results show that both L16 and L17 are critical for MMLU performance. Pruning either of these final layers causes a large drop in MMLU accuracy, while scores on knowledge tasks decline only slightly.
|
| 114 |
+
|
| 115 |
+
In contrast, Knowledge-Focused Tasks include ARC-Challenge and ARC-Easy [Clark et al., 2018], PIQA [Bisk et al., 2019], Winogrande [Sakaguchi et al., 2019], OpenBookQA [Mihaylov et al., 2018], and HellaSwag [Zellers et al., 2019]. These benchmarks primarily assess factual knowledge and commonsense reasoning with minimal reliance on recent context retrieval. The core difference lies in how predictions are evaluated: MMLU requires selecting a letter label tied to the correct answer, while the other benchmarks score the likelihood of complete answer texts—shifting the focus from label retrieval to how well the model’s internal knowledge supports each option.
|
| 116 |
+
|
| 117 |
+
# 3.2 A Crucial Layer for MMLU
|
| 118 |
+
|
| 119 |
+
Motivated by the struggle of SSMs with MMLU [Waleffe et al., 2024] and by the fact that Transformers use specialized components to solve multiple-choice questions [Lieberum et al., 2023], we examine whether solving this task utilizes different components in SSM-based language models as well. Since all language models utilize residual skip connections, eliminating a layer could reveal its specific contribution while keeping the rest of the information flowing.
|
| 120 |
+
|
| 121 |
+
We iteratively remove layers from the end of the model and evaluate performance on both MMLU and the knowledgefocused tasks. Figure 2 presents performance trends for Llama-3.1-8B as layers are progressively removed, and Appendix A.1 extends this analysis to Falcon-Mamba-7B and Llamba-8B. For Llama-3.1-8B and Llamba-8B, we ablate both the mixer and its downstream MLP, since the latter likely depends on the former. However, Appendix A.2 shows that similar trends hold even when only the mixer is removed.
|
| 122 |
+
|
| 123 |
+
All architectures reveal a striking pattern: while performance on knowledge-focused benchmarks declines steadily as layers are pruned, MMLU performance remains stable—until a single layer is removed, at which point it drops sharply. This suggests that a specific layer encodes the critical skills required for MMLU. High MMLU scores can persist even when most knowledge capacity is lost, highlighting the role of targeted retrieval components over general knowledge.
|
| 124 |
+
|
| 125 |
+
# 3.3 MMLU Relies on Two Crucial Layers
|
| 126 |
+
|
| 127 |
+
Following Figure 2, we define the minimal model as the smallest subnetwork that includes all layers up to the one before the MMLU performance drop. We now repeat the previous experiment, this time on the minimal model, with a slight modification. Instead of cumulatively removing one layer at a time from the end of the network, we remove a single layer, evaluate the model performance without it, and then restore the layer before proceeding to the next.
|
| 128 |
+
|
| 129 |
+
Figure 3 illustrates the results of this experiment in Llama-3.1-8B, and Appendix A.3 shows the results for Falcon-Mamba-7B and Llamba-8B as well. The findings reveal a surprising insight on the minimal model: not one, but two layers are critical for the performance of MMLU. Unlike earlier layers, the last two layers of the minimal model show no correlation between MMLU and knowledge task performance. Pruning either layer significantly drops MMLU accuracy while minimally affecting knowledge-focused tasks, underscoring their essential role.
|
| 130 |
+
|
| 131 |
+
Table 1: Evaluating the Role of Critical Heads in Llama-3.1-8B-Minimal’s Performance. This table presents the impact of two critical attention heads (L16H22 and L17H24) on MMLU performance while keeping all preceding layers intact. Four configurations were tested: (1) both heads retained, (2) only the last-layer head retained, (3) only the second-to-last-layer head retained, and (4) neither head retained. Results show that these heads must work together to sustain high MMLU performance $( > 6 6 \%$ ), while removing either or both drops accuracy to random guessing $( 2 5 \% )$ .
|
| 132 |
+
|
| 133 |
+
<table><tr><td colspan="3">Heads Kept in a Layer</td><td colspan="2">Metrics (%)</td></tr><tr><td>0-15</td><td>16</td><td>17</td><td>MMLU</td><td>Knowledge Tasks</td></tr><tr><td>0,1,...,31</td><td>22</td><td>24</td><td>66.32</td><td>39.09</td></tr><tr><td>0,1,...,31</td><td>∅</td><td>24</td><td>24.36</td><td>39.18</td></tr><tr><td>0,1,...,31</td><td>22</td><td>∅</td><td>25.59</td><td>39.21</td></tr><tr><td>0,1,...,31</td><td>∅</td><td>∅</td><td>25.56</td><td>39.21</td></tr></table>
|
| 134 |
+
|
| 135 |
+
# 3.4 Zooming In: MMLU Relies on Two Crucial Heads
|
| 136 |
+
|
| 137 |
+
Having established the importance of two specific layers in Section 3.3, we now refine our analysis from the layer level to the head level, investigating how individual attention heads within these layers contribute to performance.
|
| 138 |
+
|
| 139 |
+
To identify crucial heads, we conduct ablation studies on the minimal model defined in Section 3.3, systematically zeroing out individual head outputs in the two critical layers and measuring the impact on both MMLU and knowledgefocused tasks. This analysis reveals a remarkably small subset of heads whose removal drastically reduces MMLU accuracy while keeping knowledge benchmark performance intact. We designate these as “critical heads” — specifically, the heads whose removal significantly affects MMLU scores.
|
| 140 |
+
|
| 141 |
+
To further validate the importance of these critical heads, we remove all noncritical heads from the last two layers and evaluate performance across four configurations: (1) no critical heads retained, (2) only critical heads from the last layer retained, (3) only critical heads from the second-to-last layer retained, and (4) critical heads in both layers retained. The results, presented in Table 1 for Llama-3.1-8B and in Table 4 for the other models, demonstrate that MMLU performance depends on just a few mixing heads rather than the model’s broader knowledge representation. Disabling these specific heads causes accuracy to plummet to random guessing levels. Remarkably, in Llama-3.1-8B, a single head is sufficient to achieve over $66 \%$ MMLU accuracy, while in Falcon-Mamba-7B, just four Mamba-1 channels reach $5 2 . 2 6 \%$ accuracy.
|
| 142 |
+
|
| 143 |
+
# 3.5 Retrieval Emerges as a Key Factor in MMLU
|
| 144 |
+
|
| 145 |
+
Earlier results showed that two attention heads from separate layers work together to solve MMLU across architectures. We now provide evidence that these heads form part of a broader in-context retrieval mechanism, validated through a synthetic key-value (KV) retrieval task.
|
| 146 |
+
|
| 147 |
+
In this task, the model is given a dictionary and must recall the value of a queried key, for example,
|
| 148 |
+
|
| 149 |
+
Memorize the following dictionary:
|
| 150 |
+
|
| 151 |
+
present:50
|
| 152 |
+
|
| 153 |
+
institute:0
|
| 154 |
+
|
| 155 |
+
scallops:84
|
| 156 |
+
|
| 157 |
+
neuropsychiatry:67
|
| 158 |
+
|
| 159 |
+
The value of the key ’scallops’ is
|
| 160 |
+
|
| 161 |
+
To succeed, the model must accurately store mappings (e.g., “scallops $ 8 4 ^ { \ , 9 }$ ) and, when queried, retrieve the correct value (’84’) by identifying ’scallops’ in its stored representations without confusion.
|
| 162 |
+
|
| 163 |
+
We tested 55 configurations with growing numbers of key-value pairs, each using 1,000 synthetic samples. For each configuration, we evaluated Llama-3.1-8B in three settings: intact, with L17H24 removed, and with L16H22 removed (the heads identified as critical in Section 3.4). The full evaluation setup and prompt format are discussed in
|
| 164 |
+
|
| 165 |
+

|
| 166 |
+
Figure 4: Evaluation of Llama-3.1-8B on the KV-Retrieval task under three settings: unmodified, with only L16H22 removed, or with only L17H24 removed (the Gather and Aggregate Heads identified in Section 3.4, respectively). Performance is reported across 55 configurations with increasing numbers of key-value pairs, using the original (non-pruned) model. Each bar shows accuracy for a given dictionary size—for example, with 20 pairs, the original score is $8 5 . 6 \%$ , removing only the Gather Head (L16H22) drops accuracy to $76 \%$ , and removing only the Aggregate Head (L17H24) drops it to $62 \%$ . These results underscore two key points we build on later: (1) Retrieval is more sensitive to Aggregate Head removal than to Gather Head removal, underscoring its importance; (2) The Aggregate Head becomes increasingly important as task complexity grows.
|
| 167 |
+
|
| 168 |
+
# Appendix A.5.
|
| 169 |
+
|
| 170 |
+
As shown in Figure 4, removing either L16H22 or L17H24 significantly impairs retrieval, confirming their central role. Notably, the impact of removing L17H24 increases with dictionary size, suggesting its contribution grows with task complexity. These findings extend previous research: the retrieval heads we identified align with and generalize the Content Gatherer head described by Lieberum et al. [2023] and the retrieval mechanisms documented by Wu et al. [2024]. Importantly, our work demonstrates that similar retrieval mechanisms also emerge within SSM-based language models. The strong link between retrieval and MMLU performance suggests that the Transformer–SSM gap may stem from differences in a small number of retrieval-critical heads rather than fundamental architectural limitations. This reframes the performance gap as a targeted functional difference—where SSMs may lack specific retrieval capabilities—rather than a broad modeling inadequacy.
|
| 171 |
+
|
| 172 |
+
# 3.6 Caveats
|
| 173 |
+
|
| 174 |
+
While the models we tested exhibit the same two-layer mechanism, the interaction does not always occur in consecutive layers. Instead, it can span non-adjacent layers, with intermediate steps in the residual stream. This separation reduces the effectiveness of pruning-based methods for identifying the interacting layers, even though the mechanism remains present. In such cases, alternative approaches, such as the activation patching used in Lieberum et al. [2023], Wiegreffe et al. [2025], may be more suitable to detect these interactions.
|
| 175 |
+
|
| 176 |
+
# 4 Gather-and-Aggregate Heads
|
| 177 |
+
|
| 178 |
+
We now examine how the critical retrieval heads identified in Section 3 across architectures implement the same Gather-and-Aggregate (G&A) mechanism. The mechanism unfolds in two stages. First, a Gather Head isolates meaningful segments within the input—such as multiple-choice answers—and summarizes each into a representative token. Then, a later Aggregate Head uses these summaries to retrieve the information most relevant to the prompt.
|
| 179 |
+
|
| 180 |
+
While previous work has described retrieval-oriented heads in Transformers—such as the “Correct Letter” heads identified by Lieberum et al. [2023]—these analyses focused narrowly on multiple-choice tasks. Our findings show that such heads are part of a broader retrieval mechanism that generalizes beyond this format. This also refines the interpretation from Wu et al. [2024], who grouped retrieval heads under a single role; in contrast, we find they specialize in complementary functions within a coordinated process. Finally, we show that this mechanism also emerges in SSM-based models, despite their lack of explicit attention. These models exhibit smoother and less discrete patterns, but still learn to implement a G&A strategy using different architectural tools.
|
| 181 |
+
|
| 182 |
+
This section unpacks the mechanism in detail. We begin with how it operates in Transformers (Sections 4.1 and 4.2), then present experimental evidence that it also underlies retrieval in SSMs (Section 4.3).
|
| 183 |
+
|
| 184 |
+
# 4.1 Gather Heads in Transformers
|
| 185 |
+
|
| 186 |
+
A Gather Head compresses semantically related tokens within a segment into a single representative token. In Transformer models, this typically occurs through attention patterns that cause the final token of each segment to “attend to” all prior tokens in the same segment, effectively summarizing them into a compact representation (see Figure 1(a)). For example, consider the multiple-choice format introduced in Section 3:
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
\underline {{\text {A . W P A} \backslash \mathrm {n}}} \rightarrow \text {A . W P A} \backslash \mathrm {n}
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
Here, the newline token $( \nu )$ at the end of each answer choice acts as a summary token. This transformation reduces a segment from multiple tokens to one, simplifying downstream computation.
|
| 193 |
+
|
| 194 |
+
Lieberum et al. [2023] observed this behavior in 70B Chinchilla, where attention heads collect tokens like “A”, “.”, “W”, “PA”, and $" \mathrm { \Phi } \mathrm { \Phi } \backslash \ \mathrm { n } ^ { \prime \prime }$ into the final newline token. The head’s attention pattern essentially performs a form of local aggregation, summarizing the contents of each segment.
|
| 195 |
+
|
| 196 |
+
While effective, this process is not always clean: attention sometimes leaks to unrelated tokens—particularly “attention sinks” Xiao et al. [2024] used to stabilize processing over long contexts.
|
| 197 |
+
|
| 198 |
+
# 4.2 Aggregate Heads in Transformers
|
| 199 |
+
|
| 200 |
+
Once the Gather Head condenses segments into representative tokens, an Aggregate Head—in a subsequent layer— retrieves and combines these summaries to inform the model’s prediction. This head typically attends from a target token (e.g., the final “Answer:” position) over all gathered summaries, assigning greater weights to the most relevant one (see Figure 1(b)). This yields a sparse linear combination over segment summaries, often resembling an argmax-like operation [Tulchinskii et al., 2024]:
|
| 201 |
+
|
| 202 |
+
$$
|
| 203 |
+
" A n s w e r: " = \square \backslash n + \square \backslash n + \square \backslash n + \square \backslash n
|
| 204 |
+
$$
|
| 205 |
+
|
| 206 |
+
In Transformer models, such heads were previously termed “Correct Letter” Heads [Lieberum et al., 2023], due to their consistent weighting of the correct answer’s summary token. However, the aggregation pattern generalizes beyond multiple-choice QA, enabling information retrieval in broader contexts.
|
| 207 |
+
|
| 208 |
+
As with Gather Heads, this mechanism is imperfect. Aggregate Heads sometimes distribute attention to irrelevant tokens, including attention sinks. These limitations become more pronounced in SSMs, as we discuss next.
|
| 209 |
+
|
| 210 |
+
# 4.3 G&A in Transformers and SSMs: Experimental Evidence
|
| 211 |
+
|
| 212 |
+
The G&A pattern is well-documented in Transformers—but do SSM models like Mamba implement the same structure? We test this via a two-part experiment that isolates and evaluates specific heads: (1) Pruning: We prune each model to a minimal configuration (as described in Section 3.3), zeroing out all heads in the final two layers except those suspected to implement G&A, as illustrated in Table 4. (2) Masking: At runtime, we constrain the preserved heads’ attention patterns: Gather Heads may attend only within each segment and to its final token, and Aggregate Heads may attend only to those final summary tokens (see Figure 6).
|
| 213 |
+
|
| 214 |
+
Across all models—Llama-3.1-8B (Transformer), Llamba-8B (Mamba-2), and Falcon-Mamba-7B (Mamba-1)—those pruned and masked to retain only G&A heads achieve the same MMLU accuracy as their unmodified counterparts. This confirms that the selected heads are sufficient to drive retrieval and that the G&A mechanism is not unique to Transformers: despite differences in architecture, SSM-based models converge on the same two-stage strategy.
|
| 215 |
+
|
| 216 |
+

|
| 217 |
+
Figure 5: Illustration of Gather Heads (top row) and Aggregate Heads (bottom row) across different model types. The left column shows attention patterns in Llama-3.1-8B (Transformer-based), while the center and right columns correspond to Llamba-8B (Mamba-2-based) and Falcon-Mamba-7B (Mamba-1-based), respectively—both state-space models (SSMs). In Transformer models, both Gather and Aggregate Heads produce sharp, localized patterns. In contrast, SSM-based models exhibit smoother behavior, making it harder to isolate specific segments or retrieve information with the same precision.
|
| 218 |
+
|
| 219 |
+
Nevertheless, the attention patterns differ in texture. As shown in Figure 5, attention maps in Mamba-based models are smoother and less sharply localized. This softness limits their ability to isolate segments cleanly: Gather Heads in SSMs often leak attention outside segment boundaries, and Aggregate Heads struggle to sharply focus on the correct summary token. These imperfections stem from the continuous nature of SSM hidden states, which blur boundary distinctions. We explore these architectural constraints further in Section 5.
|
| 220 |
+
|
| 221 |
+
# 5 The G&A Bottleneck in SSMs
|
| 222 |
+
|
| 223 |
+
The previous section established that both Transformers and SSMs rely on a small number of heads to implement a two-stage Gather-and-Aggregate (G&A) mechanism. We now examine how this mechanism becomes less effective in SSMs by focusing on the Aggregate stage, providing a mechanistic account of their retrieval limitations.
|
| 224 |
+
|
| 225 |
+
We begin by visually inspecting G&A behavior in SSMs (Section 5.1), showing that Aggregate Heads attend broadly rather than selectively. We then quantify redundancy in SSM aggregation (Section 5.2), finding that multiple heads are needed to match the performance of fewer, stronger Transformer heads. Next, we show that hybrid models offload aggregation to attention layers (Section 5.3); ablating just six heads causes a $4 \times$ drop in MMLU. We then identify these heads as the bottleneck (Section 5.4): replacing a single SSM layer restores MMLU from $33 \%$ to $50 \%$ . Finally, we explore how targeted attention during training or distillation can restore G&A in SSMs (Section 5.5).
|
| 226 |
+
|
| 227 |
+
# 5.1 Visual Inspection of G&A Heads
|
| 228 |
+
|
| 229 |
+
Figures 5 and 6 show that Mamba Aggregate Heads correctly attend to segment-final tokens but also attend unnecessarily to neighboring tokens. This likely introduces noise and reduces aggregation effectiveness by diluting focus on the intended summary tokens. The resulting smooth attention map reflects the constraints of hidden-state architectures, where temporal compression makes it harder to express the global behavior characteristic of Aggregate Heads.
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 6: Visualization of the masking applied to the Gather Head (first row) and the Aggregate Head (second row) of Llamba-8B. The Gather Heads are restricted to interactions with the representative token and its associated answer, while the Aggregate Heads are limited to processing only the final token’s relevant portions. This setup ensures that the hypothesized Gather-and-Aggregate mechanism is exclusively responsible for the observed model behavior during MMLU evaluation.
|
| 233 |
+
|
| 234 |
+
# 5.2 Redundancy of Aggregate Heads in SSM Models
|
| 235 |
+
|
| 236 |
+
We find that SSM-based models require more Aggregate Heads than Transformer-based models to reach similar or even lower levels of performance. This suggests that SSMs compensate for limited per-head expressiveness by distributing the retrieval task across multiple weaker components. Three observations support this claim:
|
| 237 |
+
|
| 238 |
+
1. Gradual Performance Decay. As shown in Table 2 and discussed in Section 6, ablating heads in Llamba causes a slow, steady drop in performance—unlike the sharp drops seen in Transformers—implying overlapping functionality and less specialization.
|
| 239 |
+
2. Absence of Strong Isolated Heads. Llamba-8B, distilled from Llama-3.1-8B using MOHAWK [Bick et al., 2024], introduces G&A heads at the same layers as the teacher (L16 and L17). However, Table 5 shows a key difference: Llama-3.1-8B relies on two clearly effective heads (L17H24 and L17H27), while Llamba-8B lacks strong, isolated heads. Its strongest (L17H31) is only moderately effective, and the others show minimal impact. Instead of concentrating aggregation in a few heads, Llamba distributes it across weaker ones—consistent with limited per-head expressivity.
|
| 240 |
+
3. Increased Head Count. Llama-3.1-Minimal achieves $98 \%$ of its MMLU score with one Aggregate Head. Llamba-8B-Minimal requires two to reach $9 5 \%$ , and Falcon-Mamba-7B-Minimal, built with lower-capacity Mamba-1 heads, needs four to reach $86 \%$ (see Table 4). These differences indicate that SSM heads offer lower capacity individually and must be multiplied to maintain competitive performance.
|
| 241 |
+
|
| 242 |
+
# 5.3 Hybrid Models Delegate Aggregation to Attention
|
| 243 |
+
|
| 244 |
+
Attention layers in hybrid models are known to be critical for retrieval and copying tasks [Lieber et al., 2024, Glorioso et al., 2024, Waleffe et al., 2024]. We hypothesize that Aggregate Heads naturally concentrate in the attention layers during training, as attention’s greater expressivity makes it better suited for aggregation, underscoring a key limitation of SSMs.
|
| 245 |
+
|
| 246 |
+
To test this, we evaluate Zamba2-7B [Glorioso et al., 2024], the strongest 7B-scale hybrid model to date. Table 5 identifies attention heads critical for general retrieval; here, we further select nine that are especially important for MMLU: $\mathrm { L } 4 7 \mathrm { H } \{ 2 , 4 , 6 , 8 , 1 8 , 2 1 , 2 5 \}$ and $\mathrm { L } 5 9 \mathrm { H } \{ 1 7 , 2 1 \}$ . Each head is disabled by zeroing out the final row of its attention matrix—impairing aggregation while preserving other capabilities like gathering and contextual mixing. All SSM layers remain unchanged, preserving any aggregation they may contribute.
|
| 247 |
+
|
| 248 |
+
This intervention reduces MMLU accuracy from $6 4 . 3 \%$ to $3 4 . 9 \%$ , while knowledge task accuracy remains stable at $70 \%$ . This $4 \times$ drop (relative to the $2 5 \%$ random baseline) demonstrates that hybrid models depend on attention layers for effective G&A implementation.
|
| 249 |
+
|
| 250 |
+
# 5.4 Hybrid Replacements
|
| 251 |
+
|
| 252 |
+
To further investigate whether SSMs struggle to implement the Aggregate Head, we examine how well an SSM mixer can replicate the functionality of an attention layer. We use the Llamba-8B [Bick et al., 2025] architecture, distilling each layer independently from Llama-3.1-8B (following Bick et al. [2024]) without end-to-end alignment. Specifically, the $i$ -th Mamba-2 block in Llamba receives the output of Llama-3.1-8B’s $( i - 1 )$ -th layer and is aligned using L2 distance against the $i$ -th layer’s output.
|
| 253 |
+
|
| 254 |
+
After assembling the full model from these individually distilled layers, we evaluate its performance on both knowledge tasks and MMLU. Interestingly, while the distilled model recovers $64 \%$ of Llama’s $69 \%$ on knowledge tasks, its MMLU performance remains $33 \%$ , compared to $67 \%$ for Llama. This suggests that some critical capability necessary for MMLU was not fully captured by the distilled layers.
|
| 255 |
+
|
| 256 |
+
To determine whether the observed performance gap is related to retrieval and specifically to the G&A mechanism, we conducted a hybrid replacement experiment. In this experiment, we systematically replaced each layer in the distilled Llamba-8B model with its corresponding layer from Llama-3.1-8B, evaluated its impact on MMLU (without fine-tuning), and then reverted the model before proceeding to the next layer.
|
| 257 |
+
|
| 258 |
+
The results, shown in Figure 7, reveal that most layer replacements had little or even a negative impact on MMLU. However, replacing L17, which contains two prominent G&A heads at H24 and H27 (L17H24 was identified in Table 1), significantly improved performance from $33 \%$ to $50 \%$ . To isolate their effect, we ran additional hybrid experiments. Swapping only L17H24, while keeping the rest of the SSM heads intact, raised performance to $44 \%$ Including L17H27, another G&A head not used in Table 1, increased performance to $50 \%$ . This confirms that the contribution stems from the Aggregate Heads within L17, and further supports that individual SSM layers struggle to implement the Aggregate Head within G&A—reinforcing our claim that this limitation contributes to the performance gap between Transformers and SSMs.
|
| 259 |
+
|
| 260 |
+
# 5.5 Addressing G&A Limitations in SSM-Based Models
|
| 261 |
+
|
| 262 |
+
Efforts to improve the Gather-and-Aggregate mechanism within pure SSMs face a fundamental limitation: retrieval struggles stem from the fixed-size memory of RNN-style architectures, as shown in prior work [Jelassi et al., 2024, Wen et al., 2024]. Rather than trying to overcome this constraint within the SSM design space, we explore hybrid models that incorporate attention layers to directly address these bottlenecks. Our analysis reveals two empirical patterns that guide hybrid model design—one for training from scratch, and one for distillation:
|
| 263 |
+
|
| 264 |
+
1. Training hybrids from scratch. G&A heads consistently emerge in the middle of the network—for example, at layers L16 and L17 out of 32 in Llama-3.1-8B and Llamba-8B, and L35 and L36 out of 64 in Falcon-Mamba-7B. This suggests that attention is most valuable in mid layers, where retrieval operations naturally occur. As a result, when designing hybrid models from scratch, placing attention layers near the middle offers a targeted way to support G&A without relying on full attention throughout the network.
|
| 265 |
+
2. Distilling hybrids from a Transformer. As shown in Section 5.4, replacing individual layers in a distilled SSM with their attention-based counterparts from the teacher yields little benefit—except at L17, where MMLU improves from $33 \%$ to $50 \%$ . This indicates that the performance gap is concentrated in the Aggregate Head. Based on this, a practical strategy is to retain attention in the layers where strong G&A heads appear and distill the rest into SSMs. This allows the hybrid to recover retrieval quality where it matters most, while still benefiting from the efficiency of SSMs elsewhere.
|
| 266 |
+
|
| 267 |
+
These findings suggest a simple recipe for hybrid design: insert attention where G&A heads emerge during training, or preserve it at key layers when distilling from a Transformer. Determining optimal placement and refining architectural choices remain open directions for future work.
|
| 268 |
+
|
| 269 |
+

|
| 270 |
+
Figure 7: Results of the hybrid replacement experiment. Each Llamba-8B layer was replaced with its Llama-3.1-8B counterpart and tested on MMLU. Most swaps had little or negative impact on the $33 \%$ baseline, but replacing layer 17—where a key Aggregate Head is (Table 1)—significantly improved MMLU. This underscores both the difficulties SSMs face in replicating the Aggregate mechanism and G&A critical role in MMLU performance.
|
| 271 |
+
|
| 272 |
+
# 6 Transformer-SSM Gap Beyond MMLU
|
| 273 |
+
|
| 274 |
+
We previously showed that both Transformers and SSMs rely on a few heads to implement a two-stage Gather-and-Aggregate (G&A) mechanism for in-context retrieval. We now extend this analysis to additional benchmarks and models, reinforcing that the broader retrieval gap stems from specific algorithmic limits rather than general language modeling ability. Our analysis has three parts: Section 6.1 identifies G&A heads across models; Section 6.2 evaluates how architectural choices affect performance; Section 6.3 examines how task format influences these effects.
|
| 275 |
+
|
| 276 |
+
# 6.1 Isolating Retrieval Differences Across Architectures
|
| 277 |
+
|
| 278 |
+
In Section 3, we showed that MMLU performance can be severely degraded by removing a single critical head—even when the model performs poorly on knowledge-focused tasks. This scenario is specific to MMLU, where strong retrieval alone can yield high accuracy even with degraded knowledge. In contrast, most benchmarks require both retrieval and factual knowledge, making it harder to isolate the contribution of retrieval alone.
|
| 279 |
+
|
| 280 |
+
As a result, the minimal-model strategy used in MMLU fails on other tasks: pruning layers diminishes knowledge capacity and lowers scores across the board, masking the effect of retrieval-specific mechanisms. To avoid this confound, we instead take a different approach: rather than pruning the model, we preserve its knowledge and selectively disable only the G&A heads.
|
| 281 |
+
|
| 282 |
+
As described in Section 3.5, the synthetic KV-Retrieval task allows us to identify heads involved in G&A by measuring the impact of ablating each head on retrieval accuracy (Table 5). A significant drop in performance indicates the head contributes to the G&A mechanism. A similar approach was also used by Wu et al. [2024] to identify retrieval heads in Transformers. Crucially, since KV-Retrieval is synthetic and requires no external knowledge, it isolates retrieval ability without confounding effects from knowledge loss. This lets us trace G&A heads across layers and model families in a controlled and generalizable way.
|
| 283 |
+
|
| 284 |
+
# 6.2 Quantifying the Retrieval Gap
|
| 285 |
+
|
| 286 |
+
Having identified the retrieval-critical heads, we now assess their practical impact across benchmarks by incrementally disabling them in three model families. These include Transformer models (Llama-3.1-8B-Instruct and Llama-3.2-3B-Instruct [Touvron et al., 2023]) as baselines for effective G&A implementation; pure SSM models (Llamba-3B and Llamba-8B [Bick et al., 2025]) based on Mamba-2; and hybrid models (Zamba2-2.7B-Instruct and Zamba2-7B-Instruct [Glorioso et al., 2024]) that combine Mamba-2 layers with shared attention modules. In Zamba2, we ablate only attention heads, as they are responsible for retrieval (Section 5.3); each shared head is ablated once to isolate its effect. For clarity, we omit instructional and embedding-tying suffixes from all model names.
|
| 287 |
+
|
| 288 |
+
Table 2 summarizes the results. In Transformer models, we observe a steep decline in performance on retrieval-heavy tasks after disabling only 10–20 heads, while accuracy on knowledge-focused tasks remains stable. This confirms that
|
| 289 |
+
|
| 290 |
+
retrieval depends on a small, specialized set of heads. Zamba2-7B exhibits a similar pattern, albeit with nuances due to its shared-attention structure. Notably, different occurrences of the same shared head behave similarly when ablated, consistent with shared G&A roles, as seen in Table 5.
|
| 291 |
+
|
| 292 |
+
In contrast, Llamba-8B degrades gradually. Even after removing 30 G&A heads, it retains over $9 5 \%$ of its original performance across both retrieval and knowledge tasks. This slow decline reflects redundancy: SSM-based models use many weaker heads to approximate the function of fewer, sharper Transformer heads—aligning with our observations from Section 5.
|
| 293 |
+
|
| 294 |
+
Table 2: Impact of Disabling G&A Heads Across Models. Each value reports the change relative to the 0-head configuration. Evaluations are conducted on MMLU [Hendrycks et al., 2021], LAMBADA [Paperno et al., 2016], Grade School Math (GSM8K) [Cobbe et al., 2021], SWDE [Arora et al., 2024], Big-Bench Hard (BBH) [Suzgun et al., 2022], and knowledge-focused tasks defined in Section 3.1. Note that (1) GSM8K and BBH are evaluated using the “exact-match, flexible-extract” metric; (2) GSM8K is omitted for Llamba models, which were not trained on mathematical datasets and are not intended for arithmetic reasoning.
|
| 295 |
+
|
| 296 |
+
<table><tr><td>MODEL</td><td>#HEADS</td><td>MMLU ACC ↑</td><td>LAMB. PPL ↓</td><td>GSM8K ACC ↑</td><td>SWDE ACC ↑</td><td>BBH ACC ↑</td><td>KNOWLEDGE ACC ↑</td></tr><tr><td rowspan="4">Llama-3B</td><td>0</td><td>60.3 (+0.0%)</td><td>4.8 (+0.0%)</td><td>28.7 (+0.0%)</td><td>85.8 (+0.0%)</td><td>38.2 (+0.0%)</td><td>60.5 (+0.0%)</td></tr><tr><td>10</td><td>53.1 (-12.0%)</td><td>6.5 (+35.7%)</td><td>17.4 (-39.4%)</td><td>81.9 (-4.5%)</td><td>33.4 (-12.6%)</td><td>59.4 (-1.8%)</td></tr><tr><td>20</td><td>32.2 (-46.6%)</td><td>8.8 (+82.8%)</td><td>9.1 (-68.2%)</td><td>57.5 (-33.0%)</td><td>27.7 (-27.5%)</td><td>58.7 (-3.0%)</td></tr><tr><td>30</td><td>29.9 (-50.4%)</td><td>10.1 (+109%)</td><td>5.6 (-80.5%)</td><td>47.5 (-44.6%)</td><td>25.4 (-33.5%)</td><td>58.0 (-4.1%)</td></tr><tr><td rowspan="4">Llama-8B</td><td>0</td><td>68.1 (+0.0%)</td><td>3.4 (+0.0%)</td><td>27.3 (+0.0%)</td><td>90.8 (+0.0%)</td><td>45.1 (+0.0%)</td><td>68.5 (+0.0%)</td></tr><tr><td>10</td><td>61.9 (-9.1%)</td><td>4.2 (+22.0%)</td><td>21.7 (-20.5%)</td><td>87.3 (-3.9%)</td><td>37.7 (-16.5%)</td><td>67.1 (-2.0%)</td></tr><tr><td>20</td><td>38.1 (-44.0%)</td><td>6.8 (+98.6%)</td><td>9.4 (-65.6%)</td><td>79.5 (-12.4%)</td><td>29.2 (-35.2%)</td><td>64.8 (-5.4%)</td></tr><tr><td>30</td><td>38.7 (-43.2%)</td><td>7.3 (+115%)</td><td>7.8 (-71.4%)</td><td>74.0 (-18.5%)</td><td>29.0 (-35.7%)</td><td>64.4 (-6.0%)</td></tr><tr><td rowspan="4">Llama-3B</td><td>0</td><td>52.5 (+0.0%)</td><td>3.6 (+0.0%)</td><td>-</td><td>21.3 (+0.0%)</td><td>9.2 (+0.0%)</td><td>63.8 (+0.0%)</td></tr><tr><td>10</td><td>42.6 (-18.9%)</td><td>5.2 (+44.4%)</td><td>-</td><td>18.6 (-12.7%)</td><td>9.0 (-2.2%)</td><td>63.7 (-0.2%)</td></tr><tr><td>20</td><td>41.3 (-21.3%)</td><td>8.2 (+128%)</td><td>-</td><td>18.1 (-15.0%)</td><td>9.0 (-2.2%)</td><td>63.1 (-1.1%)</td></tr><tr><td>30</td><td>41.2 (-21.5%)</td><td>9.1 (+153%)</td><td>-</td><td>18.1 (-15.0%)</td><td>9.0 (-2.2%)</td><td>62.6 (-1.9%)</td></tr><tr><td rowspan="4">Llama-8B</td><td>0</td><td>60.7 (+0.0%)</td><td>4.09 (+0.0%)</td><td>-</td><td>20.0 (+0.0%)</td><td>11.0 (+0.0%)</td><td>69.1 (+0.0%)</td></tr><tr><td>10</td><td>59.6 (-1.8%)</td><td>6.26 (+53.2%)</td><td>-</td><td>18.3 (-8.5%)</td><td>11.6 (+5.5%)</td><td>68.8 (-0.4%)</td></tr><tr><td>20</td><td>59.0 (-2.8%)</td><td>6.99 (+70.8%)</td><td>-</td><td>18.6 (-7.0%)</td><td>11.4 (+3.6%)</td><td>68.6 (-0.7%)</td></tr><tr><td>30</td><td>58.1 (-4.3%)</td><td>7.44 (+81.9%)</td><td>-</td><td>18.1 (-9.5%)</td><td>11.4 (+3.6%)</td><td>68.2 (-1.3%)</td></tr><tr><td rowspan="3">Zamba2-2.7B</td><td>0</td><td>55.7 (+0.0%)</td><td>4.2 (+0.0%)</td><td>57.4 (+0.0%)</td><td>89.5 (+0.0%)</td><td>30.6 (+0.0%)</td><td>66.8 (+0.0%)</td></tr><tr><td>10</td><td>42.4 (-23.9%)</td><td>12.8 (+204%)</td><td>24.7 (-57.0%)</td><td>84.3 (-5.8%)</td><td>25.5 (-16.7%)</td><td>64.8 (-3.0%)</td></tr><tr><td>20</td><td>37.2 (-33.2%)</td><td>22.2 (+428%)</td><td>6.5 (-88.7%)</td><td>74.4 (-16.9%)</td><td>17.4 (-43.1%)</td><td>62.6 (-6.3%)</td></tr><tr><td rowspan="7">Zamba2-7B</td><td>0</td><td>65.1 (+0.0%)</td><td>3.1 (+0.0%)</td><td>60.5 (+0.0%)</td><td>91.7 (+0.0%)</td><td>33.0 (+0.0%)</td><td>70.6 (+0.0%)</td></tr><tr><td>10</td><td>63.0 (-3.2%)</td><td>3.6 (+16.1%)</td><td>40.1 (-33.7%)</td><td>80.0 (-12.8%)</td><td>24.6 (-25.5%)</td><td>68.7 (-2.7%)</td></tr><tr><td>20</td><td>57.3 (-12.0%)</td><td>5.2 (+67.7%)</td><td>27.6 (-54.4%)</td><td>75.1 (-18.1%)</td><td>28.9 (-12.4%)</td><td>67.5 (-4.4%)</td></tr><tr><td>30</td><td>54.0 (-17.1%)</td><td>7.0 (+126%)</td><td>18.4 (-69.6%)</td><td>43.7 (-52.3%)</td><td>24.0 (-27.3%)</td><td>67.3 (-4.7%)</td></tr><tr><td>40</td><td>50.6 (-22.3%)</td><td>9.5 (+206%)</td><td>14.9 (-75.4%)</td><td>41.2 (-55.1%)</td><td>21.7 (-34.2%)</td><td>67.0 (-5.1%)</td></tr><tr><td>50</td><td>37.7 (-42.1%)</td><td>13.9 (+348%)</td><td>7.5 (-87.6%)</td><td>39.6 (-56.8%)</td><td>18.5 (-43.9%)</td><td>67.0 (-5.1%)</td></tr><tr><td>60</td><td>36.2 (-44.4%)</td><td>19.8 (+538%)</td><td>7.2 (-88.1%)</td><td>39.6 (-56.8%)</td><td>15.9 (-51.8%)</td><td>66.5 (-5.8%)</td></tr></table>
|
| 297 |
+
|
| 298 |
+
# 6.3 Amplifying the Retrieval Gap through Task Format
|
| 299 |
+
|
| 300 |
+
Beyond architecture, task format can amplify or reduce the retrieval gap between Transformers and SSMs. We previously noted this in MMLU, where models select a letter label rather than score full answer texts.
|
| 301 |
+
|
| 302 |
+
To further illustrate, we compare two formats of the same content: the original ARC-Challenge multiple-choice task and its conversational variant, ARC-Challenge Chat. As shown in Table 3, disabling G&A heads has little effect on the
|
| 303 |
+
|
| 304 |
+
multiple-choice version but sharply reduces accuracy in the chat variant. The conversational format increases retrieval demands by spreading relevant content across dialogue turns, favoring architectures with sharper retrieval (Transformers and hybrids) over those with more diffuse mechanisms (pure SSMs).
|
| 305 |
+
|
| 306 |
+
This highlights a key point: retrieval pressure depends not just on what is asked, but on how it’s presented. When context is more distributed, effective in-context retrieval becomes more critical—even if the underlying knowledge stays the same.
|
| 307 |
+
|
| 308 |
+
Table 3: Comparison of ARC Challenge and ARC-Challenge Chat under Attention Head Removal. ARC-Challenge Chat repackages the same questions as ARC Challenge into a conversational, generative format. While ARC Challenge uses normalized accuracy, the chat version relies on exact-match due to its open-ended outputs. Models initially perform better on the chat variant, leveraging its generative flexibility to reason through questions. But when G&A heads are ablated, performance drops sharply—unlike the minor declines seen in ARC Challenge. This contrast suggests the degradation reflects impaired retrieval rather than loss of stored knowledge.
|
| 309 |
+
|
| 310 |
+
<table><tr><td>MODEL</td><td>#REMOVED HEADS</td><td>ARC-CHALLENGE (CHAT) ACC ↑</td><td>ARC-CHALLENGE (REGULAR) ACC ↑</td></tr><tr><td rowspan="4">Llama-3B</td><td>0</td><td>76.8 (+0.0%)</td><td>45.5 (+0.0%)</td></tr><tr><td>10</td><td>72.2 (-6.0%)</td><td>43.6 (-4.2%)</td></tr><tr><td>20</td><td>50.0 (-34.9%)</td><td>42.0 (-7.7%)</td></tr><tr><td>30</td><td>43.2 (-43.8%)</td><td>41.9 (-7.9%)</td></tr><tr><td rowspan="4">Llama-8B</td><td>0</td><td>84.3 (+0.0%)</td><td>54.9 (+0.0%)</td></tr><tr><td>10</td><td>77.1 (-8.5%)</td><td>51.6 (-6.0%)</td></tr><tr><td>20</td><td>49.3 (-41.5%)</td><td>47.3 (-13.8%)</td></tr><tr><td>30</td><td>53.6 (-36.4%)</td><td>47.9 (-12.8%)</td></tr></table>
|
| 311 |
+
|
| 312 |
+
# 7 Conclusions
|
| 313 |
+
|
| 314 |
+
We show that both Transformer and SSM models develop a Gather-and-Aggregate (G&A) mechanism across a small number of heads to support in-context retrieval, which is crucial for performance on many benchmarks. While SSMs struggle to implement strong G&A heads due to their fixed-size hidden state, this limitation is localized and does not reflect a general weakness in language modeling.
|
| 315 |
+
|
| 316 |
+
Hybrid models provide further insight: they naturally offload G&A to attention layers, leveraging their stronger algorithmic capacity. This explains why even a few attention layers can meaningfully boost SSM models, providing practical guidance for hybrid design.
|
| 317 |
+
|
| 318 |
+
Our results also reframe benchmark interpretation. Although MMLU is often seen as a broad knowledge test, we find that MMLU performance is primarily governed by retrieval ability. This highlights the role of algorithmic skills, and particularly retrieval, in benchmark success.
|
| 319 |
+
|
| 320 |
+
Important open questions remain: while narrowing the retrieval gap is a key step, the role of G&A in in-context learning and copying warrants further study. It also remains to be seen whether G&A is part of a broader retrieval process involving other head types, such as Amplification Heads [Lieberum et al., 2023], which enhance signal propagation.
|
| 321 |
+
|
| 322 |
+
# References
|
| 323 |
+
|
| 324 |
+
Ameen Ali, Itamar Zimerman, and Lior Wolf. The hidden attention of mamba models, 2024. URL https://arxiv. org/abs/2403.01590.
|
| 325 |
+
Norah Alzahrani, Hisham Abdullah Alyahya, Yazeed Alnumay, Sultan Alrashed, Shaykhah Alsubaie, Yusef Almushaykeh, Faisal Mirza, Nouf Alotaibi, Nora Altwairesh, Areeb Alowisheq, M Saiful Bari, and Haidar Khan.
|
| 326 |
+
|
| 327 |
+
When benchmarks are targets: Revealing the sensitivity of large language model leaderboards, 2024. URL https://arxiv.org/abs/2402.01781.
|
| 328 |
+
Aryaman Arora, Neil Rathi, Nikil Roashan Selvam, Robert Cs ´ ordas, Dan Jurafsky, and Christopher Potts. Mechanistic ´ evaluation of transformers and state space models, 2025a. URL https://arxiv.org/abs/2505.15105.
|
| 329 |
+
Simran Arora, Sabri Eyuboglu, Aman Timalsina, Isys Johnson, Michael Poli, James Zou, Atri Rudra, and Christopher Re. Zoology: Measuring and improving recall in efficient language models, 2023. URL ´ https://arxiv.org/ abs/2312.04927.
|
| 330 |
+
Simran Arora, Sabri Eyuboglu, Michael Zhang, Aman Timalsina, Silas Alberti, Dylan Zinsley, James Zou, Atri Rudra, and Christopher Re. Simple linear attention language models balance the recall-throughput tradeoff. ´ arXiv:2402.18668, 2024.
|
| 331 |
+
Simran Arora, Sabri Eyuboglu, Michael Zhang, Aman Timalsina, Silas Alberti, Dylan Zinsley, James Zou, Atri Rudra, and Christopher Re. Simple linear attention language models balance the recall-throughput tradeoff, 2025b. URL ´ https://arxiv.org/abs/2402.18668.
|
| 332 |
+
Maximilian Beck, Korbinian Poppel, Markus Spanring, Andreas Auer, Oleksandra Prudnikova, Michael Kopp, G ¨ unter ¨ Klambauer, Johannes Brandstetter, and Sepp Hochreiter. xlstm: Extended long short-term memory, 2024. URL https://arxiv.org/abs/2405.04517.
|
| 333 |
+
Aviv Bick, Kevin Y. Li, Eric P. Xing, J. Zico Kolter, and Albert Gu. Transformers to ssms: Distilling quadratic knowledge to subquadratic models, 2024. URL https://arxiv.org/abs/2408.10189.
|
| 334 |
+
Aviv Bick, Tobias Katsch, Nimit Sohoni, Arjun Desai, and Albert Gu. Llamba: Scaling distilled recurrent models for efficient language processing, 2025. URL https://arxiv.org/abs/2502.14458.
|
| 335 |
+
Alberto Bietti, Vivien Cabannes, Diane Bouchacourt, Herve Jegou, and Leon Bottou. Birth of a transformer: A memory viewpoint, 2023. URL https://arxiv.org/abs/2306.00802.
|
| 336 |
+
Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. Piqa: Reasoning about physical commonsense in natural language, 2019. URL https://arxiv.org/abs/1911.11641.
|
| 337 |
+
Sam Blouir, Jimmy T. H. Smith, Antonios Anastasopoulos, and Amarda Shehu. Birdie: Advancing state space models with reward-driven objectives and curricula, 2025. URL https://arxiv.org/abs/2411.01030.
|
| 338 |
+
Tom B. Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel M. Ziegler, Jeffrey Wu, Clemens Winter, Christopher Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners, 2020.
|
| 339 |
+
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the ai2 reasoning challenge, 2018. URL https://arxiv. org/abs/1803.05457.
|
| 340 |
+
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems, 2021. URL https://arxiv.org/abs/2110.14168.
|
| 341 |
+
Tri Dao and Albert Gu. Transformers are SSMs: Generalized models and efficient algorithms through structured state space duality. In International Conference on Machine Learning (ICML), 2024.
|
| 342 |
+
Tri Dao, Daniel Y. Fu, Stefano Ermon, Atri Rudra, and Christopher Re. Flashattention: Fast and memory-efficient exact ´ attention with io-awareness, 2022.
|
| 343 |
+
|
| 344 |
+
Nelson Elhage, Neel Nanda, Catherine Olsson, Tom Henighan, Nicholas Joseph, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Nova DasSarma, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. A mathematical framework for transformer circuits. Transformer Circuits Thread, 2021. https://transformer-circuits.pub/2021/framework/index.html.
|
| 345 |
+
Paolo Glorioso, Quentin Anthony, Yury Tokpanov, James Whittington, Jonathan Pilault, Adam Ibrahim, and Beren Millidge. Zamba: A compact 7b ssm hybrid model, 2024. URL https://arxiv.org/abs/2405.16712.
|
| 346 |
+
Albert Gu and Tri Dao. Mamba: Linear-time sequence modeling with selective state spaces, 2023.
|
| 347 |
+
Albert Gu, Karan Goel, and Christopher Re. Efficiently modeling long sequences with structured state spaces, 2022.´
|
| 348 |
+
Dan Hendrycks, Collin Burns, Steven Basart, Andy Zou, Mantas Mazeika, Dawn Song, and Jacob Steinhardt. Measuring massive multitask language understanding, 2021. URL https://arxiv.org/abs/2009.03300.
|
| 349 |
+
Samy Jelassi, David Brandfonbrener, Sham M. Kakade, and Eran Malach. Repeat after me: Transformers are better than state space models at copying, 2024. URL https://arxiv.org/abs/2402.01032.
|
| 350 |
+
Angelos Katharopoulos, Apoorv Vyas, Nikolaos Pappas, and Franc¸ois Fleuret. Transformers are rnns: Fast autoregressive transformers with linear attention, 2020.
|
| 351 |
+
Opher Lieber, Barak Lenz, Hofit Bata, Gal Cohen, Jhonathan Osin, Itay Dalmedigos, Erez Safahi, Shaked Meirom, Yonatan Belinkov, Shai Shalev-Shwartz, Omri Abend, Raz Alon, Tomer Asida, Amir Bergman, Roman Glozman, Michael Gokhman, Avashalom Manevich, Nir Ratner, Noam Rozen, Erez Shwartz, Mor Zusman, and Yoav Shoham. Jamba: A hybrid transformer-mamba language model, 2024. URL https://arxiv.org/abs/2403.19887.
|
| 352 |
+
Tom Lieberum, Matthew Rahtz, Janos Kram ´ ar, Neel Nanda, Geoffrey Irving, Rohin Shah, and Vladimir Mikulik. ´ Does circuit analysis interpretability scale? evidence from multiple choice capabilities in chinchilla, 2023. URL https://arxiv.org/abs/2307.09458.
|
| 353 |
+
Kevin Meng, David Bau, Alex Andonian, and Yonatan Belinkov. Locating and editing factual associations in gpt, 2023. URL https://arxiv.org/abs/2202.05262.
|
| 354 |
+
Jack Merullo, Carsten Eickhoff, and Ellie Pavlick. Circuit component reuse across tasks in transformer language models, 2024. URL https://arxiv.org/abs/2310.08744.
|
| 355 |
+
Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? a new dataset for open book question answering, 2018. URL https://arxiv.org/abs/1809.02789.
|
| 356 |
+
Catherine Olsson, Nelson Elhage, Neel Nanda, Nicholas Joseph, Nova DasSarma, Tom Henighan, Ben Mann, Amanda Askell, Yuntao Bai, Anna Chen, Tom Conerly, Dawn Drain, Deep Ganguli, Zac Hatfield-Dodds, Danny Hernandez, Scott Johnston, Andy Jones, Jackson Kernion, Liane Lovitt, Kamal Ndousse, Dario Amodei, Tom Brown, Jack Clark, Jared Kaplan, Sam McCandlish, and Chris Olah. In-context learning and induction heads. Transformer Circuits Thread, 2022. https://transformer-circuits.pub/2022/in-context-learning-and-induction-heads/index.html.
|
| 357 |
+
Daniele Paliotta, Junxiong Wang, Matteo Pagliardini, Kevin Y. Li, Aviv Bick, J. Zico Kolter, Albert Gu, Franc¸ois Fleuret, and Tri Dao. Thinking slow, fast: Scaling inference compute with distilled reasoners, 2025. URL https://arxiv.org/abs/2502.20339.
|
| 358 |
+
Denis Paperno, German Kruszewski, Angeliki Lazaridou, Quan Ngoc Pham, Raffaella Bernardi, Sandro Pezzelle,´ Marco Baroni, Gemma Boleda, and Raquel Fernandez. The lambada dataset: Word prediction requiring a broad ´ discourse context, 2016. URL https://arxiv.org/abs/1606.06031.
|
| 359 |
+
Jongho Park, Jaeseung Park, Zheyang Xiong, Nayoung Lee, Jaewoong Cho, Samet Oymak, Kangwook Lee, and Dimitris Papailiopoulos. Can mamba learn how to learn? a comparative study on in-context learning tasks, 2024. URL https://arxiv.org/abs/2402.04248.
|
| 360 |
+
|
| 361 |
+
Bo Peng, Daniel Goldstein, Quentin Anthony, Alon Albalak, Eric Alcaide, Stella Biderman, Eugene Cheah, Xingjian Du, Teddy Ferdinan, Haowen Hou, Przemysław Kazienko, Kranthi Kiran GV, Jan Kocon, Bartłomiej Koptyra, ´ Satyapriya Krishna, Ronald McClelland Jr., Jiaju Lin, Niklas Muennighoff, Fares Obeid, Atsushi Saito, Guangyu Song, Haoqin Tu, Cahya Wirawan, Stanisław Wozniak, Ruichong Zhang, Bingchen Zhao, Qihang Zhao, Peng Zhou, ´ Jian Zhu, and Rui-Jie Zhu. Eagle and finch: Rwkv with matrix-valued states and dynamic recurrence, 2024. URL https://arxiv.org/abs/2404.05892.
|
| 362 |
+
Zhen Qin, Songlin Yang, Weixuan Sun, Xuyang Shen, Dong Li, Weigao Sun, and Yiran Zhong. Hgrn2: Gated linear rnns with state expansion, 2024. URL https://arxiv.org/abs/2404.07904.
|
| 363 |
+
Daking Rai, Yilun Zhou, Shi Feng, Abulhair Saparov, and Ziyu Yao. A practical review of mechanistic interpretability for transformer-based language models, 2024. URL https://arxiv.org/abs/2407.02646.
|
| 364 |
+
Liliang Ren, Yang Liu, Yadong Lu, Yelong Shen, Chen Liang, and Weizhu Chen. Samba: Simple hybrid state space models for efficient unlimited context language modeling, 2024. URL https://arxiv.org/abs/2406. 07522.
|
| 365 |
+
Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adversarial winograd schema challenge at scale, 2019. URL https://arxiv.org/abs/1907.10641.
|
| 366 |
+
Clayton Sanford, Daniel Hsu, and Matus Telgarsky. Transformers, parallel computation, and logarithmic depth, 2024. URL https://arxiv.org/abs/2402.09268.
|
| 367 |
+
Yutao Sun, Li Dong, Shaohan Huang, Shuming Ma, Yuqing Xia, Jilong Xue, Jianyong Wang, and Furu Wei. Retentive network: A successor to transformer for large language models, 2023.
|
| 368 |
+
Mirac Suzgun, Nathan Scales, Nathanael Scharli, Sebastian Gehrmann, Yi Tay, Hyung Won Chung, Aakanksha ¨ Chowdhery, Quoc V. Le, Ed H. Chi, Denny Zhou, and Jason Wei. Challenging big-bench tasks and whether chain-of-thought can solve them, 2022. URL https://arxiv.org/abs/2210.09261.
|
| 369 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste ´ Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, Aurelien Rodriguez, Armand Joulin, Edouard Grave, and ` Guillaume Lample. Llama: Open and efficient foundation language models, 2023.
|
| 370 |
+
Eduard Tulchinskii, Laida Kushnareva, Kristian Kuznetsov, Anastasia Voznyuk, Andrei Andriiainen, Irina Piontkovskaya, Evgeny Burnaev, and Serguei Barannikov. Listening to the wise few: Select-and-copy attention heads for multiple-choice qa, 2024. URL https://arxiv.org/abs/2410.02343.
|
| 371 |
+
Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N. Gomez, Lukasz Kaiser, and Illia Polosukhin. Attention is all you need, 2023. URL https://arxiv.org/abs/1706.03762.
|
| 372 |
+
Roger Waleffe, Wonmin Byeon, Duncan Riach, Brandon Norick, Vijay Korthikanti, Tri Dao, Albert Gu, Ali Hatamizadeh, Sudhakar Singh, Deepak Narayanan, Garvit Kulshreshtha, Vartika Singh, Jared Casper, Jan Kautz, Mohammad Shoeybi, and Bryan Catanzaro. An empirical study of mamba-based language models, 2024. URL https://arxiv.org/abs/2406.07887.
|
| 373 |
+
Junxiong Wang, Daniele Paliotta, Avner May, Alexander M. Rush, and Tri Dao. The mamba in the llama: Distilling and accelerating hybrid models, 2024a. URL https://arxiv.org/abs/2408.15237.
|
| 374 |
+
Wentian Wang, Sarthak Jain, Paul Kantor, Jacob Feldman, Lazaros Gallos, and Hao Wang. Mmlu-sr: A benchmark for stress-testing reasoning capability of large language models, 2024b. URL https://arxiv.org/abs/2406. 15468.
|
| 375 |
+
Kaiyue Wen, Xingyu Dang, and Kaifeng Lyu. Rnns are not transformers (yet): The key bottleneck on in-context retrieval, 2024. URL https://arxiv.org/abs/2402.18510.
|
| 376 |
+
Sarah Wiegreffe, Oyvind Tafjord, Yonatan Belinkov, Hannaneh Hajishirzi, and Ashish Sabharwal. Answer, assemble, ace: Understanding how lms answer multiple choice questions, 2025. URL https://arxiv.org/abs/2407. 15018.
|
| 377 |
+
|
| 378 |
+
Wenhao Wu, Yizhong Wang, Guangxuan Xiao, Hao Peng, and Yao Fu. Retrieval head mechanistically explains long-context factuality, 2024. URL https://arxiv.org/abs/2404.15574.
|
| 379 |
+
Guangxuan Xiao, Yuandong Tian, Beidi Chen, Song Han, and Mike Lewis. Efficient streaming language models with attention sinks, 2024. URL https://arxiv.org/abs/2309.17453.
|
| 380 |
+
Songlin Yang, Jan Kautz, and Ali Hatamizadeh. Gated delta networks: Improving mamba2 with delta rule, 2024a. URL https://arxiv.org/abs/2412.06464.
|
| 381 |
+
Songlin Yang, Bailin Wang, Yikang Shen, Rameswar Panda, and Yoon Kim. Gated linear attention transformers with hardware-efficient training, 2024b. URL https://arxiv.org/abs/2312.06635.
|
| 382 |
+
Sangwon Yu, Jongyoon Song, Bongkyu Hwang, Hoyoung Kang, Sooah Cho, Junhwa Choi, Seongho Joe, Taehee Lee, Youngjune L. Gwon, and Sungroh Yoon. Correcting negative bias in large language models through negative attention score alignment, 2024. URL https://arxiv.org/abs/2408.00137.
|
| 383 |
+
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence?, 2019. URL https://arxiv.org/abs/1905.07830.
|
| 384 |
+
Wei Zhang, Chaoqun Wan, Yonggang Zhang, Yiu ming Cheung, Xinmei Tian, Xu Shen, and Jieping Ye. Interpreting and improving large language models in arithmetic calculation, 2024a. URL https://arxiv.org/abs/2409. 01659.
|
| 385 |
+
Yu Zhang, Songlin Yang, Ruijie Zhu, Yue Zhang, Leyang Cui, Yiqiao Wang, Bolun Wang, Freda Shi, Bailin Wang, Wei Bi, Peng Zhou, and Guohong Fu. Gated slot attention for efficient linear-time sequence modeling, 2024b. URL https://arxiv.org/abs/2409.07146.
|
| 386 |
+
Qihao Zhao, Yangyu Huang, Tengchao Lv, Lei Cui, Qinzheng Sun, Shaoguang Mao, Xin Zhang, Ying Xin, Qiufeng Yin, Scarlett Li, and Furu Wei. Mmlu-cf: A contamination-free multi-task language understanding benchmark, 2024. URL https://arxiv.org/abs/2412.15194.
|
| 387 |
+
Zifan Zheng, Yezhaohui Wang, Yuxin Huang, Shichao Song, Mingchuan Yang, Bo Tang, Feiyu Xiong, and Zhiyu Li. Attention heads of large language models: A survey, 2024. URL https://arxiv.org/abs/2409.03752.
|
| 388 |
+
Jingwei Zuo, Maksim Velikanov, Dhia Eddine Rhaiem, Ilyas Chahed, Younes Belkada, Guillaume Kunsch, and Hakim Hacid. Falcon mamba: The first competitive attention-free 7b language model, 2024. URL https: //arxiv.org/abs/2410.05355.
|
| 389 |
+
|
| 390 |
+
# A Complementary Material for Section 3
|
| 391 |
+
|
| 392 |
+
In this section, we present additional results from the experiments conducted on the models explored in Section 3. These results provide further insights into the behavior of knowledge and retrieval capabilities across layers and heads in different models.
|
| 393 |
+
|
| 394 |
+
# A.1 Detailed Performance Across Layers
|
| 395 |
+
|
| 396 |
+
We extend the analysis presented in Section 3.2 by providing performance data on other models, which show similar trends. As demonstrated in Appendix A.1, the pattern of stable MMLU scores despite a gradual decline in knowledge task performance is consistent across all models tested. Notably, the sharp drop in MMLU performance upon removal of specific layers reaffirms the criticality of certain layers in encoding retrieval skills.
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
|
| 400 |
+

|
| 401 |
+
|
| 402 |
+

|
| 403 |
+
Figure 8: Residual performance trends for knowledge tasks and the MMLU benchmark as layers are progressively pruned layers of Llama-3.1-8B, Llamba-8B, and Falcon-Mamba-7B. The leftmost bar represents the full model with all layers intact, while subsequent bars correspond to models with layers pruned incrementally from the end of the network. The plot highlights three key observations: (1) MMLU scores remain relatively stable despite a decline in general knowledge tasks performance, indicating reliance on task-specific skills; (2) a sharp drop in MMLU performance identifies a critical layer encoding essential skills; and (3) the gradual decline in knowledge tasks’ scores reflects the distributed nature of knowledge representation across layers.
|
| 404 |
+
|
| 405 |
+
# A.2 Layer Removal: Mixer and MLP Components
|
| 406 |
+
|
| 407 |
+
For both Llama-3.1-8B and Llamba-8B, we performed experiments where entire layers, including both the mixer and MLP components, were removed. This approach was taken under the assumption that MLP components likely depend on outputs from the mixer components, which are crucial for information flow across layers. The results from these tests, presented in Appendix A.2, show that similar performance trends are observed whether the MLP components are retained or not. This suggests that the mixer components play a more prominent role in encoding retrieval capabilities, while the MLP components do not significantly alter the overall performance on knowledge tasks and MMLU benchmarks. This finding reinforces the idea that retrieval skills are primarily concentrated in specific layers and do not rely heavily on the MLP components within those layers.
|
| 408 |
+
|
| 409 |
+

|
| 410 |
+
■Knowledge■MMLU
|
| 411 |
+
|
| 412 |
+
Llamba-8B: Knowledge vs.MMLU Distributions Across Layers (no MLP removed)
|
| 413 |
+
|
| 414 |
+
Figure 9: Residual performance trends for knowledge tasks and the MMLU benchmark as layers are progressively pruned from Llama-3.1-8B, Llamba-8B but keeping the MLPs intact. This plot yields similar results to Appendix A.1
|
| 415 |
+

|
| 416 |
+
■KnowledgeMMLU
|
| 417 |
+
|
| 418 |
+
# A.3 Performance in Minimal Models
|
| 419 |
+
|
| 420 |
+
The results from Section 3.3 are further elaborated in Appendix A.3. The performance of Llama-3.1-8B and other models when subjected to layer removal shows that, for all models, not one, but two layers are crucial for MMLU performance. The surprising robustness of MMLU performance in the minimal models highlights the importance of fine-tuning layer-wise architecture to achieve strong retrieval performance while retaining knowledge capabilities.
|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
|
| 426 |
+

|
| 427 |
+
Figure 10: Residual performance trends for the MMLU benchmark and knowledge tasks metrics in the minimal model (defined with respect to MMLU) for Llama-3.1-8B, Llamba-8B, and Falcon-Mamba-7B. In this experiment, each layer is independently pruned, and the resulting performance is assessed. The results reveal that two layers are critical for MMLU performance, as pruning either of the last two layers causes a significant drop in MMLU scores while leaving knowledge metrics largely unaffected. This finding highlights the unique role of these layers in task-specific skills rather than general knowledge representation.
|
| 428 |
+
|
| 429 |
+
# A.4 Critical Heads Drive MMLU Performance Across Models
|
| 430 |
+
|
| 431 |
+
To assess how in-context retrieval is localized within specific heads, we examine the MMLU performance of three models—Llama-3.1-8B, Llamba-8B, and Falcon-Mamba-7B—under targeted head ablation. Table 4 presents the results of selectively retaining or removing mixing heads in the final two layers of each model, while preserving all earlier components.
|
| 432 |
+
|
| 433 |
+
Across all architectures, we observe a sharp and consistent pattern: removing just one or two critical heads reduces MMLU accuracy to near-random levels $( \sim 2 5 \% )$ , while retaining them restores much of the original performance. Notably, these heads represent fewer than $0 . 1 \%$ of the total head count, highlighting the extreme concentration of retrieval ability within a tiny subset of the model. Meanwhile, scores on knowledge-focused benchmarks remain nearly unchanged across all configurations, reinforcing that these heads are specifically responsible for in-context retrieval rather than general language modeling or factual recall.
|
| 434 |
+
|
| 435 |
+
This result supports the broader claim that the Gather-and-Aggregate mechanism emerges in just a handful of components and suggests that hybrid and efficient model designs can selectively preserve only these heads.
|
| 436 |
+
|
| 437 |
+
Table 4: Impact of Critical Head Removal Across Model Architectures. We evaluate how retaining or removing specific heads in the final two layers affects MMLU and knowledge task performance for three models: Llama-3.1-8B, Llamba-8B, and Falcon-Mamba-7B. Each row shows performance under a different configuration, where the ”Heads Retained” columns indicate which heads are active in the two final layers (”Layer X” and ”Layer $X { + } 1 ^ { \circ }$ ) while all earlier heads are preserved. The heads shown correspond to the critical Gather and Aggregate Heads identified in prior analyses. For Llama and Llamba models, retaining both heads restores near-original MMLU performance ( $6 6 . 3 \%$ and $5 8 . 9 \%$ , respectively), while removing either or both causes performance to collapse to near-random levels. In Falcon-Mamba-7B, just four attention channels (among thousands) across the final two layers are sufficient to recover $5 2 . 3 \%$ MMLU accuracy—again, comparable to full-model performance. Knowledge task scores remain mostly unchanged across configurations, reinforcing that these heads specifically control retrieval rather than factual knowledge access. This shows that across architectures, in-context retrieval is driven by just a few heads, whose removal alone accounts for the majority of the performance gap. Note: The information for Llama-3.1-8B is a duplicate of Table 1, reprinted here for convenience in comparison.
|
| 438 |
+
|
| 439 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">Heads Retained</td><td colspan="2">Metrics (%)</td></tr><tr><td>Prev. Layers</td><td>Layer X</td><td>Layer X+1</td><td>MMLU</td><td>Knowledge Tasks</td></tr><tr><td rowspan="4">Llama-3.1-8B</td><td>0-31</td><td>22</td><td>24</td><td>66.32</td><td>39.09</td></tr><tr><td>0-31</td><td>∅</td><td>24</td><td>24.36</td><td>39.18</td></tr><tr><td>0-31</td><td>22</td><td>∅</td><td>25.59</td><td>39.21</td></tr><tr><td>0-31</td><td>∅</td><td>∅</td><td>25.56</td><td>39.21</td></tr><tr><td rowspan="4">Llama-8B</td><td>0-31</td><td>10</td><td>3,9</td><td>58.92</td><td>39.08</td></tr><tr><td>0-31</td><td>∅</td><td>3,9</td><td>42.17</td><td>39.16</td></tr><tr><td>0-31</td><td>10</td><td>∅</td><td>38.02</td><td>39.00</td></tr><tr><td>0-31</td><td>∅</td><td>∅</td><td>29.82</td><td>36.76</td></tr><tr><td rowspan="6">Falcon-Mamba-7B</td><td rowspan="2">0-8191</td><td>3186, 5143</td><td>1565, 1906</td><td rowspan="2">52.26</td><td rowspan="2">37.23</td></tr><tr><td>6607, 7305</td><td>3873, 4925</td></tr><tr><td rowspan="2">0-8191</td><td>∅</td><td>1565, 1906</td><td rowspan="2">35.91</td><td rowspan="2">37.25</td></tr><tr><td>3186, 5143</td><td>3873, 4925</td></tr><tr><td>0-8191</td><td>6607, 7305</td><td>∅</td><td>39.39</td><td>37.26</td></tr><tr><td>0-8191</td><td>∅</td><td>∅</td><td>24.98</td><td>37.28</td></tr></table>
|
| 440 |
+
|
| 441 |
+
# A.5 KV-Retrieval Recipe
|
| 442 |
+
|
| 443 |
+
To probe retrieval behavior in isolation, we design a synthetic memorization task in which the model is asked to recall values associated with keys presented earlier in the same prompt. Each input contains a list of key-value (KV) pairs, followed by a query for the value of one of the keys. For example:
|
| 444 |
+
|
| 445 |
+
Memorize the following dictionary:
|
| 446 |
+
|
| 447 |
+
present:50
|
| 448 |
+
|
| 449 |
+
institute:0
|
| 450 |
+
|
| 451 |
+
scallops:84
|
| 452 |
+
|
| 453 |
+
neuropsychiatry:67
|
| 454 |
+
|
| 455 |
+
The value of the key ’scallops’ is
|
| 456 |
+
|
| 457 |
+
Evaluation Setup. We use dictionaries containing key-value pairs and evaluate the model on randomly generated examples. For each example, we assess the model’s ability to retrieve the correct value under two settings:
|
| 458 |
+
|
| 459 |
+
1. Generation: The model is prompted with the full dictionary and asked to generate 10 additional tokens. We check whether the correct value appears anywhere in the generated output.
|
| 460 |
+
2. Answer Scoring: Each possible value from the dictionary is appended to the end of the prompt, and the logprobability of the resulting sequence is computed. The value assigned the highest log-probability is treated as the
|
| 461 |
+
|
| 462 |
+
model’s prediction.
|
| 463 |
+
|
| 464 |
+
The key difference between these strategies lies in how the model expresses its beliefs. Generation allows the model to unfold a short sequence of reasoning steps, operating within a richer space of token-level interactions. However, this flexibility comes at the cost of interpretability, making it harder to surgically probe the model’s internal mechanisms. Answer scoring, by contrast, restricts the model to a fixed set of candidates, offering a more direct readout of its internal ranking.
|
| 465 |
+
|
| 466 |
+
This distinction is important because generation can surface hallucinations—cases where the model outputs values not present in the dictionary or otherwise digresses from the task—while answer scoring is restricted to valid options. We find that the heads responsible for hallucinations differ from those that enable correct retrieval. This stands in contrast to the formulation of Wu et al. [2024], who used generation alone and concluded that “retrieval heads” may be responsible for hallucinations.
|
| 467 |
+
|
| 468 |
+
Prompt Format. We test two variants of the query prompt that differ only in their final character:
|
| 469 |
+
|
| 470 |
+
1. ‘The value of the key ‘scallops’ is‘ and
|
| 471 |
+
2. ‘The value of the key ‘scallops’ is ‘ (with a trailing space).
|
| 472 |
+
|
| 473 |
+
Though superficially similar, these variants elicit markedly different behaviors under Answer Scoring. In variant (1), the model must evaluate completions like ‘The value of the key ‘scallops’ is84‘, which lacks a space and results in unnatural tokenization. Surprisingly, this unnatural format is highly diagnostic: head-level retrieval signals emerge clearly with as few as 20–30 key-value pairs. In contrast, variant (2), which uses the more natural space-delimited form, requires much longer dictionaries to produce similar head-level effects. For comparison, Wu et al. [2024] relied on 35K-token contexts to observe such patterns—well beyond typical context lengths.
|
| 474 |
+
|
| 475 |
+
We hypothesize that this discrepancy reflects a shift in the distribution of retrieval effort across the model. When the prompt ends cleanly on a token boundary, the model can offload the task to a small number of dedicated retrieval heads. By contrast, introducing a continuation token (like a space) appears to encourage more distributed processing across heads.
|
| 476 |
+
|
| 477 |
+
Head-Ablation Protocol. To identify attention heads involved in retrieval, we systematically ablate each head by zeroing out its output projection and measure the resulting drop in accuracy under Answer Scoring (without the trailing space). This procedure isolates heads that are critical for retrieval while keeping computational overhead low.
|
| 478 |
+
|
| 479 |
+
Overall, this setup offers a clean and flexible diagnostic for in-context retrieval—independent of natural language or factual knowledge—and clarifies how individual heads contribute to this core algorithmic skill.
|
| 480 |
+
|
| 481 |
+
# A.6 Retrieval Heads Across Model Families
|
| 482 |
+
|
| 483 |
+
Table 5 presents the 50 most retrieval-relevant heads for each model, ranked by their individual contribution to KV-Retrieval accuracy. Several trends emerge. In Transformers, top heads cluster in upper layers, often overlapping with those critical for MMLU. In SSM-based models, retrieval heads are more diffuse and individually weaker. Zamba2 hybrids concentrate high-performing heads around shared-attention layers, suggesting these layers anchor retrieval in otherwise SSM-heavy architectures.
|
| 484 |
+
|
| 485 |
+
Table 5: Attention Head Ablation Study: Performance impact on KV-Retrieval task when individual attention heads are removed from various language models. Each head was systematically knocked out and the model’s accuracy was evaluated on a KV-Retrieval benchmark with dictionary size of 20 across 1000 samples. All measurements were performed using ‘Answer scoring’ without a trailing space in the prompt. After measurement, each head was restored before testing the next one. Results show the 50 most significant attention heads from each model, sorted by accuracy, revealing which heads contribute most critically to the KV-Retrieval capability across Zamba2, Llama, and Llamba model families. For Zamba2 models, † marks layers with the first shared attention, and ‡ marks those with the second.
|
| 486 |
+
|
| 487 |
+
<table><tr><td colspan="3">Zamba2-2.7B</td><td colspan="3">Zamba2-7B</td><td colspan="3">Llama-3.2-3B</td><td colspan="3">Llama-3.1-8B</td><td colspan="3">Llama-3B</td><td colspan="3">Llama-8B</td></tr><tr><td>Layer</td><td>Head</td><td>Acc</td><td>Layer</td><td>Head</td><td>Acc</td><td>Layer</td><td>Head</td><td>Acc</td><td>Layer</td><td>Head</td><td>Acc</td><td>Layer</td><td>Head</td><td>Acc</td><td>Layer</td><td>Head</td><td>Acc</td></tr><tr><td>6†</td><td>0</td><td>0.088</td><td>11‡</td><td>28</td><td>0.139</td><td>14</td><td>7</td><td>0.381</td><td>12</td><td>1</td><td>0.421</td><td>20</td><td>30</td><td>0.214</td><td>17</td><td>31</td><td>0.382</td></tr><tr><td>18†</td><td>12</td><td>0.199</td><td>23‡</td><td>28</td><td>0.139</td><td>12</td><td>1</td><td>0.405</td><td>8</td><td>8</td><td>0.494</td><td>1</td><td>0</td><td>0.220</td><td>21</td><td>2</td><td>0.446</td></tr><tr><td>6†</td><td>12</td><td>0.303</td><td>35‡</td><td>28</td><td>0.139</td><td>14</td><td>6</td><td>0.524</td><td>13</td><td>5</td><td>0.514</td><td>15</td><td>30</td><td>0.296</td><td>16</td><td>29</td><td>0.460</td></tr><tr><td>30†</td><td>0</td><td>0.328</td><td>47‡</td><td>28</td><td>0.139</td><td>15</td><td>18</td><td>0.545</td><td>14</td><td>7</td><td>0.519</td><td>14</td><td>17</td><td>0.301</td><td>22</td><td>26</td><td>0.465</td></tr><tr><td>6†</td><td>26</td><td>0.380</td><td>59‡</td><td>28</td><td>0.176</td><td>13</td><td>5</td><td>0.589</td><td>13</td><td>17</td><td>0.596</td><td>11</td><td>23</td><td>0.317</td><td>27</td><td>15</td><td>0.471</td></tr><tr><td>30†</td><td>4</td><td>0.421</td><td>71‡</td><td>28</td><td>0.176</td><td>10</td><td>17</td><td>0.597</td><td>15</td><td>18</td><td>0.635</td><td>12</td><td>24</td><td>0.320</td><td>14</td><td>9</td><td>0.471</td></tr><tr><td>18†</td><td>25</td><td>0.426</td><td>11‡</td><td>21</td><td>0.266</td><td>9</td><td>1</td><td>0.625</td><td>14</td><td>6</td><td>0.680</td><td>19</td><td>13</td><td>0.324</td><td>11</td><td>25</td><td>0.476</td></tr><tr><td>30†</td><td>20</td><td>0.430</td><td>23‡</td><td>21</td><td>0.266</td><td>0</td><td>4</td><td>0.639</td><td>13</td><td>23</td><td>0.685</td><td>19</td><td>7</td><td>0.327</td><td>21</td><td>27</td><td>0.482</td></tr><tr><td>18†</td><td>26</td><td>0.433</td><td>35‡</td><td>21</td><td>0.266</td><td>12</td><td>13</td><td>0.648</td><td>12</td><td>2</td><td>0.730</td><td>10</td><td>20</td><td>0.329</td><td>16</td><td>18</td><td>0.487</td></tr><tr><td>30†</td><td>31</td><td>0.472</td><td>47‡</td><td>21</td><td>0.266</td><td>9</td><td>18</td><td>0.655</td><td>5</td><td>14</td><td>0.732</td><td>15</td><td>6</td><td>0.333</td><td>11</td><td>31</td><td>0.487</td></tr><tr><td>24‡</td><td>23</td><td>0.479</td><td>59‡</td><td>21</td><td>0.281</td><td>12</td><td>8</td><td>0.657</td><td>10</td><td>17</td><td>0.761</td><td>24</td><td>17</td><td>0.334</td><td>10</td><td>15</td><td>0.490</td></tr><tr><td>30†</td><td>12</td><td>0.482</td><td>71‡</td><td>21</td><td>0.281</td><td>14</td><td>0</td><td>0.667</td><td>11</td><td>9</td><td>0.784</td><td>13</td><td>29</td><td>0.335</td><td>14</td><td>5</td><td>0.492</td></tr><tr><td>30†</td><td>24</td><td>0.483</td><td>11‡</td><td>3</td><td>0.424</td><td>15</td><td>20</td><td>0.670</td><td>5</td><td>22</td><td>0.816</td><td>7</td><td>28</td><td>0.337</td><td>11</td><td>29</td><td>0.492</td></tr><tr><td>30†</td><td>26</td><td>0.488</td><td>23‡</td><td>3</td><td>0.424</td><td>10</td><td>3</td><td>0.671</td><td>14</td><td>0</td><td>0.828</td><td>10</td><td>16</td><td>0.338</td><td>15</td><td>16</td><td>0.495</td></tr><tr><td>36‡</td><td>3</td><td>0.496</td><td>35‡</td><td>3</td><td>0.424</td><td>3</td><td>18</td><td>0.677</td><td>19</td><td>7</td><td>0.830</td><td>14</td><td>6</td><td>0.340</td><td>12</td><td>9</td><td>0.495</td></tr><tr><td>36‡</td><td>30</td><td>0.496</td><td>47‡</td><td>3</td><td>0.424</td><td>19</td><td>7</td><td>0.677</td><td>9</td><td>23</td><td>0.839</td><td>12</td><td>25</td><td>0.344</td><td>18</td><td>30</td><td>0.497</td></tr><tr><td>30†</td><td>16</td><td>0.499</td><td>6†</td><td>2</td><td>0.430</td><td>8</td><td>8</td><td>0.685</td><td>7</td><td>16</td><td>0.844</td><td>11</td><td>16</td><td>0.348</td><td>14</td><td>7</td><td>0.497</td></tr><tr><td>18†</td><td>16</td><td>0.500</td><td>17†</td><td>2</td><td>0.430</td><td>11</td><td>10</td><td>0.689</td><td>12</td><td>23</td><td>0.846</td><td>14</td><td>9</td><td>0.350</td><td>28</td><td>28</td><td>0.498</td></tr><tr><td>6†</td><td>16</td><td>0.508</td><td>29†</td><td>2</td><td>0.430</td><td>12</td><td>0</td><td>0.689</td><td>10</td><td>11</td><td>0.855</td><td>19</td><td>0</td><td>0.352</td><td>22</td><td>28</td><td>0.498</td></tr><tr><td>24‡</td><td>3</td><td>0.514</td><td>41†</td><td>2</td><td>0.430</td><td>13</td><td>16</td><td>0.693</td><td>16</td><td>15</td><td>0.855</td><td>13</td><td>19</td><td>0.352</td><td>9</td><td>28</td><td>0.501</td></tr><tr><td>24‡</td><td>6</td><td>0.521</td><td>53†</td><td>2</td><td>0.430</td><td>9</td><td>21</td><td>0.696</td><td>11</td><td>11</td><td>0.859</td><td>10</td><td>17</td><td>0.352</td><td>22</td><td>9</td><td>0.502</td></tr><tr><td>24‡</td><td>7</td><td>0.521</td><td>65†</td><td>2</td><td>0.434</td><td>11</td><td>1</td><td>0.698</td><td>7</td><td>4</td><td>0.860</td><td>16</td><td>22</td><td>0.353</td><td>9</td><td>20</td><td>0.502</td></tr><tr><td>30†</td><td>25</td><td>0.524</td><td>77†</td><td>2</td><td>0.434</td><td>12</td><td>12</td><td>0.699</td><td>12</td><td>7</td><td>0.868</td><td>12</td><td>10</td><td>0.353</td><td>11</td><td>0</td><td>0.504</td></tr><tr><td>24‡</td><td>21</td><td>0.526</td><td>11‡</td><td>15</td><td>0.473</td><td>3</td><td>2</td><td>0.703</td><td>10</td><td>20</td><td>0.870</td><td>2</td><td>9</td><td>0.355</td><td>8</td><td>17</td><td>0.504</td></tr><tr><td>18†</td><td>20</td><td>0.532</td><td>11‡</td><td>18</td><td>0.473</td><td>1</td><td>17</td><td>0.705</td><td>3</td><td>4</td><td>0.878</td><td>0</td><td>7</td><td>0.355</td><td>15</td><td>9</td><td>0.505</td></tr><tr><td>6†</td><td>1</td><td>0.532</td><td>23‡</td><td>15</td><td>0.473</td><td>5</td><td>13</td><td>0.705</td><td>0</td><td>7</td><td>0.879</td><td>1</td><td>23</td><td>0.356</td><td>6</td><td>10</td><td>0.505</td></tr><tr><td>24‡</td><td>25</td><td>0.533</td><td>23‡</td><td>18</td><td>0.473</td><td>13</td><td>22</td><td>0.705</td><td>4</td><td>5</td><td>0.883</td><td>8</td><td>26</td><td>0.357</td><td>5</td><td>24</td><td>0.505</td></tr><tr><td>12‡</td><td>12</td><td>0.534</td><td>35‡</td><td>15</td><td>0.473</td><td>9</td><td>3</td><td>0.710</td><td>15</td><td>20</td><td>0.883</td><td>0</td><td>18</td><td>0.357</td><td>19</td><td>24</td><td>0.506</td></tr><tr><td>24‡</td><td>22</td><td>0.538</td><td>35‡</td><td>18</td><td>0.473</td><td>6</td><td>4</td><td>0.713</td><td>1</td><td>7</td><td>0.884</td><td>11</td><td>24</td><td>0.359</td><td>15</td><td>17</td><td>0.506</td></tr><tr><td>36‡</td><td>16</td><td>0.539</td><td>47‡</td><td>15</td><td>0.473</td><td>10</td><td>18</td><td>0.713</td><td>3</td><td>23</td><td>0.885</td><td>16</td><td>9</td><td>0.360</td><td>12</td><td>18</td><td>0.506</td></tr><tr><td>24‡</td><td>13</td><td>0.539</td><td>47‡</td><td>18</td><td>0.473</td><td>5</td><td>19</td><td>0.714</td><td>10</td><td>10</td><td>0.886</td><td>13</td><td>30</td><td>0.360</td><td>7</td><td>11</td><td>0.507</td></tr><tr><td>18†</td><td>10</td><td>0.541</td><td>59‡</td><td>3</td><td>0.480</td><td>12</td><td>10</td><td>0.717</td><td>12</td><td>3</td><td>0.886</td><td>11</td><td>0</td><td>0.352</td><td>24</td><td>5</td><td>0.508</td></tr><tr><td>30†</td><td>6</td><td>0.544</td><td>71‡</td><td>3</td><td>0.480</td><td>11</td><td>15</td><td>0.721</td><td>12</td><td>6</td><td>0.886</td><td>13</td><td>19</td><td>0.352</td><td>13</td><td>29</td><td>0.508</td></tr><tr><td>18†</td><td>21</td><td>0.545</td><td>11‡</td><td>17</td><td>0.488</td><td>9</td><td>17</td><td>0.722</td><td>9</td><td>11</td><td>0.888</td><td>7</td><td>7</td><td>0.360</td><td>7</td><td>20</td><td>0.508</td></tr><tr><td>12‡</td><td>19</td><td>0.545</td><td>23‡</td><td>17</td><td>0.488</td><td>4</td><td>4</td><td>0.726</td><td>11</td><td>1</td><td>0.890</td><td>6</td><td>1</td><td>0.360</td><td>7</td><td>30</td><td>0.508</td></tr><tr><td>18†</td><td>19</td><td>0.546</td><td>35‡</td><td>17</td><td>0.488</td><td>11</td><td>2</td><td>0.729</td><td>8</td><td>17</td><td>0.892</td><td>26</td><td>6</td><td>0.361</td><td>6</td><td>18</td><td>0.508</td></tr><tr><td>24‡</td><td>15</td><td>0.547</td><td>47‡</td><td>17</td><td>0.488</td><td>12</td><td>4</td><td>0.730</td><td>1</td><td>15</td><td>0.895</td><td>23</td><td>16</td><td>0.361</td><td>5</td><td>8</td><td>0.508</td></tr><tr><td>18†</td><td>24</td><td>0.548</td><td>59‡</td><td>15</td><td>0.488</td><td>10</td><td>8</td><td>0.732</td><td>4</td><td>4</td><td>0.896</td><td>19</td><td>9</td><td>0.361</td><td>13</td><td>31</td><td>0.509</td></tr><tr><td>6†</td><td>25</td><td>0.548</td><td>71‡</td><td>15</td><td>0.488</td><td>13</td><td>21</td><td>0.733</td><td>6</td><td>15</td><td>0.896</td><td>7</td><td>9</td><td>0.361</td><td>12</td><td>15</td><td>0.509</td></tr><tr><td>18†</td><td>0</td><td>0.549</td><td>11‡</td><td>10</td><td>0.496</td><td>2</td><td>16</td><td>0.735</td><td>9</td><td>18</td><td>0.896</td><td>22</td><td>27</td><td>0.362</td><td>11</td><td>12</td><td>0.509</td></tr><tr><td>6†</td><td>11</td><td>0.549</td><td>23‡</td><td>10</td><td>0.496</td><td>10</td><td>5</td><td>0.735</td><td>8</td><td>12</td><td>0.897</td><td>16</td><td>16</td><td>0.362</td><td>10</td><td>1</td><td>0.509</td></tr><tr><td>24‡</td><td>12</td><td>0.550</td><td>35‡</td><td>10</td><td>0.496</td><td>11</td><td>14</td><td>0.735</td><td>24</td><td>15</td><td>0.897</td><td>11</td><td>8</td><td>0.362</td><td>10</td><td>8</td><td>0.509</td></tr><tr><td>24‡</td><td>24</td><td>0.550</td><td>47‡</td><td>10</td><td>0.496</td><td>11</td><td>9</td><td>0.739</td><td>3</td><td>3</td><td>0.898</td><td>9</td><td>16</td><td>0.362</td><td>10</td><td>17</td><td>0.509</td></tr><tr><td>18†</td><td>2</td><td>0.551</td><td>59‡</td><td>18</td><td>0.496</td><td>5</td><td>17</td><td>0.740</td><td>0</td><td>1</td><td>0.900</td><td>3</td><td>27</td><td>0.362</td><td>8</td><td>30</td><td>0.509</td></tr><tr><td>24‡</td><td>1</td><td>0.552</td><td>71‡</td><td>18</td><td>0.496</td><td>13</td><td>12</td><td>0.741</td><td>5</td><td>6</td><td>0.900</td><td>11</td><td>22</td><td>0.363</td><td>7</td><td>24</td><td>0.509</td></tr><tr><td>12‡</td><td>9</td><td>0.552</td><td>6†</td><td>1</td><td>0.500</td><td>9</td><td>8</td><td>0.743</td><td>20</td><td>11</td><td>0.900</td><td>6</td><td>24</td><td>0.363</td><td>5</td><td>7</td><td>0.509</td></tr><tr><td>6†</td><td>22</td><td>0.553</td><td>17†</td><td>1</td><td>0.500</td><td>7</td><td>3</td><td>0.744</td><td>3</td><td>16</td><td>0.901</td><td>18</td><td>7</td><td>0.364</td><td>12</td><td>7</td><td>0.510</td></tr><tr><td>18†</td><td>6</td><td>0.554</td><td>29†</td><td>1</td><td>0.500</td><td>12</td><td>22</td><td>0.745</td><td>10</td><td>4</td><td>0.902</td><td>16</td><td>15</td><td>0.364</td><td>11</td><td>8</td><td>0.510</td></tr><tr><td>12‡</td><td>7</td><td>0.554</td><td>41†</td><td>1</td><td>0.500</td><td>19</td><td>1</td><td>0.747</td><td>1</td><td>0</td><td>0.903</td><td>14</td><td>27</td><td>0.364</td><td>9</td><td>0</td><td>0.510</td></tr><tr><td>30†</td><td>2</td><td>0.555</td><td>53†</td><td>1</td><td>0.500</td><td>4</td><td>8</td><td>0.748</td><td>3</td><td>1</td><td>0.905</td><td>13</td><td>24</td><td>0.364</td><td>22</td><td>31</td><td>0.511</td></tr></table>
|
paper_markdowns/bamboo-05045.md
ADDED
|
@@ -0,0 +1,598 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Ziyang Yu 1 Wenbing Huang 2 3 Yang Liu 1 4
|
| 2 |
+
|
| 3 |
+
# Abstract
|
| 4 |
+
|
| 5 |
+
Molecular Dynamics (MD) simulations are essential for understanding the atomic-level behavior of molecular systems, giving insights into their transitions and interactions. However, classical MD techniques are limited by the trade-off between accuracy and efficiency, while recent deep learningbased improvements have mostly focused on single-domain molecules, lacking transferability to unfamiliar molecular systems. Therefore, we propose Unified Simulator (UniSim), which leverages cross-domain knowledge to enhance the understanding of atomic interactions. First, we employ a multi-head pretraining approach to learn a unified atomic representation model from a large and diverse set of molecular data. Then, based on the stochastic interpolant framework, we learn the state transition patterns over long timesteps from MD trajectories, and introduce a force guidance module for rapidly adapting to different chemical environments. Our experiments demonstrate that UniSim achieves highly competitive performance across small molecules, peptides, and proteins.
|
| 6 |
+
|
| 7 |
+
# 1. Introduction
|
| 8 |
+
|
| 9 |
+
Molecular Dynamics (MD) simulations, an in silico method used to comprehend the time evolution of molecular systems in given environments, serve as a fundamental and essential tool in various fields like computational chemistry, pharmacology, material design, and condensed matter physics (Van Gunsteren & Berendsen, 1990; Lindorff-Larsen et al., 2011; Hollingsworth & Dror, 2018; Lau et al.,
|
| 10 |
+
|
| 11 |
+
*Equal contribution 1Department of Computer Science and Technology, Tsinghua University, Beijing, China 2Gaoling School of Artificial intelligence, Renmin University of China, Beijing, China 3Engineering Research Center of Next-Generation Intelligent Search and Recommendation, MOE 4Institute for AI Industry Research (AIR), Tsinghua University, Beijing, China. Correspondence to: Wenbing Huang <hwenbing@126.com>, Yang Liu <liuyang2011@tsinghua.edu.cn>.
|
| 12 |
+
|
| 13 |
+
Proceedings of the $4 2 ^ { n d }$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 14 |
+
|
| 15 |
+

|
| 16 |
+
Figure 1. UniSim enables time-coarsened dynamics simulations of small molecules, peptides, and proteins over a long timestep $\tau$ .
|
| 17 |
+
|
| 18 |
+
2018). One of the MD’s core objectives is to generate trajectories of molecular states that adhere to underlying physics constraints over a period of time, given the initial state of the molecular system and environment configurations (Allen et al., 2004). To achieve this end, classical MD methods (van Gunsteren & Oostenbrink, 2024) update the next step of motion by numerically integrating Newton equations or Langevin dynamics (Langevin, 1908), with the potential energy and atomic forces calculated based on the current molecular state. It should be noted that the stability of the numerical integration requires an extremely small timestep $\Delta t \approx 1 0 ^ { - 1 5 } \mathrm { s }$ during MD simulations (Plimpton, 1995).
|
| 19 |
+
|
| 20 |
+
In terms of how energy is calculated, classical MD methods can be divided into Quantum Mechanics (QM) methods (Griffiths & Schroeter, 2019) and empirical force field methods (Pearlman et al., 1995; Vanommeslaeghe et al., 2010). On the one hand, QM methods provide highly accurate energy calculations, while their great computational complexity makes it prohibitively expensive for accurate transition path sampling on a long time scale, like protein folding (Lindorff-Larsen et al., 2011). On the other hand, empirical force field methods are faster but less accurate. To accelerate the sampling of conformation transition pathways, some MD methods based on reinforcement learning (Shin et al., 2019), adaptive sampling (Markwick et al., 2011; Botu & Ramprasad, 2015a), as well as enhanced sampling (Bal & Neyts, 2015; M. Sultan & Pande, 2017; Wang et al., 2021; Celerse et al. ´ , 2022) have been proposed, yet achieving a
|
| 21 |
+
|
| 22 |
+
qualitative improvement in efficiency while maintaining the accuracy remains challenging.
|
| 23 |
+
|
| 24 |
+
Recently, a surge of deep learning methods have been proposed to boost MD simulations from different aspects (Noe´ et al., 2019; Kohler et al. ¨ , 2023; Lu et al., 2024; Klein et al., 2024; Schreiner et al., 2024; Wang et al., 2024a;b; Yu et al., 2024). Specifically, a series of methods categorized as time-coarsened dynamics aim to accelerate simulations by learning the push forward from $\vec { \bf X } _ { t }$ to $\vec { \mathbf { X } } _ { t + \tau }$ with a much larger timestep $\tau \gg \Delta t$ , where $\vec { \bf X } _ { t }$ denotes the molecular state at the wall-clock time $t$ (Klein et al., 2024; Schreiner et al., 2024; Yu et al., 2024). Although these methods can in principle achieve rapid long-time sampling, several issues arise in practical applications: 1) Almost all previous works are restricted to a single molecular domain (e.g., peptides or proteins) within a fixed environment, lacking the transferability across different scenarios. 2) Some models leverage hand-crafted representations on specific domains (e.g., $\gamma \cdot$ - carbons in leucines), which significantly impair their ability to recognize unfamiliar molecules, such as proteins with unnatural amino acids (Link et al., 2003).
|
| 25 |
+
|
| 26 |
+
Taking all these into consideration, we propose a pretrained model for Unified full-atom time-coarsened dynamics Simulation (UniSim), which is transferable to small molecules, peptides as well as proteins, and can be easily adapted to various chemical environments by parameterefficient training. An illustration for one-step simulation performed by UniSim is displayed in Figure 1. Firstly, owing to the scarcity of MD trajectory datasets, we propose to pretrain a unified atomic representation model on multidomain 3D molecular datasets under different chemical environments and equilibrium states. Based on the pretrained model, we then leverage the stochastic interpolants generative framework (Albergo et al., 2023) to learn the push forward from $\vec { \bf X } _ { t }$ to $\vec { \mathbf X } _ { t + \tau }$ , with a predefined long timestep $\tau$ . Finally, in order to better adapt to specific chemical environments with different force conditions (temperatures, pressures, solvents etc.), we follow FBM (Yu et al., 2024) and introduce force guidance to regulate the sampling process of molecular trajectories. In summary, our contributions are:
|
| 27 |
+
|
| 28 |
+
• To our best knowledge, UniSim is the first deep learning-based generative model that tailored for transferable time-coarsened dynamics on cross-domain molecular systems.
|
| 29 |
+
• We employ a multi-task pretraining approach to learn a unified atomic representation model from crossdomain molecular data, leveraging novel techniques to tackle unbalanced molecular scales and provide finegrained atomic representations.
|
| 30 |
+
• Based on the stochastic interpolant framework, we learn the state transition patterns over long-time steps
|
| 31 |
+
|
| 32 |
+
from MD trajectories, and introduce a force guidance module for rapidly adapting to different chemical environments.
|
| 33 |
+
|
| 34 |
+
# 2. Related Work
|
| 35 |
+
|
| 36 |
+
3D Molecular Pretraining Given the success of the pretraining paradigm in the fields of NLP, some recent works have proposed pretraining methods based on 3D molecular structures (Zaidi et al., 2023; Luo et al., 2022; Zhang et al., 2023; Gao et al., 2022; Jiao et al., 2023; Zhou et al., 2023; Feng et al., 2024; Jiao et al., 2024; Zhang et al., 2024). Considering the scarcity of labeled molecular data, the NoisyNode (Zaidi et al., 2023) method proposes the denoising regularization paradigm for self-supervised pretraining on equilibrium conformations. Correspondingly, machine learning forcefields (Botu & Ramprasad, 2015b; Chmiela et al., 2017; 2018; 2023) explore the off-equilibrium conformation space by force-centric training. Furthermore, ET-OREO (Feng et al., 2024) proposes a novel pretraining method for learning unified representations encompassing both equilibrium and off-equilibrium conformations. EPT (Jiao et al., 2024) adopts the denoising pretraining on coarse-grained blocks and extends to learn representations of multi-domain molecules. Additionally, DPA-2 (Zhang et al., 2024) adapts to diverse chemical and materials systems by leveraging multi-task approach for different data sources. In this work, we propose a novel pretraining approach that is scalable to multi-domain biomolecules and adopts the multi-task approach to distinguish different forcefields and equilibrium states.
|
| 37 |
+
|
| 38 |
+
Time-Coarsened Dynamics To overcome the constraints of numerical integration stability of classical MD simulations, a series of deep learning-based methods (Fu et al., 2023; Klein et al., 2024; Li et al., 2024; Jing et al., 2024; Schreiner et al., 2024; Hsu et al., 2024; Klein & Noe, 2024; Du et al., 2024; Yu et al., 2024) learn the push forward from $\vec { \bf X } _ { t }$ to $\vec { \mathbf { X } } _ { t + \tau }$ over long timesteps $\tau$ to enable rapid state transitions, which can be classified as time-coarsened dynamics. Various generative frameworks have been leveraged to learn the all-atom dynamics from data pairs of trajectories, including augmented normalizing flows (Klein et al., 2024), score-based diffusion (Hsu et al., 2024; Schreiner et al., 2024), flow matching (Klein & Noe, 2024) and stochastic interpolants (Du et al., 2024; Yu et al., 2024). On the contrary, F3low (Li et al., 2024) and MDGen (Jing et al., 2024) learn dynamics of proteins with coarse-grained representations. Notably, FBM (Yu et al., 2024) introduces the force guidance to comply with the underlying Boltzmann distribution, achieving state-of-the-art performance on peptides. According to FBM, we first learn a unified vector field based on the stochastic interpolants framework, then we leverage the force guidance for parameter-efficient fine-tuning to
|
| 39 |
+
|
| 40 |
+
diverse chemical environments and forcefields.
|
| 41 |
+
|
| 42 |
+
# 3. Method
|
| 43 |
+
|
| 44 |
+
We present the overall workflow of UniSim in this section with an illustration in Figure 2. In $\ S \ 3 . 1$ , we will define the task formulation with necessary notations. In $\ S 3 . 2$ , we will propose novel techniques for obtaining a unified atomic representation model by pretraining on diverse datasets of multi-domain biomolecules. Afterwards, we will introduce the regimen of learning time-coarsened dynamics based on the stochastic interpolant in $\ S \ 3 . 3$ . Finally, we will incorporate the force guidance technique to adapt to diverse chemical environments and present the scheme of parameterefficient fine-tuning in $\ S \ 3 . 4$ . All proofs of propositions are provided in $\ S \ B$ .
|
| 45 |
+
|
| 46 |
+
# 3.1. Task Formulation
|
| 47 |
+
|
| 48 |
+
We assume that there are $m$ datasets $\{ \mathcal { D } _ { 1 } , \cdot \cdot \cdot , \mathcal { D } _ { m } \}$ consisting of 3D molecular conformations and $l$ datasets $\{ \mathcal T _ { 1 } , \cdots , \mathcal T _ { l } \}$ consisting of MD trajectories. Each molecule is represented as $\mathcal { G } = ( Z , \vec { X } )$ , where $\boldsymbol { Z } \in \mathbb { R } ^ { N }$ denotes the atomic types of $N$ atoms, $\vec { \pmb X } \in \mathbb R ^ { N \times 3 }$ denotes the atomic positions. If the molecular conformation is off-equilibrium, we denote $\varepsilon : \mathbb { R } ^ { N \times 3 } \mathbb { R }$ as the MD potential function and $\vec { F } = - \nabla \varepsilon ( \vec { X } ) \in \mathbb { R } ^ { N \times 3 }$ as its MD forces, otherwise $\vec { F } = 0$ . Our goals are listed below:
|
| 49 |
+
|
| 50 |
+
1. We first obtain a unified atomic representation model $\varphi$ pretrained on the datasets $\{ \mathcal { D } _ { 1 } , \cdot \cdot \cdot , \mathcal { D } _ { m } \}$ . Formally, the pretrained model is defined as:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\boldsymbol {H}, \vec {\boldsymbol {V}} = \varphi (\bar {t}, \boldsymbol {Z}, \vec {\boldsymbol {X}}), \tag {1}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where $\bar { t } \in \{ 0 , 1 \}$ is set for the compatibility to the generation framework, $H \in \mathbb { R } ^ { N \times H }$ denotes atomic representations of H channels, and V⃗ ∈ RN×3×H $H$ $\vec { V } \in \mathbb { R } ^ { N \times 3 \times H }$ denotes SO(3)-equivariant vectors of all atoms.
|
| 57 |
+
|
| 58 |
+
2. Given the coarsened timestep $\tau$ and training data pairs $\{ ( \mathcal { G } _ { t } , \mathcal { G } _ { t + \tau } ) \}$ randomly sampled from a trajectory dataset $\mathcal { T } _ { i }$ $\ 1 \leq i \leq l )$ , we train a vector field model $\phi$ with the pretrained $\varphi$ serving as a graph encoder, which learns the push forward from $\vec { \bf X } _ { t } ^ { \phantom { \dagger } }$ to $\mathbf { \dot { X } } _ { t + \tau }$ based on the stochastic interpolant framework.
|
| 59 |
+
3. For adapting to diverse chemical environments (e.g., solvation), we train a force guidance kernel $\zeta$ on the corresponding trajectory dataset $\tau _ { j }$ $( 1 \leq j \leq l )$ , which incorporates underlying physics principles into generation (Yu et al., 2024). The parameters of networks $\varphi , \phi$ are kept frozen, serving as reusable backbones.
|
| 60 |
+
|
| 61 |
+
# 3.2. Unified Pretraining
|
| 62 |
+
|
| 63 |
+
In this section, we will introduce the techniques applied for pretraining UniSim on multi-domain 3D molecular datasets. Please note that, to comply with the symmetry properties of 3D molecules, we leverage the SO(3)-equivariant graph neural network TorchMD-NET (Pelaez et al., 2024) as the model architecture.
|
| 64 |
+
|
| 65 |
+
Gradient-Environment Subgraph A crucial challenge in training unified representation models arises from the vast scale discrepancy between molecular systems: small molecules typically contain tens of atoms, while proteins often comprise hundreds or thousands atoms. Most of previous works that construct molecular graphs using KNN (Kong et al., 2023) or radius cutoff (Schreiner et al., 2024) neglect the scale discrepancy, which may inhibit the transferability across molecular domains. To properly address the issue, we propose the so-called gradientenvironment subgraph method to bridge the gap in scales of cross-domain molecules.
|
| 66 |
+
|
| 67 |
+
Specifically, for each macromolecule $\mathcal { G }$ with more than 1,000 atoms, we randomly select an atom $c$ with Cartesian coordinates $\vec { \pmb { x } } _ { c } ~ \in ~ \mathbb { R } ^ { 3 }$ . Given the predefined thresholds $0 \leq \delta _ { \mathrm { m i n } } < \delta _ { \mathrm { m a x } }$ , the gradient subgraph $\mathcal { G } _ { g }$ and the environment subgraph $\mathcal { G } _ { e }$ are constructed as follows:
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathcal {G} _ {g} = \{j \mid j \in \mathcal {G}, \left\| \vec {x} _ {j} - \vec {x} _ {c} \right\| _ {2} < \delta_ {\min } \}, \tag {2}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathcal {G} _ {e} = \{j | j \in \mathcal {G}, \left\| \vec {\boldsymbol {x}} _ {j} - \vec {\boldsymbol {x}} _ {c} \right\| _ {2} < \delta_ {\max } \}. \tag {3}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
It is easy to show that $\mathcal { G } _ { g } \subseteq \mathcal { G } _ { e }$ . Moreover, for each atom in $\mathcal { G } _ { g }$ , the distance to any other atom in $\mathcal { G } \setminus \mathcal { G } _ { e }$ should be at least $\delta _ { \mathrm { m a x } } - \delta _ { \mathrm { m i n } }$ . Therefore, as long as $\delta _ { \mathrm { m a x } } - \delta _ { \mathrm { m i n } }$ is set to be large enough, interactions between atoms outside of $\mathcal { G } _ { e }$ and those in $\mathcal { G } _ { g }$ can be neglected, which is consistent with physics principles.
|
| 78 |
+
|
| 79 |
+
Afterwards, the environment subgraph $\mathcal { G } _ { e }$ rather than the whole graph $\mathcal { G }$ will serve as the input to the model. Edges between atoms are constructed based on a predefined cutoff $r _ { \mathrm { c u t } }$ . It should be noted that only the atoms within $\mathcal { G } _ { g }$ participate in the calculation of the training objective, since the contribution of the truncated atoms of the original graph $\mathcal { G }$ to the atoms within $\mathcal { G } _ { e } \setminus \mathcal { G } _ { g }$ cannot be shielded.
|
| 80 |
+
|
| 81 |
+
Atomic Embedding Expansion In addition to the scale discrepancy, the molecular specificity is another key factor hindering the development of a unified atomic representation. In domains like proteins, atoms of the same type exhibit different but regular patterns (e.g., CA and CB), while wet lab experiments (Rossmann & Arnold, 2001) elucidate that atoms of the same pattern probably share consistent properties like bond lengths. Due to the hard constraints on bond lengths and angles, these patterns exhibit discrete characteristics, which 3D GNNs tailored for continuous features
|
| 82 |
+
|
| 83 |
+

|
| 84 |
+
|
| 85 |
+

|
| 86 |
+
|
| 87 |
+

|
| 88 |
+
|
| 89 |
+

|
| 90 |
+
Figure 2. Illustration for the overall workflow of UniSim. a. The unified atomic representation model $\varphi$ is pretrained on multi-domain 3D molecules, where data from different chemical environments are fed to the corresponding output head. b. Based on the stochastic interpolant framework, vector field models $v , \eta _ { z }$ are trained on MD trajectories to learn the push forward from $\vec { \bf X } _ { t }$ to $\vec { \mathbf { X } } _ { t + \tau }$ with timestep $\tau$ . c. To adapt to different chemical environements, additional networks $\Psi , \psi$ are trained to fit the intermediate forcefield $\nabla \varepsilon _ { t }$ , with other parameters frozen. d. Given an initial state, inference is performed by iteratively solving an SDE with the diffusion time $t$ from 0 to 1.
|
| 91 |
+
|
| 92 |
+
may struggle to capture.
|
| 93 |
+
|
| 94 |
+
This implies that an effective embedding approach must capture these patterns. Using only the periodic table as vocabulary would yield low-resolution representations, missing those domain-specific regularities. Instead, we propose the atomic embedding expansion technique, extending elements of the periodic table to multiple discrete patterns that serve as the expanded vocabulary. Given the molecular graph, the model automatically maps each atom to the most possible pattern of the element based on its neighbors, thus simplifying the understanding of complex but highly regular structures.
|
| 95 |
+
|
| 96 |
+
Specifically, We first define a basic atomic vocabulary $A _ { b } \in$ $\bar { \mathbb { R } ^ { A \times H } }$ as well as an expanded atomic vocabulary $A _ { e } ~ \in$ $\mathbb { R } ^ { A \times D \times H }$ based on all possible element types that appear in the datasets, where $A$ represents the number of element types, $D$ represents the number of regular patterns for each element. Next, for any atom $i$ of the constructed molecular graph $\mathcal { G }$ and its neighbors ${ \mathcal { N } } _ { i }$ , we compute the expanded weight vector ${ \pmb w } _ { i }$ as follows:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\boldsymbol {n} _ {i} = \sum_ {j \in \mathcal {N} _ {i}} \operatorname {r b f} \left(d _ {i j}\right) \odot \boldsymbol {A} _ {b} [ j ] \in \mathbb {R} ^ {H}, \tag {4}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\boldsymbol {w} _ {i} = \operatorname {s o f t m a x} \left(\operatorname {l i n} \left(\boldsymbol {A} _ {b} [ i ], \boldsymbol {n} _ {i}\right)\right) \in [ 0, 1 ] ^ {D}, \tag {5}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
where $\odot$ represents the element-wise multiplication operator, lin denotes the linear layer, rbf denotes the radial basis function, $V _ { b } [ i ]$ represents the atomic embedding of atom $i$ , $d _ { i j }$ denotes the Euclidean distance between atom $i$ and $j$ . The vector ${ \pmb w } _ { i }$ is further considered as the probability that atom $i$ appears in one of the $D$ possible regular chemical environments. To allow for back-propagation, we calculate
|
| 107 |
+
|
| 108 |
+
the expanded embedding of atom $i$ as follows:
|
| 109 |
+
|
| 110 |
+
$$
|
| 111 |
+
\boldsymbol {z} _ {i} = \ln \left(\boldsymbol {A} _ {b} [ i ], \boldsymbol {w} _ {i} ^ {\top} \boldsymbol {A} _ {e} [ i ], \boldsymbol {n} _ {i}\right) \in \mathbb {R} ^ {H}. \tag {6}
|
| 112 |
+
$$
|
| 113 |
+
|
| 114 |
+
Then $Z \in \mathbb { R } ^ { N \times H }$ is the concatenation of the expanded embeddings $z _ { i }$ for all atoms $i$ .
|
| 115 |
+
|
| 116 |
+
Unified Multi-Head Pretraining With the graph topology and the atomic representation well prepared, we propose the technique for unified pretraining on multi-domain molecules. First of all, following Feng et al. (2024), all molecular data can be preliminarily classified into equilibrium and off-equilibrium categories. For the off-equilibrium molecular conformations $\vec { X }$ with real MD forces $\scriptstyle { \vec { F } }$ , we use the following objective for self-disciplined pretraining:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathcal {L} _ {o} = \left\| \nabla_ {\vec {X}} \left(\sum_ {i} H _ {\text {o u t}} [ i ]\right) + \vec {F} \right\| _ {2} ^ {2}, \tag {7}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
with
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\boldsymbol {H} _ {\text {o u t}}, \vec {\boldsymbol {V}} _ {\text {o u t}} = \operatorname {G V P} (\boldsymbol {H}, \vec {\boldsymbol {V}}), \tag {8}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $H , \vec { V }$ are obtained by the representation model $\varphi$ based on Eq. (1), GVP is the Geometric Vector Perceptron (GVP) layer first introduced by Jing et al. (2021) and further updated by Jiao et al. (2024).
|
| 129 |
+
|
| 130 |
+
For the equilibrium molecular conformations, we adopt the denoising pretraining method. Specifically, we first add a Gaussian noise to the equilibrium conformation:
|
| 131 |
+
|
| 132 |
+
$$
|
| 133 |
+
\vec {X} ^ {\prime} = C \left(\vec {X} + \sigma_ {e} \epsilon\right), \epsilon \sim \mathcal {N} (0, I), \tag {9}
|
| 134 |
+
$$
|
| 135 |
+
|
| 136 |
+
where $C ( \cdot )$ is the centering operator to ensure translational neutrality, $\sigma _ { e }$ is the hyperparameter to control the noise
|
| 137 |
+
|
| 138 |
+
scale. Following Eqs. (1) and (8), we obtain $H _ { \mathrm { o u t } } ^ { \prime } \in \mathbb { R } ^ { N }$ by using ${ \vec { X } } ^ { \prime }$ as the input. Then the training objective is given by:
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\mathcal {L} _ {e} = \left\| \nabla_ {\vec {X}} \left(\sum_ {i} H _ {\text {o u t}} ^ {\prime} [ i ]\right) - \frac {\vec {X} ^ {\prime} - \vec {X}}{\sigma_ {e}} \right\| _ {2} ^ {2}. \tag {10}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
However, different datasets may have calculated MD forces under varying conditions (e.g., solvation), leading to misalignment between data distributions. To address the issue, DPA-2 (Zhang et al., 2024) proposes the multi-head pretraining technique, introducing the unified descriptor for atomic representations and the fitting network that is updated exclusively with the specific pretraining dataset. Similarly, we use a series of GVP heads in Eq. (8) with non-shared weights to process data with force labels calculated in different forcefields. For convenience, we denote the training objective in Eq. (7) calculated by the $k$ -th $( 1 \leq k \leq K )$ ) head as $\mathcal { L } _ { o } ^ { ( k ) }$ , where $K$ represents the number of forcefields across the pretraining datasets. The ultimate training objective for unified multi-head pretraining is given by:
|
| 145 |
+
|
| 146 |
+
$$
|
| 147 |
+
\mathcal {L} _ {p} = \mathcal {L} _ {e} \mathbb {I} (\vec {\boldsymbol {F}} = \mathbf {0}) + \mathcal {L} _ {o} ^ {(k)} \mathbb {I} (\vec {\boldsymbol {F}} \neq \mathbf {0}), \tag {11}
|
| 148 |
+
$$
|
| 149 |
+
|
| 150 |
+
where $\mathbb { I } ( \cdot )$ is the indicator function, $k$ is the identifier for distinguishing different chemical environments.
|
| 151 |
+
|
| 152 |
+
# 3.3. Vector Field Model for Dynamics
|
| 153 |
+
|
| 154 |
+
In this section, we will present the generative framework of UniSim, named as the vector field model, to learn the push forward from $\vec { \bf X } _ { t }$ to $\vec { \mathbf { X } } _ { t + \tau }$ of MD trajectories with a predefined long timestep $\tau$ . For compatibility to the generative framework, we will denote the initial state as $\vec { \bf X } _ { 0 }$ and the terminal state as $\vec { \bf X } _ { 1 }$ for each training data pair.
|
| 155 |
+
|
| 156 |
+
Here we leverage the stochastic interpolant (Albergo et al., 2023) as our generative framework. Given two probability density functions $q _ { 0 } , q _ { 1 } : \mathbb { R } ^ { d } \mathbb { R } _ { \geq 0 }$ , a stochastic interpolant between $q _ { 0 }$ and $q _ { 1 }$ is a stochastic process $\vec { \bf X } _ { t }$ defined as:
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\vec {\mathbf {X}} _ {t} = I (t, \vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}) + \gamma (t) \vec {\mathbf {Z}}, \tag {12}
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
where the pair $( \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } )$ is drawn from the probability measure $\nu$ that marginalizes on $q _ { 0 }$ and $q _ { 1 }$ , $\vec { \mathbf Z } \sim \mathcal { N } ( \boldsymbol 0 , \boldsymbol I ) ,$ t ∈ $[ 0 , 1 ]$ denotes the diffusion time, $I ( \cdot ) : [ 0 , 1 ] \times \mathbb { R } ^ { d } \times \mathbb { R } ^ { d } $ $\mathbb { R } ^ { d }$ and $\gamma ( \cdot ) : [ 0 , 1 ] \mathbb { R }$ are mapping functions that should satisfy certain properties.
|
| 163 |
+
|
| 164 |
+
To obtain training objectives, we first define the velocity $v$ and the denoiser $\eta _ { z }$ as:
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
v (t, \vec {\mathbf {X}}) = \mathbb {E} \left[ \partial_ {t} I \left(t, \vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}\right) \mid \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right], \tag {13}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\eta_ {z} (t, \vec {\mathbf {X}}) = \mathbb {E} [ \vec {\mathbf {Z}} | \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} ], \tag {14}
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
where the expectation is taken over the data pairs $( \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } )$ . It can be further proved that the stochastic process $\vec { \bf X } _ { t }$ , ve-
|
| 175 |
+
|
| 176 |
+
locity $v$ and denoiser $\eta _ { z }$ are linked by an SDE:
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\mathrm {d} \vec {\mathbf {X}} _ {t} = b (t, \vec {\mathbf {X}} _ {t}) \mathrm {d} t - \frac {\epsilon (t)}{\gamma (t)} \eta_ {z} (t, \vec {\mathbf {X}} _ {t}) \mathrm {d} t + \sqrt {2 \epsilon (t)} \mathrm {d} \mathbf {B} _ {t}, \tag {15}
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
where $b ( t , \vec { \bf X } ) = v ( t , \vec { \bf X } ) + \dot { \gamma } ( t ) \eta _ { z } ( t , \vec { \bf X } )$ , $\epsilon ( t )$ is a predefined function with regard to $t$ , and $\mathbf { B } _ { t }$ denotes the standard Wiener process.
|
| 183 |
+
|
| 184 |
+
Note that different choices of $I ( \cdot )$ and $\gamma ( \cdot )$ can induce infinite SDEs. As a well-studied case, we follow the setting of Yu et al. (2024):
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
I (t, \vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}) = t \vec {\mathbf {X}} _ {1} + (1 - t) \vec {\mathbf {X}} _ {0}, \gamma (t) = \sqrt {t (1 - t)} \sigma_ {s}, \tag {16}
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
where $\sigma _ { s } \in \mathbb { R } _ { + }$ is a hyperparameter to control the perturbation strength. Substituting them into Eqs. (13) and (14), the training objectives are given by:
|
| 191 |
+
|
| 192 |
+
$$
|
| 193 |
+
\mathcal {L} _ {v} = \mathbb {E} [ \| v (t, \vec {\mathbf {X}} _ {t}) - (\vec {\mathbf {X}} _ {1} - \vec {\mathbf {X}} _ {0}) \| _ {2} ^ {2} + \| \eta_ {z} (t, \vec {\mathbf {X}} _ {t}) - \vec {\mathbf {Z}} \| _ {2} ^ {2} ], \tag {17}
|
| 194 |
+
$$
|
| 195 |
+
|
| 196 |
+
where $v$ and $\eta _ { z }$ are implemented as neural networks, the expectation is taken over the diffusion time $t$ following the uniform distribution on $[ 0 , 1 ]$ , training data pairs $( \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } )$ and the intermediate state $\vec { \bf X } _ { t }$ following Eq. (12).
|
| 197 |
+
|
| 198 |
+
Here we introduce the implementation details of networks $v$ and $\eta _ { z }$ . First, the pretrained network $\varphi$ is initialized as a graph encoder, which now takes the diffusion time $t \in$ [0, 1] instead of $\bar { t } \in \{ 0 , 1 \}$ as input. The invariant and equivariant outputs of $\varphi$ , $\pmb { H }$ and $\vec { V }$ , are further fed to two GVP layers with non-shared weights as the output heads of $v$ and $\eta _ { z }$ , respectively. Considering different scales of labels, an additional Vector LayerNorm (VLN) is stacked before each GVP layer, defined as as:
|
| 199 |
+
|
| 200 |
+
$$
|
| 201 |
+
\operatorname {V L N} (\vec {\boldsymbol {V}}) = \vartheta \cdot \frac {\vec {\boldsymbol {V}}}{\operatorname {s t d} _ {1} (\vec {\boldsymbol {V}})} \in \mathbb {R} ^ {N \times 3 \times H}, \tag {18}
|
| 202 |
+
$$
|
| 203 |
+
|
| 204 |
+
where $\vartheta$ is a learnable parameter, $\mathrm { s t d } _ { i } ( \cdot )$ represents calculating the standard value along dimension $i$ of the tensor.
|
| 205 |
+
|
| 206 |
+
# 3.4. Force Guidance Kernel for Finetuning
|
| 207 |
+
|
| 208 |
+
In this section, we will introduce the network $\zeta$ , named as the force guidance kernel, which provides the mobility to different chemical environments by learning an “virtual” force defined on $\vec { \bf X } _ { t }$ and incorporating into generation. Inspired by Wang et al. (2024a); Yu et al. (2024), we hope the marginal distribution $p _ { t }$ generated by $\zeta$ satisfies:
|
| 209 |
+
|
| 210 |
+
$$
|
| 211 |
+
p _ {t} (\cdot) \propto q _ {t} (\cdot) \exp (- \alpha \varepsilon_ {t} (\cdot)), \varepsilon_ {0} (\cdot) = \varepsilon_ {1} (\cdot) = \varepsilon (\cdot), \tag {19}
|
| 212 |
+
$$
|
| 213 |
+
|
| 214 |
+
where $q _ { t }$ represents the marginal distribution generated by the vector field model $\phi$ , $\alpha$ is the hyperparameter of guidance strength, and $\varepsilon _ { t } ( \cdot )$ denotes an intermediate potential
|
| 215 |
+
|
| 216 |
+
defined on $\vec { \bf X } _ { t }$ , which is continuous with the MD potential $\varepsilon$ at two endpoints. Therefore, any change of MD potentials owing to different chemical environments will reflect on the change of generated marginal distributions based on $\zeta$ , serving as the guidance of underlying physics principles.
|
| 217 |
+
|
| 218 |
+
For simplification, we assume that the stochastic interpolant that generates $p _ { t }$ shares the same form as in Eq. (16), implying that $p _ { t } ( \hat { \vec { \mathbf { X } } } _ { t } | \vec { \mathbf { X } } _ { 0 } , \vec { \mathbf { X } } _ { 1 } ) = q _ { t } ( \vec { \mathbf { X } } _ { t } | \vec { \mathbf { X } } _ { 0 } , \vec { \mathbf { X } } _ { 1 } )$ . According to Yu et al. (2024), the closed-form of the intermediate forcefield $\nabla \varepsilon _ { t } ( \cdot )$ is given by:
|
| 219 |
+
|
| 220 |
+
$$
|
| 221 |
+
\nabla \varepsilon_ {t} \left(\vec {\mathbf {X}} _ {t}\right) = \frac {\mathbb {E} \left[ q _ {t} \left(\vec {\mathbf {X}} _ {t} \mid \vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1}\right) g \left(\vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1}\right) h \left(\vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1} , \vec {\mathbf {X}} _ {t}\right) \right]}{\alpha \mathbb {E} \left[ q _ {t} \left(\vec {\mathbf {X}} _ {t} \mid \vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1}\right) g \left(\vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1}\right) \right]}, \tag {20}
|
| 222 |
+
$$
|
| 223 |
+
|
| 224 |
+
where $g ( \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } ) = \exp ( - \alpha ( \varepsilon ( \vec { \bf X } _ { 0 } ) + \varepsilon ( \vec { \bf X } _ { 1 } ) ) )$ and $h ( \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } , \vec { \bf X } _ { t } ) \ = \ \nabla \log q _ { t } ( \vec { \bf X } _ { t } ) \ - \ \nabla \log q _ { t } ( \vec { \bf X } _ { t } | \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } )$ . According to Albergo et al. (2023), $- \gamma ^ { - 1 } ( t ) \eta _ { z } ( t , { \vec { \mathbf { X } } } _ { t } )$ is an unbiased estimation of $\nabla \log q _ { t } ( \vec { \mathbf { X } } _ { t } )$ , and $\nabla \log q _ { t } ( \vec { \bf X } _ { t } | \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } )$ has a closed-form solution based on Eqs. (12) and (16), thus all terms of Eq. (20) can be calculated during training without any approximation.
|
| 225 |
+
|
| 226 |
+
Further, Proposition 3.1 reveals the closed-form of SDE that generates $p _ { t }$ :
|
| 227 |
+
|
| 228 |
+
Proposition 3.1. Assume that marginals $q _ { t }$ and $p _ { t }$ are generated by $b ( t , \vec { \mathbf { X } } ) , \eta _ { z } ( t , \vec { \mathbf { X } } )$ and $b ^ { \prime } ( \bar { t } , \vec { \mathbf { X } } ) , \hat { \eta _ { z } ^ { \prime } } ( t , \vec { \mathbf { X } } )$ based on Eq. (15), respectively. Given the probability measure $\nu$ of data pairs satisfying $\dot { \nu } ( \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } ) \stackrel { \cdot } { = } \nu ( \vec { \bf X } _ { 1 } , \vec { \bf X } _ { 0 } )$ , we have the following equalities hold:
|
| 229 |
+
|
| 230 |
+
$$
|
| 231 |
+
b ^ {\prime} (t, \vec {\mathbf {X}}) = b (t, \vec {\mathbf {X}}), \tag {21}
|
| 232 |
+
$$
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
\eta_ {z} ^ {\prime} (t, \vec {\mathbf {X}}) = \eta_ {z} (t, \vec {\mathbf {X}}) + \alpha \gamma (t) \nabla \varepsilon_ {t} (\vec {\mathbf {X}}). \tag {22}
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
Finally, we introduce the implementation of the force guidance kernel $\zeta$ . Keeping the parameters of the representation model $\varphi$ and the vector field model $\phi = \{ v , \eta _ { z } \}$ frozen, we use another TorchMD-NET $\Psi$ as the graph encoder of $\zeta$ , which is initialized with the same hyperparameters of $\varphi$ . To leverage the unified atomic representation, we adopt the residual mechanism, where the invariant output $\pmb { H }$ of $\varphi$ will be added to that of $\Psi$ during both training and inference.
|
| 239 |
+
|
| 240 |
+
After the invariant and equivariant features are obtained from $\Psi$ , we construct the network $\psi$ to fit the intermediate forcefield $\nabla \varepsilon _ { t } ( \cdot )$ in the same interpolation form as in Yu et al. (2024):
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\psi (\cdot) = (1 - t) \psi_ {0} (\cdot) + t \psi_ {1} (\cdot) + t (1 - t) \psi_ {2} (\cdot), \tag {23}
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
where networks $\psi _ { i }$ $( i \in \{ 0 , 1 , 2 \} )$ ) are implemented as the same architecture of $v$ , and $\psi _ { 0 } , \psi _ { 1 }$ are used to fit MD forcefields at two endpoints $t = 0 , 1$ , respectively. Therefore, the
|
| 247 |
+
|
| 248 |
+
training objective of the force guidance kernel is given by:
|
| 249 |
+
|
| 250 |
+
$$
|
| 251 |
+
\begin{array}{l} \mathcal {L} _ {f} = \mathbb {E} \left[ \left\| \psi_ {0} \left(t, \vec {\mathbf {X}} _ {t}\right) + \vec {\mathbf {F}} _ {0} \right\| _ {2} ^ {2} + \left\| \psi_ {1} \left(t, \vec {\mathbf {X}} _ {t}\right) + \vec {\mathbf {F}} _ {1} \right\| _ {2} ^ {2} \right. \\ + \left\| \psi (t, \vec {\mathbf {X}} _ {t}) - \frac {g \left(\vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1}\right) h \left(\vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1} , \vec {\mathbf {X}} _ {t}\right)}{\alpha \mathbb {E} \left[ q _ {t} \left(\vec {\mathbf {X}} _ {t} \mid \vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1}\right) g \left(\vec {\mathbf {X}} _ {0} , \vec {\mathbf {X}} _ {1}\right) \right]} \right\| _ {2} ^ {2} \rbrack , \tag {24} \\ \end{array}
|
| 252 |
+
$$
|
| 253 |
+
|
| 254 |
+
where $\vec { \mathbf { F } } _ { 0 } , \vec { \mathbf { F } } _ { 1 }$ correspond to MD forces of $\vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 }$ , respectively, and the expectation in the denominator term is taken over all training data pairs of a mini-batch.
|
| 255 |
+
|
| 256 |
+
# 3.5. Inference
|
| 257 |
+
|
| 258 |
+
During inference, the SDE of Eq. (15) will be discretized into $T$ equidistant steps for generation, where $T$ is a hyperparameter. Given the initial state as $\vec { \bf X } _ { 0 }$ , a new state $\mathbf { \hat { X } } _ { 1 }$ is generated through the $T$ -step discrete Markov process, which completes one inference iteration. Subsequently, the newly generated state serves as the initial state for the next iteration, by which UniSim is able to autoregressively generate trajectories for any given chain length.
|
| 259 |
+
|
| 260 |
+
Empirically, we find that performing inference without post-processing leads to unstable conformation generation. Therefore, after each iteration, we add a conformation refinement step for peptides and proteins. Details and related analysis can be found in $\ S \ C . 2$ and $\ S \operatorname { E } . 2$ , respectively.
|
| 261 |
+
|
| 262 |
+
# 4. Experiments
|
| 263 |
+
|
| 264 |
+
# 4.1. Experimental Setup
|
| 265 |
+
|
| 266 |
+
Datasets Firstly, the pretraining datasets $\mathcal { D } _ { i }$ $( 1 \leq i \leq m )$ are listed as follows: 1) PCQM4Mv2 (Hu et al., 2021), a quantum chemistry dataset with around 3M small molecules of equilibrium conformations optimized by DFT. 2) ANI-1x (Smith et al., 2020), a small organic molecule dataset consisting of 5M DFT calculations for QM properties like energies, atomic forces, etc. 3) PepMD (Yu et al., 2024), a peptide dataset including peptides of 3-10 residues with the sequence identity threshold of $60 \%$ , where we perform MD simulations using OpenMM (Eastman et al., 2017) to generate MD trajectories of 283 peptides. We adopt the same test set split of 14 peptides as in the original paper. 4) Protein monomers processed by Jiao et al. (2024), a subset of PDB (Berman et al., 2000) including protein monomer crystal structures. 5) ATLAS (Vander Meersche et al., 2024), a protein dataset gathering all-atom MD simulations of protein structures, which is chosen for structural diversity by ECOD domain classification (Schaeffer et al., 2017). Following Cheng et al. (2024), We selected proteins from the dataset of 2024.09.21 with no more than 500 residues and a coil percentage not exceeding $50 \%$ , resulting in a total of 834 data entries. We then apply the sequence clustering with the threshold of $30 \%$ by MMseq2 (Steinegger & Soding ¨ , 2017), obtaining 790/14 as the train/test splits. 6) Solvated Protein
|
| 267 |
+
|
| 268 |
+
Fragments (SPF) (Unke & Meuwly, 2019), a dataset probing many-body intermolecular interactions between protein fragments and water molecules. We randomly split the above pretraining datasets for training and validation by 4:1.
|
| 269 |
+
|
| 270 |
+
Secondly, we will validate the transferability of UniSim across three molecular domains: 1) MD17 (Chmiela et al., 2017) and MD22 (Chmiela et al., 2023) used for training and evaluation respectively, serving as representatives for small molecules. 2) PepMD as introduced above for peptides and 3) ATLAS for proteins. More details of pretraining datasets, trajectory datasets and MD simulation setups are shown in $\ S \ D$ .
|
| 271 |
+
|
| 272 |
+
Baselines Considering computational resource limitations, we compare UniSim with baseline models on peptides and with MD trajectories on other molecular domains. Specifically, we select the following deep learning-based models as our baselines: 1) FBM (Yu et al., 2024), the current stateof-the-art model based on bridge matching, learning timecoarsened dynamics on peptides with steerable force guidance. 2) Timewarp (Klein et al., 2024), a generative model leveraging the augmented normalizing flow and MCMC techniques, exhibiting transferability to small peptide systems. 3) ITO (Schreiner et al., 2024), a conditional diffusion model tailored for learning dynamics on varying time resolutions. 4) Score Dynamics (SD) (Hsu et al., 2024), a score matching diffusion model that captures transitions of collective variables of interest.
|
| 273 |
+
|
| 274 |
+
Metrics We employ the same metrics in Yu et al. (2024) to comprehensively evaluate the distributional similarity, validity and flexibility of generated ensembles. Briefly, the metrics are listed below: 1) The proportion of conformations with neither bond break nor bond clash, termed as VAL-CA (Lu et al., 2024). 2) The root mean square error of contact maps between generated ensembles and MD trajectories, termed as CONTACT (Janson et al., 2023). 3) The Jensen-Shannon (JS) distance on projected feature spaces of Pairwise Distances (PWD), Radius-of-Gyration (RG), the slowest two Time-lagged Independent Components (TIC) (Perez-Hern ´ andez et al. ´ , 2013) as well as their joint distribution, termed as TIC-2D. The mean value of JS distances along each dimension is reported.
|
| 275 |
+
|
| 276 |
+
# 4.2. Evaluation on Peptides
|
| 277 |
+
|
| 278 |
+
Based on the unified atomic representation model $\varphi$ obtained through pretraining, we train on PepMD to derive a unified vector field model $\phi$ . The rationale behind the choice is that peptides have moderate scales and exhibit high structural flexibility, making it suitable for transferring to other molecular domains subsequently. For fair comparison, all baselines are trained from scratch on PepMD until convergence, and sample trajectories of each test peptide for
|
| 279 |
+
|
| 280 |
+
a chain length of $1 0 ^ { 3 }$ . The evaluation results on all 14 test peptides of PepMD are shown in Table 1, where $\mathrm { U n i S i m / g }$ refers to the version that performs inference using only the vector field model $\phi$ without force guidance.
|
| 281 |
+
|
| 282 |
+
Based on Table 1, we first observe that UniSim outperforms the baselines on nearly all metrics, particularly when compared to FBM that uses a similar framework, demonstrating the effectiveness of our pretraining techniques. Moreover, by introducing the force guidance, UniSim shows a significant improvement in validity while maintaining the same level of distribution similarity, which reveals a deeper comprehension of the underlying physics constraints.
|
| 283 |
+
|
| 284 |
+
Table 1. Results on the test set of PepMD. Values of each metric are shown in mean/std of all 14 test peptides. The best result for each metric is shown in bold and the second best is underlined.
|
| 285 |
+
|
| 286 |
+
<table><tr><td rowspan="2">MODELS</td><td colspan="4">JS DISTANCE (↓)</td><td rowspan="2">VAL-CA (↑)</td><td rowspan="2">CONTACT (↓)</td></tr><tr><td>PWD</td><td>RG</td><td>TIC</td><td>TIC-2D</td></tr><tr><td>FBM</td><td>0.361/0.165</td><td>0.411/0.224</td><td>0.510/0.124</td><td>0.736/0.065</td><td>0.539/0.111</td><td>0.205/0.105</td></tr><tr><td>TIMERAP</td><td>0.362/0.095</td><td>0.386/0.120</td><td>0.514/0.110</td><td>0.745/0.061</td><td>0.028/0.020</td><td>0.195/0.051</td></tr><tr><td>ITO</td><td>0.367/0.077</td><td>0.371/0.131</td><td>0.495/0.126</td><td>0.748/0.055</td><td>0.160/0.186</td><td>0.174/0.099</td></tr><tr><td>SD</td><td>0.727/0.089</td><td>0.776/0.087</td><td>0.541/0.113</td><td>0.782/0.042</td><td>0.268/0.266</td><td>0.466/0.166</td></tr><tr><td>UniSim/g</td><td>0.332/0.135</td><td>0.332/0.161</td><td>0.510/0.115</td><td>0.738/0.064</td><td>0.505/0.112</td><td>0.162/0.076</td></tr><tr><td>UniSim</td><td>0.328/0.149</td><td>0.330/0.189</td><td>0.510/0.124</td><td>0.731/0.074</td><td>0.575/0.139</td><td>0.157/0.088</td></tr></table>
|
| 287 |
+
|
| 288 |
+
For a more intuitive understanding, we provide the visualization of the metrics for the two test cases in Figure 3. UniSim exhibits a close alignment with MD trajectories with regard to pairwise distances and residue contact rates. Furthermore, UniSim shows a good recovery of known metastable states, with samples located mainly in high-density regions. Though fully reproducing the free energy landscape may require longer trajectory lengths, UniSim still demonstrates a basic understanding of the intrinsic Boltzmann distribution.
|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
|
| 294 |
+

|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
|
| 298 |
+

|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 3. The visualization of comprehensive metrics on peptide $\mathrm { 1 i 7 u . C }$ (upper) and 1ar8 0 (lower). The left column shows the joint distribution of pairwise distances. The middle column demonstrates the residue contact map, where data in the lower and upper triangle are obtained from UniSim and MD, respectively. The right column displays TIC-2D plots for the slowest two components, where contours indicate the kernel density estimated on MD trajectories and the generated conformations are shown in scatter.
|
| 302 |
+
|
| 303 |
+
# 4.3. Transferability to Small Molecules
|
| 304 |
+
|
| 305 |
+
We further investigate the performance of UniSim on small molecules. Keeping parameters of the atomic representation model $\varphi$ and the vector field model $\phi$ frozen, we train on MD17 to obtain a force guidance kernel $\zeta$ and evaluate on 5 organic molecules of MD22. Here we use the relative distances between all heavy atom pairs as the projected feature to compute TIC and TIC-2D metrics. The ablation results comparing UniSim with $\mathrm { U n i S i m / g }$ are shown in Table 2. Apparently, the force guidance kernel helps the model transfer to a new chemical environment with better distributional similarity in overall.
|
| 306 |
+
|
| 307 |
+
Table 2. Results on the test set of MD22. Values of each metric are shown in mean/std of all 5 test molecules. The best result for each metric is shown in bold.
|
| 308 |
+
|
| 309 |
+
<table><tr><td rowspan="2">MODELS</td><td colspan="2">JS DISTANCE (↓)</td></tr><tr><td>TIC</td><td>TIC-2D</td></tr><tr><td>UniSim/g</td><td>0.408/0.111</td><td>0.791/0.044</td></tr><tr><td>UniSim</td><td>0.368/0.132</td><td>0.765/0.063</td></tr></table>
|
| 310 |
+
|
| 311 |
+
To better understand how the force guidance kernel works, we provide visualizations on Ac-Ala3-NHMe and DHA in Figure 4. It shows that the force guidance greatly helps comprehend the free energy landscape, enabling more accurate transitions between metastable states. Accordingly, samples generated by UniSim are more likely concentrated in highdensity regions, which complies with physics constraints of the specific chemical environment.
|
| 312 |
+
|
| 313 |
+

|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 4. TIC and TIC-2D plots of UniSim (left) and $\mathrm { U n i S i m / g }$ (right) on a. Ac-Ala3-NHMe and b. DHA. The first row displays the free energy projection on TIC 1, and the second row demonstrates TIC plots for the slowest two components.
|
| 317 |
+
|
| 318 |
+
# 4.4. Exploration of Proteins
|
| 319 |
+
|
| 320 |
+
In this section, we explore the transferability of UniSim to proteins. Considering the complexity and specificity of protein structures, we first finetune the vector field model $\phi$ on ATLAS with a learning rate of 1e-4. Next, the force
|
| 321 |
+
|
| 322 |
+
guidance kernel corresponding to the protein domain is trained on ATLAS subsequently.
|
| 323 |
+
|
| 324 |
+
Afterwards, the models are evaluated on the test set of AT-LAS and the results are displayed in Table 3. Evidently, UniSim significantly outperforms the baselines across all metrics, especially in terms of validity, achieving an improvement from $5 \%$ (ITO) to $8 \%$ . Meanwhile, the introduction of force guidance leads to modest improvements over most metrics as well.
|
| 325 |
+
|
| 326 |
+
Table 3. Results on the test set of ATLAS. Values of each metric are shown in mean/std of all 14 test protein monomers. The best result for each metric is shown in bold.
|
| 327 |
+
|
| 328 |
+
<table><tr><td rowspan="2">MODELS</td><td colspan="3">JS DISTANCE (↓)</td><td rowspan="2">VAL-CA (↑)</td><td rowspan="2">CONTACT (↓)</td></tr><tr><td>PWD</td><td>RG</td><td>TIC</td></tr><tr><td>FBM</td><td>0.519/0.023</td><td>0.597/0.121</td><td>0.621/0.152</td><td>0.012/0.007</td><td>0.252/0.039</td></tr><tr><td>ITO</td><td>0.588/0.027</td><td>0.775/0.042</td><td>0.624/0.121</td><td>0.052/0.008</td><td>0.428/0.020</td></tr><tr><td>SD</td><td>0.604/0.020</td><td>0.762/0.060</td><td>0.605/0.128</td><td>0.001/0.000</td><td>0.235/0.033</td></tr><tr><td>UniSim/g</td><td>0.508/0.021</td><td>0.569/0.146</td><td>0.543/0.141</td><td>0.071/0.029</td><td>0.171/0.031</td></tr><tr><td>UniSim</td><td>0.506/0.021</td><td>0.554/0.149</td><td>0.542/0.159</td><td>0.079/0.033</td><td>0.173/0.031</td></tr></table>
|
| 329 |
+
|
| 330 |
+
Moreover, to intuitively demonstrate the simulation efficiency of UniSim on large proteins, we present the TIC-2D visualizations of the first 200 generated conformations for two protein test cases, as shown in Figure 5. Notably, although long-term stable simulations for large proteins still proves to be challenging, UniSim is able to cross the energy barrier and explore distinct metastable states with only a few inference iterations, which shows the potential to take the place of traditional MD in terms of efficiency.
|
| 331 |
+
|
| 332 |
+

|
| 333 |
+
|
| 334 |
+

|
| 335 |
+
Figure 5. TIC-2D plots of the first 200 generated conformations for a. 3bn0 A and b. 4b6i D. Contours indicate the kernel density estimated on MD trajectories, the generated conformations are shown in scatter, and the blue dashed arrows represent the order in which the conformations are generated.
|
| 336 |
+
|
| 337 |
+
# 4.5. Case Study: Alanine-Dipeptide
|
| 338 |
+
|
| 339 |
+
To further validate the stability and applicability of UniSim in long-timescale simulations, we conduct additional experiments on a well-studied molecular system, alanine-dipeptide (AD), consisting of only 22 atoms while exhibiting comprehensive free energy landscapes.
|
| 340 |
+
|
| 341 |
+
Specifically, following the task setup in Timewarp (Klein et al., 2024), we attempt to finetune UniSim trained on PepMD to AD before performing long-timescale simulations. Firstly, we obtain three independently sampled MD trajectories of AD with the simulation time of 250 ns from mdshare1, which are assigned as the training/validation/test trajectories. The coarsened timestep $\tau$ is set to 100 ps, with 200,000 data pairs randomly sampled for training and validation from corresponding trajectories, respectively. UniSim is then finetuned on the curated AD dataset with the learning rate of 1e-4 for 300 epochs.
|
| 342 |
+
|
| 343 |
+
After we obtain the best checkpoint of UniSim evaluated on the validation set, we perform long-timescale simulations for a chain length of 100,000 to explore the metastable states of AD. We show the Ramachandran and TIC-2D plots of UniSim and the test MD trajectory in Figure 6. Building upon previous research (Wang et al., 2014), UniSim has demonstrated robust performance in long-timescale simulations by effectively exploring key metastable states of AD, including C5, $\mathrm { C 7 _ { e q } }$ , $\alpha _ { \mathrm { { R } } } ^ { \prime }$ , $\alpha _ { \mathrm { R } }$ as well as $\alpha _ { \mathrm { L } }$ . Moreover, the relative weights of generated conformation ensembles across different metastable states show good agreement with MD, indicating that UniSim is basically capable of reproducing the free energy landscape.
|
| 344 |
+
|
| 345 |
+

|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
|
| 349 |
+

|
| 350 |
+
|
| 351 |
+

|
| 352 |
+
Figure 6. Visualization of Ramachandran plots (the first row) and TIC-2D plots (the second row) of UniSim and MD on alaninedipeptide.
|
| 353 |
+
|
| 354 |
+
Furthermore, we provide a more intuitive illustration of the accuracy in generating conformations of metastable states. Based on Ramachandran plots, we apply the K-means (Mac-Queen, 1967) algorithm to obtain 5 clusters from MD trajectories, and select the centroid of each cluster as the representative conformation of the corresponding metastable state. Subsequently, we identify the conformation with the lowest
|
| 355 |
+
|
| 356 |
+
root-mean-square deviation (RMSD) to each representative conformation from trajectories generated by UniSim, which are illustrated in Figure 7. It can be observed that UniSim consistently exhibits an excellent recovery of metastable states with negligible deviation.
|
| 357 |
+
|
| 358 |
+

|
| 359 |
+
a. C5 (0.05A)
|
| 360 |
+
|
| 361 |
+

|
| 362 |
+
b. C7eq (0.03A)
|
| 363 |
+
|
| 364 |
+

|
| 365 |
+
c. αL (0.08A)
|
| 366 |
+
|
| 367 |
+

|
| 368 |
+
d.a (0.03A)
|
| 369 |
+
|
| 370 |
+

|
| 371 |
+
e. αr (0.05A)
|
| 372 |
+
Figure 7. Comparison of representative conformations of AD between UniSim (blue) and MD (yellow), including: a. C5, b. $\mathrm { C 7 _ { e q } }$ , c. $\alpha _ { \mathrm { { L } } }$ , d. $\alpha _ { \mathrm { { R } } } ^ { \prime }$ and e. $\alpha _ { \mathrm { R } }$ . The RMSD values of each representative pair over heavy atoms are shown in brackets.
|
| 373 |
+
|
| 374 |
+
# 5. Conclusion and Future Work
|
| 375 |
+
|
| 376 |
+
In this work, we present a novel architecture called UniSim, the first deep learning-based model tailored for performing time-coarsened dynamics on biomolecules of diverse domains. To accommodate molecular inputs of different sizes and types, we obtain a unified atomic representation model by pretraining on multi-domain 3D molecular datasets with novel techniques. Afterwards, we leverage the stochastic interpolant framework to construct a vector field model that learns time-coarsened dynamics on MD trajectories. Considering the impact of different chemical environments in applications, we further introduce the force guidance kernel, which adjusts the expectation of observables by incorporating “virtual” forces into the stochastic process. Experiments conducted on small molecules, peptides and proteins have fully verified the superiority of UniSim in distribution similarity compared to MD trajectories and transferability to out-of-distribution molecular domains.
|
| 377 |
+
|
| 378 |
+
In addition, we believe this work can be advanced in the following aspects: 1) Influenced by cumulative prediction errors, the validity of the samples generated by UniSim is not fully reliable, especially for macromolecules like proteins. Efficient cross-domain structure optimization deserves further exploration. 2) The generated trajectories for evaluation in our experiment are relatively short, which may hinder the model from discovering more possible metastable states. The dynamics pattern of biomolecules over longer time scales is worth investigating.
|
| 379 |
+
|
| 380 |
+
# Acknowledgements
|
| 381 |
+
|
| 382 |
+
This work is jointly supported by the National Key R&D Program of China (No.2022ZD0160502), the National Natural Science Foundation of China (No. 61925601, No. 62376276, No. 62276152), and Beijing Nova Program (20230484278).
|
| 383 |
+
|
| 384 |
+
# Impact Statement
|
| 385 |
+
|
| 386 |
+
This paper presents work whose goal is to advance the field of molecular dynamics through developing a novel deep learning-based generative model, UniSim, which proposes a solution to the key limitation in current methods of unified and efficient simulation for cross-domain molecules. Our work has the potential to impact both scientific research and practical applications in real-world scenarios, such as drug discovery and molecular property prediction. We wish our work could inspire future research in this field.
|
| 387 |
+
|
| 388 |
+
# References
|
| 389 |
+
|
| 390 |
+
Albergo, M. S., Boffi, N. M., and Vanden-Eijnden, E. Stochastic interpolants: A unifying framework for flows and diffusions. arXiv preprint arXiv:2303.08797, 2023.
|
| 391 |
+
Allen, M. P. et al. Introduction to molecular dynamics simulation. Computational soft matter: from synthetic polymers to proteins, 23(1):1–28, 2004.
|
| 392 |
+
Bal, K. M. and Neyts, E. C. Merging metadynamics into hyperdynamics: accelerated molecular simulations reaching time scales from microseconds to seconds. Journal of chemical theory and computation, 11(10):4545–4554, 2015.
|
| 393 |
+
Berman, H. M., Westbrook, J., Feng, Z., Gilliland, G., Bhat, T. N., Weissig, H., Shindyalov, I. N., and Bourne, P. E. The protein data bank. Nucleic acids research, 28(1): 235–242, 2000.
|
| 394 |
+
Botu, V. and Ramprasad, R. Adaptive machine learning framework to accelerate ab initio molecular dynamics. International journal of quantum chemistry, 115(16):1074– 1083, 2015a.
|
| 395 |
+
Botu, V. and Ramprasad, R. Learning scheme to predict atomic forces and accelerate materials simulations. Physical Review B, 92(9):094306, 2015b.
|
| 396 |
+
Celerse, F., Inizan, T. J., Lagard ´ ere, L., Adjoua, O., Mon- ` marche, P., Miao, Y., Derat, E., and Piquemal, J.-P. An´ efficient gaussian-accelerated molecular dynamics (gamd) multilevel enhanced sampling strategy: Application to polarizable force fields simulations of large biological systems. Journal of Chemical Theory and Computation, 18(2):968–977, 2022.
|
| 397 |
+
|
| 398 |
+
Cheng, K., Liu, C., Su, Q., Wang, J., Zhang, L., Tang, Y., Yao, Y., Zhu, S., and Qi, Y. 4d diffusion for dynamic protein structure prediction with reference guided motion alignment. arXiv preprint arXiv:2408.12419, 2024.
|
| 399 |
+
Chmiela, S., Tkatchenko, A., Sauceda, H. E., Poltavsky, I., Schutt, K. T., and M ¨ uller, K.-R. Machine learning of ac- ¨ curate energy-conserving molecular force fields. Science advances, 3(5):e1603015, 2017.
|
| 400 |
+
Chmiela, S., Sauceda, H. E., Muller, K.-R., and Tkatchenko, ¨ A. Towards exact molecular dynamics simulations with machine-learned force fields. Nature communications, 9 (1):3887, 2018.
|
| 401 |
+
Chmiela, S., Vassilev-Galindo, V., Unke, O. T., Kabylda, A., Sauceda, H. E., Tkatchenko, A., and Muller, K.- ¨ R. Accurate global machine learning force fields for molecules with hundreds of atoms. Science Advances, 9 (2):eadf0873, 2023.
|
| 402 |
+
Du, Y., Plainer, M., Brekelmans, R., Duan, C., Noe, F., Gomes, C. P., Aspuru-Guzik, A., and Neklyudov, K. Doob’s lagrangian: A sample-efficient variational approach to transition path sampling. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
|
| 403 |
+
Eastman, P., Swails, J., Chodera, J. D., McGibbon, R. T., Zhao, Y., Beauchamp, K. A., Wang, L.-P., Simmonett, A. C., Harrigan, M. P., Stern, C. D., et al. Openmm 7: Rapid development of high performance algorithms for molecular dynamics. PLoS computational biology, 13(7): e1005659, 2017.
|
| 404 |
+
Feng, R., Zhu, Q., Tran, H., Chen, B., Toland, A., Ramprasad, R., and Zhang, C. May the force be with you: Unified force-centric pre-training for 3d molecular conformations. Advances in Neural Information Processing Systems, 36, 2024.
|
| 405 |
+
Fu, X., Xie, T., Rebello, N. J., Olsen, B., and Jaakkola, T. S. Simulate time-integrated coarse-grained molecular dynamics with multi-scale graph networks. Transactions on Machine Learning Research, 2023.
|
| 406 |
+
Gao, X., Gao, W., Xiao, W., Wang, Z., Wang, C., and Xiang, L. Supervised pretraining for molecular force fields and properties prediction. arXiv preprint arXiv:2211.14429, 2022.
|
| 407 |
+
Griffiths, D. J. and Schroeter, D. F. Introduction to quantum mechanics. Cambridge university press, 2019.
|
| 408 |
+
Hollingsworth, S. A. and Dror, R. O. Molecular dynamics simulation for all. Neuron, 99(6):1129–1143, 2018.
|
| 409 |
+
|
| 410 |
+
Hsu, T., Sadigh, B., Bulatov, V., and Zhou, F. Score dynamics: Scaling molecular dynamics with picoseconds time steps via conditional diffusion model. Journal of Chemical Theory and Computation, 20(6):2335–2348, 2024.
|
| 411 |
+
Hu, W., Fey, M., Ren, H., Nakata, M., Dong, Y., and Leskovec, J. Ogb-lsc: A large-scale challenge for machine learning on graphs. In Thirty-fifth Conference on Neural Information Processing Systems Datasets and Benchmarks Track (Round 2), 2021.
|
| 412 |
+
Janson, G., Valdes-Garcia, G., Heo, L., and Feig, M. Direct generation of protein conformational ensembles via machine learning. Nature Communications, 14(1):774, 2023.
|
| 413 |
+
Jiao, R., Han, J., Huang, W., Rong, Y., and Liu, Y. Energymotivated equivariant pretraining for 3d molecular graphs. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 37, pp. 8096–8104, 2023.
|
| 414 |
+
Jiao, R., Kong, X., Yu, Z., Huang, W., and Liu, Y. Equivariant pretrained transformer for unified geometric learning on multi-domain 3d molecules. In ICLR 2024 Workshop on Generative and Experimental Perspectives for Biomolecular Design, 2024.
|
| 415 |
+
Jing, B., Eismann, S., Soni, P. N., and Dror, R. O. Equivariant graph neural networks for 3d macromolecular structure. arXiv preprint arXiv:2106.03843, 2021.
|
| 416 |
+
Jing, B., Stark, H., Jaakkola, T., and Berger, B. Generative modeling of molecular dynamics trajectories. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
|
| 417 |
+
Klein, L. and Noe, F. Transferable boltzmann generators. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
|
| 418 |
+
Klein, L., Foong, A., Fjelde, T., Mlodozeniec, B., Brockschmidt, M., Nowozin, S., Noe, F., and Tomioka, ´ R. Timewarp: Transferable acceleration of molecular dynamics by learning time-coarsened dynamics. Advances in Neural Information Processing Systems, 36, 2024.
|
| 419 |
+
Kohler, J., Invernizzi, M., De Haan, P., and No ¨ e, F. Rigid ´ body flows for sampling molecular crystal structures. In International Conference on Machine Learning, pp. 17301–17326. PMLR, 2023.
|
| 420 |
+
Kong, X., Huang, W., and Liu, Y. Conditional antibody design as 3d equivariant graph translation. In The Eleventh International Conference on Learning Representations, 2023.
|
| 421 |
+
|
| 422 |
+
Langevin, P. Sur la theorie du mouvement brownien. ´ Compt. Rendus, 146:530–533, 1908.
|
| 423 |
+
Lau, D., Jian, W., Yu, Z., and Hui, D. Nano-engineering of construction materials using molecular dynamics simulations: Prospects and challenges. Composites Part B: Engineering, 143:282–291, 2018.
|
| 424 |
+
Li, S., Wang, Y., Li, M., Zhang, J., Shao, B., Zheng, N., and Tang, J. $\mathrm { F ^ { 3 } }$ low: Frame-to-frame coarse-grained molecular dynamics with se (3) guided flow matching. arXiv preprint arXiv:2405.00751, 2024.
|
| 425 |
+
Lindorff-Larsen, K., Piana, S., Dror, R. O., and Shaw, D. E. How fast-folding proteins fold. Science, 334(6055):517– 520, 2011.
|
| 426 |
+
Link, A. J., Mock, M. L., and Tirrell, D. A. Non-canonical amino acids in protein engineering. Current opinion in biotechnology, 14(6):603–609, 2003.
|
| 427 |
+
Lu, J., Zhong, B., Zhang, Z., and Tang, J. Str2str: A scorebased framework for zero-shot protein conformation sampling. In The Twelfth International Conference on Learning Representations, 2024.
|
| 428 |
+
Luo, S., Chen, T., Xu, Y., Zheng, S., Liu, T.-Y., Wang, L., and He, D. One transformer can understand both 2d & 3d molecular data. In The Eleventh International Conference on Learning Representations, 2022.
|
| 429 |
+
M. Sultan, M. and Pande, V. S. tica-metadynamics: accelerating metadynamics by using kinetically selected collective variables. Journal of chemical theory and computation, 13(6):2440–2447, 2017.
|
| 430 |
+
MacQueen, J. Some methods for classification and analysis of multivariate observations. In Proceedings of the Fifth Berkeley Symposium on Mathematical Statistics and Probability, Volume 1: Statistics, volume 5, pp. 281–298. University of California press, 1967.
|
| 431 |
+
Markwick, P. R., Pierce, L. C., Goodin, D. B., and McCammon, J. A. Adaptive accelerated molecular dynamics (ad-amd) revealing the molecular plasticity of p450cam. The journal of physical chemistry letters, 2(3):158–164, 2011.
|
| 432 |
+
Noe, F., Olsson, S., K ´ ohler, J., and Wu, H. Boltzmann gener- ¨ ators: Sampling equilibrium states of many-body systems with deep learning. Science, 365(6457):eaaw1147, 2019.
|
| 433 |
+
Onufriev, A., Bashford, D., and Case, D. A. Exploring protein native states and large-scale conformational changes with a modified generalized born model. Proteins: Structure, Function, and Bioinformatics, 55(2):383–394, 2004.
|
| 434 |
+
|
| 435 |
+
Pearlman, D. A., Case, D. A., Caldwell, J. W., Ross, W. S., Cheatham III, T. E., DeBolt, S., Ferguson, D., Seibel, G., and Kollman, P. Amber, a package of computer programs for applying molecular mechanics, normal mode analysis, molecular dynamics and free energy calculations to simulate the structural and energetic properties of molecules. Computer Physics Communications, 91(1-3):1–41, 1995.
|
| 436 |
+
Pelaez, R. P., Simeon, G., Galvelis, R., Mirarchi, A., Eastman, P., Doerr, S., Tholke, P., Markland, T. E., and Fabri- ¨ tiis, G. D. Torchmd-net 2.0: Fast neural network potentials for molecular simulations, 2024.
|
| 437 |
+
Perez-Hern ´ andez, G., Paul, F., Giorgino, T., De Fabritiis, ´ G., and Noe, F. Identification of slow molecular order ´ parameters for markov model construction. The Journal of chemical physics, 139(1), 2013.
|
| 438 |
+
Plimpton, S. Computational limits of classical molecular dynamics simulations. Computational Materials Science, 4(4):361–364, 1995.
|
| 439 |
+
Rossmann, M. G. and Arnold, E. International tables for crystallography volume F: crystallography of biological macromolecules. Wiley Online Library, 2001.
|
| 440 |
+
Schaeffer, R. D., Liao, Y., Cheng, H., and Grishin, N. V. Ecod: new developments in the evolutionary classification of domains. Nucleic acids research, 45(D1):D296– D302, 2017.
|
| 441 |
+
Schreiner, M., Winther, O., and Olsson, S. Implicit transfer operator learning: Multiple time-resolution models for molecular dynamics. Advances in Neural Information Processing Systems, 36, 2024.
|
| 442 |
+
Shin, K., Tran, D. P., Takemura, K., Kitao, A., Terayama, K., and Tsuda, K. Enhancing biomolecular sampling with reinforcement learning: A tree search molecular dynamics simulation method. ACS omega, 4(9):13853– 13862, 2019.
|
| 443 |
+
Smith, J. S., Zubatyuk, R., Nebgen, B., Lubbers, N., Barros, K., Roitberg, A. E., Isayev, O., and Tretiak, S. The ani-1ccx and ani-1x data sets, coupled-cluster and density functional theory properties for molecules. Scientific data, 7(1):134, 2020.
|
| 444 |
+
Steinegger, M. and Soding, J. Mmseqs2 enables sensi- ¨ tive protein sequence searching for the analysis of massive data sets. Nature biotechnology, 35(11):1026–1028, 2017.
|
| 445 |
+
Unke, O. T. and Meuwly, M. Physnet: A neural network for predicting energies, forces, dipole moments, and partial charges. Journal of chemical theory and computation, 15 (6):3678–3693, 2019.
|
| 446 |
+
|
| 447 |
+
Van Gunsteren, W. F. and Berendsen, H. J. Computer simulation of molecular dynamics: methodology, applications, and perspectives in chemistry. Angewandte Chemie International Edition in English, 29(9):992–1023, 1990.
|
| 448 |
+
van Gunsteren, W. F. and Oostenbrink, C. Methods for classical-mechanical molecular simulation in chemistry: Achievements, limitations, perspectives. Journal of Chemical Information and Modeling, 64(16):6281–6304, 2024.
|
| 449 |
+
Vander Meersche, Y., Cretin, G., Gheeraert, A., Gelly, J.-C., and Galochkina, T. Atlas: protein flexibility description from atomistic molecular dynamics simulations. Nucleic acids research, 52(D1):D384–D392, 2024.
|
| 450 |
+
Vanommeslaeghe, K., Hatcher, E., Acharya, C., Kundu, S., Zhong, S., Shim, J., Darian, E., Guvench, O., Lopes, P., Vorobyov, I., et al. Charmm general force field: A force field for drug-like molecules compatible with the charmm all-atom additive biological force fields. Journal of computational chemistry, 31(4):671–690, 2010.
|
| 451 |
+
Wang, H., Schutte, C., Ciccotti, G., and Delle Site, L. Ex- ¨ ploring the conformational dynamics of alanine dipeptide in solution subjected to an external electric field: A nonequilibrium molecular dynamics simulation. Journal of Chemical Theory and Computation, 10(4):1376–1386, 2014.
|
| 452 |
+
Wang, J., Arantes, P. R., Bhattarai, A., Hsu, R. V., Pawnikar, S., Huang, Y.-m. M., Palermo, G., and Miao, Y. Gaussian accelerated molecular dynamics: Principles and applications. Wiley Interdisciplinary Reviews: Computational Molecular Science, 11(5):e1521, 2021.
|
| 453 |
+
Wang, L., Shen, Y., Wang, Y., Yuan, H., Wu, Y., Gu, Q., et al. Protein conformation generation via force-guided se (3) diffusion models. In Forty-first International Conference on Machine Learning, 2024a.
|
| 454 |
+
Wang, T., He, X., Li, M., Li, Y., Bi, R., Wang, Y., Cheng, C., Shen, X., Meng, J., Zhang, H., et al. Ab initio characterization of protein molecular dynamics with ai2bmd. Nature, pp. 1–9, 2024b.
|
| 455 |
+
Yu, Z., Huang, W., and Liu, Y. Force-guided bridge matching for full-atom time-coarsened dynamics of peptides. arXiv preprint arXiv:2408.15126, 2024.
|
| 456 |
+
Zaidi, S., Schaarschmidt, M., Martens, J., Kim, H., Teh, Y. W., Sanchez-Gonzalez, A., Battaglia, P., Pascanu, R., and Godwin, J. Pre-training via denoising for molecular property prediction. In The Eleventh International Conference on Learning Representations, 2023.
|
| 457 |
+
|
| 458 |
+
Zhang, D., Liu, X., Zhang, X., Zhang, C., Cai, C., Bi, H., Du, Y., Qin, X., Peng, A., Huang, J., et al. Dpa-2: a large atomic model as a multi-task learner. npj Computational Materials, 10(1):293, 2024.
|
| 459 |
+
Zhang, Z., Xu, M., Jamasb, A. R., Chenthamarakshan, V., Lozano, A., Das, P., and Tang, J. Protein representation learning by geometric structure pretraining. In The Eleventh International Conference on Learning Representations, 2023.
|
| 460 |
+
Zhou, G., Gao, Z., Ding, Q., Zheng, H., Xu, H., Wei, Z., Zhang, L., and Ke, G. Uni-mol: A universal 3d molecular representation learning framework. In The Eleventh International Conference on Learning Representations, 2023.
|
| 461 |
+
|
| 462 |
+
# A. Reproducibility
|
| 463 |
+
|
| 464 |
+
Our code is available at https://github.com/yaledeus/UniSim.
|
| 465 |
+
|
| 466 |
+
# B. Proofs of Propositions
|
| 467 |
+
|
| 468 |
+
Proof of Proposition 3.1. Firstly, denote the marginal score of the vector field model $\phi$ as $s ( t , { \vec { \mathbf { X } } } )$ , which is given by:
|
| 469 |
+
|
| 470 |
+
$$
|
| 471 |
+
\begin{array}{l} s (t, \vec {\mathbf {X}}) = \mathbb {E} \left[ \nabla \log q _ {t} \left(\vec {\mathbf {X}} \mid \vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}\right) \mid \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right] (25) \\ = \iint \nabla \log q _ {t} \left(\vec {\mathbf {X}} \mid \vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}\right) q _ {t} \left(\vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1} \mid \vec {\mathbf {X}}\right) \mathrm {d} \vec {\mathbf {X}} _ {0} \mathrm {d} \vec {\mathbf {X}} _ {1} (26) \\ = \frac {1}{q _ {t} (\vec {\mathbf {X}})} \iint \nabla q _ {t} (\vec {\mathbf {X}} | \vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}) q (\vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}) \mathrm {d} \vec {\mathbf {X}} _ {0} \mathrm {d} \vec {\mathbf {X}} _ {1} (27) \\ = \frac {1}{q _ {t} (\vec {\mathbf {X}})} \nabla \iint q _ {t} (\vec {\mathbf {X}} | \vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}) q (\vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}) \mathrm {d} \vec {\mathbf {X}} _ {0} \mathrm {d} \vec {\mathbf {X}} _ {1} (28) \\ = \frac {\nabla q _ {t} (\vec {\mathbf {X}})}{q _ {t} (\vec {\mathbf {X}})} = \nabla \log q _ {t} (\vec {\mathbf {X}}), (29) \\ \end{array}
|
| 472 |
+
$$
|
| 473 |
+
|
| 474 |
+
where in the second equality we use the Bayesian rule, and the third equality is justified by assuming the integrands satisfy the regularity conditions of the Leibniz Rule. $q ( \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } )$ denotes the joint distribution of training data pairs.
|
| 475 |
+
|
| 476 |
+
Further, according to Albergo et al. (2023), we have the following inference:
|
| 477 |
+
|
| 478 |
+
$$
|
| 479 |
+
s (t, \vec {\mathbf {X}}) = - \gamma^ {- 1} (t) \eta_ {z} (t, \vec {\mathbf {X}}). \tag {30}
|
| 480 |
+
$$
|
| 481 |
+
|
| 482 |
+
Based on the assumption of Eq. (19), we have:
|
| 483 |
+
|
| 484 |
+
$$
|
| 485 |
+
\nabla \log p _ {t} (\vec {\mathbf {X}}) = \nabla \log q _ {t} (\vec {\mathbf {X}}) - \alpha \nabla \varepsilon_ {t} (\vec {\mathbf {X}}). \tag {31}
|
| 486 |
+
$$
|
| 487 |
+
|
| 488 |
+
According to the above derivation, by replacing $\nabla \log p _ { t } ( \vec { \mathbf { X } } ) , \nabla \log q _ { t } ( \vec { \mathbf { X } } )$ with $- \gamma ^ { - 1 } ( t ) \eta _ { z } ^ { \prime } ( t , \vec { \mathbf { X } } ) , - \gamma ^ { - 1 } ( t ) \eta _ { z } ( t , \vec { \mathbf { X } } )$ , respectively, we show that $\eta _ { z } ^ { \prime } ( t , \vec { \mathbf { X } } ) = \eta _ { z } ( t , \vec { \mathbf { X } } ) + \alpha \gamma ( t ) \nabla \varepsilon _ { t } ( \vec { \mathbf { X } } )$ holds.
|
| 489 |
+
|
| 490 |
+
Secondly, we denote the following two terms on the probability path $q _ { t }$ :
|
| 491 |
+
|
| 492 |
+
$$
|
| 493 |
+
u _ {f} (t, \vec {\mathbf {X}}) = \mathbb {E} \left[ \frac {\vec {\mathbf {X}} _ {1} - \vec {\mathbf {X}}}{1 - t} \mid \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right], u _ {r} (t, \vec {\mathbf {X}}) = \mathbb {E} \left[ \frac {\vec {\mathbf {X}} - \vec {\mathbf {X}} _ {0}}{t} \mid \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right]. \tag {32}
|
| 494 |
+
$$
|
| 495 |
+
|
| 496 |
+
Similarly, we define $u _ { f } ^ { \prime } ( t , \vec { \bf X } )$ and $u _ { r } ^ { \prime } ( t , \vec { \bf X } )$ on the probability path $p _ { t }$ in the same form. Based on Eqs. (13), (14) and (16), we have:
|
| 497 |
+
|
| 498 |
+
$$
|
| 499 |
+
v (t, \vec {\mathbf {X}}) = \mathbb {E} \left[ \partial_ {t} I \left(t, \vec {\mathbf {X}} _ {0}, \vec {\mathbf {X}} _ {1}\right) \mid \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right] = \mathbb {E} \left[ \vec {\mathbf {X}} _ {1} - \vec {\mathbf {X}} _ {0} \mid \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right], \tag {33}
|
| 500 |
+
$$
|
| 501 |
+
|
| 502 |
+
$$
|
| 503 |
+
\eta_ {z} (t, \vec {\mathbf {X}}) = \mathbb {E} [ \vec {\mathbf {Z}} | \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} ] = \mathbb {E} \left[ \frac {\vec {\mathbf {X}} - t \vec {\mathbf {X}} _ {1} - (1 - t) \vec {\mathbf {X}} _ {0}}{\sqrt {t (1 - t)} \sigma_ {s}} | \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right]. \tag {34}
|
| 504 |
+
$$
|
| 505 |
+
|
| 506 |
+
Combining the connection of $b ( t , \vec { \mathbf { X } } ) = v ( t , \vec { \mathbf { X } } ) + \dot { \gamma } ( t ) \eta _ { z } ( t , \vec { \mathbf { X } } )$ , we have:
|
| 507 |
+
|
| 508 |
+
$$
|
| 509 |
+
\begin{array}{l} b (t, \vec {\mathbf {X}}) = \mathbb {E} \left[ \vec {\mathbf {X}} _ {1} - \vec {\mathbf {X}} _ {0} + \frac {(1 - 2 t) \sigma_ {s}}{2 \sqrt {t (1 - t)}} \cdot \frac {\vec {\mathbf {X}} - t \vec {\mathbf {X}} _ {1} - (1 - t) \vec {\mathbf {X}} _ {0}}{\sqrt {t (1 - t)} \sigma_ {s}} \mid \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right] (35) \\ = \mathbb {E} \left[ \frac {(1 - 2 t) \vec {\mathbf {X}} + t \vec {\mathbf {X}} _ {1} - (1 - t) \vec {\mathbf {X}} _ {0}}{2 \sqrt {t (1 - t)}} \mid \vec {\mathbf {X}} _ {t} = \vec {\mathbf {X}} \right] (36) \\ = \frac {1}{2} \left(u _ {f} (t, \vec {\mathbf {X}}) + u _ {r} (t, \vec {\mathbf {X}})\right). (37) \\ \end{array}
|
| 510 |
+
$$
|
| 511 |
+
|
| 512 |
+
Similarly, $b ^ { \prime } ( t , \vec { \bf X } ) = { \scriptstyle \frac 1 2 } ( u _ { f } ^ { \prime } ( t , \vec { \bf X } ) + u _ { r } ^ { \prime } ( t , \vec { \bf X } ) )$ . According to Yu et al. (2024), it has been proven that $u _ { r } ^ { \prime } ( t , { \vec { \mathbf { X } } } ) - u _ { r } ( t , { \vec { \mathbf { X } } } ) =$ $u _ { f } ( t , \vec { \mathbf { X } } ) - u _ { f } ^ { \prime } ( t , \vec { \mathbf { X } } )$ given the probability measure $\nu$ of training data pairs satisfying $\nu ( \vec { \bf X } _ { 0 } , \vec { \bf X } _ { 1 } ) = \nu ( \vec { \bf X } _ { 1 } , \vec { \bf X } _ { 0 } )$ . Therefore, we can derive that $b ^ { \prime } ( t , \vec { \mathbf { X } } ) = b ( t , \vec { \mathbf { X } } )$ . □
|
| 513 |
+
|
| 514 |
+
# C. Training and Inference Details
|
| 515 |
+
|
| 516 |
+
# C.1. Normalization of Potential and Force Labels
|
| 517 |
+
|
| 518 |
+
Previous works Wang et al. (2024a); Yu et al. (2024) have mentioned the numerical instability of potential energies across different molecular systems. To ensure the stability of the training process, the potential labels are normalized during pre-processing. Specifically, For each trajectory of one molecular system, we denote the concatenation of unnormalized potential labels of all conformations as $\pmb { { \cal E } } \in \mathbb { R } ^ { M }$ , where $M$ represents the trajectory length. The normalized potentials are given by:
|
| 519 |
+
|
| 520 |
+
$$
|
| 521 |
+
\hat {\boldsymbol {E}} = \frac {\boldsymbol {E} - \operatorname* {m a x} (\boldsymbol {E})}{\operatorname* {m a x} (\boldsymbol {E}) - \operatorname* {m i n} (\boldsymbol {E})} \in [ - 1, 0 ] ^ {M}, \tag {38}
|
| 522 |
+
$$
|
| 523 |
+
|
| 524 |
+
where $\operatorname* { m a x } ( { \mathord { \cdot } } )$ and $\operatorname* { m i n } ( \cdot )$ denote the maximum and minimum element of the vector. Based on the technique, all potential energy labels are normalized to $[ - 1 , 0 ]$ without manipulating the energy distribution of each ensemble.
|
| 525 |
+
|
| 526 |
+
For atomic force labels which are comparably more stable, we unify them into MJ/(mol·nm), whose scale is close to standard Gaussian distributions empirically.
|
| 527 |
+
|
| 528 |
+
# C.2. Conformation Refinement
|
| 529 |
+
|
| 530 |
+
In practice, we found that small prediction errors in the autoregressive generation process would accumulate over time, resulting in unreasonable conformations especially for proteins. Following Wang et al. (2024a); Yu et al. (2024), after generating a new conformation, we introduce an energy minimization step using OpenMM (Eastman et al., 2017) with harmonic constraints for local structure refinement. Specifically, independent harmonic constraints are first added on all heavy atoms with spring constant of $1 0 \mathrm { k c a l / m o l { \cdot } \mathring { A } ^ { 2 } }$ $\mathring \mathrm { A } ^ { 2 }$ in case of altering the overall conformation. The minimization tolerance is set to be $2 . 3 9 \mathrm { k c a l / m o l { \cdot } \mathring { A } ^ { 2 } }$ $\mathring \mathrm { A } ^ { 2 }$ without maximal step limits. Afterwards, the energy minimization step will be applied for peptides or proteins, while small molecules will not undergo any additional treatment.
|
| 531 |
+
|
| 532 |
+
# C.3. Hyperparameters
|
| 533 |
+
|
| 534 |
+
The hyperparameters of UniSim for model constructing, training and inference are shown in Table 4.
|
| 535 |
+
|
| 536 |
+
# D. Experimental Details
|
| 537 |
+
|
| 538 |
+
# D.1. Dataset Details
|
| 539 |
+
|
| 540 |
+
Dataset Curation All peptides of PepMD are simulated by OpenMM (Eastman et al., 2017) with the implicit solvation model GB-OBC I (Onufriev et al., 2004), where we show MD simulation setups in Table 5. Moreover, we use the same forcefield to obtain MD potential and force labels of protein conformations in ATLAS. The pretraining dataset details are shown in Table 6, and we summarize the trajectory datasets in Table 7.
|
| 541 |
+
|
| 542 |
+
Test Set Molecules of each test set are listed below, where peptides or protein monomers are named as “{PDB id} {chain id}”:
|
| 543 |
+
|
| 544 |
+
• MD22: AT-AT-CG-CG, AT-AT, DHA, stachyose, Ac-Ala3-NHMe.
|
| 545 |
+
• PepMD: 1hhg C, 1k8d P, 1k83 M, 1bz9 C, 1i7u C, 1gxc B, 1ar8 0, 2xa7 P, 1e28 C, 1gy3 F, 1n73 I, 1fpr B, 1aze B, 1qj6 I.
|
| 546 |
+
• ATLAS: 1chd A, 2nnu A, 2bjq A, 2ov9 C, 1r9f A, 7rm7 A, 4adn B, 3bn0 A, 3eye A, 1h2e A, 1jq5 A, 4b6i D, 2znr A, 1huf A.
|
| 547 |
+
|
| 548 |
+
# E. Additional Experimental Results
|
| 549 |
+
|
| 550 |
+
# E.1. Ablation Study
|
| 551 |
+
|
| 552 |
+
Hyperparameter Sensitivity In order to investigate the hyperparameter sensitivity, we conduct ablation studies of SDE steps $T$ and the guidance strength $\alpha$ on PepMD test set, where the ablation results are shown in Table 8. From the table, we
|
| 553 |
+
|
| 554 |
+
Table 4. Hyperparameters of UniSim.
|
| 555 |
+
|
| 556 |
+
<table><tr><td>Hyperparameters</td><td>Values</td></tr><tr><td colspan="2">Model</td></tr><tr><td>Hidden dimension H</td><td>256</td></tr><tr><td>FFN dimension</td><td>512</td></tr><tr><td>RBF dimension</td><td>64</td></tr><tr><td>Expand embed dimension D</td><td>32</td></tr><tr><td># attention heads</td><td>8</td></tr><tr><td># layers of atomic representation model</td><td>4</td></tr><tr><td># layers of force guidance kernel</td><td>4</td></tr><tr><td>Gradient subgraph threshold δmin</td><td>8Å</td></tr><tr><td>Environment subgraph threshold δmax</td><td>20Å</td></tr><tr><td>Cutoff threshold rcut</td><td>5Å</td></tr><tr><td>Pretraining noise scale σe</td><td>0.04</td></tr><tr><td>SDE perturbation strength σs</td><td>0.2</td></tr><tr><td colspan="2">Training</td></tr><tr><td>Learning rate</td><td>5e-4</td></tr><tr><td>Optimizer</td><td>Adam</td></tr><tr><td>Warm up steps</td><td>1,000</td></tr><tr><td>Warm up scheduler</td><td>LamdaLR</td></tr><tr><td>Training scheduler</td><td>ReduceLRonPlateau(factor=0.8, patience=5, min_lr=1e-7)</td></tr><tr><td colspan="2">Inference</td></tr><tr><td>SDE steps T</td><td>[15,25,50]</td></tr><tr><td>Guidance strength α</td><td>[0.05,0.06,0.07]</td></tr></table>
|
| 557 |
+
|
| 558 |
+
Table 5. MD simulation setups using OpenMM.
|
| 559 |
+
|
| 560 |
+
<table><tr><td>Property</td><td>Value</td></tr><tr><td>Forcefield</td><td>AMBER-14</td></tr><tr><td>Integrator</td><td>LangevinMiddleIntegrator</td></tr><tr><td>Integration time step</td><td>1fs</td></tr><tr><td>Frame spacing</td><td>1ps</td></tr><tr><td>Friction coefficient</td><td>0.5ps-1</td></tr><tr><td>Temperature</td><td>300K</td></tr><tr><td>Solvation model</td><td>GB-OBC I</td></tr><tr><td>Electrostatics</td><td>CutoffNonPeriodic</td></tr><tr><td>Cutoff</td><td>2.0nm</td></tr><tr><td>Constraints</td><td>HBonds</td></tr></table>
|
| 561 |
+
|
| 562 |
+
Table 6. Pretraining dataset details.
|
| 563 |
+
|
| 564 |
+
<table><tr><td>Domain</td><td>Dataset</td><td># Items</td><td>Equilibrium</td><td>Off-equilibrium</td><td>Traj.</td><td>Forcefields</td></tr><tr><td rowspan="2">small molecule</td><td>PCQM4Mv2</td><td>~3M</td><td>✓</td><td>×</td><td>×</td><td>-</td></tr><tr><td>ANI-1x</td><td>~5M</td><td>✓</td><td>✓</td><td>×</td><td>DFT</td></tr><tr><td>peptide</td><td>PepMD</td><td>~1M</td><td>✓</td><td>✓</td><td>✓</td><td>AMBER-14/GB-OBC I</td></tr><tr><td rowspan="3">protein</td><td>PDB</td><td>~200K</td><td>✓</td><td>×</td><td>×</td><td>-</td></tr><tr><td>ATLAS</td><td>~500K</td><td>✓</td><td>✓</td><td>✓</td><td>AMBER-14/GB-OBC I</td></tr><tr><td>SPF</td><td>~2M</td><td>×</td><td>✓</td><td>×</td><td>revPBE-D3(BJ)/def2-TZVP</td></tr></table>
|
| 565 |
+
|
| 566 |
+
Table 7. Details of the trajectory datasets.
|
| 567 |
+
|
| 568 |
+
<table><tr><td>Properties</td><td>MD17&22</td><td>PepMD</td><td>ATLAS</td></tr><tr><td>Frame spacing</td><td>0.5fs</td><td>1ps</td><td>100ps</td></tr><tr><td>Simulation time per traj</td><td>not fixed</td><td>100ns</td><td>100ns</td></tr><tr><td>Coarsened time τ</td><td>100ps</td><td>10ps</td><td>1ns</td></tr><tr><td># Training traj</td><td>8</td><td>269</td><td>790</td></tr><tr><td># Training pairs per traj</td><td>5,000</td><td>5,000</td><td>500</td></tr><tr><td># Valid pairs per traj</td><td>500</td><td>500</td><td>100</td></tr><tr><td># Test traj</td><td>5</td><td>14</td><td>14</td></tr></table>
|
| 569 |
+
|
| 570 |
+
can summarize two key observations:
|
| 571 |
+
|
| 572 |
+
1. Within the tested range, the validity metric improves significantly as $\alpha$ increases, while other metrics generally exhibit deteriorating trends. This suggests that the force guidance kernel enhances the comprehension of physical priors, thereby facilitating higher-quality sample generation, but may simultaneously constrain the exploration breadth of the state space to some extent.
|
| 573 |
+
2. As $T$ increases, most metrics show varying degrees of degradation. This is likely because excessive discretization of the SDE process leads to greater error accumulation, indicating that a small $T$ is sufficient for balancing accuracy and efficiency within the bridge matching framework.
|
| 574 |
+
|
| 575 |
+
Table 8. Ablation results of SDE steps $T$ and the guidance strength $\alpha$ on PepMD test set. Values of each metric are first averaged over 3 independent runs for each peptide and then shown in mean/std of all 14 test peptides.
|
| 576 |
+
|
| 577 |
+
<table><tr><td rowspan="2">Hyperparameters</td><td colspan="4">JS DISTANCE (↓)</td><td rowspan="2">VAL-CA (↑)</td><td rowspan="2">CONTACT (↓)</td></tr><tr><td>PWD</td><td>RG</td><td>TIC</td><td>TIC-2D</td></tr><tr><td>T=15,α=0.05</td><td>0.328/0.149</td><td>0.330/0.189</td><td>0.510/0.124</td><td>0.731/0.074</td><td>0.575/0.139</td><td>0.157/0.088</td></tr><tr><td>T=15,α=0.06</td><td>0.340/0.143</td><td>0.372/0.187</td><td>0.511/0.114</td><td>0.740/0.059</td><td>0.594/0.100</td><td>0.167/0.090</td></tr><tr><td>T=15,α=0.07</td><td>0.349/0.144</td><td>0.384/0.206</td><td>0.523/0.132</td><td>0.736/0.074</td><td>0.607/0.138</td><td>0.195/0.091</td></tr><tr><td>T=25,α=0.05</td><td>0.391/0.141</td><td>0.474/0.190</td><td>0.507/0.134</td><td>0.738/0.066</td><td>0.441/0.117</td><td>0.231/0.087</td></tr><tr><td>T=25,α=0.06</td><td>0.404/0.171</td><td>0.445/0.222</td><td>0.505/0.142</td><td>0.734/0.078</td><td>0.468/0.136</td><td>0.244/0.110</td></tr><tr><td>T=25,α=0.07</td><td>0.409/0.159</td><td>0.488/0.218</td><td>0.516/0.129</td><td>0.742/0.078</td><td>0.496/0.147</td><td>0.239/0.114</td></tr></table>
|
| 578 |
+
|
| 579 |
+
Atomic Embedding Expansion To investigate the contribution of atomic embedding expansion to pretraining, we conduct additional ablation experiments. Specifically, we remove the expanded embedding $A _ { e }$ from the model architecture while keeping all other parameters the same as in Table 4. The model is then pretrained and finetuned on the PepMD dataset following the same procedure as described in the main text, and the ablation results on PepMD test set are shown in Table 9. It is evident that removing $A _ { e }$ leads to a decline in nearly all evaluation metrics to varying degrees, demonstrating the effectiveness and necessity of our atomic embedding expansion technique in cross-domain scenarios.
|
| 580 |
+
|
| 581 |
+
Table 9. Ablation Results of atomic embedding expansion on PepMD test set. Values of each metric are shown in mean/std of all 14 test peptides. The best result for each metric is shown in bold.
|
| 582 |
+
|
| 583 |
+
<table><tr><td rowspan="2">MODELS</td><td colspan="4">JS DISTANCE (↓)</td><td rowspan="2">VAL-CA (↑)</td><td rowspan="2">CONTACT (↓)</td></tr><tr><td>PWD</td><td>RG</td><td>TIC</td><td>TIC-2D</td></tr><tr><td>UniSim/g</td><td>0.332/0.135</td><td>0.332/0.161</td><td>0.510/0.115</td><td>0.738/0.064</td><td>0.505/0.112</td><td>0.162/0.076</td></tr><tr><td>UniSim/g w/o Ae</td><td>0.389/0.175</td><td>0.453/0.233</td><td>0.516/0.135</td><td>0.732/0.053</td><td>0.397/0.132</td><td>0.228/0.119</td></tr></table>
|
| 584 |
+
|
| 585 |
+
# E.2. Inference Efficiency
|
| 586 |
+
|
| 587 |
+
In this section, we compare the inference efficiency of UniSim with that of MD performed using OpenMM. Following Timewarp (Klein et al., 2024), we use the effective-sample-size per second of wall-clock time (ESS/s) as the evaluation metric. Figure 8 illustrates the statistical results of ESS/s between UniSim and MD on PepMD test set, demonstrating that UniSim achieves, on average, approximately 25 times higher efficiency compared to MD.
|
| 588 |
+
|
| 589 |
+
Meanwhile, since conformation refinement using OpenMM is performed at each inference iteration (i.e., generating a new state) for peptide or protein generation, we provide the statistics of the number of optimization steps required per iteration as follows: (1) mean: 69.3, (2) median: 55, and (3) maximum: 2,075, as illustrated in Figure 8. Additionally, for each iteration, the average inference time is 0.120 s and the average optimization time is 0.152 s. Therefore, the computational overhead remains within the same order of magnitude with the refinement step.
|
| 590 |
+
|
| 591 |
+

|
| 592 |
+
|
| 593 |
+

|
| 594 |
+
Figure 8. Statistical results for evaluating the model’s efficiency. Left. The effective-sample-size per second of wall-clock time (ESS/s) on PepMD test set. For the convenience of comparison, the values were converted into ratios relative to the median of results from MD (the blue dashed line). Right. The optimization steps performed by OpenMM per iteration on PepMD test set.
|
| 595 |
+
|
| 596 |
+
# F. Computing Infrastructure
|
| 597 |
+
|
| 598 |
+
UniSim was trained on 8 NVIDIA GeForce RTX 3090 GPUs within a week. The inference procedures were performed on one NVIDIA GeForce RTX 3090 GPU.
|
paper_markdowns/bamboo-05152.md
ADDED
|
@@ -0,0 +1,297 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# CGTrack: Cascade Gating Network with Hierarchical Feature Aggregation for UAV Tracking
|
| 2 |
+
|
| 3 |
+
Weihong $\mathrm { L i ^ { 1 } }$ , Xiaoqiong Liu2, Heng Fan2,†, and Libo Zhang3,†,∗
|
| 4 |
+
|
| 5 |
+
Abstract— Recent advancements in visual object tracking have markedly improved the capabilities of unmanned aerial vehicle (UAV) tracking, which is a critical component in realworld robotics applications. While the integration of hierarchical lightweight networks has become a prevalent strategy for enhancing efficiency in UAV tracking, it often results in a significant drop in network capacity, which further exacerbates challenges in UAV scenarios, such as frequent occlusions and extreme changes in viewing angles. To address these issues, we introduce a novel family of UAV trackers, termed CGTrack, which combines explicit and implicit techniques to expand network capacity within a coarse-to-fine framework. Specifically, we first introduce a Hierarchical Feature Cascade (HFC) module that leverages the spirit of feature reuse to increase network capacity by integrating the deep semantic cues with the rich spatial information, incurring minimal computational costs while enhancing feature representation. Based on this, we design a novel Lightweight Gated Center Head (LGCH) that utilizes gating mechanisms to decouple target-oriented coordinates from previously expanded features, which contain dense local discriminative information. Extensive experiments on three challenging UAV tracking benchmarks demonstrate that CGTrack achieves state-of-the-art performance while running fast. Code will be available at https://github.com/Nightwatch-Fox11/CGTrack.
|
| 6 |
+
|
| 7 |
+
# I. INTRODUCTION
|
| 8 |
+
|
| 9 |
+
Unmanned aerial vehicles (UAVs) commonly refer to drones remotely operated by a human operator without any pilot on board. The rapid development of UAVs has boosted numerous real-world applications, e.g., logistic and product deliveries [1], UAV-assisted IoT applications [2], and robotic automation [3]. Despite the remarkable progress in visual object tracking, achieving efficient and accurate UAV tracking remains fraught with significant challenges, such as frequent scale changes, extreme viewing angles, and severe occlusions. These issues are particularly pronounced in the context of fast-moving drones. Therefore, it is crucial to develop more robust and efficient network designs, especially for edge devices with limited power resources.
|
| 10 |
+
|
| 11 |
+
In general, the majority of UAV trackers can be categorized into two types: discriminative correlation filters (DCF)-based trackers [4]–[9] or deep learning (DL)-based trackers [10]–[16]. Despite the superior efficiency brought by Fourier transformation, the accuracy of DCF-based trackers has fallen far behind that of the DL-based trackers.
|
| 12 |
+
|
| 13 |
+

|
| 14 |
+
Fig. 1. Comparison of success rate and precision between CGTrack and other 13 state-of-the-art (SOTA) trackers on the authoritative UAV123 benchmark [34]. CGTrack achieves SOTA performance in both precision and success rate, surpassing the average performance of 13 trackers by $6 . 6 \%$ and $8 . 4 \%$ respectively. Best viewed in color for all figures in this paper.
|
| 15 |
+
|
| 16 |
+
Among modern DL-based trackers, those based on Siamese networks [10]–[12], [17]–[20] are the most prevalent. They employ the strategy of “divide-and-conquer”, where the template and the search region features are extracted separately before relation modeling. However, as described in [15], the features extracted by Siamese networks lack essential targetoriented discriminative information, resulting in significant performance degradation in UAV scenarios, particularly during high-speed movement. Recently, Transformer [21] has played a pivotal role in the field of UAV tracking [22]–[24] due to its superior capacity of modeling global relationships. Moreover, with the power of pre-trained Vision Transformer (ViT) models [25]–[29], one-stream frameworks [15], [30]– [32] exhibit superior performance in both accuracy and efficiency when compared to Siamese-based trackers. However, Transformer-based trackers are burdened by high computational costs brought by ViTs and often neglect critical local information [33], leading to failures in extreme UAV scenarios.
|
| 17 |
+
|
| 18 |
+
In this work, we address the aforementioned challenges by introducing a lightweight, hierarchical one-stream tracking framework. By adopting a lightweight hierarchical ViT as backbone, we obtain hierarchical features that preserve rich global contextual information. To effectively enhance network capacity with these hierarchical features, we propose a Hierarchical Feature Cascade (HFC) module, inspired by DenseNet [35], which highlights the strength of feature reuse. However, unlike the original DenseNet [35], our HFC module simplifies dense connections into a cascade structure by scaling multi-level features to a uniform size and later concatenating them. This approach allows us to obtain a feature map containing both deep semantic information and
|
| 19 |
+
|
| 20 |
+
shallow detail information without additional parameters or FLOPs. The HFC module explicitly increases the network width (i.e., channel number) to provide rich contextual information for subsequent fine-grained discriminative feature extraction. The enriched feature map contains both discriminative local details and global context which are particularly crucial in resource-constrained challenging UAV scenarios. Additionally, we introduce a Residual Squeezeand-Excitation (SE) module to apply coarse-grained gating on the feature maps after each concatenation, improving gradient flow through its residual design.
|
| 21 |
+
|
| 22 |
+
To fully leverage the feature map generated by the HFC module, we improve the center head design in modern trackers [15], [36]–[38] by proposing the Lightweight Gated Center Head. Inspired by [39], we replace the basic Conv-BN-ReLU (CBR) block with an Efficient Gating (EG) block. The EG block first maps the features into a high-dimensional nonlinear feature space, where gating is performed subsequently via the Hadamard product. The gating mechanisms have shown superior capability in enhancing local finegrained details in the field of image inpainting [40]. In light of this, we employ EG block to further mine local discriminative information which is critical for addressing the challenges inherent in UAV scenarios.
|
| 23 |
+
|
| 24 |
+
In summary, our contributions in this paper are as follows:
|
| 25 |
+
|
| 26 |
+
• We propose CGTrack, a family of UAV tracking architecture aiming at combining global context provided by lightweight ViT with mined local discriminative details from hierarchical features to achieve robust UAV tracking.
|
| 27 |
+
• Leveraging the art of feature reuse, a novel HFC module is presented whereby hierarchical features are aggregated and gated in an efficient cascade pipeline.
|
| 28 |
+
• An original tracking head LGCH is introduced. It further utilizes the HFC-expanded features by mapping the features to a higher-dimensional nonlinear feature space, whereby gating is performed through the Hadamard product.
|
| 29 |
+
• We perform comprehensive evaluations on three authoritative UAV tracking benchmarks demonstrating the state-of-the-art performance of CGTrack.
|
| 30 |
+
|
| 31 |
+
# II. RELATED WORKS
|
| 32 |
+
|
| 33 |
+
# A. Visual Object Tracking for UAV.
|
| 34 |
+
|
| 35 |
+
Despite the high efficiency of DCF-based trackers [4]– [9], they have been largely supplanted by Siamese-based trackers [10]–[16] in UAV tracking due to their relatively low accuracy. More recently, some studies have attempted to incorporate Transformer [21] into Siamese-based UAV tracking pipeline [22]–[24] to enhance the interaction between extracted template and search region features. However, these methods still adopt the two-stream framework, leading to insufficient information interaction during feature extraction. In this work, we adapt a lightweight hierarchical ViT into the one-stream UAV tracking pipeline, establishing an optimal equilibrium between computational demands and tracking accuracy
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
(a) Addition-Based Fusion
|
| 39 |
+
(b) Transformer-Based Fusion
|
| 40 |
+
|
| 41 |
+

|
| 42 |
+
|
| 43 |
+

|
| 44 |
+
(c) Ours: Cascade Gating Fusion
|
| 45 |
+
Fig. 2. Comparison of the popular hierarchical feature fusion methods for UAV tracking. (a) Addition-Based Fusion: simply adds all the feature maps up. (b) Transformer-Based Fusion: employs Transformer layers or multi-head attention modules for feature fusion. (c) Cascade Gating Fusion: concatenates adjacent feature maps and performs gating subsequently in a cascade architecture.
|
| 46 |
+
|
| 47 |
+
# B. Hierarchical UAV Trackers.
|
| 48 |
+
|
| 49 |
+
In UAV scenarios, most existing trackers adopt lightweight image classification networks as backbones for better computational efficiency [10], [22]–[24], [41]–[43]. However, the high-stride downsampling in these networks often leads to a loss of critical information. To mitigate this, hierarchical UAV trackers attempt to leverage multi-level feature maps generated at different stages of the lightweight backbones. For instance, SiamAPN++ [41] employs an attention mechanism to adaptively fuse multi-level features, while HiFT [22] stacks Transformer layers to incorporate multi-scales feature maps. These methods, as shown in Fig. 2(b), are burdened with heavy relation modeling. Beyond UAV-specific trackers, HiT [32] employs simple addition for hierarchical feature aggregation, also depicted in Fig. 2(a). This approach, despite its simplicity, ignores the diverse variance of hierarchical feature maps, resulting in severe information loss. As shown in Fig. 2(c), unlike the aforementioned methods, we propose a novel cascade gating structure that combines gating mechanism and feature reuse to expand network capacity with minor computational costs.
|
| 50 |
+
|
| 51 |
+
# C. Gating Mechenism.
|
| 52 |
+
|
| 53 |
+
Recent studies have demonstrated the utility of the gating mechanism across numerous computer vision tasks [39], [40], [44], [45]. To illustrate, SENet [44] introduces an efficient channel-wise attention mechanism through lightweight gating. DeepFill v2 [40] incorporates the gating mechanism into the convolution to better distinguish between different pixels in an image. Moreover, StarNet [39] further explains the reason why numerous efficient network designs adopt gating mechanisms [44], [45]: the Hadamard product has
|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Fig. 3. Overview of the proposed CGTrack, which comprises three main components: a lightweight hierarchical backbone, an HFC module, and a Lightweight Gated Center Head.
|
| 57 |
+
|
| 58 |
+
the ability to map the features into higher and nonlinear dimensions, but operates in low-dimensional space. In this work, we integrate the coarse-gained gating and fine-grained gating into the tracking framework respectively to mine local discriminative details with efficiency.
|
| 59 |
+
|
| 60 |
+
# III. PROPOSED METHOD
|
| 61 |
+
|
| 62 |
+
This section systematically elaborates on our proposed CGTrack framework. We first establish a conceptual schematic of the architecture, followed by the detailed component introduction, including a lightweight ViT backbone, the proposed Hierarchical Feature Cascade module, and Lightweight Gated Center Head. In the final part of this section, we introduce the training objective.
|
| 63 |
+
|
| 64 |
+
# A. Overview
|
| 65 |
+
|
| 66 |
+
As depicted in Fig. 3, CGTrack is a one-stream tracking framework incorporating three core components: a lightweight ViT backbone, the proposed HFC module, and LGCH. Like most one-stream trackers [15], [16], [32], [46], CGTrack takes a pair of images as input and then jointly performs feature extraction and relational modeling across different network stages. The model progressively generates hierarchical feature maps with varying spatial resolutions from each ViT stage. Besides the backbone is a coarse-tofine architecture consisting of our proposed HFC module and LGCH: The feature sequence is firstly fed into the HFC module for efficient feature augmentation and preliminary gating; Then, LGCH takes the expanded feature map as input and performs final purification to obtain tracking result.
|
| 67 |
+
|
| 68 |
+
# B. LeViT Backbone
|
| 69 |
+
|
| 70 |
+
Inspired by HiT [32], we adopt LeViT [47] as the backbone of CGTrack and adapt it into the tracking framework. For clarification, we denote the input template image and search region image as $\textbf { Z } \in \mathbb { R } ^ { 3 \times H _ { z } \times W _ { z } }$ and $\textbf { X } \in$ $\mathbb { R } ^ { 3 \times H _ { x } \times W _ { x } }$ respectively. They are first downsampled by a factor of 16 through patch embedding resulting in $\mathbb { R } ^ { C \times \frac { H _ { z } } { 1 6 } \times \frac { W _ { z } } { 1 6 } }$ and $\begin{array} { r } { \check { \mathbf { X } } _ { \mathbf { p } } \in \mathbb { R } ^ { C \times \frac { H _ { x } } { 1 6 } \times \frac { W _ { x } } { 1 6 } } } \end{array}$ . Then we flatten and $\mathbf { Z _ { p } } \in$ concatenate $\mathbf { Z _ { p } }$ and $\mathbf { X _ { p } }$ in the spatial dimension and feed them into the following ViT stages. The transformer part of LeViT comprises three stages, and each stage consists of $L i$ blocks, i.e., $L 1 { = } 4$ , $L 2 { = } 4$ , $L 3 { = } 4$ . Each block has a Multi-Head Attention and an MLP in the residual form. LeViT leverages the Shrink Attention modules to downsample feature maps at a scale of 4 between stages, producing three feature maps with multiple resolutions. As is common in one-stream trackers, we extract the search region part of the output from each stage and re-interpret these tokens to a 2D spatial correlation map. Finally, we obtain a sequence including three correlation maps with distinct size, i.e., $\mathbf { M _ { 1 \rho } } \in$ $\mathbb { R } ^ { H _ { s } \times \bar { W } _ { s } \times C _ { s } }$ , $\mathbf { M _ { 2 } } \in \mathbb { R } ^ { H _ { m } \times W _ { m } \times C _ { m } }$ , $\mathbf { M _ { 3 } } \in \mathbb { R } ^ { H _ { l } \times W _ { l } \times C _ { l } }$ , where $C _ { s } ~ = ~ 3 8 4$ , $C _ { m } \ = \ 5 1 2$ , $C _ { l } ~ = ~ 7 6 8$ . In addition, a similar position encoding design, analogous to Dual-image Position Encoding in HiT is used in our CGTrack, to better adapt LeViT for the tracking task. Further details regarding the backbone network of CGTrack can be found in LeViT and HiT.
|
| 71 |
+
|
| 72 |
+
Remark 1: Attributing to the lightweight hierarchical ViT, we obtain a sequence of correlation maps preserving rich global context information in both search region and template with
|
| 73 |
+
|
| 74 |
+
minor costs. This highly parallelized one-stream structure is able to handle multiple UAV scenarios with flexible variants.
|
| 75 |
+
|
| 76 |
+
# C. Hierarchical Feature Cascade Module
|
| 77 |
+
|
| 78 |
+
Inspired by DenseNet [35], we propose a Hierarchical Feature Cascade module that progressively integrates multistage backbone features via concatenation operations. By applying gating to the concatenated feature maps, the HFC module enhances the critical local discriminative details. Different from the original dense connection in DenseNet, the HFC module simplifies it by only keeping one cascade path between adjacent feature maps, which significantly reduces memory usage and achieves promising efficiency. As illustrated in Fig. 3, for hierarchical 3D correlation maps denoted as $M _ { i }$ , $i \in \{ 1 , 2 , 3 \}$ , we first upsample $M _ { 1 }$ and concatenate it and $M _ { 2 }$ together along the channel dimension, which can be written as
|
| 79 |
+
|
| 80 |
+
$$
|
| 81 |
+
X = \operatorname {C o n c a t} \left(\mathbf {M} _ {2}, \operatorname {U p s a m p l e} \left(\mathbf {M} _ {1}\right)\right) \tag {1}
|
| 82 |
+
$$
|
| 83 |
+
|
| 84 |
+
where $X$ is the intermediate result of the HFC module. In view of the diverse variance of the concatenated features, we adapt the original Squeeze-and-Excitation block [44] into the residual form and propose Residual SE, which efficiently applies channel re-scaling and preliminary gating to the concatenated feature map through Hadamard product. The entire process of Residual SE can be formulated as
|
| 85 |
+
|
| 86 |
+
$$
|
| 87 |
+
z _ {c} = \frac {1}{H \times W} \sum_ {i = 1} ^ {H} \sum_ {j = 1} ^ {W} x _ {c, i, j} \tag {2}
|
| 88 |
+
$$
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
s _ {c} = \sigma \left(W _ {2} \cdot \operatorname {R e L U} \left(W _ {1} \cdot z _ {c}\right)\right), \tag {3}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
$$
|
| 95 |
+
\hat {x} _ {c, i, j} = x _ {c, i, j} \cdot s _ {c}, \tag {4}
|
| 96 |
+
$$
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\hat {X} = X + X \odot S \tag {5}
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
where $x _ { c , i , j }$ represents the input feature at channel $c$ and spatial location $( i , j )$ . $z _ { c }$ is the channel descriptor obtained via global average pooling. $W _ { 1 }$ and $W _ { 2 }$ are the weights of the fully connected layers used in the excitation step. $\sigma$ is the sigmoid activation function. $X$ and $\hat { X }$ are the overall input and output feature maps, respectively. $\odot$ denotes Hadamard product. Then, we apply the same operation to the output of the previous step to obtain the final feature. The entire process can be mathematically formulated as:
|
| 103 |
+
|
| 104 |
+
$$
|
| 105 |
+
O = \operatorname {R e s i d u a l S E} \left(\operatorname {C o n c a t} \left(\mathbf {M} _ {2}, \operatorname {U p s a m p l e} \left(\mathbf {M} _ {1}\right)\right)\right) \tag {6}
|
| 106 |
+
$$
|
| 107 |
+
|
| 108 |
+
$$
|
| 109 |
+
Y = \operatorname {R e s i d u a l S E} \left(\operatorname {C o n c a t} \left(\mathbf {M} _ {3}, \operatorname {U p s a m p l e} (\mathbf {O})\right)\right) \tag {7}
|
| 110 |
+
$$
|
| 111 |
+
|
| 112 |
+
Remark 2: Compared to additive operations, feature concatenations preserve all information and improve gradient flow, thereby accelerating network convergence. Each concatenation operation yields a higher-dimensional feature map explicitly. By applying the Residual SE to the concatenated feature map, we enhance local discriminative details through gating. This amplification is particularly crucial in challenging UAV scenarios, such as tracking small objects or handling sudden appearance changes.
|
| 113 |
+
|
| 114 |
+

|
| 115 |
+
Fig. 4. Detailed architectures of LGCH. The left part illustrates the overall workflow of LGCH. The right one shows the structure of the EG block.
|
| 116 |
+
|
| 117 |
+
# D. Lightweight Gated Center Head
|
| 118 |
+
|
| 119 |
+
From the HFC module, we obtain features enriched with contextual information. Building on this, we propose the Efficient Gating block to extract fine-grained discriminative details from the expanded features. As illustrated in Fig. 4, the concatenated feature map is first downsampled by a $1 \times 1$ convolution into a channel size of 256 for memory efficiency. The feature map is then fed into three branches, each containing four EG blocks followed by a $1 \times 1$ convolution. Consistent with [15], the output of three branches is a classification score map, a local offset map, and a bounding box size map, respectively. The detailed structure of the EG block is depicted on the right side of Fig. 4. The core design of the EG block involves two $1 \times 1$ convolutions that map the input into higher-dimensional, non-linear feature space. Among these, one branch incorporates an activation function, forming the gate branch while the other serves as the context branch. Subsequently, the Hadamard product is performed between gate and context. The entire process of the EG block can be written as:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
O = \operatorname {B N} \left(\mathrm {D W} _ {7 \times 7} (X)\right) \tag {8}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
X _ {1} = \operatorname {C o n v} _ {1 \times 1} (O) \tag {9}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
X _ {2} = \operatorname {C o n v} _ {1 \times 1} (O) \tag {10}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
$$
|
| 134 |
+
P = \operatorname {R e L U} 6 \left(X _ {1}\right) \odot X _ {2} \tag {11}
|
| 135 |
+
$$
|
| 136 |
+
|
| 137 |
+
$$
|
| 138 |
+
Y = \operatorname {B N} \left(\operatorname {C o n v} _ {1 \times 1} \left(\mathrm {D W} _ {7 \times 7} (P)\right)\right) \tag {12}
|
| 139 |
+
$$
|
| 140 |
+
|
| 141 |
+
where $X _ { 1 }$ and $X _ { 2 }$ are the gate and context branch, respectively.
|
| 142 |
+
|
| 143 |
+
Remark 3: Unlike commonly used CBR blocks, the proposed EG blocks exhibit enhanced capability in extracting finegrained features. Similar to the HFC module, EG blocks first explicitly map features to higher dimensions before performing gating, effectively decoupling discriminative, targetoriented information in the correlation map. Furthermore, as described in [39], the Hadamard product implicitly transforms previously expanded features into exceptionally high and nonlinear dimensions while maintaining operations in a low-dimensional space. Notably, our proposed EG block
|
| 144 |
+
|
| 145 |
+

|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
Fig. 5. Overall performance of CGTrack and prevailing SOTA trackers on UAV123 [34] (the first column), UAV123@10fp [34] (the second column), and UAVTrack112 [48] (the third column) benchmarks. CGTrack achieves SOTA performance across all benchmarks.
|
| 157 |
+
|
| 158 |
+
has even fewer FLOPs and parameters than a CBR block, highlighting its potential for applications on edge devices.
|
| 159 |
+
|
| 160 |
+
# E. Training objective
|
| 161 |
+
|
| 162 |
+
In the training phase, we employ weighted focal loss [49] in the classification task, while utilizing a combination of $\ell _ { 1 }$ loss and generalized GIoU loss [50] for the localization task. The overall loss function is
|
| 163 |
+
|
| 164 |
+
$$
|
| 165 |
+
\mathcal {L} = \mathcal {L} _ {\text {f o c a l}} + \lambda_ {G} \mathcal {L} _ {\mathrm {G I o U}} + \lambda_ {l} \mathcal {L} _ {l}, \tag {13}
|
| 166 |
+
$$
|
| 167 |
+
|
| 168 |
+
where $\lambda _ { G } = 2$ and $\lambda _ { l } = 5$ are the regularization parameters following [15].
|
| 169 |
+
|
| 170 |
+
# IV. EXPERIMENTS
|
| 171 |
+
|
| 172 |
+
# A. Implementation Details
|
| 173 |
+
|
| 174 |
+
The proposed CGTrack is implemented in Python 3.8 with PyTorch 1.10.0, trained on four NVIDIA RTX 3090 GPUs. We employ the train-splits of GOT-10k [51] (excluding 1k sequences as convention), LaSOT [52], COCO2017 [53], and TrackingNet [54] for training. Common data augmentations including horizontal flipping and brightness jittering are applied during training. The network processes $1 2 8 \times 1 2 8$ template and $2 5 6 \times 2 5 6$ search images in each training batch of 128 samples. We adopt AdamW [55], with the weight decay of 1e-4 as the optimizer. The initial learning rate of CGTrack is set to 4e-5 which decays by $10 \%$ during the final $20 \%$ training epochs.
|
| 175 |
+
|
| 176 |
+
# B. Overall Performance on UAV Tracking Benchmarks
|
| 177 |
+
|
| 178 |
+
In this subsection, our CGTrack is comprehensively compared with 13 SOTA trackers including TCTrack [42], SGDViT [23], FDNT [56], HiFT [22], SiamAPN [48], LPAT [57], DeconNet [58], SiamTPN [59], SiamDW [60], TCTrack++ [43], SiamAPN $^ { + + }$ [41], SE-SiamFC [61],
|
| 179 |
+
|
| 180 |
+
Ocean [62] on three public authoritative aerial tracking benchmarks.
|
| 181 |
+
|
| 182 |
+
UAV123. UAV123 [34] is a comprehensive aerial video benchmark dataset containing $1 2 3 ~ \mathrm { H D }$ sequences with over 112,000 frames captured from low-altitude aerial platforms. This benchmark includes various challenging scenarios such as rapid target motion and scale variation, providing a comprehensive platform to thoroughly evaluate CGTrack’s performance in aerial tracking. As depicted in Fig. 5, CG-Track demonstrates SOTA tracking performance with $8 8 . 0 \%$ in Precision and $6 7 . 2 \%$ in Success score.
|
| 183 |
+
|
| 184 |
+
UAV123@10fps. UAV123@10fps [34] is derived by downsampling the original 30fps version, which leads to more pronounced motion between consecutive frames. This increased motion poses a challenge to trackers in more effectively leveraging inter-frame continuity information for robust aerial tracking. As shown in Fig. 5, CGTrack consistently achieves SOTA performance, with the highest Precision $( 8 3 . 8 \% )$ and Success score $( 6 6 . 1 \% )$ .
|
| 185 |
+
|
| 186 |
+
UAVTrack112. UAVTrack112 [48] is a challenging aerial benchmark that collects 112 real-world sequences including low illumination scenarios in the dark time. As illustrated in Fig. 5, CGTrack sets a new SOTA Success score of $6 4 . 9 \%$ and Precision score of $8 0 . 6 \%$ .
|
| 187 |
+
|
| 188 |
+
# C. Attribute-Based Comparison
|
| 189 |
+
|
| 190 |
+
To further evaluate the robustness of CGTrack against diverse UAV-specific challenges, we conduct exhaustive attribute-based comparisons with other 5 SOTA UAV trackers. As depicted in Fig. 6, our CGTrack achieves SOTA performance in all attributes. The promising results demonstrate that CGTrack is capable of aggregating the mined local discriminative details and global context to mitigate various challenges in UAV scenarios.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Fig. 6. Success scores of different attributes among top 6 SOTA UAV trackers. CGTrack significantly outperforms other trackers in typical UAV attributes.
|
| 194 |
+
|
| 195 |
+
<table><tr><td>#</td><td>Method</td><td>Precision</td><td>Params(M)</td><td>MACs(G)</td></tr><tr><td>1</td><td>Addition-based Fusion</td><td>82.90</td><td>40.931</td><td>4.315</td></tr><tr><td>2</td><td>Concatenation-based Fusion(w/o Residual SE)</td><td>84.12</td><td>40.668</td><td>4.323</td></tr><tr><td>3</td><td>Concatenation-based Fusion + Residual SE</td><td>86.24</td><td>41.219</td><td>4.324</td></tr></table>
|
| 196 |
+
|
| 197 |
+
TABLE I Ablation study of different fusion manners of CGTrack. Gray color is employed to denote our final configuration.
|
| 198 |
+
TABLE II Details and variants of our CGTrack model.
|
| 199 |
+
|
| 200 |
+
<table><tr><td>#</td><td>Method</td><td>Params(M)</td><td>MACs(G)</td><td>FPS</td><td>Precision</td></tr><tr><td>1</td><td>CGTrack-T</td><td>9.987</td><td>1.165</td><td>61.4</td><td>80.08</td></tr><tr><td>2</td><td>CGTrack-S</td><td>11.421</td><td>1.300</td><td>55.6</td><td>82.00</td></tr><tr><td>3</td><td>CGTrack-B</td><td>41.219</td><td>4.324</td><td>42.1</td><td>86.24</td></tr></table>
|
| 201 |
+
|
| 202 |
+
TABLE III Ablation study on different components and configurations of the center head. Gray denotes our final configuration.
|
| 203 |
+
|
| 204 |
+
<table><tr><td>#</td><td>Method</td><td>Head Params(M)</td><td>MACs(G)</td><td>AUC</td></tr><tr><td>1</td><td>Plain CBR block</td><td>2.935</td><td>0.751</td><td>65.51</td></tr><tr><td>2</td><td>EG block-1x</td><td>1.425</td><td>0.364</td><td>63.64</td></tr><tr><td>3</td><td>EG block-2x</td><td>2.665</td><td>0.680</td><td>66.14</td></tr><tr><td>4</td><td>EG block-3x</td><td>3.904</td><td>0.996</td><td>65.31</td></tr><tr><td>4</td><td>EG block-4x</td><td>5.143</td><td>1.313</td><td>63.40</td></tr></table>
|
| 205 |
+
|
| 206 |
+
# D. Ablation Study and Visualization
|
| 207 |
+
|
| 208 |
+
In this subsection, we present the ablation studies on UAV123@10fps.
|
| 209 |
+
|
| 210 |
+
Hierarchical Feature Fusion Analysis. To verify the superiority of our fusion manner, we compare different hierarchical feature fusion manners. As shown in Tab. I, the original concatenation-based fusion (without gating) gains a $1 . 2 2 \%$ improvement in Precision score. Furthermore, as enumerated in Tab. I, Row 3, the cascade gating framework exhibits a $3 . 3 4 \%$ increase in Precision score compared to Row 2. The aforementioned results demonstrate the efficacy of the designed HFC module in UAV tracking.
|
| 211 |
+
|
| 212 |
+
Variants Analysis. In Tab. II, we present multiple variants of CGTrack with different backbone networks. Specifically, we adopt LeViT-384 [47], LeViT-128, and LeViT-128S for CGTrack-B, CGTrack-S, and CGTrack-T, respectively.
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Fig. 7. Qualitative comparison of CGTrack with other trackers on three representative sequences (wakeboard2 from UAV123@10fps, and excavator, car4 from UAVTrack112). CGTrack achieves robust performance under severe UAV-specific challenges.
|
| 216 |
+
|
| 217 |
+
Among these variants, CGTrack-T exhibits superior speed at 61.4 fps on an NVIDIA RTX 3090 GPU, while CGTrack-B focuses on robustness, achieving an $8 6 . 2 4 \%$ Precision score on UAV123@10fps. Notably, the CGTrack-S achieves a more favorable balance between computational complexity and tracking performance. The designed variants show strong generalization across different application scenarios.
|
| 218 |
+
|
| 219 |
+
LGCH Analysis. This part analyzes the effectiveness of LGCH and compares different feature upsampling ratios in the EG block. As in Tab. III, LGCH outperforms the CBRbased center head with even fewer parameters and FLOPs. When setting the upsampling ratio to 2, the highest Success score is achieved. The results indicate that a larger upsampling ratio can cause overfitting, while a smaller upsampling ratio may result in insufficient modeling capacity.
|
| 220 |
+
|
| 221 |
+
Qualitative Results. To intuitively demonstrate the tracking performance in real-world scenarios, we visualize the tracking results in Fig. 7. The qualitative results across multiple real-world challenging scenes demonstrate that our CGTrack achieves superior robustness and accuracy, outperforming all the other UAV trackers. For further visualization of our method and comparison to other trackers, please kindly refer to the accompanying video.
|
| 222 |
+
|
| 223 |
+
# V. CONCLUSION
|
| 224 |
+
|
| 225 |
+
In this work, we introduce a novel family of lightweight one-stream UAV trackers, dubbed CGTrack. CGTrack integrates global contextual information with mined local discriminative details to bridge the gap between lightweight ViTs and robust UAV tracking. By leveraging the art of feature reuse and gating mechanism, CGTrack significantly expands network capacity to tackle challenges in UAV scenarios without additional computational overhead. Extensive experiments demonstrate the superior real-world practicability and state-of-the-art performance of CGTrack. Finally, we hope this work could inspire and facilitate future research in robust UAV tracking.
|
| 226 |
+
|
| 227 |
+
# ACKNOWLEDGMENT
|
| 228 |
+
|
| 229 |
+
Libo Zhang is supported by National Natural Science Foundation of China (No. 62476266). Heng Fan is not supported by any fund for this work.
|
| 230 |
+
|
| 231 |
+
# REFERENCES
|
| 232 |
+
|
| 233 |
+
[1] S. Kim and I. Moon, “Ieee tsmc,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 49, no. 1, pp. 42–52, 2019.
|
| 234 |
+
[2] Q. Wang, H. N. Dai, X. Li, M. K. Shukla, and M. Imran, “Artificial noise aided scheme to secure uav-assisted internet of things with wireless power transfer,” Computer Communications, vol. 164, 2020.
|
| 235 |
+
[3] Z. Ouyang, R. Mei, Z. Liu, M. Wei, Z. Zhou, and H. Cheng, “Control of an aerial manipulator using a quadrotor with a replaceable robotic arm,” in ICRA. IEEE, 2021, pp. 153–159.
|
| 236 |
+
[4] J. F. Henriques, R. Caseiro, P. Martins, and J. Batista, “High-speed tracking with kernelized correlation filters,�� IEEE TPAMI, vol. 37, no. 3, pp. 583–596, 2014.
|
| 237 |
+
[5] M. Danelljan, G. Bhat, F. S. Khan, and M. Felsberg, “ECO: Efficient Convolution Operators for Tracking,” in CVPR, 2017, pp. 6931–6939.
|
| 238 |
+
[6] , “Atom: Accurate tracking by overlap maximization,” in CVPR, 2019, pp. 4660–4669.
|
| 239 |
+
[7] G. Bhat, M. Danelljan, L. V. Gool, and R. Timofte, “Learning Discriminative Model Prediction for Tracking,” in ICCV, 2019, pp. 6181–6190.
|
| 240 |
+
[8] M. Danelljan, L. V. Gool, and R. Timofte, “Probabilistic Regression for Visual Tracking,” in CVPR, 2020, pp. 7181–7190.
|
| 241 |
+
[9] G. Bhat, M. Danelljan, L. Van Gool, and R. Timofte, “Know your surroundings: Exploiting scene information for object tracking,” in ECCV. Springer, 2020, pp. 205–221.
|
| 242 |
+
[10] L. Bertinetto, J. Valmadre, J. F. Henriques, A. Vedaldi, and P. H. S. Torr, “Fully-Convolutional Siamese Networks for Object Tracking,” in ECCV, 2016, pp. 850–865.
|
| 243 |
+
[11] B. Li, J. Yan, W. Wu, Z. Zhu, and X. Hu, “High Performance Visual Tracking With Siamese Region Proposal Network,” in CVPR, 2018, pp. 8971–8980.
|
| 244 |
+
[12] Z. Chen, B. Zhong, G. Li, S. Zhang, and R. Ji, “Siamese Box Adaptive Network for Visual Tracking,” in CVPR, 2020, pp. 6667–6676.
|
| 245 |
+
[13] B. Yan, H. Peng, J. Fu, D. Wang, and H. Lu, “Learning Spatio-Temporal Transformer for Visual Tracking,” in ICCV, 2021, pp. 10 428–10 437.
|
| 246 |
+
[14] X. Chen, B. Yan, J. Zhu, D. Wang, X. Yang, and H. Lu, “Transformer Tracking,” in CVPR, 2021, pp. 8126–8135.
|
| 247 |
+
[15] B. Ye, H. Chang, B. Ma, S. Shan, and X. Chen, “Joint Feature Learning and Relation Modeling for Tracking: A One-Stream Framework,” in ECCV, 2022, pp. 341–357.
|
| 248 |
+
[16] X. Chen, H. Peng, D. Wang, H. Lu, and H. Hu, “Seqtrack: Sequence to sequence learning for visual object tracking,” in CVPR, 2023, pp. 14 572–14 581.
|
| 249 |
+
[17] Y. Xu, Z. Wang, Z. Li, Y. Yuan, and G. Yu, “SiamFC $^ { + + }$ : Towards Robust and Accurate Visual Tracking with Target Estimation Guidelines.” in AAAI, 2020, pp. 12 549–12 556.
|
| 250 |
+
[18] D. Guo, J. Wang, Y. Cui, Z. Wang, and S. Chen, “SiamCAR: Siamese Fully Convolutional Classification and Regression for Visual Tracking,” in CVPR, 2020, pp. 6268–6276.
|
| 251 |
+
[19] B. Li, W. Wu, Q. Wang, F. Zhang, J. Xing, and J. Yan, “SiamRPN++: Evolution of Siamese Visual Tracking with Very Deep Networks,” in CVPR, 2019, pp. 4282–4291.
|
| 252 |
+
[20] Q. Wang, L. Zhang, L. Bertinetto, W. Hu, and P. H. S. Torr, “Fast Online Object Tracking and Segmentation: A Unifying Approach,” in CVPR, 2019, pp. 1328–1338.
|
| 253 |
+
[21] A. Vaswani, N. Shazeer, N. Parmar, J. Uszkoreit, L. Jones, A. N. Gomez, L. Kaiser, and I. Polosukhin, “Attention is all you need,” in NIPS, 2017, pp. 5998–6008.
|
| 254 |
+
[22] Z. Cao, C. Fu, J. Ye, B. Li, and Y. Li, “Hift: Hierarchical feature transformer for aerial tracking,” in Proceedings of the IEEE/CVF International Conference on Computer Vision, 2021, pp. 15 457– 15 466.
|
| 255 |
+
[23] L. Yao, C. Fu, S. Li, G. Zheng, and J. Ye, “SGDViT: saliency-guided dynamic vision transformer for uav tracking,” in ICRA. IEEE, 2023, pp. 3353–3359.
|
| 256 |
+
[24] C. Fu, M. Cai, S. Li, K. Lu, H. Zuo, and C. Liu, “Continuity-aware latent interframe information mining for reliable uav tracking,” in ICRA. IEEE, 2023, pp. 1327–1333.
|
| 257 |
+
[25] A. Dosovitskiy, L. Beyer, A. Kolesnikov, D. Weissenborn, X. Zhai, T. Unterthiner, M. Dehghani, M. Minderer, G. Heigold, S. Gelly et al., “An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale,” in ICLR, 2021.
|
| 258 |
+
|
| 259 |
+
[26] A. Radford, J. W. Kim, C. Hallacy, A. Ramesh, G. Goh, S. Agarwal, G. Sastry, A. Askell, P. Mishkin, J. Clark et al., “Learning Transferable Visual Models From Natural Language Supervision,” in ICML, 2021, pp. 8748–8763.
|
| 260 |
+
[27] X. Chen, M. Ding, X. Wang, Y. Xin, S. Mo, Y. Wang, S. Han, P. Luo, G. Zeng, and J. Wang, “Context autoencoder for self-supervised representation learning,” International Journal of Computer Vision, pp. 1–16, 2023.
|
| 261 |
+
[28] M. Caron, H. Touvron, I. Misra, H. Jegou, J. Mairal, P. Bojanowski, ´ and A. Joulin, “Emerging properties in self-supervised vision transformers,” in ICCV, 2021.
|
| 262 |
+
[29] M. Oquab, T. Darcet, T. Moutakanni, H. Vo, M. Szafraniec, V. Khalidov, P. Fernandez, D. Haziza, F. Massa, A. El-Nouby et al., “Dinov2: Learning robust visual features without supervision,” arXiv preprint arXiv:2304.07193, 2023.
|
| 263 |
+
[30] B. Chen, P. Li, L. Bai, L. Qiao, Q. Shen, B. Li, W. Gan, W. Wu, and W. Ouyang, “Backbone is All Your Need: A Simplified Architecture for Visual Object Tracking,” in ECCV, 2022, pp. 375–392.
|
| 264 |
+
[31] Y. Cai, J. Liu, J. Tang, and G. Wu, “Robust object modeling for visual tracking,” in ICCV, 2023, pp. 9589–9600.
|
| 265 |
+
[32] B. Kang, X. Chen, D. Wang, H. Peng, and H. Lu, “Exploring lightweight hierarchical vision transformers for efficient visual tracking,” in ICCV, 2023.
|
| 266 |
+
[33] Z. Peng, W. Huang, S. Gu, L. Xie, Y. Wang, J. Jiao, and Q. Ye, “Conformer: Local features coupling global representations for visual recognition,” in ICCV, 2021, pp. 367–376.
|
| 267 |
+
[34] M. Mueller, N. Smith, and B. Ghanem, “A Benchmark and Simulator for UAV Tracking,” in ECCV, 2016, pp. 445–461.
|
| 268 |
+
[35] G. Huang, Z. Liu, L. van der Maaten, and K. Q. Weinberger, “Densely connected convolutional networks,” in CVPR, 2017.
|
| 269 |
+
[36] S. Gao, C. Zhou, and J. Zhang, “Generalized relation modeling for transformer tracking,” in CVPR, 2023, pp. 18 686–18 695.
|
| 270 |
+
[37] J. Zhu, S. Lai, X. Chen, D. Wang, and H. Lu, “Visual prompt multimodal tracking,” in CVPR, 2023, pp. 9516–9526.
|
| 271 |
+
[38] W. Cai, Q. Liu, and Y. Wang, “Hiptrack: Visual tracking with historical prompts,” in CVPR, 2024, pp. 19 258–19 267.
|
| 272 |
+
[39] X. Ma, X. Dai, Y. Bai, Y. Wang, and Y. Fu, “Rewrite the stars,” in CVPR, 2024.
|
| 273 |
+
[40] J. Yu, Z. Lin, J. Yang, X. Shen, X. Lu, and T. S. Huang, “Free-form image inpainting with gated convolution,” in ICCV, 2019, pp. 4471– 4480.
|
| 274 |
+
[41] Z. Cao, C. Fu, J. Ye, B. Li, and Y. Li, “Siamapn++: Siamese attentional aggregation network for real-time uav tracking,” in IROS. IEEE, 2021, pp. 3086–3092.
|
| 275 |
+
[42] Z. Cao, Z. Huang, L. Pan, S. Zhang, Z. Liu, and C. Fu, “Tctrack: Temporal contexts for aerial tracking,” in CVPR, 2022, pp. 14 798– 14 808.
|
| 276 |
+
[43] — , “Towards real-world visual tracking with temporal contexts,” IEEE TPAMI, 2023.
|
| 277 |
+
[44] J. Hu, L. Shen, and G. Sun, “Squeeze-and-excitation networks,” in CVPR, 2018, pp. 7132–7141.
|
| 278 |
+
[45] S. Li, Z. Wang, Z. Liu, C. Tan, H. Lin, D. Wu, Z. Chen, J. Zheng, and S. Z. Li, “Moganet: Multi-order gated aggregation network,” in ICLR, 2022.
|
| 279 |
+
[46] X. Wei, Y. Bai, Y. Zheng, D. Shi, and Y. Gong, “Autoregressive visual tracking,” in CVPR, June 2023, pp. 9697–9706.
|
| 280 |
+
[47] B. Graham, A. El-Nouby, H. Touvron, P. Stock, A. Joulin, H. Jegou, ´ and M. Douze, “LeViT: a Vision Transformer in ConvNet’s Clothing for Faster Inference,” in ICCV, 2021, pp. 12 239–12 249.
|
| 281 |
+
[48] C. Fu, Z. Cao, Y. Li, J. Ye, and C. Feng, “Onboard real-time aerial tracking with efficient siamese anchor proposal network,” IEEE TGARS, vol. 60, pp. 1–13, 2021.
|
| 282 |
+
[49] T.-Y. Lin, P. Goyal, R. Girshick, K. He, and P. Dollar, “Focal loss for ´ dense object detection,” in ICCV, 2017, pp. 2980–2988.
|
| 283 |
+
[50] H. Rezatofighi, N. Tsoi, J. Gwak, A. Sadeghian, I. D. Reid, and S. Savarese, “Generalized Intersection Over Union: A Metric and a Loss for Bounding Box Regression,” in CVPR, 2019, pp. 658–666.
|
| 284 |
+
[51] L. Huang, X. Zhao, and K. Huang, “Got-10k: A Large High-Diversity Benchmark for Generic Object Tracking in the Wild,” IEEE TPAMI, vol. 43, no. 5, pp. 1562–1577, 2021.
|
| 285 |
+
[52] H. Fan, L. Lin, F. Yang, P. Chu, G. Deng, S. Yu, H. Bai, Y. Xu, C. Liao, and H. Ling, “LaSOT: A High-Quality Benchmark for Large-Scale Single Object Tracking,” in CVPR, 2019, pp. 5374–5383.
|
| 286 |
+
[53] T.-Y. Lin, M. Maire, S. J. Belongie, L. D. Bourdev, R. B. Girshick, J. Hays, P. Perona, D. Ramanan, P. Dollar, and C. L. Zitnick, ´
|
| 287 |
+
|
| 288 |
+
“Microsoft COCO: Common Objects in Context,” in ECCV, 2014, pp. 740–755.
|
| 289 |
+
[54] M. Muller, A. Bibi, S. Giancola, S. Alsubaihi, and B. Ghanem, “TrackingNet: A Large-Scale Dataset and Benchmark for Object Tracking in the Wild,” in ECCV, 2018, pp. 310–327.
|
| 290 |
+
[55] I. Loshchilov and F. Hutter, “Decoupled Weight Decay Regularization,” in ICLR, 2019.
|
| 291 |
+
[56] H. Zuo, C. Fu, S. Li, J. Ye, and G. Zheng, “End-to-end feature decontaminated network for uav tracking,” in IROS. IEEE, 2022, pp. 12 130–12 137.
|
| 292 |
+
[57] C. Fu, W. Peng, S. Li, J. Ye, and Z. Cao, “Local perception-aware transformer for aerial tracking,” in IROS. IEEE, 2022, pp. 12 122– 12 129.
|
| 293 |
+
[58] H. Zuo, C. Fu, S. Li, J. Ye, and G. Zheng, “Deconnet: End-toend decontaminated network for vision-based aerial tracking,” IEEE TGARS, vol. 60, pp. 1–12, 2022.
|
| 294 |
+
[59] D. Xing, N. Evangeliou, A. Tsoukalas, and A. Tzes, “Siamese transformer pyramid networks for real-time uav tracking,” in WACV, 2022, pp. 2139–2148.
|
| 295 |
+
[60] Z. Zhang and H. Peng, “Deeper and Wider Siamese Networks for Real-Time Visual Tracking,” in CVPR, 2019, pp. 4591–4600.
|
| 296 |
+
[61] I. Sosnovik, A. Moskalev, and A. W. Smeulders, “Scale equivariance improves siamese tracking,” in WACV, 2021, pp. 2765–2774.
|
| 297 |
+
[62] Z. Zhang, H. Peng, J. Fu, B. Li, and W. Hu, “Ocean: Object-aware Anchor-free Tracking,” in ECCV, 2020, pp. 771–787.
|
paper_markdowns/bamboo-05163.md
ADDED
|
@@ -0,0 +1,294 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Improving Indoor Localization Accuracy
|
| 2 |
+
|
| 3 |
+
# by Using an Efficient Implicit Neural Map Representation
|
| 4 |
+
|
| 5 |
+
Haofei Kuang
|
| 6 |
+
|
| 7 |
+
Yue Pan
|
| 8 |
+
|
| 9 |
+
Xingguang Zhong
|
| 10 |
+
|
| 11 |
+
Louis Wiesmann
|
| 12 |
+
|
| 13 |
+
Jens Behley
|
| 14 |
+
|
| 15 |
+
Cyrill Stachniss
|
| 16 |
+
|
| 17 |
+
Abstract— Globally localizing a mobile robot in a known map is often a foundation for enabling robots to navigate and operate autonomously. In indoor environments, traditional Monte Carlo localization based on occupancy grid maps is considered the gold standard, but its accuracy is limited by the representation capabilities of the occupancy grid map. In this paper, we address the problem of building an effective map representation that allows to accurately perform probabilistic global localization. To this end, we propose an implicit neural map representation that is able to capture positional and directional geometric features from 2D LiDAR scans to efficiently represent the environment and learn a neural network that is able to predict both, the non-projective signed distance and a direction-aware projective distance for an arbitrary point in the mapped environment. This combination of neural map representation with a lightweight neural network allows us to design an efficient observation model within a conventional Monte Carlo localization framework for pose estimation of a robot in real time. We evaluated our approach to indoor localization on a publicly available dataset for global localization and the experimental results indicate that our approach is able to more accurately localize a mobile robot than other localization approaches employing occupancy or existing neural map representations. In contrast to other approaches employing an implicit neural map representation for 2D LiDAR localization, our approach allows to perform real-time pose tracking after convergence and near real-time global localization. The code of our approach is available at: https://github.com/PRBonn/enm-mcl.
|
| 18 |
+
|
| 19 |
+
# I. INTRODUCTION
|
| 20 |
+
|
| 21 |
+
Estimating the state of a robot in terms of its position and orientation in an environment is crucial to enable robots to operate autonomously, but it is also a key requirement for realizing autonomous navigation and planning. Localization in a pre-built map is a common way to realize state estimation for robotic systems, where probabilistic methods using various map representations are often employed. In indoor environments, localization via external sources of global positioning information, such as GNSS data, is typically not available, therefore, global localization must rely on onboard sensors, like wheel odometry and 2D LiDAR sensors. A gold standard approach for that is Monte Carlo localization [5].
|
| 22 |
+
|
| 23 |
+
In this paper, we investigate the problem of building an effective map for achieving accurate and efficient global localization and ego-pose tracking in indoor environments.
|
| 24 |
+
|
| 25 |
+
All authors are with the Center for Robotics, University of Bonn, Germany. Cyrill Stachniss is additionally with the Department of Engineering Science at the University of Oxford, UK, and with the Lamarr Institute for Machine Learning and Artificial Intelligence, Germany.
|
| 26 |
+
|
| 27 |
+
This work has partially been funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) under Germany’s Excellence Strategy, EXC-2070 – 390732324 – PhenoRob, and by the German Federal Ministry of Education and Research (BMBF) in the project “Robotics Institute Germany” under grant No. 16ME0999.
|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
|
| 31 |
+

|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
Fig. 1: We learn a neural network to represent the surfaces of environments. Our method achieves both efficiency and accuracy for indoor localization by integrating our proposed efficient neural map representation into a Monte Carlo localization system. We show the average runtime for each method in sequence 1 of the in-house dataset.
|
| 35 |
+
|
| 36 |
+
Specifically, we aim to build a map representation that can be used for implementing an accurate and computationally efficient probabilistic localization approach, where we employ a conventional Monte Carlo localization (MCL) and use our map representation for an efficient observation model.
|
| 37 |
+
|
| 38 |
+
A classical approach to build an effective map representation is occupancy grid mapping [23] often used to realize MCL [7], [8], [31] in indoor environments. Recently, several approaches [11], [24] investigated the usage of novel implicit neural map representations to replace the commonly employed occupancy grid maps due to promising prospects regarding representing scene details continuously with a comparably small memory footprint and scene completion capabilities [28]. While these approaches demonstrate the advantages of an implicit map representation over conventional occupancy maps, they typically require significant computational resources for training and deployment in global localization, especially in large-scale environments.
|
| 39 |
+
|
| 40 |
+
To address these key limitations of current implicit neural map representation-based global localization methods [11], [24], we propose a novel approach that improves the efficiency of using the map representation in an MCL-based localization, while simultaneously increasing the localization accuracy at the same time, as we show in Fig. 1.
|
| 41 |
+
|
| 42 |
+
The main contribution of this paper is a novel implicit map representation, which we call efficient neural map (ENM), that allows to learn the surface information of a mapped environment through a dense feature grid combined with a lightweight neural network enabling efficient global localization in large indoor environments with a large number of particles. The light-weight neural network learns an approximate regular (non-projective) signed distance field (SDF), but is also able by incorporating information of the ray direction to accurately predict a direction-aware projective SDF (PSDF) capturing both, geometric and directional features of the environment. We integrate our ENM representation into the existing MCL framework by replacing the occupancy grid map used to compute a beam end point-based observation model [23], resulting in the approach we call ENM-MCL. Our experimental evaluation on multiple publicly available sequences for indoor localization indicates that our ENM-MCL is able to more accurately localize a mobile robot than other probabilistic localization approaches employing occupancy or so far used neural representations. Furthermore, the results show that ENM-MCL is able to perform realtime pose tracking after convergence, while allowing near real-time global localization.
|
| 43 |
+
|
| 44 |
+
In sum, we make three key claims: (i) Our map representation, ENM, used by ENM-MCL achieves more accurate global localization compared to other localization approaches employing conventional occupancy grid maps or neural map representations; (ii) Our ENM-MCL system operates at real time for pose tracking but also enables efficient global localization even with a large number of particles; (iii) Our ENM-MCL converges quickly to the correct pose estimate enabling fast and reliable localization in indoor environments. We will publish the source code of our ENM-MCL.
|
| 45 |
+
|
| 46 |
+
# II. RELATED WORK
|
| 47 |
+
|
| 48 |
+
Pose tracking and global localization for mobile robots are key research areas in robotics as determining the location of a robot in a given map is crucial for many downstream tasks. Regarding global localization for mobile robots, Monte Carlo localization is a gold standard method, which exploits a particle filter to estimate the robot’s state in a probabilistic manner and has been implemented with various sensors, such as 2D LiDARs [5], [8], [22] and cameras [2], [30]. To improve the efficiency of the MCL algorithm, Fox et al. [8] propose an adaptive sampling strategy, which adapt the size of the sample set on the fly. Traditionally, MCL methods for LiDAR-based localization often rely on occupancy grid maps [4], [8], [31] for 2D LiDARs, but also for 3D LiDARs [3], [13].
|
| 49 |
+
|
| 50 |
+
The representational capacity of occupancy maps is constrained by their pre-defined grid resolution, where simply increasing the resolution can substantially increase memory consumption. To overcome this limitation of a fixed resolution, some approaches for LiDAR-based localization have been proposed to construct a multi-resolution map [6] or learn continuous implicit map representations via Gaussian processes [16], [26], reproducing kernel Hilbert maps [20].
|
| 51 |
+
|
| 52 |
+
Nonetheless, these methods are quite time-consuming and challenging to directly apply to real-world scenarios.
|
| 53 |
+
|
| 54 |
+
Recently, implicit neural map representations have gained popularity due to their compactness and continuous representational capacity. These representations have been used to model complex geometric information, such as learning a radiance field [1], [15], [21] from images to representing the 3D world [17], [19]. Consequently, NeRFs have been employed for visual localization tasks, such as global localization [14] or re-localization [12]. Other methods [17], [19] learn a signed distance field from LiDAR or RGB-D camera as a more accurate geometric representation of the environment. Moreover, some works [25], [27] use the neural network not only to encode the geometry or appearance of the scene, but also the semantics of the environment. Due to their high representational capacity of the employed neural network, several works [11], [24] use a single MLP to represent the entire scene and integrate the implicit neural map representation into an observation model of MCL to achieve global localization. Although these methods exhibit good map representation capabilities, the reconstruction process is very time-consuming and the time needed to querying the representation does not meet the required efficiency for realtime localization.
|
| 55 |
+
|
| 56 |
+
To address the challenge with respect to efficiency, recent works [18], [28], [29] have introduced feature fields combined with shallow MLPs as a representation of the environment. This approach not only accelerates convergence of training process but also enhances the quality and capacity of the map representation. However, these methods have primarily been applied to 3D reconstruction tasks and have not yet been efficiently deployed in 2D indoor localization scenarios.
|
| 57 |
+
|
| 58 |
+
In this work, we leverage the high capacity of neural networks to learn both the non-projective SDF and a directionaware projective SDF by encoding the ray direction of 2D LiDAR into the neural map representation. Additionally, we propose a novel implicit representation based on a dense feature grid combined with a light-weight neural network, which substantially reduces computational cost, especially for querying the neural map representation. Our novel implicit neural map representation enables more detailed modeling of the environment while improving the accuracy and efficiency of global localization using 2D LiDAR scans.
|
| 59 |
+
|
| 60 |
+
# III. OUR APPROACH FOR GLOBAL LOCALIZATION
|
| 61 |
+
|
| 62 |
+
The goal of our approach is to accurately localize a mobile robot in a given map by learning an efficient neural map representation of the environment. More specifically, we propose to represent the environment via a feature gridbased representation, which is learned from 2D LiDAR scans recorded in a mapping session and allows to predict the signed distance to the surface at an arbitrary position via a shallow multi-layer perceptron (MLP), see Sec. III-A. For learning the implicit neural map representation, we supervise learnable features of the feature grid and the weights of the employed MLP with real measurements from a 2D LiDAR as
|
| 63 |
+
|
| 64 |
+

|
| 65 |
+
|
| 66 |
+

|
| 67 |
+
Fig. 2: Overview of our approach for jointly predicting the non-projective SDF and direction-aware projective SDF values using our proposed efficient neural map representation. We sample several positions along a LiDAR ray and input the 2D position $\pmb { p } = ( x , y ) ^ { \top }$ as well as the corresponding ray direction $\pmb { d } = ( d _ { x } , d _ { y } ) ^ { \top }$ into our ENM model to estimate the SDF and PSDF. The predictions of the SDF and PSDF values by the neural network are supervised with the ground truth SDF/PSDF values from 2D LiDAR measurements.
|
| 68 |
+
|
| 69 |
+
presented in Sec. III-B. After that, we use the efficient neural map representation in an MCL-based localization approach, where we use the estimated SDF for an observation model to update the weights of the particles, as described in more detail in Sec. III-C.
|
| 70 |
+
|
| 71 |
+
# A. Efficient Neural Map Representation
|
| 72 |
+
|
| 73 |
+
For our map representation, we want to leverage a neural representation that allows for estimating the signed distance to the surface in the environment. More specifically, we propose an implicit neural surface representation, which is a function $F _ { \Theta , \mathbf { G } }$ that takes the 2D location vector $\pmb { p } = ( x , y ) ^ { \top }$ and 2D Cartesian unit vector $\pmb { d } = ( d _ { x } , d _ { y } ) ^ { \top }$ as inputs, and predicts the corresponding non-projective signed distance field (SDF) value $s$ and direction-aware projective signed distance field (PSDF) value s¯. The SDF value represents the shortest distance from the point $\pmb { p }$ to the nearest surface in the environment and the PSDF is the distance from a point $\pmb { p }$ to the surface along the specific ray direction $^ d$ . Formally, we have the following:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
s, \bar {s} = F _ {\Theta , \mathbf {G}} (\boldsymbol {p}, \boldsymbol {d}). \tag {1}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
We represent $F _ { \Theta , \mathbf { G } }$ by a MLP, where $\Theta$ represents the weights of the MLP and G corresponds to a dense grid of learnable feature vectors. By combining a light-weight network with a dense feature grid, we can substantially reduce the computation-cost meanwhile maintaining the quality of the map model, which supports to use it with a particle filter for localization in real time.
|
| 80 |
+
|
| 81 |
+
Our dense feature grid G has a given grid resolution $\Delta _ { \mathbf { G } }$ . Each grid corner at the location coordinate $( i , j )$ stores a $D$ -dimensional feature vector $\boldsymbol { c } _ { i , j } ^ { g } \in \mathbb { R } ^ { D }$ . During operation, the input 2D location $\pmb { p }$ is first encoded into a location feature $\pmb { f } ^ { p } \in \mathbb { R } ^ { D }$ by performing bilinear interpolation on the dense feature grid G. We use the neural network to estimate the SDF $s$ and PSDF $\overline { { s } }$ of input 2D location $\pmb { p }$ and ray direction $^ d$ , which consist of two branches, as shown in Fig. 2.
|
| 82 |
+
|
| 83 |
+
In the SDF branch, the location feature $f ^ { p }$ is first processed by an encoder $F _ { p }$ , a 3-layer MLP, to extract the
|
| 84 |
+
|
| 85 |
+
positional embedding $f _ { \mathrm { e m b e d } } ^ { p }$ . Then, $f _ { \mathrm { e m b e d } } ^ { p }$ is decoded into the $s$ value of the input location by the SDF head $H _ { \mathrm { s d f } }$ , which is a 1-layer MLP. Formally, we have the following:
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\boldsymbol {f} _ {\text {e m b e d}} ^ {p} = F _ {p} \left(\boldsymbol {f} ^ {p}\right), \tag {2}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
s = H _ {\mathrm {s d f}} \left(\boldsymbol {f} _ {\text {e m b e d}} ^ {p}\right). \tag {3}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
In the PSDF branch, the extracted positional embedding $f _ { \mathrm { e m b e d } } ^ { p }$ is concatenated with the positional encoding of directional vector , to extract the d $\scriptstyle { d _ { \gamma } }$ and fed into another 3-tion-aware embedding MLPs, and $F _ { d }$ $\pmb { f } _ { \mathrm { e m b e d } } ^ { \bar { d } }$ then predict the $\bar { s }$ value of the input location and direction by a PSDF head $H _ { \mathrm { p s d f } }$ , which is also a 1-layer MLP, as follows:
|
| 96 |
+
|
| 97 |
+
$$
|
| 98 |
+
\boldsymbol {f} _ {\text {e m b e d}} ^ {d} = F _ {d} \left(\boldsymbol {f} _ {\text {e m b e d}} ^ {p} \oplus \boldsymbol {d} _ {\gamma}\right), \tag {4}
|
| 99 |
+
$$
|
| 100 |
+
|
| 101 |
+
$$
|
| 102 |
+
\bar {s} = H _ {\text {p s d f}} \left(\boldsymbol {f} _ {\text {e m b e d}} ^ {d}\right), \tag {5}
|
| 103 |
+
$$
|
| 104 |
+
|
| 105 |
+
where $\oplus$ is the concatenation of two vectors. To enable the model to capture high-frequency geometric features of the ray direction, we encode the directional vector $^ d$ via a positional encoding $\gamma$ , where we apply $\gamma$ to each component [15], i.e., $\pmb { d } _ { \gamma } = ( \gamma ( d _ { x } ) , \gamma ( d _ { y } ) ) ^ { \top }$ . The positional encoding function $\gamma : \mathbb { R } \mapsto \mathbb { R } ^ { 2 L + 1 }$ is defined as:
|
| 106 |
+
|
| 107 |
+
$$
|
| 108 |
+
\gamma (d) = \left(d, \sin \left(2 ^ {0} d\right), \cos \left(2 ^ {0} d\right), \dots , \sin \left(2 ^ {L - 1} d\right), \cos \left(2 ^ {L - 1} d\right)\right), \tag {6}
|
| 109 |
+
$$
|
| 110 |
+
|
| 111 |
+
where $L$ is the number of frequency bands used.
|
| 112 |
+
|
| 113 |
+
The networks $F _ { p }$ and $F _ { d }$ are shallow MLPs. Each hidden layer has $D$ neurons and $D + 2 ( 2 L + 1 )$ neurons for $F _ { p }$ and $F _ { d }$ , respectively. $D$ is the dimension of the feature vector from $\mathbf { G }$ and $L$ is the bandwidth of $\gamma$ . In our model, we set $D = 4$ and $L = 4$ , and each layer is followed by a ReLU activation. These shallow MLPs enable our model to run in real-time, even with a large number of particles.
|
| 114 |
+
|
| 115 |
+
# B. Learning the ENM from 2D LiDAR Data
|
| 116 |
+
|
| 117 |
+
We learn our ENM representation using 2D LiDAR data from scans recorded in a mapping run. Given a posed 2D LiDAR scan with a set of rays $\boldsymbol { B } = \{ ( r _ { j } , d _ { j } ) \}$ , where $\mathbf { \delta } _ { d _ { j } }$ are
|
| 118 |
+
|
| 119 |
+
ray directions and $r _ { j }$ are range readings, we sample positions on these rays for a training set $s$ for each scan.
|
| 120 |
+
|
| 121 |
+
We sample training data by selecting points along each Li-DAR ray within three regions: the truncated space, occupied space, and free space, see Fig. 2 left. The truncated space is the area in front of the surface, and the occupied space is the area behind the surface. For each ray, we randomly sample $M _ { t }$ samples in the truncated space, denoted as $S _ { t }$ , and fewer $M _ { o }$ samples in the occupied space, denoted as $\scriptstyle { S _ { o } }$ , to encourage the model to learn the surface features. Furthermore, we sample a small number of $M _ { s }$ samples in the free space, denoted as $ { \boldsymbol { S } } _ { f }$ , as these areas contribute less to learn the fine geometric details. The set of sampled points along each ray of a single LiDAR scan is then given by $S = S _ { t } \cup S _ { o } \cup S _ { f }$ . Fig. 2 shows the sampling process visually.
|
| 122 |
+
|
| 123 |
+
To optimize the weights and learnable feature vectors of $F _ { \Theta , \mathbf { G } }$ , we supervise the predicted $s$ and $\bar { s }$ values using the generated ground truth from the training samples. Regarding the PSDF loss $\mathcal { L } _ { \mathrm { p s d f } }$ , we can directly generate the groundtruth projective SDF values from the range readings of each LiDAR ray. Let $\pmb { p }$ be a sample on the LiDAR ray, then the ground-truth PSDF value $\hat { \bar { s } }$ is given by the distance between real measured distance $r$ and the distance between $\pmb { p }$ and the LiDAR origin $^ o$ :
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\hat {\bar {s}} = r - \left\| \boldsymbol {p} - \boldsymbol {o} \right\| _ {2}. \tag {7}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
The loss $\mathcal { L } _ { \mathrm { p s d f } }$ for the projected SDF is then computed using only the sampled points near the surface, $\cal { S } _ { t } \cup \cal { S } _ { o }$ , as:
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\mathcal {L} _ {\mathrm {p s d f}} = \frac {1}{| \mathcal {S} _ {t} | + | \mathcal {S} _ {o} |} \sum_ {(\boldsymbol {p}, \boldsymbol {d}) \in \mathcal {S} _ {t} \cup \mathcal {S} _ {o}} | \bar {s} - \hat {\bar {s}} |, \tag {8}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
where $^ d$ is the corresponding ray direction of sample $\pmb { p }$ and $\bar { s }$ is the predicted PSDF from $F _ { \Theta , \mathbf { G } } ( \pmb { p } , \pmb { d } )$ .
|
| 136 |
+
|
| 137 |
+
Regarding the SDF loss $\mathcal { L } _ { \mathrm { s d f } }$ , we activate the predicted SDF values using a sigmoid function $\sigma$ , and minimize a binary cross-entropy loss as the SDF objective $\mathcal { L } _ { \mathrm { s d f } }$ , formulated as:
|
| 138 |
+
|
| 139 |
+
$$
|
| 140 |
+
\begin{array}{l} \mathcal {L} _ {\mathrm {s d f}} = - \frac {1}{| \mathcal {S} |} \sum_ {(\boldsymbol {p}, \boldsymbol {d}) \in \mathcal {S}} \left(\sigma (\hat {s}) \log \sigma (s) \right. \\ \left. + (1 - \sigma (\hat {s})) \log (1 - \sigma (s))\right), \tag {9} \\ \end{array}
|
| 141 |
+
$$
|
| 142 |
+
|
| 143 |
+
where $s = F _ { \Theta , \mathbf { G } } ( p , d )$ is the predicted signed distance value for the input sample, and $\sigma ( \hat { s } ) \in [ 0 , 1 ]$ is the ground-truth value indicating the probability of the point being inside or outside the surface. Since we cannot directly obtain the non-projective SDF value from LiDAR range readings, we supervise the SDF prediction in an approximate manner, i.e., $\sigma ( \hat { s } ) \approx \sigma ( \hat { \bar { s } } )$ , inspired by prior work [28].
|
| 144 |
+
|
| 145 |
+
Additionally, we incorporate an Eikonal loss $\mathcal { L } _ { \mathrm { e i k o n a l } }$ to regularize the SDF [18], [28]. The Eikonal loss ensures that the gradient of the predicted SDF $\nabla s$ satisfies the Eikonal equation $\| \nabla s \| = 1$ , which helps to enforce SDF smoothness and prevents the SDF from unrealistic deformations, leading to a more accurate neural map representation. The Eikonal
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
Fig. 3: The observation model based on the ENM representation. We estimate the SDF and PSDF values for all beam end-points of the particles using the ENM model, and update the particles’ weights by computing the likelihood based on the SDF and PSDF values of the beam end-points. The positive particle has higher likelihood which scans are aligned with the zero level of distance field.
|
| 149 |
+
|
| 150 |
+
loss $\mathcal { L } _ { \mathrm { e i k o n a l } }$ is defined as:
|
| 151 |
+
|
| 152 |
+
$$
|
| 153 |
+
\mathcal {L} _ {\text {e i k o n a l}} = \frac {1}{| \mathcal {S} _ {t} | + | \mathcal {S} _ {o} |} \sum_ {(\boldsymbol {p}, \boldsymbol {d}) \in \mathcal {S} _ {t} \cup \mathcal {S} _ {o}} \left(\left\| \nabla s _ {i} \right\| - 1\right) ^ {2}. \tag {10}
|
| 154 |
+
$$
|
| 155 |
+
|
| 156 |
+
By minimizing this loss, we ensure that the predicted SDF adheres to the properties of a signed distance function, improving both stability and accuracy in the learned map representation. To sum up, our final loss objective is:
|
| 157 |
+
|
| 158 |
+
$$
|
| 159 |
+
\mathcal {L} _ {\text {f i n a l}} = \mathcal {L} _ {\text {s d f}} + \mathcal {L} _ {\text {p s d f}} + \beta \mathcal {L} _ {\text {e i k o n a l}}. \tag {11}
|
| 160 |
+
$$
|
| 161 |
+
|
| 162 |
+
We optimize the loss function of the ENM model using the Adam optimizer [10] with a learning rate of 0.001, and we use $\beta = 0 . 1$ for the Eikonal loss. $s$ . We sample $M _ { t } = 6$ positions in the truncated space, $M _ { o } = 4$ positions in the occupied space, and $M _ { f } = 5$ positions in the free space. The training process runs for 5,000 iterations, at each iteration we randomly sample batch of rays from all training LiDAR scans with a batch size of 2,048.
|
| 163 |
+
|
| 164 |
+
# C. Efficient Neural Map-based MCL
|
| 165 |
+
|
| 166 |
+
Given our new map representation, we need to integrate it into MCL as our localization approach, ENM-MCL. We want to estimate the SE(2) state ${ \pmb x } _ { t } ~ = ~ ( x , y , \theta ) _ { t } ^ { \top }$ of the robot at time $t$ defined by the 2D position $( x , y ) ^ { \top }$ and the orientation $\theta \in [ - \pi , \pi ]$ . To this end, we estimate the posterior $p ( \pmb { x } _ { t } | \pmb { z } _ { t } , m )$ of the robot state $\mathbf { \Delta } _ { \mathbf { \mathcal { X } } _ { t } }$ at time $t$ with observations ${ \boldsymbol { z } } _ { t }$ and map $m$ using a recursive Bayes filter [23], which is realized in MCL [5] via a particle filter. The particle filter approximates $p ( \pmb { x } _ { t } | \pmb { z } _ { t } , m )$ by a set of particles $\mathcal { N } = \{ ( \boldsymbol { x } _ { t } ^ { n } , w _ { t } ^ { n } ) \}$ , $| { \mathcal { N } } | = N$ , where each particle is a hypothesis of the robot’s state $\pmb { x } _ { t } ^ { n } = ( x _ { t } ^ { n } , y _ { t } ^ { n } , \theta _ { t } ^ { n } ) ^ { \top }$ with its corresponding weight $w _ { t } ^ { n }$ . The weights $w _ { t } ^ { n }$ are updated based on the likelihood $p ( z _ { t } | \mathbf { x } _ { t } ^ { n } , m )$ of the observation ${ \boldsymbol { z } } _ { t }$ , commonly called observation model.
|
| 167 |
+
|
| 168 |
+
We use as observation model the conventional beam endpoint model of MCL, but adapt it to employ our map representation. Here, we want to achieve that the observation model results in a higher likelihood if a particle hypothesis is closer to the real robot state, which means that the beam end points have the small SDF and PSDF values with our map representation. Specifically, we transfer the measured LiDAR
|
| 169 |
+
|
| 170 |
+
scan to a particle’s state $\mathbf { \Delta } \mathbf { x } _ { t } ^ { n }$ at time $t$ and then check the SDF and PSDF value of end-point $ { \boldsymbol { z } } _ { t } ^ { i }$ for each ray $( r _ { t } ^ { i } , d _ { t } ^ { i } ) \in B ^ { t }$ , formally as:
|
| 171 |
+
|
| 172 |
+
$$
|
| 173 |
+
\boldsymbol {z} _ {t} ^ {i} = \mathbf {R} _ {t} ^ {n} \left(r _ {t} ^ {i} \boldsymbol {d} _ {t} ^ {i}\right) + t _ {t} ^ {n}, \tag {12}
|
| 174 |
+
$$
|
| 175 |
+
|
| 176 |
+
where $\mathbf { R } _ { t } ^ { n } \in \mathbb { R } ^ { 2 \times 2 }$ is the 2D rotation matrix for angle $\theta _ { t } ^ { n }$ , and $t _ { t } ^ { n } = ( x _ { t } ^ { n } , y _ { t } ^ { n } ) ^ { \top }$ . Then, we exploit our ENM model $F _ { \Theta , \mathbf { G } }$ to estimate the SDF value $s _ { t } ^ { i }$ of $ { \boldsymbol { z } } _ { t } ^ { i }$ , and the PSDF value $\hat { s } _ { t } ^ { i }$ of $( z _ { t } ^ { i } , \mathbf { R } _ { t } ^ { n } d _ { t } ^ { i } )$ as:
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
s _ {t} ^ {i}, \bar {s} _ {t} ^ {i} = F _ {\Theta , \mathbf {G}} \left(\boldsymbol {z} _ {t} ^ {i}, \mathbf {R} _ {t} ^ {n} \boldsymbol {d} _ {t} ^ {i}\right), \tag {13}
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
where $\mathbf { R } _ { t } ^ { n } d _ { t } ^ { i }$ is $i$ -th the ray direction in the reference frame of the particle. Then, the likelihood of $ { \boldsymbol { z } } _ { t } ^ { i }$ is given by:
|
| 183 |
+
|
| 184 |
+
$$
|
| 185 |
+
p \left(\boldsymbol {z} _ {t} \mid \boldsymbol {x} _ {t} ^ {n}, F _ {\Theta , \mathbf {G}}\right) \propto \exp \left(- \lambda \frac {1}{\left| \mathcal {B} ^ {t} \right|} \sum_ {i = 1} ^ {\left| \mathcal {B} ^ {t} \right|} \frac {\left| s _ {t} ^ {i} \right| + \left| \bar {s} _ {t} ^ {i} \right|}{2}\right). \tag {14}
|
| 186 |
+
$$
|
| 187 |
+
|
| 188 |
+
Similar to other localization systems [9], we compute an average alignment for each scan to the map. Furthermore, we average the predictions from the ENM model since it reduces the impact of noise or inaccuracies in either $s _ { t } ^ { i }$ or $\hat { s } _ { t } ^ { i }$ , resulting in a more robust and consistent likelihood estimation.
|
| 189 |
+
|
| 190 |
+
# IV. EXPERIMENTAL EVALUATION
|
| 191 |
+
|
| 192 |
+
The focus of this work is an efficient MCL system using an efficient and accurate neural map representation. We present our experiments to show the capabilities of our method. The results of our experiments support our key claims, which are: (i) the method achieves high accuracy in localization by representing the environment with the ENM model; (ii) our ENM-MCL system operates in real-time at pose tracking but also enables efficient global localization even with large numbers of particles; (iii) our algorithm converges quickly to the correct pose estimation to support rapid and reliable localization.
|
| 193 |
+
|
| 194 |
+
# A. Experimental Setup
|
| 195 |
+
|
| 196 |
+
We evaluate our global localization results using the inhouse dataset, previously used in prior work [11], [24]. It was collected with a KuKa YouBot equipped with a UTM-30LX 2D LiDAR and an upward-facing camera (not used for localization). The ground-truth robot poses were generated by localizing a large number of AprilTags on the ceiling detected by the upward-facing camera, as described in our prior work [11], providing a reference trajectory as near ground truth with a global position error around $1 \mathrm { c m }$ , often even better. The dataset covers different indoor scenes such as offices, a kitchen, and a long corridor. It contains a 31,608- frame mapping sequence for training ENM and five test sequences averaging 1,419 frames for localization evaluation.
|
| 197 |
+
|
| 198 |
+
To demonstrate the localization accuracy of our method, we compare with four existing LiDAR-based localization algorithms: AMCL [8], SRRG-Loc [9], IRMCL [11], and LocNDF [24]. AMCL and SRRG-Loc are both occupancy grid map-based methods. The AMCL is a widely used global localization method from the standard ROS1 implementation. The SRRG-Loc [9] is developed by the Sapienza Robust
|
| 199 |
+
|
| 200 |
+
<table><tr><td>Seq</td><td>Method</td><td>Location RMSE (cm) ↓</td><td>Yaw RMSE (degree) ↓</td><td>Success Rate (%)</td></tr><tr><td rowspan="5">1</td><td>AMCL</td><td>12.24 ± 0.33</td><td>2.08 ± 0.08</td><td>40.0</td></tr><tr><td>SRRG-Loc</td><td>5.33 ± 0.02</td><td>0.75 ± 0.00</td><td>100.0</td></tr><tr><td>IRMCL</td><td>5.35 ± 0.07</td><td>1.06 ± 0.01</td><td>100.0</td></tr><tr><td>LocNDF</td><td>4.06 ± 0.06</td><td>0.60 ± 0.00</td><td>60.0</td></tr><tr><td>ENM-MCL</td><td>1.96 ± 0.07</td><td>0.41 ± 0.00</td><td>100.0</td></tr><tr><td rowspan="5">2</td><td>AMCL</td><td>10.28 ± 0.00</td><td>0.86 ± 0.00</td><td>100.0</td></tr><tr><td>SRRG-Loc</td><td>6.59 ± 0.02</td><td>1.09 ± 0.00</td><td>100.0</td></tr><tr><td>IRMCL</td><td>5.53 ± 0.06</td><td>0.82 ± 0.01</td><td>60.0</td></tr><tr><td>LocNDF</td><td>4.06 ± 0.93</td><td>0.62 ± 0.03</td><td>80.0</td></tr><tr><td>ENM-MCL</td><td>4.18 ± 0.06</td><td>0.60 ± 0.01</td><td>100.0</td></tr><tr><td rowspan="5">3</td><td>AMCL</td><td>-</td><td>-</td><td>0.0</td></tr><tr><td>SRRG-Loc</td><td>-</td><td>-</td><td>0.0</td></tr><tr><td>IRMCL</td><td>4.70 ± 0.13</td><td>0.77 ± 0.04</td><td>100.0</td></tr><tr><td>LocNDF</td><td>3.85 ± 0.13</td><td>0.72 ± 0.01</td><td>100.0</td></tr><tr><td>ENM-MCL</td><td>3.05 ± 0.03</td><td>0.74 ± 0.01</td><td>100.0</td></tr><tr><td rowspan="5">4</td><td>AMCL</td><td>-</td><td>-</td><td>0.0</td></tr><tr><td>SRRG-Loc</td><td>-</td><td>-</td><td>0.0</td></tr><tr><td>IRMCL</td><td>11.72 ± 0.31</td><td>1.57 ± 0.12</td><td>100.0</td></tr><tr><td>LocNDF</td><td>10.89 ± 0.55</td><td>1.55 ± 0.16</td><td>60.0</td></tr><tr><td>ENM-MCL</td><td>5.82 ± 0.12</td><td>0.97 ± 0.08</td><td>100.0</td></tr><tr><td rowspan="5">5</td><td>AMCL</td><td>-</td><td>-</td><td>0.0</td></tr><tr><td>SRRG-Loc</td><td>6.29 ± 0.06</td><td>1.03 ± 0.05</td><td>100.0</td></tr><tr><td>IRMCL</td><td>6.12 ± 0.03</td><td>1.26 ± 0.01</td><td>100.0</td></tr><tr><td>LocNDF</td><td>-</td><td>-</td><td>0.0</td></tr><tr><td>ENM-MCL</td><td>2.40 ± 0.02</td><td>0.54 ± 0.01</td><td>100.0</td></tr></table>
|
| 201 |
+
|
| 202 |
+
TABLE I: Quantitative results of global localization on the in-house dataset. We report the ATE for both location and orientation RMSE, along with the success rate of each method over five runs. The ATE is only reported if at least one run was successful; otherwise, ‘-’ indicates failure.
|
| 203 |
+
|
| 204 |
+
Robotics Group (SRRG), which is a well-designed MCL implementation by Giorgio Grisetti and is based on occupancy grid maps. In contrast, IRMCL and LocNDF are two stateof-the-art methods based on implicit neural representations.
|
| 205 |
+
|
| 206 |
+
# B. Global Localization Performance
|
| 207 |
+
|
| 208 |
+
The first experiment evaluates the performance of our approach and its outcomes support the claim that our method achieves the state-of-the-art accuracy for global localization.
|
| 209 |
+
|
| 210 |
+
Regarding the parameters of our MCL system, we use a large particle number $N = 8 0 { , } 0 0 0$ during the initialization phase, where particles are uniformly distributed across the map with random orientations for global localization, and reduce it to $N = 1 { , } 0 0 0$ for efficient pose tracking after convergence. This adaptive adjustment for the particle number balances the trade-off between reliability and computational cost for the MCL system. To evaluate the localization results, we compute the absolute trajectory error (ATE) between the predicted and ground-truth trajectories. It includes the RMSE of translation (in centimeters) and orientation (in degrees). To reduce the sensitivity to randomness in the particle filter, we run five times with different random seeds, and take the average as the final ATE for each sequence.
|
| 211 |
+
|
| 212 |
+
The comparison results are shown in Tab. I. Our method demonstrates better accuracy compared to the baseline methods across all sequences. Even in challenging scenarios, such as sequence 3 where the robot starts in a corridor, our method substantially outperforms other approaches, leading to a $3 5 . 7 \%$ improvement over IRMCL. Meanwhile occupancy grid map-based methods failed entirely without parameter
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Fig. 4: Qualitative global localization results of ENM-MCL on all five sequences of the in-house dataset. We show the predicted trajectories after convergence. The predicted trajectories are mostly aligned with the ground truth, indicating the high accuracy and reliability of our method.
|
| 216 |
+
|
| 217 |
+
<table><tr><td>Sequence 1</td></tr><tr><td>Sequence 2</td></tr><tr><td>Sequence 3</td></tr><tr><td>Sequence 4</td></tr><tr><td>Sequence 5</td></tr><tr><td>---- GT</td></tr><tr><td>• Start</td></tr><tr><td>• End</td></tr></table>
|
| 218 |
+
|
| 219 |
+
tuning in this sequence. Furthermore, the results highlight that our method is more robust than the baselines, achieving a $100 \%$ success rate on all five sequences. This indicates that our model offers a better geometric representation to support more reliable localization in complex indoor environments. The predicted trajectories of our method are shown in Fig. 4.
|
| 220 |
+
|
| 221 |
+
# C. Runtime Analysis
|
| 222 |
+
|
| 223 |
+
The second experiment evaluates the runtime for both training and localization, illustrating the efficiency of our approach. Specifically, we measure the runtime during performing MCL in initialization and pose tracking phase, and also propose the average frame rate on sequence 1 of the in-house dataset. We compare our method with IRMCL [11] and LocNDF [24], two other implicit representation-based MCL methods. Since all these methods are based on neural networks to build implicit representations, our results support the claim that the ENM architecture can reduce computation costs for real-time applications. We test all approaches on a desktop computer with a 3.7 GHz CPU and 64 GB memory, and a NVIDIA Quadro RTX 5000 GPU with 16 GB memory.
|
| 224 |
+
|
| 225 |
+
As shown in Tab. II, the runtime performance of the tested methods demonstrates the efficiency of our approach. We keep the default settings of the number of particle to each method for fair comparison. Specifically, our ENM-MCL outperforms the other methods in both initialization and pose tracking phases on the dataset. During pose tracking, ENM-MCL achieves 180.2 fps using 1,000 particles, making it suitable for real-time operation. Although our method requires more particles during the initialization phase (80,000 particles), it still reaches a speed of $4 \ \mathrm { H z }$ , showcasing its efficiency even with larger particle sets.
|
| 226 |
+
|
| 227 |
+
# D. Convergence Analysis
|
| 228 |
+
|
| 229 |
+
Finally, we analyze our method with respect to its ability for rapid and reliable global localization. For fair comparison, we compare the convergence speed of localization with baseline methods in sequence 1 of the dataset, as it is a relatively simple scenario where all baselines succeed, and the trajectory of the sequence is shown in Fig. 4.
|
| 230 |
+
|
| 231 |
+
The location RMSE error curves of all methods are shown in Fig. 5. The occupancy grid map-based methods converge slowly in the sequence because of many similar offices in the environment and the occupancy grid map does not include enough geometric details to quickly distinguish similar rooms. In contrast, the implicit representation-based
|
| 232 |
+
|
| 233 |
+
<table><tr><td rowspan="2">Method</td><td colspan="3">Localization Speed [FPS]</td></tr><tr><td>Initialization (#Particles)</td><td>Pose Tracking (#Particles)</td><td>Average Speed on Sequence 1</td></tr><tr><td>IRMCL</td><td>1.2 Hz (100,000)</td><td>27.0 Hz (5,000)</td><td>9.1 Hz</td></tr><tr><td>LocNDF</td><td>0.5 Hz (100,000)</td><td>2.8 Hz (10,000)</td><td>2.1 Hz</td></tr><tr><td>ENM-MCL</td><td>4.0 Hz (80,000)</td><td>250.0 Hz (1,000)</td><td>180.2 Hz</td></tr></table>
|
| 234 |
+
|
| 235 |
+

|
| 236 |
+
TABLE II: Runtime comparison of different methods. We report the frame rate for the initialization and pose tracking phase of MCL under the default parameters of baselines. We also report average frame rate of both phases over the complete sequence.
|
| 237 |
+
Fig. 5: The error curves of location RMSE on the Sequence 5 of the in-house dataset.
|
| 238 |
+
|
| 239 |
+
methods quickly converge and our ENM-MCL maintains a fast convergence time of only 3.6 seconds.
|
| 240 |
+
|
| 241 |
+
In summary, our evaluation suggests that our method is highly efficient and robust, which is suitable for efficient global localization. At the same time, our method maintains high accuracy and reliability. Thus, we supported all our claims with this experimental evaluation.
|
| 242 |
+
|
| 243 |
+
# V. CONCLUSION
|
| 244 |
+
|
| 245 |
+
In this paper, we presented a novel approach to robot localization using an efficient and effective implicit neural representation. Our map representation is capable of learning both, the non-projective signed distance fields and directionaware projective distance fields from 2D LiDAR data, which stores both positional and directional geometric features of the environment. Our method exploits a learnable dense feature grid combined with a light-weight neural network as the map representation model. This allows us to successfully integrate the implicit representation into a Monte Carlo localization framework to improve the accuracy and efficiency for implicit representation-based MCL. We evaluated our approach on a public dataset and provided comparisons to other existing methods and supported all claims made in this paper. The experiments suggest that by leveraging neural representations, we can not only improve the quality of map, but also reduce the computation costs of MCL to perform real-time pose tracking and enable efficient global localization with a large number of particles.
|
| 246 |
+
|
| 247 |
+
# REFERENCES
|
| 248 |
+
|
| 249 |
+
[1] J. Barron, B. Mildenhall, D. Verbin, P.P. Srinivasan, and P. Hedman. Mip-nerf 360: Unbounded anti-aliased neural radiance fields. In Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition (CVPR), 2022.
|
| 250 |
+
[2] M. Bennewitz, C. Stachniss, W. Burgard, and S. Behnke. Metric Localization with Scale-Invariant Visual Features using a Single Perspective Camera. In Proc. of the European Robotics Symposium, 2006.
|
| 251 |
+
[3] X. Chen, T. Labe, L. Nardi, J. Behley, and C. Stachniss. Learning ¨ an Overlap-based Observation Model for 3D LiDAR Localization. In Proc. of the IEEE/RSJ Intl. Conf. on Intelligent Robots and Systems (IROS), 2020.
|
| 252 |
+
[4] X. Chen, I. Vizzo, T. Labe, J. Behley, and C. Stachniss. Range Image- ¨ based LiDAR Localization for Autonomous Vehicles. In Proc. of the IEEE Intl. Conf. on Robotics & Automation (ICRA), 2021.
|
| 253 |
+
[5] F. Dellaert, D. Fox, W. Burgard, and S. Thrun. Monte carlo localization for mobile robots. In Proc. of the IEEE Intl. Conf. on Robotics & Automation (ICRA), 1999.
|
| 254 |
+
[6] D. Droeschel and S. Behnke. Efficient Continuous-Time SLAM for 3D Lidar-Based Online Mapping. In Proc. of the IEEE Intl. Conf. on Robotics & Automation (ICRA), 2018.
|
| 255 |
+
[7] D. Fox, W. Burgard, F. Dellaert, and S. Thrun. Monte Carlo Localization: Efficient Position Estimation for Mobile Robots. In Proc. of the National Conf. on Artificial Intelligence (AAAI), 1999.
|
| 256 |
+
[8] D. Fox. KLD-sampling: Adaptive particle filters. In Proc. of the Conf. Neural Information Processing Systems (NIPS), 2001.
|
| 257 |
+
[9] G. Grisetti. srrg-localizer2d (1.6.0). https://gitlab.com/ srrg-software/srrg_localizer2d, 2018.
|
| 258 |
+
[10] D. Kingma and J. Ba. Adam: A Method for Stochastic Optimization. In Proc. of the Intl. Conf. on Learning Representations (ICLR), 2015.
|
| 259 |
+
[11] H. Kuang, X. Chen, T. Guadagnino, N. Zimmerman, J. Behley, and C. Stachniss. IR-MCL: Implicit Representation-Based Online Global Localization. IEEE Robotics and Automation Letters (RA-L), 8(3):1627–1634, 2023.
|
| 260 |
+
[12] J. Liu, Q. Nie, Y. Liu, and C. Wang. Nerf-loc: Visual localization with conditional neural radiance field. In Proc. of the IEEE Intl. Conf. on Robotics & Automation (ICRA), 2023.
|
| 261 |
+
[13] W. Lu, Y. Zhou, G. Wan, S. Hou, and S. Song. L3-Net: Towards Learning Based LiDAR Localization for Autonomous Driving. In Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 262 |
+
[14] D. Maggio, M. Abate, J. Shi, C. Mario, and L. Carlone. Loc-nerf: Monte carlo localization using neural radiance fields. In Proc. of the IEEE Intl. Conf. on Robotics & Automation (ICRA), 2023.
|
| 263 |
+
[15] B. Mildenhall, P. Srinivasan, M. Tancik, J. Barron, R. Ramamoorthi, and R. Ng. NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis. In Proc. of the Europ. Conf. on Computer Vision (ECCV), 2020.
|
| 264 |
+
[16] S. O’Callaghan and F. Ramos. Gaussian Process Occupancy Maps. Intl. Journal of Robotics Research (IJRR), 31(1):42–62, 2012.
|
| 265 |
+
[17] J. Ortiz, A. Clegg, J. Dong, E. Sucar, D. Novotny, M. Zollhoefer, and M. Mukadam. isdf: Real-time neural signed distance fields for robot perception. In Proc. of Robotics: Science and Systems (RSS), 2022.
|
| 266 |
+
[18] Y. Pan, X. Zhong, L. Wiesmann, T. Posewsky, J. Behley, and C. Stachniss. PIN-SLAM: LiDAR SLAM Using a Point-Based Implicit Neural Representation for Achieving Global Map Consistency. IEEE Trans. on Robotics (TRO), 40:4045–4064, 2024.
|
| 267 |
+
[19] J.J. Park, P. Florence, J. Straub, R. Newcombe, and S. Lovegrove. DeepSDF: Learning Continuous Signed Distance Functions for Shape Representation. In Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition (CVPR), 2019.
|
| 268 |
+
[20] F. Ramos and L. Ott. Hilbert maps: Scalable continuous occupancy mapping with stochastic gradient descent. Intl. Journal of Robotics Research (IJRR), 35(14):1717–1730, 2016.
|
| 269 |
+
[21] K. Rematas, A. Liu, P.P. Srinivasan, J. Barron, A. Tagliasacchi, T. Funkhouser, and V. Ferrari. Urban radiance fields. In Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition (CVPR), 2022.
|
| 270 |
+
[22] C. Stachniss and W. Burgard. Mobile Robot Mapping and Localization in Non-Static Environments. In Proc. of the National Conf. on Artificial Intelligence (AAAI), 2005.
|
| 271 |
+
[23] S. Thrun, W. Burgard, and D. Fox. Probabilistic Robotics. MIT Press, 2005.
|
| 272 |
+
|
| 273 |
+
[24] L. Wiesmann, T. Guadagnino, I. Vizzo, N. Zimmerman, Y. Pan, H. Kuang, J. Behley, and C. Stachniss. LocNDF: Neural Distance Field Mapping for Robot Localization. IEEE Robotics and Automation Letters (RA-L), 8(8):4999–5006, 2023.
|
| 274 |
+
[25] Y. Yuan and A. Nuchter. Uni-fusion: Universal continuous mapping. ¨ IEEE Trans. on Robotics (TRO), 40:1373–1392, 2024.
|
| 275 |
+
[26] Y. Yuan, H. Kuang, and S. Schwertfeger. Fast gaussian process occupancy maps. In Proc. of the Intl. Conf. on Control, Automation, Robotics and Vision (ICARCV), 2018.
|
| 276 |
+
[27] S. Zhi, T. Laidlow, S. Leutenegger, and A. Davison. In-place scene labelling and understanding with implicit scene representation. In Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition (CVPR), 2021.
|
| 277 |
+
[28] X. Zhong, Y. Pan, J. Behley, and C. Stachniss. SHINE-Mapping: Large-Scale 3D Mapping Using Sparse Hierarchical Implicit Neural Representations. In Proc. of the IEEE Intl. Conf. on Robotics & Automation (ICRA), 2023.
|
| 278 |
+
[29] Z. Zhu, S. Peng, V. Larsson, W. Xu, H. Bao, Z. Cui, M.R. Oswald, and M. Pollefeys. Nice-slam: Neural implicit scalable encoding for slam. In Proc. of the IEEE/CVF Conf. on Computer Vision and Pattern Recognition (CVPR), 2022.
|
| 279 |
+
[30] N. Zimmerman, T. Guadagnino, X. Chen, J. Behley, and C. Stachniss. Long-Term Localization using Semantic Cues in Floor Plan Maps. IEEE Robotics and Automation Letters (RA-L), 8(1):176–183, 2023.
|
| 280 |
+
[31] N. Zimmerman, L. Wiesmann, T. Guadagnino, T. Labe, J. Behley, and ¨ C. Stachniss. Robust Onboard Localization in Changing Environments Exploiting Text Spotting. In Proc. of the IEEE/RSJ Intl. Conf. on Intelligent Robots and Systems (IROS), 2022.
|
| 281 |
+
|
| 282 |
+
# CERTIFICATE OF REPRODUCIBILITY
|
| 283 |
+
|
| 284 |
+
The authors of this publication declare that:
|
| 285 |
+
|
| 286 |
+
1) The software related to this publication is distributed in the hope that it will be useful, support open research, and simplify the reproducability of the results but it comes without any warranty and without even the implied warranty of merchantability or fitness for a particular purpose.
|
| 287 |
+
2) Haofei Kuang primarily developed the implementation related to this paper. This was done on Ubuntu 22.04.
|
| 288 |
+
3) Yue Pan verified that the code can be executed on a machine that follows the software specification given in the Git repository available at:
|
| 289 |
+
|
| 290 |
+
https://github.com/PRBonn/enm-mcl
|
| 291 |
+
|
| 292 |
+
4) Yue Pan verified that the experimental results presented in this publication can be reproduced using the implementation used at submission, which is labeled with a tag in the Git repository and can be retrieved using the command:
|
| 293 |
+
|
| 294 |
+
git checkout icra25-release
|
paper_markdowns/bamboo-05414.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-05417.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-05456.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-05488.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-05595.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
paper_markdowns/bamboo-05691.md
ADDED
|
@@ -0,0 +1,612 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# MS-BART: Unified Modeling of Mass Spectra and Molecules for Structure Elucidation
|
| 2 |
+
|
| 3 |
+
Yang Han1,2, Pengyu Wang1,2, Kai $\mathbf { V } _ { \mathbf { u } } ^ { 1 , 2 , 4 }$ , Xin Chen2*, Lu Chen1,2,3,4∗
|
| 4 |
+
|
| 5 |
+
1X-LANCE Lab, School of Computer Science
|
| 6 |
+
|
| 7 |
+
MoE Key Lab of Artificial Intelligence, SJTU AI Institute
|
| 8 |
+
|
| 9 |
+
Shanghai Jiao Tong University, Shanghai, China
|
| 10 |
+
|
| 11 |
+
2Suzhou Laboratory, Suzhou, China
|
| 12 |
+
|
| 13 |
+
3Shanghai Innovation Institute, Shanghai, China
|
| 14 |
+
|
| 15 |
+
4Jiangsu Key Lab of Language Computing, Suzhou, China
|
| 16 |
+
|
| 17 |
+
{csyanghan,chenlusz}@sjtu.edu.cn,mail.xinchen@gmail.com
|
| 18 |
+
|
| 19 |
+
# Abstract
|
| 20 |
+
|
| 21 |
+
Mass spectrometry (MS) plays a critical role in molecular identification, significantly advancing scientific discovery. However, structure elucidation from MS data remains challenging due to the scarcity of annotated spectra. While largescale pretraining has proven effective in addressing data scarcity in other domains, applying this paradigm to mass spectrometry is hindered by the complexity and heterogeneity of raw spectral signals. To address this, we propose MS-BART, a unified modeling framework that maps mass spectra and molecular structures into a shared token vocabulary, enabling cross-modal learning through large-scale pretraining on reliably computed fingerprint–molecule datasets. Multi-task pretraining objectives further enhance MS-BART’s generalization by jointly optimizing denoising and translation task. The pretrained model is subsequently transferred to experimental spectra through finetuning on fingerprint predictions generated with MIST, a pre-trained spectral inference model, thereby enhancing robustness to real-world spectral variability. While finetuning alleviates the distributional difference, MS-BART still suffers molecular hallucination and requires further alignment. We therefore introduce a chemical feedback mechanism that guides the model toward generating molecules closer to the reference structure. Extensive evaluations demonstrate that MS-BART achieves SOTA performance across 5/12 key metrics on MassSpecGym and NPLIB1 and is faster by one order of magnitude than competing diffusion-based methods, while comprehensive ablation studies systematically validate the model’s effectiveness and robustness. We provide the data and code at https://github.com/OpenDFM/MS-BART.
|
| 22 |
+
|
| 23 |
+
# 1 Introduction
|
| 24 |
+
|
| 25 |
+
Mass spectrometry is an analytical technique that measures the mass-to-charge ratio of ions, enabling the identification, quantification, and structural characterization of molecules. The identification of small molecules from mass spectrometry data represents a fundamental task in analytical chemistry, with broad applications across multiple domains, including drug discovery [1, 32, 39], environmental biochemistry [35], and materials science [21]. Recent advances in machine learning have enabled structure elucidation from mass spectra. Existing approaches can be broadly categorized into (1) retrieval-based methods and (2) de novo generative methods. Retrieval-based methods rely on matching query spectra against large annotated spectra databases. However, annotated experimental
|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
Figure 1: Randomly selected mass spectra of a molecule (SMILES: C#CCNCC1=CC=CC=C1, InChIKey: LDYBFSGEBHSTOQ) from MassSpecGym [7], acquired under varying collision energies. The $x$ -axis shows the mass-to-charge ratio $( m / z )$ , the $y$ -axis indicates collision energy (in eV), and color represents normalized relative intensity.
|
| 29 |
+
|
| 30 |
+
spectra are scarce and costly to obtain [3]. In addition, these methods are inherently limited to known molecules and cannot identify novel structures absent from reference databases. De novo generation methods learn to generate molecular structures directly from mass spectra, offering the potential to discover new compounds. However, these generative models [39, 45, 13, 29] are also bottlenecked by the limited availability of high-quality experimental spectra.
|
| 31 |
+
|
| 32 |
+
In other domains such as natural language processing (NLP) and computer vision (CV), a common strategy to overcome data scarcity is to pretrain models on large-scale unlabeled data and then finetune them on task-specific datasets [8, 28, 6, 20, 19]. A similar paradigm can also be observed in nuclear magnetic resonance (NMR) structure elucidation [48], where the model is first pretrained on 3.6 million unlabeled molecules and then fine-tuned directly on simulated and experimental NMR data. However, adapting this paradigm to mass spectrometry remains challenging due to the intrinsic complexity and heterogeneity of mass spectra. As illustrated in Fig. 1, spectra for the same molecule can vary substantially under different collision energies, adduct types, or instrument settings, and may even fluctuate slightly under identical experimental conditions. To address this variability, we propose using molecular fingerprints as an intermediate representation of mass spectra. Fingerprints are binary vectors that encode the presence of chemical substructures. Unlike raw spectra, they are invariant to experimental conditions and can be reliably computed from molecular structures using cheminformatics toolkits such as RDKit. This eliminates the need to simulate mass spectra under diverse experimental settings[34, 17], enabling scalable pretraining dataset construction.
|
| 33 |
+
|
| 34 |
+
Building on this insight, we propose MS-BART, a unified framework for molecular structure elucidation from mass spectrometry data, following the pretraining–finetuning–alignment paradigm widely used in NLP. We first construct a large-scale pretraining dataset consisting of fingerprint–molecule pairs, where molecular fingerprints are computed for 4 million unlabeled molecules using RDKit. Based on this dataset, we design multi-task pretraining objectives to facilitate cross-modal learning between molecular fingerprints and molecular structures. For finetuning, we incorporate experimental mass spectrometry data by using MIST [18] to predict fingerprints from spectra, conditioned on associated metadata and molecular formulas. As these predicted fingerprints are subject to dataset-specific noise and systematic biases, we finetune the pretrained model using the predicted fingerprints as input, thereby improving its adaptability to real-world experimental conditions. Finally, the generated structures are prone to molecular hallucinations [15], where outputs are chemically valid but deviate from the true molecules. To address this, we introduce an alignment step that incorporates chemical feedback by assigning higher probabilities to structures more similar to the ground truth. In summary, our main contributions are as follows:
|
| 35 |
+
|
| 36 |
+
• To the best of our knowledge, we are the first to leverage language model for mass spectra structure elucidation by introducing a unified vocabulary and multi-task pretraining on a large corpus of fingerprint–molecule pairs.
|
| 37 |
+
• We finetune the model on experimental data and incorporate chemical feedback to align the generative distribution with real-world structural preferences.
|
| 38 |
+
|
| 39 |
+
• We validate our approach on two public benchmarks, achieving SOTA performance across 5/12 key metrics on MassSpecGym[7] and NPLIB1[10] and is faster by one order of magnitude than competing diffusion-based methods.
|
| 40 |
+
|
| 41 |
+
# 2 Related Work
|
| 42 |
+
|
| 43 |
+
Mass Spectra Modeling. Mass spectra are variable-length, discrete, two-dimensional data, which makes them inherently challenging to model. A basic approach involves padding the two-dimensional matrix to a fixed length and projecting it into an embedding space via a linear layer [45]. A more common strategy is spectral binning, which partitions spectra into fixed-width intervals (e.g., 0.1 Da) to yield fixed-size input vectors [38]. For example, ChemEmbed [14] limits molecular weights to 700 Da, encodes spectra into a 7000-dimensional vector using a bin size of 0.01, and applies a convolutional neural network (CNN) to predict 300-dimensional Mol2vec embeddings. Similarly, Spec2Mol [29] and MS2DeepScore [23] convert spectra into bit vectors and train 1D CNNs or Siamese networks [5] to learn meaningful spectral embeddings. While binning is simple, it suffers from sparsity and sensitivity to noise, limiting its ability to capture chemically meaningful patterns. To overcome this, some methods leverage molecular fingerprints as intermediate representations that encode chemical substructures more robustly. CSI:FingerID [11] predicts molecular fingerprints from tandem mass spectra using fragmentation trees and machine learning, achieving strong performance in metabolite identification. MSNovelist [41] builds on this by integrating predicted fingerprints into an encoder-decoder model for de novo structure generation. Inspired by these approaches, MS-BART adopts molecular fingerprints as a spectrum representation, enabling scalable pretraining while preserving chemical semantics.
|
| 44 |
+
|
| 45 |
+
Structure Elucidation from Mass Spectra. Two major paradigms dominate structure elucidation from mass spectra: library matching and de novo generation. Library matching formulates the task as an information retrieval problem [40], comparing query spectra against databases of experimental or simulated spectra. Methods such as Spec2Vec [22] and MSBERT [49] learn spectrum embeddings and perform retrieval over databases like GNPS [44]. Due to the scarcity of experimental spectra, some methods (e.g., CFM-ID [43], GRAFF-MS [34]) simulate spectra from known molecular databases (e.g., PubChem). However, the effectiveness of library matching is constrained by database coverage, spectrum quality, and experimental variation, limiting its utility for novel compounds. In contrast, de novo approaches generate molecular structures directly from spectra, bypassing the need for reference databases. Spec2Mol [29] draws inspiration from speech-to-text models, employing an encoder-decoder network to translate spectra into SMILES sequences. MADGEN [45] uses a two-stage framework: scaffold retrieval and scaffold-conditioned molecule generation. Spectra and scaffolds are embedded into a shared latent space using MLPs and GNNs, and RetroBridge [24] generates the final structure conditioned on both inputs. Other models, including MSNovelist [41] and MS2SMILES [30], use fingerprints predicted by SIRIUS [9] as inputs to sequence models for SMILES generation. MS2SMILES further improves atom-level resolution by jointly predicting heavy atoms and their associated hydrogens. DiffMS [4] adopts an implicit fingerprint representation by extracting the final embedding from the precursor peak in MIST [18] and then generates the target structure by discrete diffusion conditioned on the spectrum embedding and node features (derived from the given formula). Despite promising results, most existing methods treat spectra and molecular structures as separate modalities, which often leads to semantic mismatches and molecular hallucinations [15]. In contrast, MS-BART unifies their modeling through a shared vocabulary. By pretraining on large-scale spectral fingerprint–molecule pairs, MS-BART learns rich representations for both chemical structures and their spectral abstractions. Subsequent finetuning and alignment on experimental spectra further enhance the model’s ability to generate accurate and chemically consistent predictions on real-world data.
|
| 46 |
+
|
| 47 |
+
# 3 Methodology
|
| 48 |
+
|
| 49 |
+
Our framework is illustrated in Fig. 2. Section 3.1 introduces a unified vocabulary for representing both mass spectra and molecules. Section 3.2 describes multi-task pretraining with reliably computed fingerprints. Section 3.3 finetunes the model on experimental spectra to adapt to real-world distributions, while Section 3.4 further aligns molecular generation through chemical feedback.
|
| 50 |
+
|
| 51 |
+
# Step1: Unified Multi-Task Pretraining on Reliably Computed Fingerprints
|
| 52 |
+
|
| 53 |
+

|
| 54 |
+
|
| 55 |
+

|
| 56 |
+
Step2&3: Finetuning & Alignment on Experimental Spectra
|
| 57 |
+
Figure 2: Overview of the MS-BART framework. Square symbols represent unified tokens, where ■ denotes SELFIES tokens, ■ indicates fingerprint tokens, and ■ represents a special separator token between SELFIES and fingerprint tokens. The □ symbol signifies padding tokens. Masked tokens are represented by striped patterns $\mathcal { O }$ . The top row illustrates pretraining tasks utilizing reliably computed fingerprints (Computed by RDKit), designed to enable MS-BART to capture fundamental patterns in both fingerprint and SELFIES representations. Transfer learning is subsequently applied to experimental spectra through finetuning and alignment to enhance structure elucidation performance.
|
| 58 |
+
|
| 59 |
+
# 3.1 Mass Spectra and Molecular Representation
|
| 60 |
+
|
| 61 |
+
Mass Spectra Representation. Raw mass spectra consist of variable-length sets of peaks $\{ P _ { 1 } , P _ { 2 } , \ldots , P _ { k } \}$ , where each peak $P _ { i } = ( M _ { i } , { \bar { I } } _ { i } )$ represents a mass-to-charge ratio $( m / z )$ and a corresponding intensity. Due to noise and variability in experimental spectra, learning from raw spectra directly is challenging. In tandem mass spectrometry, precursor ions undergo collisioninduced dissociation (CID), producing charged product ions and uncharged neutral loss fragments. These fragmentation patterns reflect structural information and correspond to chemical fragment encoded in molecular fingerprint bits. Prior work [11, 18, 2] has explored on predicting molecular fingerprints from spectra by leveraging fragmentation information. Following this, we represent each spectrum as a 4096-bit circular Morgan fingerprint $F P \in \{ 0 , 1 \} ^ { 4 0 9 6 }$ , where each bit indicates the presence of a specific substructure. For experimental data, we employ the pretrained MIST model [18] to predict molecular fingerprints $F P$ from mass spectra, conditioned on the chemical formula. The output of MIST is a probability vector $\{ p _ { 0 } , \ldots , p _ { 4 0 9 5 } \}$ , where each $p _ { i }$ indicates the predicted likelihood of the $i$ -th fingerprint bit being active. To convert these probabilities into a binary fingerprint representation, we apply a threshold $\epsilon$ :
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
F P _ {i} = \left\{ \begin{array}{l l} 1, & \text {i f} p _ {i} \geq \epsilon , \\ 0, & \text {o t h e r w i s e}, \end{array} \quad \forall i \in \{0, 1, \dots , 4 0 9 5 \}. \right. \tag {1}
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Each activated bit $F P _ { i } = 1 )$ ) is converted into a fingerprint token of the form $< \mathtt { f p } \{ \mathtt { i } : 0 4 \mathtt { d } \} >$ (e.g., $< \mathtt { f p } 0 1 2 3 > )$ , producing a token sequence suitable for language modeling. We also compute the fingerprints from unlabeled molecules using RDKit [27] and apply the same tokenization for subsequent pretraining.
|
| 68 |
+
|
| 69 |
+
Molecular Representation. SMILES [46] and SELFIES [25] are two widely used string-based molecular representations. While SMILES is compact and human-readable, it does not guarantee chemical validity. In contrast, SELFIES is designed to ensure that every valid string maps to a chemically feasible molecule. We adopt SELFIES in MS-BART for its robustness and validity guarantees. To ensure consistency and uniqueness, we use the canonical form of each SELFIES string. Following [15], we employ a vocabulary of 185 SELFIES tokens. Although this is significantly smaller than typical language model vocabularies, prior work [37] shows that compact chemical vocabularies are sufficient for effective molecular representation learning.
|
| 70 |
+
|
| 71 |
+
# 3.2 Unified Multi-Task Pretraining on Reliably Computed Fingerprints
|
| 72 |
+
|
| 73 |
+
Given the tokenization approach described above, we tokenize mass spectra and molecular sequences by MIST [18] and the aforementioned vocabulary, respectively. As illustrated in Fig. 2, we design three self-supervised denoising tasks for pretraining to recover masked spans, along with one crossmodal translation task to strengthen modality alignment. We pretrain MS-BART on a simulated dataset of 4 million fingerprint–molecule pairs. The molecules are provided by MassSpecGym [7] and are preprocessed by excluding those with an MCES distance of less than two from any molecule in the test fold. The pretraining framework comprises four tasks detailed as follows: (1) SELFIES Denoising $( \textcircled{1} )$ . Randomly mask $30 \%$ of tokens in SELFIES sequence $S = \{ s _ { 1 } , \ldots , s _ { l } \}$ with [MASK] token and recover original tokens. (2) Fingerprint-to-Molecule Translation $r ( \textcircled { 2 } )$ . Generate SELFIES sequences conditioned on fingerprint tokens $F P$ . (3) Hybrid Denoising $\textcircled{3}$ and $\textcircled{4}$ ). Combine fingerprint tokens and masked SELFIES using separator $< \pounds _ { \mathrm { p s } _ { - } \mathrm { s e p } > }$ , with input order variants, $[ F P , < \pounds _ { \mathsf { P } } \mathsf { s } _ { - } \mathsf { s e p } >$ , $S _ { m a s k e d }$ and $[ S _ { m a s k e d }$ , $< \mathrm { f } \mathrm { p } \mathrm { s } \_ { - } \mathrm { s e p } > , F P ]$ , predicting full SELFIES sequences from both modalities. All tasks follow a conditional generation paradigm optimized via cross-entropy loss:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\mathcal {L} _ {c e} = - \sum_ {i = 1} ^ {l} \log P \left(y _ {i} \mid y _ {< i}, X; \theta\right), \tag {2}
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
where $\theta$ denotes the model parameters, $X$ is the input sequence (e.g., masked SELFIES or fingerprints), $y _ { i }$ is the $i$ -th target token, and $l$ is the target SELFIES length.
|
| 80 |
+
|
| 81 |
+
# 3.3 Finetuning on Experimental Spectra
|
| 82 |
+
|
| 83 |
+
After pretraining on the simulated fingerprint-molecule dataset, MS-BART is fine-tuned on experimental spectra to bridge the domain gap between computational and real-world data distributions. As shown in Fig. 2, the original mass spectra are tokenized into fingerprint tokens, and the model is also optimized through cross-entropy loss (Eq. 2) calculated between the target and predicted SELFIES tokens. This crucial step aims to learn the systematic bias introduced by the MIST [18] model and improve prediction performance.
|
| 84 |
+
|
| 85 |
+
# 3.4 Contrastive Alignment via Chemical Feedback
|
| 86 |
+
|
| 87 |
+
Following pretraining and dataset-specific fine-tuning, MS-BART acquires the capability to interpret molecular fingerprints and generate chemically plausible molecular structures. However, it remains susceptible to molecular hallucination [15], where generated molecules maintain chemical validity but exhibit limited consistency with original mass spectra or corresponding fingerprints. Specifically, the model may yield structures deviating substantially from true underlying molecular structures. To alleviate this hallucination and enhance performance, we propose aligning the model’s probabilistic rankings of generated molecules with preference rankings derived from chemical contexts. In this paper, we define molecular preference through Tanimoto similarity, denoted as $P s ( \cdot )$ . Given a fingerprint $F P$ , MS-BART generates $n$ candidate molecules $C = \{ S _ { 1 } , S _ { 2 } , · · · , S _ { n } \}$ . The preference score for each candidate $S _ { i }$ is calculated as $P s ( S _ { i } ) = T a n ( S _ { i } , S )$ , where $S$ represents the groundtruth molecular structure. Simultaneously, the model (parameterized by $\theta$ ) assigns a conditional log-probability estimate $P _ { \theta } ( S _ { i } )$ to each candidate $S _ { i }$ , given the input $F P$ . Our objective is to establish consistency between the model’s generative probabilities and Tanimoto similarity metrics. Specifically, for any candidate pair $( S _ { i } , S _ { j } )$ , we expect:
|
| 88 |
+
|
| 89 |
+
$$
|
| 90 |
+
P _ {\theta} \left(S _ {i}\right) > P _ {\theta} \left(S _ {j}\right), i f P s \left(S _ {i}\right) > P s \left(S _ {j}\right). \tag {3}
|
| 91 |
+
$$
|
| 92 |
+
|
| 93 |
+
To encourage MS-BART to assign higher probabilities to candidate molecules that are more structurally similar to the target molecule, we employ a contrastive rank loss [31, 15], defined as:
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathcal {L} _ {\text {r a n k}} (C) = \sum_ {i} \sum_ {j > i} \max \left(0, P _ {\theta} \left(S _ {j}\right) - P _ {\theta} \left(S _ {i}\right) + \gamma_ {i j}\right), \quad \forall i < j, \operatorname {P s} \left(S _ {i}\right) > \operatorname {P s} \left(S _ {j}\right), \tag {4}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\gamma _ { i j } = ( j - i ) * \gamma$ denotes a margin scaled by the rank difference between candidates, $\gamma$ is a hyperparameter. Additionally, we retain the token-level cross-entropy loss (Eq. 2) to preserve the
|
| 100 |
+
|
| 101 |
+
model’s generative capability and the overall loss is defined as:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\mathcal {L} = \mathcal {L} _ {c e} + \alpha \mathcal {L} _ {\text {r a n k}}, \tag {5}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
where $\alpha$ controls the weight of the rank loss. By jointly optimizing the token-level cross-entropy loss and the sequence-level contrastive rank loss on the same finetuning dataset, MS-BART can assign a balanced probability mass across the whole sequence. This optimization strategy elevates the probability of generating molecular structures that not only exhibit higher similarity to the target molecule but may also achieve exact matches.
|
| 108 |
+
|
| 109 |
+
# 4 Experiments
|
| 110 |
+
|
| 111 |
+
# 4.1 Datasets
|
| 112 |
+
|
| 113 |
+
We evaluate our MS-BART model on two widely used open-source benchmarks: NPLIB1 [10] and MassSpecGym [7], following prior works [4, 45]. NPLIB1 is a subset of the GNPS library, originally curated for training the CANOPUS model. Its name serves to distinguish the dataset from the associated tool. MassSpecGym is the largest publicly available dataset containing 231k high-quality mass spectra spanning $2 9 \mathrm { k }$ unique molecular structures. The dataset is partitioned into training, validation, and test sets based on the edit distance between molecular structures, facilitating robust evaluation. Although MADGEN [45] also reports performance on the NIST23 dataset, access to this resource is restricted due to its commercial licensing requirements.
|
| 114 |
+
|
| 115 |
+
# 4.2 Evaluation Metrics and Baselines
|
| 116 |
+
|
| 117 |
+
To evaluate the performance of our model, we employ the following metrics:
|
| 118 |
+
|
| 119 |
+
• Top- $k$ accuracy: We measure the exact match between the predicted structure and the ground truth molecule by converting the generated molecule into a full InChIKey and comparing it with the gold InChIKey. Since MS fragmentation is largely insensitive to 3D stereochemistry, results based on 2D InChIKey are also reported in Appendix C.
|
| 120 |
+
• Top- $k$ maximum Tanimoto similarity: This metric quantifies the structural similarity between molecules using molecular fingerprints. We compute fingerprints based on the Morgan algorithm [33] with a radius of 2 and a bit length of 2048 using RDKit.
|
| 121 |
+
• Top- $k$ minimum MCES (maximum common edge subgraph): This metric measures the graph edit distance between molecules, reflecting the largest common substructure shared between the generated and ground-truth molecules [26].
|
| 122 |
+
|
| 123 |
+
We report the $k = 1$ , 10 metrics following previous works [4, 7, 45]. Meanwhile, DIFFMS samples 100 molecules for each spectrum and identifies the top- $k$ molecules based on frequency. To ensure a fair comparison, we sample 100 molecules and subsequently rank the generated molecules according to their distance from the given formula. Given two formula $F _ { 1 } = \{ ( \bar { a _ { 1 } } , n _ { 1 } ) , ( a _ { 2 } , n _ { 2 } ) , . . . , ( a _ { m } , n _ { m } ) \bar \}$ and $F _ { 2 } = \{ ( a _ { 1 } , m _ { 1 } ) , ( a _ { 2 } , m _ { 2 } ) , . . . , ( a _ { m } , m _ { k } ) \}$ , the distance is defined as:
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
D \left(F _ {1}, F _ {2}\right) = \sum_ {a \in \text {A l l A t o m s}} \left| n _ {a} - m _ {a} \right|, \tag {6}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
$n _ { a } , m _ { a }$ are the counts of atom $a$ in $F _ { 1 }$ and $F _ { 2 }$ . If multiple molecules have the same distance, we sort them according to their estimated log-probability. After this re-ranking, we select the first $k$ molecules as the top- $k$ predictions.
|
| 130 |
+
|
| 131 |
+
Baselines. MassSpecGym [7] establishes three baselines for molecular generation: random generation, a SMILES-based Transformer, and a SELFIES-based Transformer. Spec2Mol [29] is retrained on both the NPLIB1 and MassSpecGym datasets to enable fair comparison. MIST+MSNovelist modifies the original MSNovelist framework [41] by replacing CSI:FingerID [11] with MIST. In MIST+Neuraldecipher, molecules are encoded into CDDD representations [47], followed by reconstruction of the SMILES strings using a pretrained LSTM decoder. MADGEN [45] and DIFFMS [4] represent recent state-of-the-art approaches. MADGEN first retrieves molecular scaffolds, then generates complete structures using the RetroBridge model [24], conditioned on both spectra and scaffolds. DIFFMS also adopts MIST as the spectrum encoder and employs a Graph Transformer [12] as the diffusion decoder, with separate pretraining of encoder and decoder components.
|
| 132 |
+
|
| 133 |
+
Table 1: Performance comparison of MS-BART and baseline methods on the NPLIB1 [10] and MassSpecGym [7]. Results marked with ∗ are reproduced from MassSpecGym and DIFFMS. Bold denotes the best performance, underlined indicates the second-best.
|
| 134 |
+
|
| 135 |
+
<table><tr><td rowspan="2">Model</td><td colspan="3">Top-1</td><td colspan="3">Top-10</td></tr><tr><td>ACCURACY ↑</td><td>MCES ↓</td><td>TANIMOTO ↑</td><td>ACCURACY ↑</td><td>MCES ↓</td><td>TANIMOTO ↑</td></tr><tr><td colspan="7">NPLIB1</td></tr><tr><td>SPEC2MOL*</td><td>0.00%</td><td>27.82</td><td>0.12</td><td>0.00%</td><td>23.13</td><td>0.16</td></tr><tr><td>MIST + NEURALDECIPHER*</td><td>2.32%</td><td>12.11</td><td>0.35</td><td>6.11%</td><td>9.91</td><td>0.43</td></tr><tr><td>MIST + MSNOVELIST*</td><td>5.40%</td><td>14.52</td><td>0.34</td><td>11.04%</td><td>10.23</td><td>0.44</td></tr><tr><td>MADGEN</td><td>2.10%</td><td>20.56</td><td>0.22</td><td>2.39%</td><td>12.69</td><td>0.27</td></tr><tr><td>DIFFMS</td><td>8.34%</td><td>11.95</td><td>0.35</td><td>15.44%</td><td>9.23</td><td>0.47</td></tr><tr><td>MS-BART</td><td>7.45%</td><td>9.66</td><td>0.44</td><td>10.99%</td><td>8.31</td><td>0.51</td></tr><tr><td>MS-BART(Gold Fingerprint)</td><td>73.50%</td><td>2.14</td><td>0.90</td><td>79.12%</td><td>1.60</td><td>0.94</td></tr><tr><td colspan="7">MASSPECGYM</td></tr><tr><td>SMILES TRANSFORMER*</td><td>0.00%</td><td>79.39</td><td>0.03</td><td>0.00%</td><td>52.13</td><td>0.10</td></tr><tr><td>SELFIES TRANSFORMER*</td><td>0.00%</td><td>38.88</td><td>0.08</td><td>0.00%</td><td>26.87</td><td>0.13</td></tr><tr><td>RANDOM GENERATION*</td><td>0.00%</td><td>21.11</td><td>0.08</td><td>0.00%</td><td>18.26</td><td>0.11</td></tr><tr><td>SPEC2MOL*</td><td>0.00%</td><td>37.76</td><td>0.12</td><td>0.00%</td><td>29.40</td><td>0.16</td></tr><tr><td>MIST + NEURALDECIPHER*</td><td>0.00%</td><td>33.19</td><td>0.14</td><td>0.00%</td><td>31.89</td><td>0.16</td></tr><tr><td>MIST + MSNOVELIST*</td><td>0.00%</td><td>45.55</td><td>0.06</td><td>0.00%</td><td>30.13</td><td>0.15</td></tr><tr><td>MADGEN</td><td>1.31%</td><td>27.47</td><td>0.20</td><td>1.54%</td><td>16.84</td><td>0.26</td></tr><tr><td>DIFFMS</td><td>2.30%</td><td>18.45</td><td>0.28</td><td>4.25%</td><td>14.73</td><td>0.39</td></tr><tr><td>MS-BART</td><td>1.07%</td><td>16.47</td><td>0.23</td><td>1.11%</td><td>15.12</td><td>0.28</td></tr><tr><td>MS-BART(Gold Fingerprint)</td><td>47.56%</td><td>3.26</td><td>0.85</td><td>64.62%</td><td>2.02</td><td>0.93</td></tr></table>
|
| 136 |
+
|
| 137 |
+
# 4.3 Implementation
|
| 138 |
+
|
| 139 |
+
We adopt BART-BASE [28] as the backbone of MS-BART, initializing all parameters from scratch using a normal distribution. To convert MIST probabilities into binary fingerprints, we apply a threshold of $\epsilon = 0 . 2$ for NPLIB1 and $\epsilon = 0 . 1 1$ for MassSpecGym. Further details regarding this selection are provided in Appendix A. During pretraining, we set the maximum sequence length to 512 to accommodate simultaneous learning from both fingerprints and SELFIES. For finetuning and alignment, we fix the input and output token lengths to 256, as the fingerprint inputs and SELFIES outputs rarely exceed this length in practice. When aligning MS-BART with chemical feedback, we freeze the encoder following practices from prior work [16, 36], and update only the decoder. Additional training details are provided in Appendix B.
|
| 140 |
+
|
| 141 |
+
# 4.4 Main Results
|
| 142 |
+
|
| 143 |
+
Table 1 presents a comparison of overall performance, demonstrating that MS-BART outperforms most baseline methods and achieves SOTA performance across 5/12 key metrics on NPLIB1 and MassSpecGym. Notably, on NPLIB1, MS-BART performs the best across all similarity metrics, surpassing the second-best method by $1 9 . 1 6 \%$ (MCES) and $2 5 . 7 1 \%$ (Tanimoto similarity) in the Top-1 setting. Significant improvements are also observed in the Top-10 setting, further validating the effectiveness of MS-BART. The high absolute Tanimoto similarity values (close to or exceeding 0.5) suggest that MS-BART generates structurally similar molecules, which are particularly valuable to domain experts. However, the Top-1 and Top-10 accuracy do not surpass DiffMS [4], primarily because we have filtered out similar molecules in the pretraining data (Appendix B), whereas DiffMS only removes all NPLIB1 and MassSpecGym test and validation molecules from their pretraining dataset. Another recently proposed open-source dataset, MassSpecGym, presents a more challenging benchmark than NPLIB1, as NPLIB1 lacks a scaffold-based split, resulting in a test set containing molecules with high structural similarity (Tanimoto similarity $> 0 . 8 5$ ) to those in the training set [4, 7]. Meanwhile, MassSpecGym exhibits a more complex data composition due to the presence of $[ \mathrm { M } + \mathrm { N } \mathrm { a } ] ^ { + }$ adducts. The ${ \mathrm { N a } } ^ { + }$ atom have a higher mass than $\mathrm { H } ^ { + }$ atom, leading to more complex fragmentation patterns and consequently a data distribution that differs significantly from that of $[ \mathrm { M } + \mathrm { H } ] ^ { + }$ . Furthermore, the $[ \mathrm { M } + \mathrm { N } \mathrm { a } ] ^ { + }$ data in the MassSpecGym training set is relatively scarce, constituting only $1 5 . 5 2 \%$ of the total samples. This class imbalance, combined with the distinct fragmentation behavior of $[ \mathrm { M } + \mathrm { N } \mathrm { \hat { a } } ] ^ { + }$ compared to $[ \mathrm { M } + \mathrm { H } ] ^ { + }$ , introduces additional noise and potential bias during model training. To avoid fragmentation pattern conflicts and preserve data consistency, we
|
| 144 |
+
|
| 145 |
+
Table 2: Performance comparison of MS-BART on the NPLIB1 dataset using different pretraining strategies. "NONE" indicates no pretraining, "SD" and "TRANS" denote pretraining with SELFIES Denoising and Fingerprint-to-Molecule Translation, respectively, and "HYBRID" refers to pretraining with the Hybrid Denoising method described in Section 3.2.
|
| 146 |
+
|
| 147 |
+
<table><tr><td rowspan="2">PRETRAIN STRATEGY</td><td colspan="3">TOP-1</td><td colspan="3">TOP-10</td></tr><tr><td>ACCURACY ↑</td><td>MCES ↓</td><td>TANIMOTO ↑</td><td>ACCURACY ↑</td><td>MCES ↓</td><td>TANIMOTO ↑</td></tr><tr><td>NONE</td><td>1.71%</td><td>12.93</td><td>0.27</td><td>3.05%</td><td>11.36</td><td>0.34</td></tr><tr><td>SD</td><td>0.37%</td><td>14.41</td><td>0.24</td><td>0.98%</td><td>12.42</td><td>0.32</td></tr><tr><td>TRANS</td><td>6.23%</td><td>9.37</td><td>0.42</td><td>10.26%</td><td>7.98</td><td>0.50</td></tr><tr><td>HYBRID</td><td>5.13%</td><td>9.96</td><td>0.41</td><td>7.81%</td><td>8.87</td><td>0.48</td></tr><tr><td>MS-BART</td><td>7.45%</td><td>9.66</td><td>0.44</td><td>10.99%</td><td>8.31</td><td>0.51</td></tr></table>
|
| 148 |
+
|
| 149 |
+

|
| 150 |
+
|
| 151 |
+

|
| 152 |
+
|
| 153 |
+

|
| 154 |
+
Figure 3: Progressive improvement of MS-BART for molecular hallucination mitigation on MassSpec-Gym. Subfigures show: a) Tanimoto similarity, b) Accuracy, and c) MCES scores across three training stages under Top-1 and Top-10 settings. Stage 1: Pretrain, the base model pretrained on 4M simulated unlabeld molecules. Stage 2: Pretrain-FT, fine-tuned on MassSpecGym. Stage 3: Pretrain-FT-Rank, fully optimized MS-BART with chemical feedback.
|
| 155 |
+
|
| 156 |
+
filter out $\left[ \mathrm { M } { + } \mathrm { N } \mathrm { a } \right] ^ { + }$ adducts before fine-tuning and alignment, retaining only the dominant $[ \mathrm { M } + \mathrm { H } ] ^ { + }$ data. However, to ensure a fair and comprehensive evaluation, we retain the $\left[ \mathrm { M } { + } \mathrm { N } \hat { \mathbf { a } } \right] ^ { + }$ adducts in the test set. The results show that MS-BART does not surpass DiffMS on most metrics, and the main reason is same as for NPLIB1. Excluding DiffMS, MS-BART also shows SOTA performance across all similarity metrics and demonstrates the robustness and effectiveness of MS-BART in handling diverse spectral patterns. Finally, we report the best possible performance of MS-BART if we use the gold fingerprint calculated from the true structure rather than predicting it with the pretrained MIST model. It is noteworthy that MS-BART can almost find the exact match or extremely similar candidates, proving the great potential of MS-BART and indicating that further work can be devoted to improving the performance of MIST model.
|
| 157 |
+
|
| 158 |
+
# 4.5 Unified Multi-Task Pretraining Enhances Cross-Modal Learning
|
| 159 |
+
|
| 160 |
+
Pretraining serves as the foundational phase and a critical step in training language models, enabling a broad understanding of linguistic features such as syntax, semantics, and context, which are essential for effective transfer learning. To investigate the role of multi-task pretraining in enhancing MS-BART’s comprehension of molecular fingerprints and SELFIES, we conduct ablation experiments, with results presented in Table 2. It is obvious that the model trained without pretraining exhibits relatively poor performance compared to its pretrained counterpart. Nevertheless, its accuracy remains above chance level and surpasses baseline methods that encode mass spectra directly, demonstrating the advantage of representing raw mass spectra as fingerprints and training with a unified vocabulary in an end-to-end style. Furthermore, we compare multi-task pretraining with single-task pretraining. Pretraining solely with the denoising task leads to performance degradation rather than improvement, primarily because the denoising task is not well aligned with structure elucidation. The substantial improvement observed in the fingerprint-to-molecule translation task further supports this finding. Moreover, the performance gain of MS-BART over single-task pretraining indicates that the denoising task remains beneficial, as it helps MS-BART develop a fundamental understanding of molecular
|
| 161 |
+
|
| 162 |
+
structures and contributes to the final performance. These results suggest that unified multi-task pretraining on unlabeled data promotes cross-modal interaction and alignment by enabling MS-BART to learn a shared representation space across modalities.
|
| 163 |
+
|
| 164 |
+
# 4.6 MS-BART Mitigates Molecular Hallucination
|
| 165 |
+
|
| 166 |
+
The training paradigm of MS-BART consists of three steps. Fig. 3 illustrates the impact of these steps on the final performance in MassSpecGym, revealing two key findings. First, continued fine-tuning on the MassSpecGym training fold improves performance and mitigates molecular hallucination, particularly in terms of accuracy. For example, the "Pretrain" model achieves near-zero Top-1 and Top-10 accuracy scores of $0 . 0 0 \%$ and $0 . 0 1 \%$ , respectively, while the "Pretrain-FT" model improves these values to $1 . 0 7 \%$ and $1 . 1 2 \%$ . Moreover, aligning the model with chemical feedback based on Tanimoto similarity further reduces molecular hallucination. This alignment enables the generation of structurally more similar molecules, as evidenced by the improved Tanimoto similarity and the degraded MCES metric. Fig. 4 shows a randomly selected case from MassSpecGym where MS-BART effectively mitigates molecular hallucination.
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
Ground Truth
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
Top-1 Tan. Sim: 0.13,MCES: 16.00
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
Top-2 Tan. Sim: 0.14, MCES: 16.00
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Top-3 Tan. Sim: 0.13, MCES: 15.00
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Top-4 Tan. Sim: 0.14, MCES: 20.00
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
Ground Truth
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Top-1 Tan. Sim: 1.0O. MCES: 0.00
|
| 188 |
+
|
| 189 |
+

|
| 190 |
+
Top-2 Tan.Sim: 0.3O,MCES:15.00
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
Top-3 Tan. Sim: 0.31, MCES: 15.00
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Top-4 Tan. Sim: 0.72, MCES: 3.00
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Ground Truth
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Top-1 Tan. Sim: 1.0O. MCES: 0.00
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Top-2 Tan. Sim: 0.78, MCES: 2.00
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Top-3 Tan. Sim: 0.75.MCES: 2.00
|
| 209 |
+
|
| 210 |
+

|
| 211 |
+
Top-4 Tan. Sim: 0.45, MCES: 6.00
|
| 212 |
+
Figure 4: Predictions of the Pretrain (top row), Pretrain-FT (middle row), and Pretrain-FT-Rank (bottom row) models on a representative MassSpecGym sample, with the ground-truth structure shown in the first column and the Top-4 generated outputs in the subsequent columns. Results demonstrate that MS-BART can effectively mitigate molecular hallucination and predict more chemically plausible and structurally consistent predictions.
|
| 213 |
+
|
| 214 |
+
# 4.7 Sensitivity Analysis of Model Hyperparameters
|
| 215 |
+
|
| 216 |
+
MS-BART employs two key hyperparameters, the fingerprint generation threshold $\epsilon$ and the rank loss weight $\alpha$ . The fingerprint threshold determines how the MIST probability is converted into an active fingerprint, where different thresholds lead to distinct representations. The rank loss weight controls the influence of the token-level rank loss in guiding the alignment training. To comprehensively evaluate the impact of these two parameters, we experiment with different values of $\epsilon$ on MassSpecGym and $\alpha$ on NPLIB1 and present the results in Table 3. The results show no significant differences among the tested $\epsilon$ values, indicating that MS-BART is not sensitive to this parameter. Although $\epsilon = 0 . 1 1$ achieves the best performance on the MassSpecGym validation set and is reported in Table 1 as the final result, the ablation results suggest that $\epsilon = 0 . 1 1$ is not the best overall. This discrepancy is mainly due to the high difficulty of the MassSpecGym dataset and the distribution mismatch between its validation and test sets. A similar observation holds for $\alpha$ on NPLIB1. The model with $\alpha = 5$ performs best in terms of Top-1 Tanimoto score on the validation set and is also reported as the final result. However, models with $\alpha = 1$ and $\alpha = 3$ also achieve competitive results on specific metrics. The variations across different configurations are minor, indicating that MS-BART is not highly sensitive to the rank loss weight.
|
| 217 |
+
|
| 218 |
+
# 4.8 Analysis of Decoding Hyperparameters
|
| 219 |
+
|
| 220 |
+
Table 3: Performance comparison of MS-BART under two key model hyperparameters, where the ablation of the fingerprint generation threshold and the rank loss weight are evaluated on MassSpec-Gym and NPLIB1, respectively.
|
| 221 |
+
|
| 222 |
+
<table><tr><td></td><td colspan="3">TOP-1</td><td colspan="3">TOP-10</td></tr><tr><td></td><td>ACCURACY ↑</td><td>MCES ↓</td><td>TANIMOTO ↑</td><td>ACCURACY ↑</td><td>MCES ↓</td><td>TANIMOTO ↑</td></tr><tr><td colspan="7">Fingerprint Generation Threshold ω (MassSpecGym)</td></tr><tr><td>ε = 0.11</td><td>1.07%</td><td>16.47</td><td>0.23</td><td>1.11%</td><td>15.12</td><td>0.28</td></tr><tr><td>ε = 0.15</td><td>1.20%</td><td>16.88</td><td>0.23</td><td>1.20%</td><td>15.45</td><td>0.28</td></tr><tr><td>ε = 0.20</td><td>1.19%</td><td>17.27</td><td>0.23</td><td>1.20%</td><td>15.75</td><td>0.28</td></tr><tr><td colspan="7">Rank Loss Weight ω (NPLIB1)</td></tr><tr><td>α = 1</td><td>7.08%</td><td>10.56</td><td>0.44</td><td>12.45%</td><td>9.10</td><td>0.52</td></tr><tr><td>α = 3</td><td>7.20%</td><td>9.53</td><td>0.44</td><td>10.50%</td><td>8.21</td><td>0.51</td></tr><tr><td>α = 5</td><td>7.45%</td><td>9.66</td><td>0.44</td><td>10.99%</td><td>8.31</td><td>0.51</td></tr></table>
|
| 223 |
+
|
| 224 |
+
MS-BART employs beam-search multinomial sampling for structure prediction, governed by two key decoding hyperparameters while maintaining default values for other parameters. First, the temperature parameter [50, 42] regulates output randomness during inference, a factor known to substantially influence generation quality in typical language models. Interestingly, MS-BART’s outputs demonstrate remarkable stability across temperature variations, which is likely attributable to the model’s high confidence in next-token prediction gained through multi-task pretraining and its relatively small vocabulary size of 185. Detailed temperature analysis is provided in Appendix D. The second critical parameter, beam width, governs the search space breadth during decoding. We systematically evaluated MS-BART’s performance on the complete MassSpecGym test fold using an NVIDIA A800-SXM4- 80GB GPU, exploring beam widths from 10 to 100. As shown in Fig. 5, both Top-1 and Top-10 accuracies demonstrate consistent improvement with increasing beam width, while inference latency exhibits linear scaling. Notably, when tested on a common consumer-grade GPU like the RTX 4090 with a beam width of 100, the average inference
|
| 225 |
+
|
| 226 |
+

|
| 227 |
+
Figure 5: Performance of MS-BART with beam-search multinomial sampling decoding under different beam widths: Top-1 accuracy, Top-10 accuracy, and average inference time per spectrum.
|
| 228 |
+
|
| 229 |
+
time per spectrum is about 3 seconds, which is $5 3 \mathrm { x }$ times faster than DiffMS’s approximately 160 seconds and remains practically acceptable.
|
| 230 |
+
|
| 231 |
+
# 5 Conclusion
|
| 232 |
+
|
| 233 |
+
In this work, we propose MS-BART, a novel language model for mass spectra structure elucidation within a unified modeling framework. Specifically, we first represent mass spectra as fingerprints and tokenize both the fingerprints and molecular representations (SELFIES) using a unified vocabulary. Subsequently, MS-BART undergoes the standard pretraining-finetuning-alignment paradigm commonly employed in NLP, enabling the model to interpret spectral fingerprints and generate plausible molecular structures. Extensive experiments demonstrate that MS-BART achieves SOTA performance on two widely adopted benchmarks across 5/12 key metrics on MassSpecGym and NPLIB1 and is faster by one order of magnitude than competing diffusion-based method, while ablation studies further validate its effectiveness and robustness.
|
| 234 |
+
|
| 235 |
+
# Acknowledgments and Disclosure of Funding
|
| 236 |
+
|
| 237 |
+
This work was supported by the National Science and Technology Major Project (2023ZD0120703), the China NSFC Projects (U23B2057, 62120106006, and 92370206), and Shanghai Municipal Science and Technology Projects (2021SHZDZX0102 and 25X010202846).
|
| 238 |
+
|
| 239 |
+
# References
|
| 240 |
+
|
| 241 |
+
[1] Ruedi Aebersold and Matthias Mann. Mass spectrometry-based proteomics. Nature, 422(6928):198–207, 2003.
|
| 242 |
+
[2] Sadjad Fakouri Baygi and Dinesh Kumar Barupal. Idsl_mint: a deep learning framework to predict molecular fingerprints from mass spectra. Journal of Cheminformatics, 16(1):8, 2024.
|
| 243 |
+
[3] Wout Bittremieux, Mingxun Wang, and Pieter C Dorrestein. The critical role that spectral libraries play in capturing the metabolomics community knowledge. Metabolomics, 18(12):94, 2022.
|
| 244 |
+
[4] Montgomery Bohde, Mrunali Manjrekar, Runzhong Wang, Shuiwang Ji, and Connor W Coley. Diffms: Diffusion generation of molecules conditioned on mass spectra. arXiv preprint arXiv:2502.09571, 2025.
|
| 245 |
+
[5] Jane Bromley, Isabelle Guyon, Yann LeCun, Eduard Säckinger, and Roopak Shah. Signature verification using a" siamese" time delay neural network. Advances in neural information processing systems, 6, 1993.
|
| 246 |
+
[6] Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. Advances in neural information processing systems, 33:1877–1901, 2020.
|
| 247 |
+
[7] Roman Bushuiev, Anton Bushuiev, Niek de Jonge, Adamo Young, Fleming Kretschmer, Raman Samusevich, Janne Heirman, Fei Wang, Luke Zhang, Kai Dührkop, et al. Massspecgym: A benchmark for the discovery and identification of molecules. Advances in Neural Information Processing Systems, 37:110010–110027, 2024.
|
| 248 |
+
[8] Jacob Devlin, Ming-Wei Chang, Kenton Lee, and Kristina Toutanova. Bert: Pre-training of deep bidirectional transformers for language understanding. In Proceedings of the 2019 conference of the North American chapter of the association for computational linguistics: human language technologies, volume 1 (long and short papers), pages 4171–4186, 2019.
|
| 249 |
+
[9] Kai Dührkop, Markus Fleischauer, Marcus Ludwig, Alexander A Aksenov, Alexey V Melnik, Marvin Meusel, Pieter C Dorrestein, Juho Rousu, and Sebastian Böcker. Sirius 4: a rapid tool for turning tandem mass spectra into metabolite structure information. Nature methods, 16(4):299–302, 2019.
|
| 250 |
+
[10] Kai Dührkop, Louis-Félix Nothias, Markus Fleischauer, Raphael Reher, Marcus Ludwig, Martin A Hoffmann, Daniel Petras, William H Gerwick, Juho Rousu, Pieter C Dorrestein, et al. Systematic classification of unknown metabolites using high-resolution fragmentation mass spectra. Nature biotechnology, 39(4):462–471, 2021.
|
| 251 |
+
[11] Kai Dührkop, Huibin Shen, Marvin Meusel, Juho Rousu, and Sebastian Böcker. Searching molecular structure databases with tandem mass spectra using csi: Fingerid. Proceedings of the National Academy of Sciences, 112(41):12580–12585, 2015.
|
| 252 |
+
[12] Vijay Prakash Dwivedi and Xavier Bresson. A generalization of transformer networks to graphs. arXiv preprint arXiv:2012.09699, 2020.
|
| 253 |
+
[13] David Elser, Florian Huber, and Emmanuel Gaquerel. Mass2smiles: deep learning based fast prediction of structures and functional groups directly from high-resolution ms/ms spectra. bioRxiv, pages 2023–07, 2023.
|
| 254 |
+
|
| 255 |
+
[14] Muhammad Faizan-Khan, Roger Giné, Josep M Badia, Maribel Pérez-Ribera, Alexandra Junza, Maria Vinaixa, Marta Sales-Pardo, Roger Guimerà, and Oscar Yanes. Chemembed: A deep learning framework for metabolite identification using enhanced ms/ms data and multidimensional molecular embeddings. bioRxiv, pages 2025–02, 2025.
|
| 256 |
+
[15] Yin Fang, Ningyu Zhang, Zhuo Chen, Lingbing Guo, Xiaohui Fan, and Huajun Chen. Domainagnostic molecular generation with chemical feedback. In The Twelfth International Conference on Learning Representations.
|
| 257 |
+
[16] Giacomo Frisoni, Paolo Italiani, Stefano Salvatori, and Gianluca Moro. Cogito ergo summ: abstractive summarization of biomedical papers via semantic parsing graphs and consistency rewards. In Proceedings of the AAAI conference on artificial intelligence, volume 37, pages 12781–12789, 2023.
|
| 258 |
+
[17] Samuel Goldman, John Bradshaw, Jiayi Xin, and Connor Coley. Prefix-tree decoding for predicting mass spectra from molecules. Advances in neural information processing systems, 36:48548–48572, 2023.
|
| 259 |
+
[18] Samuel Goldman, Jeremy Wohlwend, Martin Stražar, Guy Haroush, Ramnik J Xavier, and Connor W Coley. Annotating metabolite mass spectra with domain-inspired chemical formula transformers. Nature Machine Intelligence, 5(9):965–979, 2023.
|
| 260 |
+
[19] Yang Han, Yiming Wang, Rui Wang, Lu Chen, and Kai Yu. Alignsum: Data pyramid hierarchical fine-tuning for aligning with human summarization preference. In Findings of the Association for Computational Linguistics: EMNLP 2024, pages 8506–8522, 2024.
|
| 261 |
+
[20] Kaiming He, Xinlei Chen, Saining Xie, Yanghao Li, Piotr Dollár, and Ross Girshick. Masked autoencoders are scalable vision learners. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pages 16000–16009, 2022.
|
| 262 |
+
[21] Xiu Huang, Huihui Liu, Dawei Lu, Yue Lin, Jingfu Liu, Qian Liu, Zongxiu Nie, and Guibin Jiang. Mass spectrometry for multi-dimensional characterization of natural and synthetic materials at the nanoscale. Chemical Society Reviews, 50(8):5243–5280, 2021.
|
| 263 |
+
[22] Florian Huber, Lars Ridder, Stefan Verhoeven, Jurriaan H. Spaaks, Faruk Diblen, Simon Rogers, and Justin J. J. van der Hooft. Spec2vec: Improved mass spectral similarity scoring through learning of structural relationships. PLoS Comput. Biol., 17(2), 2021.
|
| 264 |
+
[23] Florian Huber, Sven van der Burg, Justin JJ van der Hooft, and Lars Ridder. Ms2deepscore: a novel deep learning similarity measure to compare tandem mass spectra. Journal of cheminformatics, 13(1):84, 2021.
|
| 265 |
+
[24] Ilia Igashov, Arne Schneuing, Marwin Segler, Michael M Bronstein, and Bruno Correia. Retrobridge: Modeling retrosynthesis with markov bridges. In The Twelfth International Conference on Learning Representations.
|
| 266 |
+
[25] Mario Krenn, Florian Häse, AkshatKumar Nigam, Pascal Friederich, and Alan Aspuru-Guzik. Self-referencing embedded strings (selfies): A $100 \%$ robust molecular string representation. Machine Learning: Science and Technology, 1(4):045024, 2020.
|
| 267 |
+
[26] Fleming Kretschmer, Jan Seipp, Marcus Ludwig, Gunnar W Klau, and Sebastian Böcker. Small molecule machine learning: All models are wrong, some may not even be useful. bioRxiv, pages 2023–03, 2023.
|
| 268 |
+
[27] Greg Landrum. Rdkit documentation. Release, 1(1-79):4, 2013.
|
| 269 |
+
[28] Mike Lewis, Yinhan Liu, Naman Goyal, Marjan Ghazvininejad, Abdelrahman Mohamed, Omer Levy, Veselin Stoyanov, and Luke Zettlemoyer. Bart: Denoising sequence-to-sequence pretraining for natural language generation, translation, and comprehension. In Proceedings of the 58th Annual Meeting of the Association for Computational Linguistics, page 7871. Association for Computational Linguistics, 2020.
|
| 270 |
+
|
| 271 |
+
[29] Eleni E Litsa, Vijil Chenthamarakshan, Payel Das, and Lydia E Kavraki. An end-to-end deep learning framework for translating mass spectra to de-novo molecules. Communications Chemistry, 6(1):132, 2023.
|
| 272 |
+
[30] Yanmin Liu, Xuan Zhang, Wei Zhao, Daming Zhu, and Xuefeng Cui. De novo molecular structure generation from mass spectra. In 2023 IEEE International Conference on Bioinformatics and Biomedicine (BIBM), pages 373–378. IEEE, 2023.
|
| 273 |
+
[31] Yixin Liu, Pengfei Liu, Dragomir Radev, and Graham Neubig. BRIO: Bringing order to abstractive summarization. In Smaranda Muresan, Preslav Nakov, and Aline Villavicencio, editors, Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pages 2890–2903, Dublin, Ireland, May 2022. Association for Computational Linguistics.
|
| 274 |
+
[32] Felix Meissner, Jennifer Geddes-McAlister, Matthias Mann, and Marcus Bantscheff. The emerging role of mass spectrometry-based proteomics in drug discovery. Nature Reviews Drug Discovery, 21(9):637–654, 2022.
|
| 275 |
+
[33] Harry L Morgan. The generation of a unique machine description for chemical structuresa technique developed at chemical abstracts service. Journal of chemical documentation, 5(2):107–113, 1965.
|
| 276 |
+
[34] Michael Murphy, Stefanie Jegelka, Ernest Fraenkel, Tobias Kind, David Healey, and Thomas Butler. Efficiently predicting high resolution mass spectra with graph neural networks. In International Conference on Machine Learning, pages 25549–25562. PMLR, 2023.
|
| 277 |
+
[35] Yolanda Picó and Damià Barceló. Pyrolysis gas chromatography-mass spectrometry in environmental analysis: Focus on organic matter and microplastics. TrAC Trends in Analytical Chemistry, 130:115964, 2020.
|
| 278 |
+
[36] Alessandro Raganato and Jörg Tiedemann. An analysis of encoder representations in transformer-based machine translation. In Proceedings of the 2018 EMNLP workshop BlackboxNLP: analyzing and interpreting neural networks for NLP, pages 287–297, 2018.
|
| 279 |
+
[37] Alexander Rives, Joshua Meier, Tom Sercu, Siddharth Goyal, Zeming Lin, Jason Liu, Demi Guo, Myle Ott, C Lawrence Zitnick, Jerry Ma, et al. Biological structure and function emerge from scaling unsupervised learning to 250 million protein sequences. Proceedings of the National Academy of Sciences, 118(15):e2016239118, 2021.
|
| 280 |
+
[38] Khawla Seddiki, Philippe Saudemont, Frédéric Precioso, Nina Ogrinc, Maxence Wisztorski, Michel Salzet, Isabelle Fournier, and Arnaud Droit. Cumulative learning enables convolutional neural network representations for small mass spectrometry data classification. Nature communications, 11(1):5595, 2020.
|
| 281 |
+
[39] Michael A Skinnider, Fei Wang, Daniel Pasin, Russell Greiner, Leonard J Foster, Petur W Dalsgaard, and David S Wishart. A deep generative model enables automated structure elucidation of novel psychoactive substances. Nature Machine Intelligence, 3(11):973–984, 2021.
|
| 282 |
+
[40] Stephen Stein. Mass spectral reference libraries: an ever-expanding resource for chemical identification, 2012.
|
| 283 |
+
[41] Michael A Stravs, Kai Dührkop, Sebastian Böcker, and Nicola Zamboni. Msnovelist: de novo structure generation from mass spectra. Nature Methods, 19(7):865–870, 2022.
|
| 284 |
+
[42] Chi Wang, Xueqing Liu, and Ahmed Hassan Awadallah. Cost-effective hyperparameter optimization for large language model generation inference. In Aleksandra Faust, Roman Garnett, Colin White, Frank Hutter, and Jacob R. Gardner, editors, Proceedings of the Second International Conference on Automated Machine Learning, volume 224 of Proceedings of Machine Learning Research, pages 21/1–17. PMLR, 12–15 Nov 2023.
|
| 285 |
+
[43] Fei Wang, Jaanus Liigand, Siyang Tian, David Arndt, Russell Greiner, and David S Wishart. Cfm-id 4.0: more accurate esi-ms/ms spectral prediction and compound identification. Analytical chemistry, 93(34):11692–11700, 2021.
|
| 286 |
+
|
| 287 |
+
[44] Mingxun Wang, Jeremy J Carver, Vanessa V Phelan, Laura M Sanchez, Neha Garg, Yao Peng, Don Duy Nguyen, Jeramie Watrous, Clifford A Kapono, Tal Luzzatto-Knaan, et al. Sharing and community curation of mass spectrometry data with global natural products social molecular networking. Nature biotechnology, 34(8):828–837, 2016.
|
| 288 |
+
[45] Yinkai Wang, Xiaohui Chen, Liping Liu, and Soha Hassoun. MADGEN: Mass-spec attends to de novo molecular generation. In The Thirteenth International Conference on Learning Representations, 2025.
|
| 289 |
+
[46] David Weininger. Smiles, a chemical language and information system. 1. introduction to methodology and encoding rules. Journal of chemical information and computer sciences, 28(1):31–36, 1988.
|
| 290 |
+
[47] Robin Winter, Floriane Montanari, Frank Noé, and Djork-Arné Clevert. Learning continuous and data-driven molecular descriptors by translating equivalent chemical representations. Chemical science, 10(6):1692–1701, 2019.
|
| 291 |
+
[48] Lin Yao, Minjian Yang, Jianfei Song, Zhuo Yang, Hanyu Sun, Hui Shi, Xue Liu, Xiangyang Ji, Yafeng Deng, and Xiaojian Wang. Conditional molecular generation net enables automated structure elucidation based on 13c nmr spectra and prior knowledge. Analytical chemistry, 95(12):5393–5401, 2023.
|
| 292 |
+
[49] Hailiang Zhang, Qiong Yang, Ting Xie, Yue Wang, Zhimin Zhang, and Hongmei Lu. Msbert: Embedding tandem mass spectra into chemically rational space by mask learning and contrastive learning. Analytical Chemistry, 96(42):16599–16608, 2024.
|
| 293 |
+
[50] Yuqi Zhu, Jia Li, Ge Li, YunFei Zhao, Zhi Jin, and Hong Mei. Hot or cold? adaptive temperature sampling for code generation with large language models. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pages 437–445, 2024.
|
| 294 |
+
|
| 295 |
+
# A Selection of the Probability Threshold ϵ
|
| 296 |
+
|
| 297 |
+
We selected the threshold value $\epsilon$ for NPLIB1 and MassSpecGym using different methods. Since NPLIB1 is known to be a much easier dataset, we chose its threshold empirically. After examining the probability distribution, we observed that most probabilities were smaller than 0.3. A large threshold could cause information loss, whereas a small threshold might introduce noise. Therefore, we selected $\epsilon = 0 . 2$ to balance these factors, which resulted in excellent performance. For MassSpecGym, we trained MS-BARTusing $\epsilon$ values ranging from 0.1 to 0.2 in increments of 0.01. We then validated these on the validation set and selected the best threshold based on the highest Top-1 Tanimoto similarity. As shown in Table 4, the Top-1 Tanimoto similarity values for different thresholds were very close. We ultimately chose $\epsilon = 0 . 1 1$ as the final threshold, although performance did not vary significantly across the different threshold values.
|
| 298 |
+
|
| 299 |
+
Table 4: Top-1 Tanimoto Similarity under different $\epsilon$ values.
|
| 300 |
+
|
| 301 |
+
<table><tr><td>€</td><td>0.10</td><td>0.11</td><td>0.12</td><td>0.13</td><td>0.14</td><td>0.15</td><td>0.16</td><td>0.17</td><td>0.18</td><td>0.19</td><td>0.20</td></tr><tr><td>Tanimoto Similarity</td><td>0.1666</td><td>0.1678</td><td>0.1640</td><td>0.1651</td><td>0.1660</td><td>0.1660</td><td>0.1654</td><td>0.1643</td><td>0.1651</td><td>0.1649</td><td>0.1636</td></tr></table>
|
| 302 |
+
|
| 303 |
+
# B MS-BART Training Details
|
| 304 |
+
|
| 305 |
+
Pretraining. We pretrain MS-BART from scratch on a simulated dataset of 4M fingerprint-molecule pairs. This dataset was generated from a refined subset of the 4M unlabeled molecules provided by MassSpecGym [7]. The refinement process involved excluding any molecule with an MCES distance of less than two from any molecule in the MassSpecGym test fold. For the NPLIB1 dataset, we first evaluated the structural similarity between its test set and our pretraining data. As shown in Table 5, approximately $3 \%$ of the pretraining molecules were structurally similar to those in the NPLIB1 test set. To prevent data leakage, we further filtered the pretraining set to remove any molecules that were structurally similar or identical to those in the NPLIB1 test set. Specifically, we refined the
|
| 306 |
+
|
| 307 |
+
pretraining dataset by removing molecules with a maximum Tanimoto similarity greater than 0.5 to any molecule in the NPLIB1 test set.
|
| 308 |
+
|
| 309 |
+
The training was conducted on four NVIDIA A800-SXM4-80GB GPUs using bfloat16 precision. A per-device batch size of 96 and two gradient accumulation steps were employed, resulting in an effective total batch size of 768 across three training epochs. The optimization process adopted a cosine learning rate scheduler with a warm-up phase of 10,000 steps. The learning rate increased linearly from zero to a peak value of 6e-4 during warm-up and subsequently decayed following a cosine schedule to a minimum value of 1e-5. The entire multi-task pretraining process required approximately 34 hours to complete.
|
| 310 |
+
|
| 311 |
+
Table 5: Distribution of max Tanimoto Similarity between pretraining set and NPLIB1 test set.
|
| 312 |
+
|
| 313 |
+
<table><tr><td>Similarity Interval</td><td>0.0-0.1</td><td>0.1-0.2</td><td>0.2-0.3</td><td>0.3-0.4</td><td>0.4-0.5</td><td>0.5-0.6</td><td>0.6-0.7</td><td>0.7-0.8</td><td>0.8-0.9</td><td>0.9-1.0</td></tr><tr><td>Proportion</td><td>0.09%</td><td>8.40%</td><td>55.85%</td><td>21.58%</td><td>6.79%</td><td>3.79%</td><td>1.84%</td><td>1.20%</td><td>0.40%</td><td>0.06%</td></tr></table>
|
| 314 |
+
|
| 315 |
+
Finetuning. Fine-tuning is performed on a single NVIDIA A800-SXM4-80GB GPU using bfloat16 precision, with consistent parameter settings across both MassSpecGym and NPLIB1 datasets. We adopt a learning rate of 5e-5 combined with a warm-up phase covering $10 \%$ of total training steps. Each training iteration processes 128 samples per batch. For validation monitoring, we implement an early stopping criterion that evaluates model performance every 400 steps on MassSpecGym and every 200 steps on NPLIB1. Training terminates when the validation set’s Top-1 Tanimoto similarity fails to improve for three consecutive evaluations.
|
| 316 |
+
|
| 317 |
+
Alignment Training. The alignment phase is more complex than pretraining and fine-tuning, requiring careful hyperparameter optimization. As specified in Table 6, we explore multiple configurations during this stage while maintaining a fixed batch size of 128 and bfloat16 precision on a single NVIDIA A800 GPU. The learning schedule includes a $10 \%$ warm-up ratio of total training steps. Validation frequency is set to 400-step intervals for MassSpecGym and 50-step intervals for NPLIB1. We extend the patience to five consecutive evaluations without improvement in Top-1 Tanimoto similarity before triggering early stopping. Final hyperparameter selection is determined by maximizing the validation set’s Top-1 Tanimoto similarity.
|
| 318 |
+
|
| 319 |
+
Table 6: Hyper-parameter settings.
|
| 320 |
+
|
| 321 |
+
<table><tr><td>Hyper-parameters</td><td>Values</td></tr><tr><td>Learning Rate</td><td>{1e-5, 5e-5}</td></tr><tr><td>Candidate Margin γ</td><td>{0.05, 0.1, 0.2}</td></tr><tr><td>Rank Loss Weight α</td><td>{1, 3, 5}</td></tr><tr><td>Number of Candidates</td><td>{3, 5}</td></tr><tr><td>Length Penalty Coefficient</td><td>{1.4, 1.6}</td></tr></table>
|
| 322 |
+
|
| 323 |
+
# C 2D InChIKey Based Accuracy
|
| 324 |
+
|
| 325 |
+
We evaluate the Top-1 and Top-10 accuracy based on 2D InChIKey matching and present the results in Table 7. On NPLIB1, the two calculation methods yield the same results. However, for MassSpecGym, the 2D InChIKey-based accuracy of MS-BART shows a slight improvement compared to evaluation with the full InChIKey because the 2D InChIKey uses only the first 14 characters, which do not include 3D stereochemistry. To maintain consistency with the DiffMS [4], we use the full InChIKey results as the final results.
|
| 326 |
+
|
| 327 |
+
# D The Impact of Sampling Temperature on Model Performance
|
| 328 |
+
|
| 329 |
+
Table 8 presents the performance evaluation of MS-BART during decoding with varying temperature values on MassSpecGym. The results demonstrate that MS-BART’s performance remains largely consistent across different temperature settings. This stability can be attributed to the model’s high confidence in next-token predictions, which likely stems from its multi-task pretraining framework.
|
| 330 |
+
|
| 331 |
+
Table 7: 2D InChIKey based Top-1 and Top-10 accuracy on NPLIB1 and MassSpecGym.
|
| 332 |
+
|
| 333 |
+
<table><tr><td>Calculation Method</td><td>Top-1 Accuracy</td><td>Top-10 Accuracy</td></tr><tr><td colspan="3">NPLIB1</td></tr><tr><td>MS-BART (InChIKey)</td><td>7.45%</td><td>10.99%</td></tr><tr><td>MS-BART (2D InChIKey)</td><td>7.45%</td><td>10.99%</td></tr><tr><td colspan="3">MASSPECGYM</td></tr><tr><td>MS-BART (InChIKey)</td><td>1.07%</td><td>1.11%</td></tr><tr><td>MS-BART (2D InChIKey)</td><td>1.26%</td><td>1.28%</td></tr></table>
|
| 334 |
+
|
| 335 |
+
Table 8: The performance of MS-BART when decoding with different temperature on MassSpecGym.
|
| 336 |
+
|
| 337 |
+
<table><tr><td rowspan="2">TEMPERATURE</td><td colspan="3">TOP-1</td><td colspan="3">TOP-10</td></tr><tr><td>ACCURACY ↑</td><td>MCES ↓</td><td>TANIMOTO ↑</td><td>ACCURACY ↑</td><td>MCES ↓</td><td>TANIMOTO ↑</td></tr><tr><td colspan="7">Prtrain-FT</td></tr><tr><td>0.2</td><td>1.07%</td><td>17.16</td><td>0.22</td><td>1.12%</td><td>15.51</td><td>0.27</td></tr><tr><td>0.4</td><td>1.07%</td><td>17.17</td><td>0.22</td><td>1.12%</td><td>15.51</td><td>0.27</td></tr><tr><td>0.8</td><td>1.07%</td><td>17.16</td><td>0.22</td><td>1.12%</td><td>15.50</td><td>0.27</td></tr><tr><td colspan="7">MS-BART</td></tr><tr><td>0.2</td><td>1.07%</td><td>16.47</td><td>0.23</td><td>1.11%</td><td>15.12</td><td>0.28</td></tr><tr><td>0.4</td><td>1.07%</td><td>16.47</td><td>0.23</td><td>1.11%</td><td>15.12</td><td>0.28</td></tr><tr><td>0.8</td><td>1.07%</td><td>16.47</td><td>0.23</td><td>1.11%</td><td>15.11</td><td>0.28</td></tr></table>
|
| 338 |
+
|
| 339 |
+
# E Limitations
|
| 340 |
+
|
| 341 |
+
Our primary limitation lies in the reliance on the external MIST model [18] for predicting fingerprints from experimental spectra. The accuracy of these fingerprint predictions significantly impacts the overall performance. Future work may focus on fine-tuning the MIST model using task-specific datasets to improve prediction accuracy, or it could explore directly modeling the fragments from raw mass spectra. Another limitation is that the formula information is used only for re-ranking and not for training the model. However, these additional formulas definitely include important information and are very likely to boost the model’s performance. We plan to explore effective ways to incorporate these informational hints into MS-BART in future work.
|
| 342 |
+
|
| 343 |
+
# F Ethics Statement
|
| 344 |
+
|
| 345 |
+
All data used in this work are obtained from publicly available sources, including molecular structure datasets and mass spectrometry benchmarks such as NPLIB1 and MassSpecGym. We strictly follow the corresponding licenses and usage protocols. No modifications have been made to the original datasets beyond necessary preprocessing using standard cheminformatics tools (e.g., RDKit) to compute molecular fingerprints. No personal, private, or sensitive data are involved. The proposed model, MS-BART, is trained and evaluated solely for the task of molecular structure elucidation from mass spectrometry data. Our work does not involve human subjects, biometric data, or decisionmaking in socially sensitive applications. We do not foresee any immediate negative societal impact. On the contrary, improving molecular identification from mass spectrometry may benefit fields such as drug discovery, environmental chemistry, and materials science.
|
| 346 |
+
|
| 347 |
+
# NeurIPS Paper Checklist
|
| 348 |
+
|
| 349 |
+
# 1. Claims
|
| 350 |
+
|
| 351 |
+
Question: Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
|
| 352 |
+
|
| 353 |
+
Answer: [Yes]
|
| 354 |
+
|
| 355 |
+
Justification: [Abstract, Section 1]
|
| 356 |
+
|
| 357 |
+
Guidelines:
|
| 358 |
+
|
| 359 |
+
• The answer NA means that the abstract and introduction do not include the claims made in the paper.
|
| 360 |
+
• The abstract and/or introduction should clearly state the claims made, including the contributions made in the paper and important assumptions and limitations. A No or NA answer to this question will not be perceived well by the reviewers.
|
| 361 |
+
• The claims made should match theoretical and experimental results, and reflect how much the results can be expected to generalize to other settings.
|
| 362 |
+
• It is fine to include aspirational goals as motivation as long as it is clear that these goals are not attained by the paper.
|
| 363 |
+
|
| 364 |
+
# 2. Limitations
|
| 365 |
+
|
| 366 |
+
Question: Does the paper discuss the limitations of the work performed by the authors?
|
| 367 |
+
|
| 368 |
+
Answer: [Yes]
|
| 369 |
+
|
| 370 |
+
Justification: [Appendix E]
|
| 371 |
+
|
| 372 |
+
Guidelines:
|
| 373 |
+
|
| 374 |
+
• The answer NA means that the paper has no limitation while the answer No means that the paper has limitations, but those are not discussed in the paper.
|
| 375 |
+
• The authors are encouraged to create a separate "Limitations" section in their paper.
|
| 376 |
+
• The paper should point out any strong assumptions and how robust the results are to violations of these assumptions (e.g., independence assumptions, noiseless settings, model well-specification, asymptotic approximations only holding locally). The authors should reflect on how these assumptions might be violated in practice and what the implications would be.
|
| 377 |
+
• The authors should reflect on the scope of the claims made, e.g., if the approach was only tested on a few datasets or with a few runs. In general, empirical results often depend on implicit assumptions, which should be articulated.
|
| 378 |
+
• The authors should reflect on the factors that influence the performance of the approach. For example, a facial recognition algorithm may perform poorly when image resolution is low or images are taken in low lighting. Or a speech-to-text system might not be used reliably to provide closed captions for online lectures because it fails to handle technical jargon.
|
| 379 |
+
• The authors should discuss the computational efficiency of the proposed algorithms and how they scale with dataset size.
|
| 380 |
+
• If applicable, the authors should discuss possible limitations of their approach to address problems of privacy and fairness.
|
| 381 |
+
• While the authors might fear that complete honesty about limitations might be used by reviewers as grounds for rejection, a worse outcome might be that reviewers discover limitations that aren’t acknowledged in the paper. The authors should use their best judgment and recognize that individual actions in favor of transparency play an important role in developing norms that preserve the integrity of the community. Reviewers will be specifically instructed to not penalize honesty concerning limitations.
|
| 382 |
+
|
| 383 |
+
# 3. Theory assumptions and proofs
|
| 384 |
+
|
| 385 |
+
Question: For each theoretical result, does the paper provide the full set of assumptions and a complete (and correct) proof?
|
| 386 |
+
|
| 387 |
+
Answer: [NA]
|
| 388 |
+
|
| 389 |
+
Justification: [The paper does not include theoretical results]
|
| 390 |
+
|
| 391 |
+
# Guidelines:
|
| 392 |
+
|
| 393 |
+
• The answer NA means that the paper does not include theoretical results.
|
| 394 |
+
• All the theorems, formulas, and proofs in the paper should be numbered and crossreferenced.
|
| 395 |
+
• All assumptions should be clearly stated or referenced in the statement of any theorems.
|
| 396 |
+
• The proofs can either appear in the main paper or the supplemental material, but if they appear in the supplemental material, the authors are encouraged to provide a short proof sketch to provide intuition.
|
| 397 |
+
• Inversely, any informal proof provided in the core of the paper should be complemented by formal proofs provided in appendix or supplemental material.
|
| 398 |
+
• Theorems and Lemmas that the proof relies upon should be properly referenced.
|
| 399 |
+
|
| 400 |
+
# 4. Experimental result reproducibility
|
| 401 |
+
|
| 402 |
+
Question: Does the paper fully disclose all the information needed to reproduce the main experimental results of the paper to the extent that it affects the main claims and/or conclusions of the paper (regardless of whether the code and data are provided or not)?
|
| 403 |
+
|
| 404 |
+
Answer: [Yes]
|
| 405 |
+
|
| 406 |
+
Justification: [Section 4.14.3, Appendix B]
|
| 407 |
+
|
| 408 |
+
# Guidelines:
|
| 409 |
+
|
| 410 |
+
• The answer NA means that the paper does not include experiments.
|
| 411 |
+
• If the paper includes experiments, a No answer to this question will not be perceived well by the reviewers: Making the paper reproducible is important, regardless of whether the code and data are provided or not.
|
| 412 |
+
• If the contribution is a dataset and/or model, the authors should describe the steps taken to make their results reproducible or verifiable.
|
| 413 |
+
• Depending on the contribution, reproducibility can be accomplished in various ways. For example, if the contribution is a novel architecture, describing the architecture fully might suffice, or if the contribution is a specific model and empirical evaluation, it may be necessary to either make it possible for others to replicate the model with the same dataset, or provide access to the model. In general. releasing code and data is often one good way to accomplish this, but reproducibility can also be provided via detailed instructions for how to replicate the results, access to a hosted model (e.g., in the case of a large language model), releasing of a model checkpoint, or other means that are appropriate to the research performed.
|
| 414 |
+
• While NeurIPS does not require releasing code, the conference does require all submissions to provide some reasonable avenue for reproducibility, which may depend on the nature of the contribution. For example
|
| 415 |
+
(a) If the contribution is primarily a new algorithm, the paper should make it clear how to reproduce that algorithm.
|
| 416 |
+
(b) If the contribution is primarily a new model architecture, the paper should describe the architecture clearly and fully.
|
| 417 |
+
(c) If the contribution is a new model (e.g., a large language model), then there should either be a way to access this model for reproducing the results or a way to reproduce the model (e.g., with an open-source dataset or instructions for how to construct the dataset).
|
| 418 |
+
(d) We recognize that reproducibility may be tricky in some cases, in which case authors are welcome to describe the particular way they provide for reproducibility. In the case of closed-source models, it may be that access to the model is limited in some way (e.g., to registered users), but it should be possible for other researchers to have some path to reproducing or verifying the results.
|
| 419 |
+
|
| 420 |
+
# 5. Open access to data and code
|
| 421 |
+
|
| 422 |
+
Question: Does the paper provide open access to the data and code, with sufficient instructions to faithfully reproduce the main experimental results, as described in supplemental material?
|
| 423 |
+
|
| 424 |
+
# Answer: [Yes]
|
| 425 |
+
|
| 426 |
+
Justification: [Section 4.1, Anonymous code]
|
| 427 |
+
|
| 428 |
+
# Guidelines:
|
| 429 |
+
|
| 430 |
+
• The answer NA means that paper does not include experiments requiring code.
|
| 431 |
+
• Please see the NeurIPS code and data submission guidelines (https://nips.cc/ public/guides/CodeSubmissionPolicy) for more details.
|
| 432 |
+
• While we encourage the release of code and data, we understand that this might not be possible, so “No” is an acceptable answer. Papers cannot be rejected simply for not including code, unless this is central to the contribution (e.g., for a new open-source benchmark).
|
| 433 |
+
• The instructions should contain the exact command and environment needed to run to reproduce the results. See the NeurIPS code and data submission guidelines (https: //nips.cc/public/guides/CodeSubmissionPolicy) for more details.
|
| 434 |
+
• The authors should provide instructions on data access and preparation, including how to access the raw data, preprocessed data, intermediate data, and generated data, etc.
|
| 435 |
+
• The authors should provide scripts to reproduce all experimental results for the new proposed method and baselines. If only a subset of experiments are reproducible, they should state which ones are omitted from the script and why.
|
| 436 |
+
• At submission time, to preserve anonymity, the authors should release anonymized versions (if applicable).
|
| 437 |
+
• Providing as much information as possible in supplemental material (appended to the paper) is recommended, but including URLs to data and code is permitted.
|
| 438 |
+
|
| 439 |
+
# 6. Experimental setting/details
|
| 440 |
+
|
| 441 |
+
Question: Does the paper specify all the training and test details (e.g., data splits, hyperparameters, how they were chosen, type of optimizer, etc.) necessary to understand the results?
|
| 442 |
+
|
| 443 |
+
# Answer: [Yes]
|
| 444 |
+
|
| 445 |
+
Justification: [Section 4.14.3, Appendix B]
|
| 446 |
+
|
| 447 |
+
# Guidelines:
|
| 448 |
+
|
| 449 |
+
• The answer NA means that the paper does not include experiments.
|
| 450 |
+
• The experimental setting should be presented in the core of the paper to a level of detail that is necessary to appreciate the results and make sense of them.
|
| 451 |
+
• The full details can be provided either with the code, in appendix, or as supplemental material.
|
| 452 |
+
|
| 453 |
+
# 7. Experiment statistical significance
|
| 454 |
+
|
| 455 |
+
Question: Does the paper report error bars suitably and correctly defined or other appropriate information about the statistical significance of the experiments?
|
| 456 |
+
|
| 457 |
+
# Answer: [Yes]
|
| 458 |
+
|
| 459 |
+
Justification: [Appendix D]
|
| 460 |
+
|
| 461 |
+
# Guidelines:
|
| 462 |
+
|
| 463 |
+
• The answer NA means that the paper does not include experiments.
|
| 464 |
+
• The authors should answer "Yes" if the results are accompanied by error bars, confidence intervals, or statistical significance tests, at least for the experiments that support the main claims of the paper.
|
| 465 |
+
• The factors of variability that the error bars are capturing should be clearly stated (for example, train/test split, initialization, random drawing of some parameter, or overall run with given experimental conditions).
|
| 466 |
+
• The method for calculating the error bars should be explained (closed form formula, call to a library function, bootstrap, etc.)
|
| 467 |
+
• The assumptions made should be given (e.g., Normally distributed errors).
|
| 468 |
+
• It should be clear whether the error bar is the standard deviation or the standard error of the mean.
|
| 469 |
+
|
| 470 |
+
• It is OK to report 1-sigma error bars, but one should state it. The authors should preferably report a 2-sigma error bar than state that they have a $96 \%$ CI, if the hypothesis of Normality of errors is not verified.
|
| 471 |
+
• For asymmetric distributions, the authors should be careful not to show in tables or figures symmetric error bars that would yield results that are out of range (e.g. negative error rates).
|
| 472 |
+
• If error bars are reported in tables or plots, The authors should explain in the text how they were calculated and reference the corresponding figures or tables in the text.
|
| 473 |
+
|
| 474 |
+
# 8. Experiments compute resources
|
| 475 |
+
|
| 476 |
+
Question: For each experiment, does the paper provide sufficient information on the computer resources (type of compute workers, memory, time of execution) needed to reproduce the experiments?
|
| 477 |
+
|
| 478 |
+
Answer: [Yes]
|
| 479 |
+
|
| 480 |
+
Justification: [Section 4.8, Appendix B]
|
| 481 |
+
|
| 482 |
+
Guidelines:
|
| 483 |
+
|
| 484 |
+
• The answer NA means that the paper does not include experiments.
|
| 485 |
+
• The paper should indicate the type of compute workers CPU or GPU, internal cluster, or cloud provider, including relevant memory and storage.
|
| 486 |
+
• The paper should provide the amount of compute required for each of the individual experimental runs as well as estimate the total compute.
|
| 487 |
+
• The paper should disclose whether the full research project required more compute than the experiments reported in the paper (e.g., preliminary or failed experiments that didn’t make it into the paper).
|
| 488 |
+
|
| 489 |
+
# 9. Code of ethics
|
| 490 |
+
|
| 491 |
+
Question: Does the research conducted in the paper conform, in every respect, with the NeurIPS Code of Ethics https://neurips.cc/public/EthicsGuidelines?
|
| 492 |
+
|
| 493 |
+
Answer: [Yes]
|
| 494 |
+
|
| 495 |
+
Justification: [Appendix F]
|
| 496 |
+
|
| 497 |
+
Guidelines:
|
| 498 |
+
|
| 499 |
+
• The answer NA means that the authors have not reviewed the NeurIPS Code of Ethics.
|
| 500 |
+
• If the authors answer No, they should explain the special circumstances that require a deviation from the Code of Ethics.
|
| 501 |
+
• The authors should make sure to preserve anonymity (e.g., if there is a special consideration due to laws or regulations in their jurisdiction).
|
| 502 |
+
|
| 503 |
+
# 10. Broader impacts
|
| 504 |
+
|
| 505 |
+
Question: Does the paper discuss both potential positive societal impacts and negative societal impacts of the work performed?
|
| 506 |
+
|
| 507 |
+
Answer: [Yes]
|
| 508 |
+
|
| 509 |
+
Justification: [Appendix F]
|
| 510 |
+
|
| 511 |
+
Guidelines:
|
| 512 |
+
|
| 513 |
+
• The answer NA means that there is no societal impact of the work performed.
|
| 514 |
+
• If the authors answer NA or No, they should explain why their work has no societal impact or why the paper does not address societal impact.
|
| 515 |
+
• Examples of negative societal impacts include potential malicious or unintended uses (e.g., disinformation, generating fake profiles, surveillance), fairness considerations (e.g., deployment of technologies that could make decisions that unfairly impact specific groups), privacy considerations, and security considerations.
|
| 516 |
+
• The conference expects that many papers will be foundational research and not tied to particular applications, let alone deployments. However, if there is a direct path to any negative applications, the authors should point it out. For example, it is legitimate to point out that an improvement in the quality of generative models could be used to
|
| 517 |
+
|
| 518 |
+
generate deepfakes for disinformation. On the other hand, it is not needed to point out that a generic algorithm for optimizing neural networks could enable people to train models that generate Deepfakes faster.
|
| 519 |
+
|
| 520 |
+
• The authors should consider possible harms that could arise when the technology is being used as intended and functioning correctly, harms that could arise when the technology is being used as intended but gives incorrect results, and harms following from (intentional or unintentional) misuse of the technology.
|
| 521 |
+
• If there are negative societal impacts, the authors could also discuss possible mitigation strategies (e.g., gated release of models, providing defenses in addition to attacks, mechanisms for monitoring misuse, mechanisms to monitor how a system learns from feedback over time, improving the efficiency and accessibility of ML).
|
| 522 |
+
|
| 523 |
+
# 11. Safeguards
|
| 524 |
+
|
| 525 |
+
Question: Does the paper describe safeguards that have been put in place for responsible release of data or models that have a high risk for misuse (e.g., pretrained language models, image generators, or scraped datasets)?
|
| 526 |
+
|
| 527 |
+
Answer: [Yes]
|
| 528 |
+
|
| 529 |
+
Justification: [Appendix F]
|
| 530 |
+
|
| 531 |
+
Guidelines:
|
| 532 |
+
|
| 533 |
+
• The answer NA means that the paper poses no such risks.
|
| 534 |
+
• Released models that have a high risk for misuse or dual-use should be released with necessary safeguards to allow for controlled use of the model, for example by requiring that users adhere to usage guidelines or restrictions to access the model or implementing safety filters.
|
| 535 |
+
• Datasets that have been scraped from the Internet could pose safety risks. The authors should describe how they avoided releasing unsafe images.
|
| 536 |
+
• We recognize that providing effective safeguards is challenging, and many papers do not require this, but we encourage authors to take this into account and make a best faith effort.
|
| 537 |
+
|
| 538 |
+
# 12. Licenses for existing assets
|
| 539 |
+
|
| 540 |
+
Question: Are the creators or original owners of assets (e.g., code, data, models), used in the paper, properly credited and are the license and terms of use explicitly mentioned and properly respected?
|
| 541 |
+
|
| 542 |
+
Answer: [Yes]
|
| 543 |
+
|
| 544 |
+
Justification: [Section 4.1]
|
| 545 |
+
|
| 546 |
+
Guidelines:
|
| 547 |
+
|
| 548 |
+
• The answer NA means that the paper does not use existing assets.
|
| 549 |
+
• The authors should cite the original paper that produced the code package or dataset.
|
| 550 |
+
• The authors should state which version of the asset is used and, if possible, include a URL.
|
| 551 |
+
• The name of the license (e.g., CC-BY 4.0) should be included for each asset.
|
| 552 |
+
• For scraped data from a particular source (e.g., website), the copyright and terms of service of that source should be provided.
|
| 553 |
+
• If assets are released, the license, copyright information, and terms of use in the package should be provided. For popular datasets, paperswithcode.com/datasets has curated licenses for some datasets. Their licensing guide can help determine the license of a dataset.
|
| 554 |
+
• For existing datasets that are re-packaged, both the original license and the license of the derived asset (if it has changed) should be provided.
|
| 555 |
+
• If this information is not available online, the authors are encouraged to reach out to the asset’s creators.
|
| 556 |
+
|
| 557 |
+
# 13. New assets
|
| 558 |
+
|
| 559 |
+
Question: Are new assets introduced in the paper well documented and is the documentation provided alongside the assets?
|
| 560 |
+
|
| 561 |
+
# Answer: [Yes]
|
| 562 |
+
|
| 563 |
+
Justification: [We provide the model parameters.]
|
| 564 |
+
|
| 565 |
+
# Guidelines:
|
| 566 |
+
|
| 567 |
+
• The answer NA means that the paper does not release new assets.
|
| 568 |
+
• Researchers should communicate the details of the dataset/code/model as part of their submissions via structured templates. This includes details about training, license, limitations, etc.
|
| 569 |
+
• The paper should discuss whether and how consent was obtained from people whose asset is used.
|
| 570 |
+
• At submission time, remember to anonymize your assets (if applicable). You can either create an anonymized URL or include an anonymized zip file.
|
| 571 |
+
|
| 572 |
+
# 14. Crowdsourcing and research with human subjects
|
| 573 |
+
|
| 574 |
+
Question: For crowdsourcing experiments and research with human subjects, does the paper include the full text of instructions given to participants and screenshots, if applicable, as well as details about compensation (if any)?
|
| 575 |
+
|
| 576 |
+
# Answer: [NA]
|
| 577 |
+
|
| 578 |
+
Justification: [Our paper does not involve crowdsourcing experiments and research.]
|
| 579 |
+
|
| 580 |
+
# Guidelines:
|
| 581 |
+
|
| 582 |
+
• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
|
| 583 |
+
• Including this information in the supplemental material is fine, but if the main contribution of the paper involves human subjects, then as much detail as possible should be included in the main paper.
|
| 584 |
+
• According to the NeurIPS Code of Ethics, workers involved in data collection, curation, or other labor should be paid at least the minimum wage in the country of the data collector.
|
| 585 |
+
|
| 586 |
+
# 15. Institutional review board (IRB) approvals or equivalent for research with human subjects
|
| 587 |
+
|
| 588 |
+
Question: Does the paper describe potential risks incurred by study participants, whether such risks were disclosed to the subjects, and whether Institutional Review Board (IRB) approvals (or an equivalent approval/review based on the requirements of your country or institution) were obtained?
|
| 589 |
+
|
| 590 |
+
# Answer: [NA]
|
| 591 |
+
|
| 592 |
+
Justification: [NA]
|
| 593 |
+
|
| 594 |
+
# Guidelines:
|
| 595 |
+
|
| 596 |
+
• The answer NA means that the paper does not involve crowdsourcing nor research with human subjects.
|
| 597 |
+
• Depending on the country in which research is conducted, IRB approval (or equivalent) may be required for any human subjects research. If you obtained IRB approval, you should clearly state this in the paper.
|
| 598 |
+
• We recognize that the procedures for this may vary significantly between institutions and locations, and we expect authors to adhere to the NeurIPS Code of Ethics and the guidelines for their institution.
|
| 599 |
+
• For initial submissions, do not include any information that would break anonymity (if applicable), such as the institution conducting the review.
|
| 600 |
+
|
| 601 |
+
# 16. Declaration of LLM usage
|
| 602 |
+
|
| 603 |
+
Question: Does the paper describe the usage of LLMs if it is an important, original, or non-standard component of the core methods in this research? Note that if the LLM is used only for writing, editing, or formatting purposes and does not impact the core methodology, scientific rigorousness, or originality of the research, declaration is not required.
|
| 604 |
+
|
| 605 |
+
Answer: [NA]
|
| 606 |
+
|
| 607 |
+
Justification: [We use LLM for writing.]
|
| 608 |
+
|
| 609 |
+
# Guidelines:
|
| 610 |
+
|
| 611 |
+
• The answer NA means that the core method development in this research does not involve LLMs as any important, original, or non-standard components.
|
| 612 |
+
• Please refer to our LLM policy (https://neurips.cc/Conferences/2025/ LLM) for what should or should not be described.
|
paper_markdowns/bamboo-05762.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|