diff --git "a/data_all_eng_slimpj/shuffled/split2/finalzzjqmp" "b/data_all_eng_slimpj/shuffled/split2/finalzzjqmp" new file mode 100644--- /dev/null +++ "b/data_all_eng_slimpj/shuffled/split2/finalzzjqmp" @@ -0,0 +1,5 @@ +{"text":"\n\n\\section{Results for AdamW (Freeze-embed)}\nIn our paper, we hypothesized that AdamW and SGD (freeze-embed) improve on SGD for the same reason---they change the embedding layer less. Based on this hypothesis, we would expect that the gains of AdamW and freeze-embed are \\emph{not complementary}. Indeed, we find that the AdamW (freeze-embed) variation performs similarly to AdamW and SGD (freeze-embed). %\n\nTables~\\ref{tab:ood_bigtable_adamw_freeze}~\\&~\\ref{tab:id_bigtable_adamw_freeze} expand on the OOD and ID accuracy results in Tables~\\ref{tab:ood_bigtable_adamw_freeze}~\\&~\\ref{tab:id_bigtable_adamw_freeze}, respectively, to include AdamW (freeze-embed).\nOverall, AdamW (freeze-embed) and SGD (freeze-embed) perform comparably for all the recent vision models, both fairly close to AdamW---although there are differences in some models and datasets.\nAveraged across all the datasets and models, AdamW, AdamW (freeze-embed), and SGD (freeze-embed) get 76\\%, 76.5\\%, and 76.7\\% accuracy, respectively, compared to 72.0\\% for SGD.\nAveraged across all the \\emph{in-distribution} datasets and models, AdamW, AdamW (freeze-embed), and SGD (freeze-embed) get 91.5\\%, 91.5\\%, and 91.3\\% accuracy, respectively, compared to 90.3\\% for SGD. Overall the performances of the three models are similar enough to suggest that these methods work well for the same reason that they tune the embedding layers less, and that freeze-embed is not an independent axis of improvement. \n\n\\begin{table}[h!]\n \\small \n \\caption{\n\\textbf{Out-of-distribution (OOD)} accuracies with AdamW (freeze-embed). This is an expansion of Table~\\ref{tab:ood_bigtable_final} to include AdamW (freeze-embed) OOD results for fine-tuning 7 popular models across 5 benchmark datasets. On OOD performance averaged across all models and datasets, AdamW (freeze-embed) gets slightly better accuracy than AdamW but slightly worse than SGD (freeze-embed). \n}\n\\begin{center}\n\\resizebox{\\textwidth}{!}{\n\\begin{tabular}{cccccccccccc|cc}\n\\toprule\n & & \\multicolumn{2}{c}{Living-17} & \\multicolumn{2}{c}{Waterbirds} & \\multicolumn{2}{c}{DomainNet} & \\multicolumn{2}{c}{FMoW} & \\multicolumn{2}{c}{Camelyon} & \\multicolumn{2}{c}{Avg.} \\\\\n\\midrule\nCLIP ViT-B\/16 & SGD & 80.0 & & 62.5 & & 72.8 & & 37.3 & & 86.8 & & 67.9 & \\\\\nCLIP ViT-B\/16 & AdamW & 82.8 & \\hspace{-1em}{\\hgreen{(+2.8)}} & 71.9 & \\hspace{-1em}{\\hgreen{(+9.4)}} & \\textbf{89.2} & \\hspace{-1em}{\\hgreen{(+16.4)}} & \\textbf{40.7} & \\hspace{-1em}{\\hgreen{(+3.4)}} & 95.7 & \\hspace{-1em}{\\hgreen{(+8.9)}} & \\textbf{76.0} & \\hspace{-1em}{\\hgreen{(+8.1)}}\\\\\nCLIP ViT-B\/16 & SGD (freeze-embed) & \\textbf{83.2} & \\hspace{-1em}{\\hgreen{(+3.2)}} & \\textbf{73.7} & \\hspace{-1em}{\\hgreen{(+11.2)}} & 88.2 & \\hspace{-1em}{\\hgreen{(+15.4)}} & 40.2 & \\hspace{-1em}{\\hgreen{(+2.9)}} & 94.3 & \\hspace{-1em}{\\hgreen{(+7.5)}} & \\textbf{75.9} & \\hspace{-1em}{\\hgreen{(+8.0)}}\\\\\nCLIP ViT-B\/16 & AdamW (freeze-embed) & 82.4 & \\hspace{-1em}{\\hgreen{(+2.4)}} & 69.5 & \\hspace{-1em}{\\hgreen{(+7.0)}} & 88.2 & \\hspace{-1em}{\\hgreen{(+15.4)}} & \\textbf{40.7} & \\hspace{-1em}{\\hgreen{(+3.4)}} & \\textbf{96.7} & \\hspace{-1em}{\\hgreen{(+9.9)}} & 75.5 & \\hspace{-1em}{\\hgreen{(+7.6)}}\\\\\n\\midrule\nCLIP ViT-L\/14 & SGD & 84.2 & & 65.0 & & 60.8 & & 41.0 & & 83.2 & & 66.8 & \\\\\nCLIP ViT-L\/14 & AdamW & 88.0 & \\hspace{-1em}{\\hgreen{(+3.8)}} & \\textbf{85.2} & \\hspace{-1em}{\\hgreen{(+20.2)}} & \\textbf{93.8} & \\hspace{-1em}{\\hgreen{(+33.0)}} & 48.3 & \\hspace{-1em}{\\hgreen{(+7.3)}} & 95.9 & \\hspace{-1em}{\\hgreen{(+12.7)}} & 82.2 & \\hspace{-1em}{\\hgreen{(+15.4)}}\\\\\nCLIP ViT-L\/14 & SGD (freeze-embed) & \\textbf{90.5} & \\hspace{-1em}{\\hgreen{(+6.3)}} & 84.7 & \\hspace{-1em}{\\hgreen{(+19.7)}} & 93.1 & \\hspace{-1em}{\\hgreen{(+32.3)}} & \\textbf{49.9} & \\hspace{-1em}{\\hgreen{(+8.9)}} & \\textbf{96.5} & \\hspace{-1em}{\\hgreen{(+13.3)}} & \\textbf{83.0} & \\hspace{-1em}{\\hgreen{(+16.2)}}\\\\\nCLIP ViT-L\/14 & AdamW (freeze-embed) & 88.0 & \\hspace{-1em}{\\hgreen{(+3.8)}} & 84.6 & \\hspace{-1em}{\\hgreen{(+19.6)}} & \\textbf{93.8} & \\hspace{-1em}{\\hgreen{(+33.0)}} & 44.6 & \\hspace{-1em}{\\hgreen{(+3.6)}} & \\textbf{96.4} & \\hspace{-1em}{\\hgreen{(+13.2)}} & 81.5 & \\hspace{-1em}{\\hgreen{(+14.7)}}\\\\\n\\midrule\nSup ViT-B\/16 & SGD & \\textbf{89.5} & & 77.4 & & \\textbf{86.3} & & 33.5 & & 92.6 & & 75.8 & \\\\\nSup ViT-B\/16 & AdamW & 88.3 & \\hspace{-1em}{\\hred{(-1.2)}} & 81.6 & \\hspace{-1em}{\\hgreen{(+4.2)}} & 84.4 & \\hspace{-1em}{\\hred{(-1.9)}} & \\textbf{35.9} & \\hspace{-1em}{\\hgreen{(+2.4)}} & 87.9 & \\hspace{-1em}{\\hred{(-4.7)}} & 75.6 & \\hspace{-1em}{\\hred{(-0.2)}}\\\\\nSup ViT-B\/16 & SGD (freeze-embed) & 88.0 & \\hspace{-1em}{\\hred{(-1.5)}} & \\textbf{82.4} & \\hspace{-1em}{\\hgreen{(+5.0)}} & \\textbf{86.3} & \\hspace{-1em}{\\lgreen{(+0.0)}} & 34.4 & \\hspace{-1em}{\\hgreen{(+0.9)}} & \\textbf{93.7} & \\hspace{-1em}{\\hgreen{(+1.1)}} & \\textbf{77.0} & \\hspace{-1em}{\\hgreen{(+1.2)}}\\\\\nSup ViT-B\/16 & AdamW (freeze-embed) & 88.1 & \\hspace{-1em}{\\hred{(-1.4)}} & \\textbf{82.4} & \\hspace{-1em}{\\hgreen{(+5.0)}} & 82.3 & \\hspace{-1em}{\\hred{(-4.0)}} & 35.7 & \\hspace{-1em}{\\hgreen{(+2.2)}} & 93.0 & \\hspace{-1em}{\\hgreen{(+0.4)}} & 76.3 & \\hspace{-1em}{\\hgreen{(+0.5)}}\\\\\n\\midrule\nDINO ViT-B\/16 & SGD & \\textbf{88.2} & & 56.1 & & 76.0 & & 33.6 & & 86.9 & & 68.2 & \\\\\nDINO ViT-B\/16 & AdamW & 87.4 & \\hspace{-1em}{\\hred{(-0.8)}} & 61.2 & \\hspace{-1em}{\\hgreen{(+5.1)}} & 77.4 & \\hspace{-1em}{\\hgreen{(+1.4)}} & \\textbf{35.8} & \\hspace{-1em}{\\hgreen{(+2.2)}} & 91.9 & \\hspace{-1em}{\\hgreen{(+5.0)}} & 70.7 & \\hspace{-1em}{\\hgreen{(+2.5)}}\\\\\nDINO ViT-B\/16 & SGD (freeze-embed) & 86.7 & \\hspace{-1em}{\\hred{(-1.5)}} & \\textbf{67.9} & \\hspace{-1em}{\\hgreen{(+11.8)}} & \\textbf{78.4} & \\hspace{-1em}{\\hgreen{(+2.4)}} & \\textbf{35.9} & \\hspace{-1em}{\\hgreen{(+2.3)}} & 90.6 & \\hspace{-1em}{\\hgreen{(+3.7)}} & \\textbf{71.9} & \\hspace{-1em}{\\hgreen{(+3.7)}}\\\\\nDINO ViT-B\/16 & AdamW (freeze-embed) & 86.8 & \\hspace{-1em}{\\hred{(-1.4)}} & 64.5 & \\hspace{-1em}{\\hgreen{(+8.4)}} & 76.6 & \\hspace{-1em}{\\hgreen{(+0.6)}} & 35.4 & \\hspace{-1em}{\\hgreen{(+1.8)}} & \\textbf{93.5} & \\hspace{-1em}{\\hgreen{(+6.6)}} & 71.4 & \\hspace{-1em}{\\hgreen{(+3.2)}}\\\\\n\\midrule\nConvNext-Base & SGD & \\textbf{94.0} & & 80.2 & & 89.8 & & 39.7 & & 83.0 & & 77.3 & \\\\\nConvNext-Base & AdamW & 90.3 & \\hspace{-1em}{\\hred{(-3.7)}} & 89.8 & \\hspace{-1em}{\\hgreen{(+9.6)}} & 89.5 & \\hspace{-1em}{\\hred{(-0.3)}} & 38.4 & \\hspace{-1em}{\\hred{(-1.3)}} & \\textbf{89.5} & \\hspace{-1em}{\\hgreen{(+6.5)}} & 79.5 & \\hspace{-1em}{\\hgreen{(+2.2)}}\\\\\nConvNext-Base & SGD (freeze-embed) & 92.6 & \\hspace{-1em}{\\hred{(-1.4)}} & 86.9 & \\hspace{-1em}{\\hgreen{(+6.7)}} & \\textbf{91.2} & \\hspace{-1em}{\\hgreen{(+1.4)}} & 38.2 & \\hspace{-1em}{\\hred{(-1.5)}} & 88.1 & \\hspace{-1em}{\\hgreen{(+5.1)}} & 79.4 & \\hspace{-1em}{\\hgreen{(+2.1)}}\\\\\nConvNext-Base & AdamW (freeze-embed) & 88.1 & \\hspace{-1em}{\\hred{(-5.9)}} & \\textbf{91.6} & \\hspace{-1em}{\\hgreen{(+11.4)}} & 89.8 & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{41.6} & \\hspace{-1em}{\\hgreen{(+1.9)}} & 87.7 & \\hspace{-1em}{\\hgreen{(+4.7)}} & \\textbf{79.8} & \\hspace{-1em}{\\hgreen{(+2.5)}}\\\\\n\\midrule\nBiT ResNet-50 & SGD & \\textbf{84.3} & & 76.5 & & 80.0 & & 34.1 & & 90.4 & & 73.1 & \\\\\nBiT ResNet-50 & AdamW & 83.1 & \\hspace{-1em}{\\hred{(-1.2)}} & 74.8 & \\hspace{-1em}{\\hred{(-1.7)}} & \\textbf{84.0} & \\hspace{-1em}{\\hgreen{(+4.0)}} & 33.8 & \\hspace{-1em}{\\hred{(-0.3)}} & 92.4 & \\hspace{-1em}{\\hgreen{(+2.0)}} & 73.6 & \\hspace{-1em}{\\hgreen{(+0.5)}}\\\\\nBiT ResNet-50 & SGD (freeze-embed) & 84.1 & \\hspace{-1em}{\\hred{(-0.2)}} & 75.5 & \\hspace{-1em}{\\hred{(-1.0)}} & 82.3 & \\hspace{-1em}{\\hgreen{(+2.3)}} & 35.0 & \\hspace{-1em}{\\hgreen{(+0.9)}} & \\textbf{95.2} & \\hspace{-1em}{\\hgreen{(+4.8)}} & 74.4 & \\hspace{-1em}{\\hgreen{(+1.3)}}\\\\\nBiT ResNet-50 & AdamW (freeze-embed) & 82.9 & \\hspace{-1em}{\\hred{(-1.4)}} & \\textbf{77.3} & \\hspace{-1em}{\\hgreen{(+0.8)}} & 83.3 & \\hspace{-1em}{\\hgreen{(+3.3)}} & \\textbf{36.3} & \\hspace{-1em}{\\hgreen{(+2.2)}} & 93.7 & \\hspace{-1em}{\\hgreen{(+3.3)}} & \\textbf{74.7} & \\hspace{-1em}{\\hgreen{(+1.6)}}\\\\\n\\midrule\nBiT ResNet-101 & SGD & 82.8 & & 76.9 & & \\textbf{86.2} & & \\textbf{38.0} & & 89.3 & & 74.6 & \\\\\nBiT ResNet-101 & AdamW & 82.9 & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{79.4} & \\hspace{-1em}{\\hgreen{(+2.5)}} & 83.5 & \\hspace{-1em}{\\hred{(-2.7)}} & 37.0 & \\hspace{-1em}{\\hred{(-1.0)}} & 89.7 & \\hspace{-1em}{\\hgreen{(+0.4)}} & 74.5 & \\hspace{-1em}{\\lred{(-0.1)}}\\\\\nBiT ResNet-101 & SGD (freeze-embed) & 83.1 & \\hspace{-1em}{\\hgreen{(+0.3)}} & 77.3 & \\hspace{-1em}{\\hgreen{(+0.4)}} & 86.0 & \\hspace{-1em}{\\hred{(-0.2)}} & 36.0 & \\hspace{-1em}{\\hred{(-2.0)}} & \\textbf{95.5} & \\hspace{-1em}{\\hgreen{(+6.2)}} & 75.6 & \\hspace{-1em}{\\hgreen{(+1.0)}}\\\\\nBiT ResNet-101 & AdamW (freeze-embed) & \\textbf{84.8} & \\hspace{-1em}{\\hgreen{(+2.0)}} & 78.3 & \\hspace{-1em}{\\hgreen{(+1.4)}} & 84.3 & \\hspace{-1em}{\\hred{(-1.9)}} & \\textbf{38.2} & \\hspace{-1em}{\\lgreen{(+0.2)}} & 95.0 & \\hspace{-1em}{\\hgreen{(+5.7)}} & \\textbf{76.1} & \\hspace{-1em}{\\hgreen{(+1.5)}}\\\\\n\\bottomrule\n\\end{tabular}\n}\n\\end{center}\n\\label{tab:ood_bigtable_adamw_freeze}\n\\end{table}\n\n\n\n\n\n\\begin{table}[h!]\n \\small \n\\caption{\n\\textbf{In-distribution (ID)} accuracies with AdamW (freeze-embed). This is an expansion of Table~\\ref{tab:id_bigtable_final}\nto include AdamW (freeze-embed) ID results for our 7 models and 5 datasets. AdamW, AdamW (freeze-embed), and SGD (freeze-embed) all perform comparably on ID accuracies. \n}\n\\label{tab:id_bigtable_adamw_freeze}\n\\begin{center}\n\\resizebox{\\textwidth}{!}{\n\\begin{tabular}{cccccccccccc|cc}\n\\toprule\n & & \\multicolumn{2}{c}{Living-17} & \\multicolumn{2}{c}{Waterbirds} & \\multicolumn{2}{c}{DomainNet} & \\multicolumn{2}{c}{FMoW} & \\multicolumn{2}{c}{Camelyon} & \\multicolumn{2}{c}{Avg.} \\\\\n\\midrule\nCLIP ViT-B\/16 & SGD & 97.8 & & 97.2 & & 88.8 & & 67.0 & & \\textbf{99.4} & & 90.0 & \\\\\nCLIP ViT-B\/16 & AdamW & \\textbf{98.1} & \\hspace{-1em}{\\hgreen{(+0.3)}} & \\textbf{97.7} & \\hspace{-1em}{\\hgreen{(+0.5)}} & 95.0 & \\hspace{-1em}{\\hgreen{(+6.2)}} & 70.1 & \\hspace{-1em}{\\hgreen{(+3.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{92.1} & \\hspace{-1em}{\\hgreen{(+2.1)}}\\\\\nCLIP ViT-B\/16 & SGD (freeze-embed) & \\textbf{98.2} & \\hspace{-1em}{\\hgreen{(+0.4)}} & \\textbf{97.8} & \\hspace{-1em}{\\hgreen{(+0.6)}} & 94.9 & \\hspace{-1em}{\\hgreen{(+6.1)}} & 70.0 & \\hspace{-1em}{\\hgreen{(+3.0)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & 92.1 & \\hspace{-1em}{\\hgreen{(+2.1)}}\\\\\nCLIP ViT-B\/16 & AdamW (freeze-embed) & \\textbf{98.3} & \\hspace{-1em}{\\hgreen{(+0.5)}} & \\textbf{97.8} & \\hspace{-1em}{\\hgreen{(+0.6)}} & \\textbf{95.3} & \\hspace{-1em}{\\hgreen{(+6.5)}} & \\textbf{70.5} & \\hspace{-1em}{\\hgreen{(+3.5)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{92.3} & \\hspace{-1em}{\\hgreen{(+2.3)}}\\\\\n\\midrule\nCLIP ViT-L\/14 & SGD & 98.4 & & 97.3 & & 84.3 & & 69.0 & & \\textbf{99.4} & & 89.7 & \\\\\nCLIP ViT-L\/14 & AdamW & \\textbf{98.9} & \\hspace{-1em}{\\hgreen{(+0.5)}} & \\textbf{98.8} & \\hspace{-1em}{\\hgreen{(+1.5)}} & 96.9 & \\hspace{-1em}{\\hgreen{(+12.6)}} & 74.5 & \\hspace{-1em}{\\hgreen{(+5.5)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{93.7} & \\hspace{-1em}{\\hgreen{(+4.0)}}\\\\\nCLIP ViT-L\/14 & SGD (freeze-embed) & \\textbf{98.7} & \\hspace{-1em}{\\hgreen{(+0.3)}} & \\textbf{98.9} & \\hspace{-1em}{\\hgreen{(+1.6)}} & \\textbf{97.1} & \\hspace{-1em}{\\hgreen{(+12.8)}} & 74.5 & \\hspace{-1em}{\\hgreen{(+5.5)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{93.7} & \\hspace{-1em}{\\hgreen{(+4.0)}}\\\\\nCLIP ViT-L\/14 & AdamW (freeze-embed) & \\textbf{98.7} & \\hspace{-1em}{\\hgreen{(+0.3)}} & \\textbf{98.8} & \\hspace{-1em}{\\hgreen{(+1.5)}} & 96.7 & \\hspace{-1em}{\\hgreen{(+12.4)}} & \\textbf{75.1} & \\hspace{-1em}{\\hgreen{(+6.1)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{93.8} & \\hspace{-1em}{\\hgreen{(+4.1)}}\\\\\n\\midrule\nSup ViT-B\/16 & SGD & \\textbf{98.6} & & \\textbf{99.1} & & \\textbf{91.7} & & 64.1 & & \\textbf{99.4} & & 90.6 & \\\\\nSup ViT-B\/16 & AdamW & \\textbf{98.7} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{99.0} & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{91.7} & \\hspace{-1em}{\\lred{(-0.0)}} & 66.4 & \\hspace{-1em}{\\hgreen{(+2.3)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{91.1} & \\hspace{-1em}{\\hgreen{(+0.5)}}\\\\\nSup ViT-B\/16 & SGD (freeze-embed) & \\textbf{98.7} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{99.2} & \\hspace{-1em}{\\lgreen{(+0.1)}} & 91.5 & \\hspace{-1em}{\\hred{(-0.2)}} & 65.0 & \\hspace{-1em}{\\hgreen{(+0.9)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & 90.8 & \\hspace{-1em}{\\hgreen{(+0.2)}}\\\\\nSup ViT-B\/16 & AdamW (freeze-embed) & \\textbf{98.6} & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{99.0} & \\hspace{-1em}{\\lred{(-0.1)}} & 90.9 & \\hspace{-1em}{\\hred{(-0.8)}} & \\textbf{66.8} & \\hspace{-1em}{\\hgreen{(+2.7)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{91.0} & \\hspace{-1em}{\\hgreen{(+0.4)}}\\\\\n\\midrule\nDINO ViT-B\/16 & SGD & \\textbf{98.4} & & 97.0 & & 88.2 & & 62.4 & & 99.4 & & 89.1 & \\\\\nDINO ViT-B\/16 & AdamW & \\textbf{98.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{97.9} & \\hspace{-1em}{\\hgreen{(+0.9)}} & 89.4 & \\hspace{-1em}{\\hgreen{(+1.2)}} & \\textbf{66.0} & \\hspace{-1em}{\\hgreen{(+3.6)}} & \\textbf{99.6} & \\hspace{-1em}{\\hgreen{(+0.2)}} & \\textbf{90.3} & \\hspace{-1em}{\\hgreen{(+1.2)}}\\\\\nDINO ViT-B\/16 & SGD (freeze-embed) & \\textbf{98.4} & \\hspace{-1em}{\\lgreen{(+0.0)}} & 97.5 & \\hspace{-1em}{\\hgreen{(+0.5)}} & 89.0 & \\hspace{-1em}{\\hgreen{(+0.8)}} & 63.5 & \\hspace{-1em}{\\hgreen{(+1.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & 89.6 & \\hspace{-1em}{\\hgreen{(+0.5)}}\\\\\nDINO ViT-B\/16 & AdamW (freeze-embed) & \\textbf{98.4} & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{97.8} & \\hspace{-1em}{\\hgreen{(+0.8)}} & \\textbf{89.7} & \\hspace{-1em}{\\hgreen{(+1.5)}} & 65.7 & \\hspace{-1em}{\\hgreen{(+3.3)}} & \\textbf{99.6} & \\hspace{-1em}{\\hgreen{(+0.2)}} & \\textbf{90.3} & \\hspace{-1em}{\\hgreen{(+1.2)}}\\\\\n\\midrule\nConvNext-Base & SGD & \\textbf{98.7} & & 99.0 & & 94.8 & & 66.3 & & 99.4 & & 91.6 & \\\\\nConvNext-Base & AdamW & \\textbf{98.6} & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\hgreen{(+0.5)}} & 94.5 & \\hspace{-1em}{\\hred{(-0.3)}} & 68.8 & \\hspace{-1em}{\\hgreen{(+2.5)}} & \\textbf{99.7} & \\hspace{-1em}{\\hgreen{(+0.3)}} & \\textbf{92.2} & \\hspace{-1em}{\\hgreen{(+0.6)}}\\\\\nConvNext-Base & SGD (freeze-embed) & \\textbf{98.6} & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{99.4} & \\hspace{-1em}{\\hgreen{(+0.4)}} & \\textbf{95.1} & \\hspace{-1em}{\\hgreen{(+0.3)}} & 67.4 & \\hspace{-1em}{\\hgreen{(+1.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & 92.0 & \\hspace{-1em}{\\hgreen{(+0.4)}}\\\\\nConvNext-Base & AdamW (freeze-embed) & \\textbf{98.7} & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{99.5} & \\hspace{-1em}{\\hgreen{(+0.5)}} & 94.7 & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{69.2} & \\hspace{-1em}{\\hgreen{(+2.9)}} & \\textbf{99.6} & \\hspace{-1em}{\\hgreen{(+0.2)}} & \\textbf{92.4} & \\hspace{-1em}{\\hgreen{(+0.8)}}\\\\\n\\midrule\nBiT ResNet-50 & SGD & 97.4 & & \\textbf{98.4} & & \\textbf{89.3} & & 64.6 & & \\textbf{99.5} & & \\textbf{89.8} & \\\\\nBiT ResNet-50 & AdamW & 97.2 & \\hspace{-1em}{\\hred{(-0.2)}} & \\textbf{98.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{89.2} & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{65.1} & \\hspace{-1em}{\\hgreen{(+0.5)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{89.9} & \\hspace{-1em}{\\lgreen{(+0.1)}}\\\\\nBiT ResNet-50 & SGD (freeze-embed) & \\textbf{97.6} & \\hspace{-1em}{\\hgreen{(+0.2)}} & \\textbf{98.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{89.2} & \\hspace{-1em}{\\lred{(-0.1)}} & 64.8 & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{89.9} & \\hspace{-1em}{\\lgreen{(+0.1)}}\\\\\nBiT ResNet-50 & AdamW (freeze-embed) & \\textbf{97.4} & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{98.4} & \\hspace{-1em}{\\lred{(-0.0)}} & \\textbf{89.1} & \\hspace{-1em}{\\hred{(-0.2)}} & 64.9 & \\hspace{-1em}{\\hgreen{(+0.3)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{89.9} & \\hspace{-1em}{\\lgreen{(+0.1)}}\\\\\n\\midrule\nBiT ResNet-101 & SGD & \\textbf{98.3} & & \\textbf{98.9} & & \\textbf{92.0} & & 66.0 & & \\textbf{99.4} & & \\textbf{90.9} & \\\\\nBiT ResNet-101 & AdamW & \\textbf{98.4} & \\hspace{-1em}{\\lgreen{(+0.1)}} & 98.6 & \\hspace{-1em}{\\hred{(-0.3)}} & 91.1 & \\hspace{-1em}{\\hred{(-0.9)}} & \\textbf{67.0} & \\hspace{-1em}{\\hgreen{(+1.0)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{90.9} & \\hspace{-1em}{\\lred{(-0.0)}}\\\\\nBiT ResNet-101 & SGD (freeze-embed) & \\textbf{98.4} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{98.8} & \\hspace{-1em}{\\lred{(-0.1)}} & 91.5 & \\hspace{-1em}{\\hred{(-0.5)}} & 65.9 & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{90.8} & \\hspace{-1em}{\\lred{(-0.1)}}\\\\\nBiT ResNet-101 & AdamW (freeze-embed) & \\textbf{98.2} & \\hspace{-1em}{\\lred{(-0.1)}} & 98.7 & \\hspace{-1em}{\\hred{(-0.2)}} & 91.1 & \\hspace{-1em}{\\hred{(-0.9)}} & 66.6 & \\hspace{-1em}{\\hgreen{(+0.6)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{90.9} & \\hspace{-1em}{\\lred{(-0.0)}}\\\\\n\\bottomrule\n\\end{tabular}\n}\n\\end{center}\n\\end{table}\n\n\n\n\n\n\n\n\n\\section{Ablations on CLIP}\nIn Tables~\\ref{tab:ood_clip_all_optimizers_ablation}-\\ref{tab:id_clip_all_optimizers_ablation}, we show additional ablations for the CLIP ViT-B\/16 model on all datasets.\\footnote{Running each ablation for all models on all datasets is too computationally expensive.} \nWe tried:\n\\begin{enumerate}[1.]\n %\n \\item SGD (freeze-embed, not layer-norm): For the CLIP model our freeze-embed variation freezes the bottom embedding layer along with the layernorm right after that. We ran an ablation where we only freeze the bottom linear embedding layer, but not the layer norm. This performs comparably with SGD (freeze-embed), which suggests that freezing the input layer is what's important, and the layer norm does not matter much.\n \\item SGD (no momentum): Since SGD (freeze-embed, no momentum) performed very well in our experiments, we also tried fine-tuning with full SGD (no freezing), but without momentum. We found that SGD (no momentum) and SGD perform comparable.\n \\item SGD (weight decay): Vanilla SGD is done without weight decay, but AdamW incorporates weight decay. We ran this ablation to confirm that the gains of AdamW are not because of weight decay. We used the torch SGD optimizer, and set the weight\\_decay argument to 0.01. Indeed, we found that SGD and SGD (weight decay) perform comparably, which suggests that weight\\_decay is not the reason for the improved performance of AdamW.\n \\item Linear probing: We freeze the pretrained model, and only train a linear probe on the features of the CLIP ViT-B\/16 model. We train a logistic regression classifier using the sklearn library, sweeping over 50 regularization values in np.logspace$(-7, 2, 5)$\n\\end{enumerate}\n\n\\begin{table}[ht]\n \\small \n\\caption{\n\\textbf{Out-of-distribution (OOD)} accuracy of more optimizers on CLIP ViT-B\/16. We find that weight decay, momentum, and unfreezing the layer norm at the bottom of the model do not make much of a difference.\n}\n\\label{tab:ood_clip_all_optimizers_ablation}\n\\begin{center}\n\\resizebox{0.89\\textwidth}{!}{\n\\begin{tabular}{lccccc|c}\n\\toprule\n & Living-17 & Waterbirds & DomainNet & FMoW & Camelyon & Avg.\\\\\n\\midrule\nSGD & 80.0 & 62.5 & 72.8 & 37.3 & 86.8 & 67.9\\\\\nAdamW & 82.8 & 71.9 & 89.2 & \\textbf{40.7} & 95.7 & 76.0\\\\\n\\midrule \n\\multicolumn{6}{l|}{\\textit{Our methods}}&\\vspace{0.05in}\\\\\nSGD (freeze-embed) & 83.2 & 73.7 & 88.2 & 40.2 & 94.3 & 75.9\\\\\nSGD (freeze-embed, no momentum) & 83.1 & \\textbf{80.4} & 89.0 & 38.8 & 93.3 & \\textbf{76.9}\\\\\nGradual-unfreezing & 81.9 & 69.1 & \\textbf{93.2} & \\textbf{40.5} & \\textbf{96.5} & 76.2\\\\\n\\midrule\n\\multicolumn{6}{l|}{\\textit{Other layerwise normalization methods}}&\\vspace{0.05in}\\\\\nLAMB & 79.5 & 64.0 & 90.4 & 38.8 & 93.4 & 73.2\\\\\nLARS & 83.9 & 48.6 & 83.8 & 38.6 & 93.3 & 69.6\\\\\n\\midrule\n\\multicolumn{6}{l|}{\\textit{Variations of SGD (freeze-embed)}}&\\vspace{0.05in}\\\\\nSGD (freeze-embed, not layer-norm) & 83.6 & 74.3 & 89.1 & 39.3 & 92.9 & 75.9\\\\\nOther freezing: Linear probing & \\textbf{86.2} & 60.4 & 89.1 & 29.0 & 92.6 & 71.5 \\\\\n\\midrule\n\\multicolumn{6}{l|}{\\textit{Variations of SGD without any freezing}}&\\vspace{0.05in}\\\\\nSGD (no momentum) & 81.4 & 59.2 & 76.7 & 37.9 & 84.3 & 67.9\\\\\nSGD (weight decay) & 83.9 & 65.1 & 67.5 & 37.1 & 85.6 & 67.8\\\\\n\\bottomrule\n\\end{tabular}\n}\n\\end{center}\n\\end{table}\n\n\n\\begin{table}[ht]\n \\small \n\\caption{\n\\textbf{In-distribution (ID)} accuracy of more optimizers on CLIP ViT-B\/16. We find that weight decay, momentum, and unfreezing the layer norm at the bottom of the model do not make much of a difference.\n}\n\\label{tab:id_clip_all_optimizers_ablation}\n\\begin{center}\n\\resizebox{0.89\\textwidth}{!}{\n\\begin{tabular}{lccccc|c}\n\\toprule\n & Living-17 & Waterbirds & DomainNet & FMoW & Camelyon & Avg.\\\\\n\\midrule\nSGD & 97.8 & 97.2 & 88.8 & 67.0 & \\textbf{99.4} & 90.0\\\\\nAdamW & 98.1 & 97.7 & 95.0 & \\textbf{70.1} & \\textbf{99.5} & \\textbf{92.1}\\\\\n\\midrule \n\\multicolumn{6}{l|}{\\textit{Our methods}}&\\vspace{0.05in}\\\\\nSGD (freeze-embed) & \\textbf{98.2} & 97.8 & 94.9 & \\textbf{70.0} & \\textbf{99.5} & \\textbf{92.1}\\\\\nSGD (freeze-embed, no momentum) & \\textbf{98.2} & 97.9 & 95.2 & \\textbf{70.1} & \\textbf{99.5} & \\textbf{92.2}\\\\\nGradual-unfreezing & \\textbf{98.3} & \\textbf{98.3} & \\textbf{96.3} & 69.2 & 99.3 & \\textbf{92.3}\\\\\n\\midrule\n\\multicolumn{6}{l|}{\\textit{Other layerwise normalization methods}}&\\vspace{0.05in}\\\\\nLAMB & \\textbf{98.2} & 97.8 & 95.1 & 67.9 & \\textbf{99.5} & 91.7\\\\\nLARS & 97.7 & 97.1 & 93.2 & 67.0 & 99.3 & 90.9\\\\\n\\midrule\n\\multicolumn{6}{l|}{\\textit{Variations of SGD (freeze-embed)}}&\\vspace{0.05in}\\\\\nSGD (freeze-embed, not layer-norm) & 98.0 & 98.0 & 95.4 & \\textbf{70.2} & \\textbf{99.5} & \\textbf{92.2}\\\\\nOther freezing: Linear probing & 97.8 & 96.6 & 94.5 & 47.2 & 96.1 & 86.4 \\\\\n\\midrule \n\\multicolumn{6}{l|}{\\textit{Variations of SGD without any freezing}}&\\vspace{0.05in}\\\\\nSGD (no momentum) & 98.0 & 97.1 & 89.5 & 66.4 & 99.3 & 90.1\\\\\nSGD (weight decay) & 97.6 & 97.2 & 87.9 & 66.4 & 99.3 & 89.7\\\\\n\\bottomrule\n\\end{tabular}\n}\n\\end{center}\n\\end{table}\n\n\\\n\n\n\\section{Additional plots on gradient norms at the pretrained initialization}\\label{app:gradnorm}\n\nIn Figure~\\ref{fig:gradient_norm_others} we show plots for the gradients norms at different layers for Living-17 and Waterbirds. These are analogous to Figure~\\ref{fig:gradient_norm} for DomainNet in the main paper. We again see that, among the pretrained layers, the embedding layer has much higher gradients in the modern architectures. \n\nWe also consider two ways of normalizing the gradient magnitude. In the first method, we divide the norm of the gradient by the norm of the parameters in order to capture the relative ``movement'' in the first SGD step as opposed to the absolute ``movement'' which is captured by gradient norm itself. In the second method, we divide the norm of the gradient by the square root of the number of parameters. This is to check that a layer does not simply have a larger gradient because it has more parameters. The reason we use square root is as follows: suppose each parameter has gradient $\\approx c$, then the layerwise gradient norm scales with the square root of the number of parameters. Also, the first step of AdamW update is essentially a signed gradient descent step, wherein if we ignore weight decay, the per-layer ``movement'' is the square root of the number of parameters. So this normalization can be thought of as relative size of SGD update compared to AdamW in each layer at initialization. For visualization purposes, we exclude the `head' layer gradient in these plots as they often much larger than the others so the plots become hard to see if we include the `head' layer. Note that we expect the head layer to have higher gradients because it is randomly initialized~\\citep{kumar2022finetuning}. For ViT models, we omit gradients of the cls token, position embedding, and layer norm after the embedding layer.\n\n\n\n\n\\begin{figure}[htb]\n\\centering\n \\begin{subfigure}{\\textwidth}\n \\centering\n \\includegraphics[width=0.76\\textwidth]{figures\/living17_grad_plot.png}\n \\caption{Layer-wise gradient norms on Living-17 at pretrained initialization} \n \\end{subfigure}\\\\\n \n \\begin{subfigure}{\\textwidth}\n \\centering\n \\includegraphics[width=0.76\\textwidth]{figures\/waterbirds_grad_plot.png}\n \\caption{Layer-wise gradient norms on Waterbirds at pretrained initialization} \n \\end{subfigure}\n \\caption{\n We visualize the layer-wise gradient norms our models on (a) Living-17 and (b) Waterbirds, at the pretrained initialization. The format is the same as Figure~\\ref{fig:gradient_norm}: gradient norms of ``embedding'', ``head'', and ``middle'' layers are shown as \\hred{\\textbf{red-squares}}, \\hgreen{\\textbf{green-triangles}} and \\textbf{black-circles}, respectively.\n }\n \\label{fig:gradient_norm_others}\n\\end{figure}\n\n\n\\begin{figure}[htb]\n\\centering\n \\begin{subfigure}{\\textwidth}\n \\centering\n \\includegraphics[width=0.76\\textwidth]{figures\/domainnet_grad_plot_normalized.png}\n \\caption{Layer-wise gradient norms divided by parameter norm, on DomainNet at pretrained initialization} \n \\end{subfigure}\\\\\n\n \\begin{subfigure}{\\textwidth}\n \\centering\n \\includegraphics[width=0.76\\textwidth]{figures\/living17_grad_plot_normalized.png}\n \\caption{Layer-wise gradient norms divided by parameter norm, on Living-17 at pretrained initialization} \n \\end{subfigure}\\\\\n \n \\begin{subfigure}{\\textwidth}\n \\centering\n \\includegraphics[width=0.76\\textwidth]{figures\/waterbirds_grad_plot_normalized.png}\n \\caption{Layer-wise gradient norms divided by parameter norm, on Waterbirds at pretrained initialization} \n \\end{subfigure}\n \\caption{\n We visualize the layer-wise gradient norm, \\textbf{divided by the norm of the parameters} on (a) DomainNet, (b) Living-17, and (c) Waterbirds, at the pretrained initialization. For better visualization, we omit the head from the plot, which predictably has much larger gradients than the others (since it is randomly initialized). The format is the same as Figure~\\ref{fig:gradient_norm}: gradient norms of ``embedding'' and ``middle'' layers are shown as \\hred{\\textbf{red-squares}} and \\textbf{black-circles}, respectively. Under this normalization scheme, the embedding layer has higher gradients than the other layers in all models. However, the gradient is only slightly larger for ResNet models, and substantially larger for the Vision Transformer models---which also provides support for why freezing the embedding layer in Vision Transformers might make a larger difference.\n }\n \\label{fig:gradient_norm_normalized}\n\\end{figure}\n\n\n\\begin{figure}[htb]\n\\centering\n \\begin{subfigure}{\\textwidth}\n \\centering\n \\includegraphics[width=0.76\\textwidth]{figures\/domainnet_grad_plot_param_normalized.png}\n \\caption{Layer-wise gradient norms divided by $\\sqrt{\\text{\\#parameters}}$, on DomainNet at pretrained initialization} \n \\end{subfigure}\\\\\n\n \\begin{subfigure}{\\textwidth}\n \\centering\n \\includegraphics[width=0.76\\textwidth]{figures\/living17_grad_plot_param_normalized.png}\n \\caption{Layer-wise gradient norms divided by $\\sqrt{\\text{\\#parameters}}$, on Living-17 at pretrained initialization} \n \\end{subfigure}\\\\\n \n \\begin{subfigure}{\\textwidth}\n \\centering\n \\includegraphics[width=0.76\\textwidth]{figures\/waterbirds_grad_plot_param_normalized.png}\n \\caption{Layer-wise gradient norms divided by $\\sqrt{\\text{\\#parameters}}$, on Waterbirds at pretrained initialization} \n \\end{subfigure}\n \\caption{\n We visualize the layer-wise gradient norm, \\textbf{divided by the square root of the number of parameters} on (a) DomainNet, (b) Living-17, and (c) Waterbirds, at the pretrained initialization. For better visualization, we omit the head from the plot which has predictably much larger than the others (since it is randomly initialized). The format is the same as Figure~\\ref{fig:gradient_norm}: gradient norms of ``embedding'' and ``middle'' layers are shown as \\hred{\\textbf{red-squares}} and \\textbf{black-circles}, respectively. Under this normalization, we see that the gradients of the embedding layer are much larger than the other layers in all models, including ResNets. \n }\n \\label{fig:gradient_norm_param_normalized}\n\\end{figure}\n\n\\remove{\n\\section{Check}\n\n\\subsection{Best Results with SGD (Freeze-embed)}\n\nIn Table~\\ref{tab:sgd_freeze_best} we show the best results in our paper when using SGD (Freeze-embed).\n\n\\begin{table}[]\n\\caption{\nOur best result using SGD (Freeze-embed) outperforms previous state-of-the-art in 4\/5 datasets---all datasets except Waterbirds.\nThe difference with Table~\\ref{tab:sota_results} is that Table~\\ref{tab:sota_results} shows our best results across models and optimizers, and here we show the best results for SGD (Freeze-embed).\n}\n\\label{tab:sgd_freeze_best}\n\\vskip 0.1in\n\\begin{center}\n\\begin{tabular}{cccccc}\n\\toprule\n & Liv-17 & Waterbirds & DomainNet & FMoW & Camelyon\\\\\n\\midrule\n\\begin{tabular}{@{}c@{}}Best prior \\\\ result \\end{tabular} & 87.6 & \\textbf{89.3} & 87.2 & 47.6 & 93.3 \\\\\n\\midrule\n\\vspace{0.03in}\n\\begin{tabular}{@{}c@{}}Our best \\\\ result \\end{tabular} & \\textbf{90.5} & 86.9 & \\textbf{93.1} & \\textbf{49.9} & \\textbf{96.5} \\\\\n\\vspace{0.08in}\nOptimizer & \\begin{tabular}{@{}c@{}}SGD \\\\ Freeze-Embed \\end{tabular} & \\begin{tabular}{@{}c@{}}SGD \\\\ Freeze-Embed \\end{tabular} & \\begin{tabular}{@{}c@{}}SGD \\\\ Freeze-Embed \\end{tabular} & \\begin{tabular}{@{}c@{}}SGD \\\\ Freeze-Embed \\end{tabular} & \\begin{tabular}{@{}c@{}}SGD \\\\ Freeze-Embed \\end{tabular} \\\\\n\\vspace{0.015in}\nModel & CLIP-ViT-L\/14 & ConvNeXt-B & CLIP-ViT-L\/14 & CLIP-ViT-L\/14 & CLIP-ViT-L\/14 \\\\\n\\bottomrule\n\\end{tabular}\n\\end{center}\n\\end{table}\n}\n\\section{Profiling GPU Memory}\n\\label{app:profiling_gpu_memory}\n\nWe profiled the GPU memory consumption of 4 fine-tuning methods, on 3 models on a Titan-X GPU with 12.2 GB of GPU memory.\nThe profiling was done using Weights and Biases and measures the total GPU memory utilization (so includes weights, activations, etc.).\nThe four methods we profiled are: SGD, AdamW, SGD (freeze-embed), SGD (freeze-embed, no momentum).\nWe profiled these on three models: CLIP-ViT B\/16, CLIP ViT-L\/14, and OpenCLIP ViT-H\/14---the original CLIP model only scales up to ViT-L\/14, so we used the OpenCLIP~\\citep{ilharco_gabriel_2021_5143773} for ViT-H\/14.\nWe used a batch size of 32 and do gradient accumulation with micro-batch size of 1---i.e., we calculate the gradients one sample at a time and accumulate them before calling the optimizer update. \n\nWe show results below in Table~\\ref{tab:clip_memory_profiling_results}. On a ViT-B\/16, AdamW uses $16\\%$ and $36\\%$ more memory than SGD (freeze-embed) and SGD (freeze-embed, no momentum), respectively. The gains are better for larger models: on a ViT-L\/14, AdamW uses $18\\%$ and $48\\%$ more memory respectively. On a ViT-H\/14, AdamW runs out of memory, while SGD (freeze-embed) and SGD (freeze-embed, no momentum) are able to run, showing that the gains are at least $20\\%$ and $60\\%$ respectively.\n\n\\begin{table}\n\\vspace{-10pt}\n\\caption{We profile the GPU memory consumption of four optimization methods on three CLIP models of varying sizes, on a Titan-X GPU. SGD (freeze-embed) gives practical gains over AdamW, especially if we drop the momentum parameter. The largest CLIP ViT-H\/14 does not fit in GPU memory when using AdamW, but fits in memory with other optimizers. Note that the freeze-embed methods perform competitively or better than AdamW on accuracy, as shown in Table~\\ref{tab:clip_results}.}\n\\label{tab:clip_memory_profiling_results}\n\\centering\n\\vspace{-7pt}\n\\resizebox{0.9\\textwidth}{!}{\n\\begin{tabular}{cccc}\n\\toprule\n & {CLIP ViT-B\/16} & { CLIP ViT-L\/14} & { CLIP ViT-H\/14} \\\\\n\\midrule\n{ AdamW} & 2.7 GB & 7.1 GB & Out-of-Memory \\\\\n{ SGD} & 2.3 GB & 6.1 GB & 10.1 GB \\\\\n\\midrule\nSGD (freeze-embed) & 2.3 GB & 6.1 GB & 10.1 GB \\\\\nSGD (freeze-embed, no momentum) & \\textbf{2.0 GB} & \\textbf{4.8 GB} & \\textbf{7.6 GB} \\\\\n\\bottomrule\n\\end{tabular}\n}\n\\end{table}\n\nFor large models, it is common to use additional tricks like gradient checkpointing to reduce the activation memory. That is, for a speed penalty (at most 2x), we only need to store activations in $\\sqrt{L}$ of $L$ layers when doing backpropagation. Gradient checkpointing would further increase our gains over AdamW since they do not change the memory consumed by the weights but can substantially decrease the memory consumed by the model's activations.\n\n\\section{Additional training details} \\label{app:setup}\n\\paragraph{SGD and AdamW updates.} We start with initialization $\\theta^{(0)}=\\theta^{\\mathsf{pretrain}}$. Given hyperparameters, minibatch size $batch\\_size$ and number of epochs $num\\_epochs$, our algorithms run for $T=\\frac{num\\_epochs\\cdot{|D_{\\mathsf{train}}|}}{batch\\_size}$ steps. At steps $t=0,1,\\ldots, T$, we select a randomly shuffled minibatch $B_t$ from $D_{\\mathsf{train}}$ (reshuffled at end of each epoch) and compute the minibatch stochastic gradient $g_t = \\frac{1}{|B_t|}\\sum_{(x,y)\\in B_t}\\nabla_\\theta l(f_\\theta(x),y)$. The parameters $\\theta^{(t)}$ are updated as follows.\n\n For SGD, in addition to gradients $g_t$ and weights $\\theta^{(t)}$, we maintain first order momentum estimate $m_t$ as optimizer state, initialized as $m_{-1}=0$. The SGD($\\eta_t,\\mu,\\lambda$) update with $\\eta_t$ learning rate, $\\mu$ momentum, and $\\lambda$ weight decay, is given by\n \\begin{equation*}\n \\begin{split}\n g_t &= g_t +\\lambda \\theta^{(t)}\\\\\n m_t &= \\mu m_{t-1}+g_t\\quad(\\text{first moment})\\\\\n \\theta^{(t+1)} &= \\theta^{(t)}-\\eta_t m_t\n \\end{split}\n \\end{equation*}\n\nFor AdamW, we maintain two additional optimizer states: the first moment estimate $m_t$ and second moment estimate $v_t$, initialized as $m_{-1}= v_{-1}=0$. The AdamW($\\eta_t,\\beta_1,\\beta_2,\\lambda$) update with $\\eta_t$ learning rate, $(\\beta_1,\\beta_2)$ betas, and $\\lambda$ weight decay is given by\n \\begin{equation*}\n \\begin{split}\n %\n m_t &= \\beta_1 m_{t-1}+ (1-\\beta_1) g_t \\; \\quad(\\text{first moment})\\\\\n v_t &= \\beta_2 v_{t-1}+ (1-\\beta_2) g_t^{\\odot 2} \\quad(\\text{second moment})\\\\\n \\hat{m}_t &= \\frac{m_t}{(1-\\beta_1^t)};\\;\\quad \\hat{v}_t = \\frac{v_t}{(1-\\beta_2^t)}\\\\\n \\theta^{(t+1)} &= (1-\\eta_t\\lambda)\\theta^{(t)}-\\eta_t \\frac{\\hat{m}_t}{\\sqrt{\\hat{v}_t}+\\epsilon}\n \\end{split}\n \\end{equation*}\n\n\n\\paragraph{Hyperparameter details}\n\\begin{itemize}\n \\item \\textbf{Learning rate. }We sweep over 6 learning rates for SGD ([3e-5, 1e-4, 3e-4, 1e-3, 3e-3, 1e-2]) and for AdamW ([3e-7, 1e-6, 3e-6, 1e-5, 3e-5, 1e-4]). As standard, we use smaller learning rates for AdamW because they work better. We check that the best learning rate is in the middle of this grid for each model and dataset. The best learning rate is chosen based on ID validation accuracy. \n \\item \\textbf{Other optimizer parameters. } We use all the default options for SGD and AdamW in pytorch except set the SGD momentum parameter to 0.9. The other default options are: for SGD, the weight decay is 0 and we use momentum without dampening, and for AdamW, the weight decay is 0.01, betas are (0.9,0.999) and epsilon is 1e-08.\n \\item \\textbf{Number of epochs. }We train for 20 epochs on Living-17, 20 epochs on Waterbirds, 50 epochs on DomainNet, 5 epochs on WILDS-FMoW, and 3 epochs on Camelyon. We use the same number of training epochs for all the optimizer methods we report results on. \n \\item \\textbf{Learning rate schedule. } With the exception of \\textit{Gradual-unfreezing} in Table~\\ref{tab:clip_results}, we use a cosine learning rate schedule and decay the starting learning rate to $0$ over the course of $T$ training steps. Learning rates schedule for \\textit{Gradual-unfreezing} is described below. \n \\item \\textbf{Learning rate schedule for gradual unfreezing.} For gradual unfreezing, we do not use a cosine learning rate scheduler. Instead, at epoch $t$ ($0$-indexed) out of $T$, we multiply the base learning rate by $\\exp(3.73 * (1.0 - t\/(T-1)))$. This means we multiply the learning rate by $\\exp(3.73) \\approx 41.7$ in epoch $0$, and by $1$ in the last epoch. The intuition is that when we are tuning a smaller number of layers we need a higher learning rate than for full fine-tuning---for example, the optimal learning rates for head tuning is higher than the optimal learning rate for full fine-tuning. The exact constant (3.73) was selected by comparing the optimal learning rate for head tuning with full fine-tuning on Waterbirds (the optimal learning rate for head-tuning was approximately $\\exp(3.73)$ larger for head-tuning). Without this decay schedule, for example using a vanilla cosine learning rate scheduler, gradual unfreezing worked similarly or worse than vanilla full fine-tuning.\n \\item \\textbf{Stopping criteria. }The results presented in the paper are from models early stopped based on ID validation accuracy. We sanity checked that the conclusions are similar if we use the last epoch checkpoint. \n\\end{itemize}\n\n\n\\paragraph{Data augmentation and input preprocessing. } Additionally, we use the following preprocessing and augmentations on our input images. We use very basic augmentations (e.g., only horizontal flips for WILDS, and standard augmentations from past work), including for our state-of-the-art results:\n\\begin{enumerate}\n \\item For WILDS-FMoW, the images are $224\\times224$, so we do not resize, and only perform a random horizontal flip augmentation. We do not perform any augmentations at test time.\n \\item For WILDS-Camelyon, we resize the images to $224\\times 224$ with a bilinear interpolation (standard in pyorch), and only perform a random horizontal flip augmentation. We do not perform any augmentations at test time, just the resize.\n \\item For Living-17, we follow~\\citep{kumar2022finetuning} and perform a RandomResizedCrop to $224\\times 224$ sized images (using the default options in pyorch), and then a random horizontal flip augmentation while training. At test-time we resize the image to $256\\times256$ and then take a centercrop of size $224\\times 224$.\n \\item For DomainNet, we follow~\\citep{kumar2022finetuning} and first resize the image to $256\\times 256$ with bicubic interpolation, then take a RandomCrop of size $224\\times224$ (using the default options in pyorch), and then a random horizontal flip augmentation while training. At test-time we simply resize the image to $224\\times 224$ with bicubic interpolation.\n \\item For Waterbirds, we resize the image to $224\\times 224$ with bicubic interpolation and then take a centercrop of size $224\\times224$. We apply the same transformation at test time.\n\\end{enumerate}\n\n\n\\paragraph{Embedding layer.} For SGD (freeze-embed), the exact layers we freeze are as follows: \n\\begin{enumerate}\n \\item CLIP ViTs: We freeze the patch-to-token embedding layer and layernorm.\n \\item Supervised and DINO ViTs: We freeze the patch-to-token embedding layer (there is no layernorm after this)\n \\item BiT-ResNets: We freeze the `stem' and the first convolution block of the model. We tried freezing less and more of the model in our initial experiments, but it did not seem to help.\n \\item ConvNeXt-B: We freeze the `stem' and the first stage of the model. \\ak{Need to see what happens if we only freeze the stem}\n\\end{enumerate}\n\n\n\\section{What could cause large ``embedding'' layer gradients?}\nGenerally speaking, we find that AdamW fine-tuning leads to better performing and more robust models than SGD fine-tuning, specially in modern architectures. \nOur algorithms to close this gap were inspired by the observation that on modern vision architectures, the embedding layers have substantially larger gradients at pretrained initialization compared to other layers. This could lead to over-training of the embedding layer when using SGD, which we hypothesized would be bad for robust fine-tuning. The success of SGD (freeze-embed) in our experiments adds further evidence to our hypothesis. But, why are the gradients of embedding layers at pretrained initialization high in the first place? More generally, why does AdamW do better than SGD during fine-tuning? We do not have definitive answers to these questions as we are far from understanding the precise dynamics optimization algorithms on large neural networks. Below we discuss some plausible reasons. \n\n\\paragraph{Algorithmic aspects: pretraining algorithm?} Among our 7 models, the more recent models like vision transformers and ConvNeXt, which were pretrained with AdamW are also the ones with largest gaps in performance between AdamW and SGD fine-tuning. BiT ResNets that were pretrained with SGD had much smaller differences between AdamW and SGD. This strongly suggests that the {discrepancy between the algorithms in pretraining and fine-tuning} might be cause for the performance gaps. For example, it is possible that pretraining with AdamW implicitly biases towards configurations that most benefit from AdamW updates. This would also explain why other adaptive algorithms like LARS and LAMB are not competitive even though they perform some form of layer-wise normalization. On the other hand it does not explain why such effects would distinctively impact the ``embedding'' layer and not the other layers. In a related manner, it is also unclear why SGD (freeze-embed) would be able to overcome such implicit biases from AdamW pretraining. \n\n\\paragraph{Architectural aspects: ``patchifying'' first layer?} There are substantial architectural differences between the newer transformer and ConvNeXt models and the older ResNets which could also contribute to the newer models working better with AdamW. Most notably, vision transformer is fundamentally different architecture from convolutional networks. At the same time, the biggest differences between the architectures---like self-attention, softmax non-linearity, or fully connected layers---are \\textit{not} the likely contributors to the differences between AdamW and SGD in fine-tuning. This is because, we also see gaps between these methods with the ConvNeXt models which lack the major transformer components. Rather, it is the possible that some of the designs that were adapted from transformers to ConvNeXt contributes to the differences between AdamW and SGD fine-tuning. Among these, many primarily affect the higher layers such as \n\\begin{inparaenum}[] \n\\item heavy third stage, \n\\item depthwise convolution,\n\\item inverted bottleneck, and \n\\item larger kernels,\n\\end{inparaenum} \nand are unlikely to cause the lower layer gradients to be high. %\nThe key design change we believe is important here is the use of a ``patchify stem'' that could cause distinctive changes in the gradients for lower blocks. \n\nThe ``stem'' layer primarily controls how the input is processed for the rest of the network. ViTs and ConvNext down-samples the input images from non-overlapping patch tokens, compared to ResNets that use denser-overlapped convolution followed by max-pool. The coarser non-overlap might lead the embedding layer to attune more closely to the patch distribution in pretraining. This might not be an issue by itself as pixel\/patch level information is noisy anyways and the higher layers can extract more robust features from across the patches. A possible dynamics in fine-tuning is as follows: On new datasets where the patch distributions are very different from pretraining, the embedding layers might have large gradients. In standard SGD, this might cause the embedding layer to moving too quickly to fit the new patches before the higher layers can adapt to the changes. Instead, freezing the embedding layer would pass along the raw patches with minimal processing and lets the model adapt to the new distribution based on higher level features, which are likely more robust. \n\n\\remove{\n\\paragraph{Dataset aspects: closeness to pretraining data? } In our experiments, we saw that Living-17 which is a dataset closest to pretraining data for non-CLIP models was also the only dataset where SGD perform better than AdamW, especially on non-CLIP models. Intuitively, it is reasonable that when the input distribution is close to the pretraining dataset, the distribution of patches seen by the embedding layer is similar and this could cause less movement of the embedding layer with SGD. This is not an entirely satisfactory explanation as even for Living-17, in Figure~\\ref{fig:gradient_norm_others} we see that the gradients of the embedding layer at least at initialization are high even on Living-17.\\sgnote{this argument is not very convincing. specially i am bothered that the gradient magnitudes of living-17 do not concur with our story overall}\n}\n\n\n\\paragraph{Summary. }In conclusion, we hypothesize that the differences between AdamW and SGD fine-tuning arise from a combination of the above reasons---pretraining with AdamW and large ``patchify'' embedding layer. Additionally, the use of GeLU activation and layer normalization might also change the optimizer dynamics although these are minor changes from ReLU activation and group normalization used in BiT ResNets. It is of interest to systematically explore these reasons further in future work. \n\n\\section{Detailed analysis of CLIP.}\\label{sec:clip_details}\nCLIP models have strong transfer learning performance and robustness--among our 7 models, CLIP models had the best ID and OOD accuracies averaged across datasets. So we did a more detailed analysis of the CLIP ViT-B\/16 with other optimizers\\footnote{Generating Table~\\ref{tab:ood_bigtable_final} involved over 600 fine-tuning runs, so we weren't able to repeat this for every model.} which are summarized in Table~\\ref{tab:clip_results}. %\n\\begin{table}[h!]\n \\caption{CLIP ViT-B\/16 performance with new optimizers and confidence intervals. For addition to SGD, AdamW, and SGD (freeze-embed), we provide 90\\% confidence intervals based on $3$ runs of each hyperparameter configuration. In addition,\n we show accuracies for two of our variant methods \\textit{SGD (freeze-embed, no momentum) }and \\textit{Gradual-unfreezing}; as well as comparison to two other optimizers, LARS~\\citep{You2017LargeBT} and LAMB~\\citep{you2020large}, which use layer-wise normalization in their updates. }\n \\label{tab:clip_results}\n \\centering\n \\resizebox{\\linewidth}{!}{\n \\begin{tabular}{c|cc|cc|cc|cc|cc|cc}\n \\toprule\n & \\multicolumn{2}{c|}{Living-17} & \\multicolumn{2}{c|}{Waterbirds} & \\multicolumn{2}{c|}{DomainNet} & \\multicolumn{2}{c|}{FMoW} & \\multicolumn{2}{c|}{Camelyon} & \\multicolumn{2}{c}{Avg.}\\\\\n & ID & OOD & ID & OOD & ID & OOD & ID & OOD & ID & OOD & ID & OOD\\\\ \n \\midrule\n{SGD} & 97.8 (0.2) & 80.0 (1.3) & 97.2 (0.1) & 62.5 (5.0) & 88.8 (7.1) & 72.8 (18.0) & 67.0 (0.8) & 37.3 (1.1) & 99.4 (0.0) & 86.8 (1.1) & 90.0 & 67.9\\\\[5pt]\n\\midrule\n{\\begin{tabular}[c]{@{}c@{}} AdamW\\\\ \\end{tabular}} & 98.1 (0.1) & \\textbf{82.8 (1.2)} & 97.7 (0.0) & \\textbf{71.9 (2.4)} & 95.0 (0.1) & 89.2 (1.1) & \\textbf{70.1 (0.2)} & \\textbf{40.7 (0.3)} & \\textbf{99.5 (0.0)} & 95.7 (0.4) & \\textbf{92.1} & \\textbf{76.0}\\\\[5pt]\n{\\begin{tabular}[c]{@{}c@{}} SGD\\\\ (freeze-embed)\\end{tabular}} & \\textbf{98.2 (0.3)} & \\textbf{83.2 (0.8)} & 97.8 (0.1) & \\textbf{73.7 (1.1)} & 94.9 (0.3) & 88.2 (0.7) & \\textbf{70.0 (0.2)} & \\textbf{40.2 (0.7)} & \\textbf{99.5} (0.0) & 94.3 (0.3) & \\textbf{92.1} & 75.9\\\\\n\\midrule \n{\\begin{tabular}[c]{@{}c@{}} SGD\\\\ (freeze-em. no mom.)\\end{tabular}} & \\textbf{98.2} & 83.1 & 97.9 & \\textbf{80.4} & 95.2 & 89.0 & \\textbf{70.1} & 38.8 & \\textbf{99.5} & 93.3 & \\textbf{92.2} & \\textbf{76.9}\\\\[10pt]\n{Gradual-unfreezing} & \\textbf{98.3\\remove{ (0.1)}} & 81.9\\remove{ (0.1)} & \\textbf{98.3\\remove{ (0.0)}} & 69.1\\remove{ (3.4)} & \\textbf{96.3\\remove{ (0.1)}} & \\textbf{93.2\\remove{ (0.3)}} & 69.2\\remove{ (0.5)} & \\textbf{40.5\\remove{ (1.2)}} & 99.3\\remove{ (0.1)} & \\textbf{96.5\\remove{ (0.4)}} & \\textbf{92.3}& \\textbf{76.2}\\\\\n\\midrule\n{\\begin{tabular}[c]{@{}c@{}} LAMB\\\\ \\end{tabular}} & \\textbf{98.2} & 79.5 & 97.8 & 64.0 & 95.1 & 90.4 & 67.9 & 38.8 & \\textbf{99.5} & 93.4 & 91.7 & 73.2\\\\\n{\\begin{tabular}[c]{@{}c@{}} LARS\\\\ \\end{tabular}} & 97.7 & \\textbf{83.9} & 97.1 & 48.6 & 93.2 & 83.8 & 67.0 & 38.6 & 99.3 & 93.3 & 90.9 & 69.6\\\\\n\\bottomrule\n \\end{tabular}\n }\n\\end{table}\n\n\\remove{\n\\begin{table}[h!]\n\\parbox{.48\\linewidth}{\n\\caption{\nIn-distribution (ID) accuracies for the CLIP base model, with 90\\% confidence intervals.\nSGD (freze-embed) is better than SGD, and competitive with AdamW, but LARS and LAMB perform worse than AdamW. \\sgnote{make into one table}\n}\n\\begin{center}\n\\resizebox{\\linewidth}{!}{\n\\begin{tabular}{cccccc|c}\n\\toprule\n & Liv-17 & Waterbirds & DomainNet & FMoW & Camelyon & Avg.\\\\\n\\midrule\nSGD & 97.8 (0.2) & 97.2 (0.1) & 88.8 (7.1) & 67.0 (0.8) & 99.4 (0.0) & 90.0\\\\\nAdamW & 98.1 (0.1) & 97.7 (0.0) & 95.0 (0.1) & \\textbf{70.1 (0.2)} & \\textbf{99.5 (0.0)} & \\textbf{92.1}\\\\\n\\midrule\nSGD (Freeze-embed) & \\textbf{98.2 (0.3)} & 97.8 (0.1) & 94.9 (0.3) & \\textbf{70.0 (0.2)} & 99.5 (0.0) & \\textbf{92.1}\\\\\nGradual-unfreezing & \\textbf{98.3 (0.1)} & \\textbf{98.3 (0.0)} & \\textbf{96.3 (0.1)} & 69.2 (0.5) & 99.3 (0.1) & \\textbf{92.3}\\\\\n\\midrule\nLAMB & \\textbf{98.2} & 97.8 & 95.1 & 67.9 & \\textbf{99.5} & 91.7\\\\\nLARS & 97.7 & 97.1 & 93.2 & 67.0 & 99.3 & 90.9\\\\\n\\bottomrule\n\\end{tabular}\n}\n\\end{center}\n}\n\\hfill\n\\parbox{.48\\linewidth}{\n\\caption{\nOut-of-distribution (OOD) accuracies for the CLIP base model, with 90\\% confidence intervals.\nSGD (freze-embed) is much better than SGD, and competitive with AdamW, but LARS and LAMB performs much worse than AdamW.\n}\n\\begin{center}\n\\resizebox{\\linewidth}{!}{\n\\begin{tabular}{cccccc|c}\n\\toprule\n & Liv-17 & Waterbirds & DomainNet & FMoW & Camelyon & Avg.\\\\\n\\midrule\nSGD & 80.0 (1.3) & 62.5 (5.0) & 72.8 (18.0) & 37.3 (1.1) & 86.8 (1.1) & 67.9\\\\\nAdamW & \\textbf{82.8 (1.2)} & \\textbf{71.9 (2.4)} & 89.2 (1.1) & \\textbf{40.7 (0.3)} & 95.7 (0.4) & \\textbf{76.0}\\\\\n\\midrule\nSGD (Freeze-embed) & \\textbf{83.2 (0.8)} & \\textbf{73.7 (1.1)} & 88.2 (0.7) & \\textbf{40.2 (0.7)} & 94.3 (0.3) & 75.9\\\\\nGradual-unfreezing & 81.9 (0.1) & 69.1 (3.4) & \\textbf{93.2 (0.3)} & \\textbf{40.5 (1.2)} & \\textbf{96.5 (0.4)} & \\textbf{76.2}\\\\\n\\midrule\nLAMB & 79.5 & 64.0 & 90.4 & 38.8 & 93.4 & 73.2\\\\\nLARS & \\textbf{83.9} & 48.6 & 83.8 & 38.6 & 93.3 & 69.6\\\\\n\\bottomrule\n\\end{tabular}\n}\n\\end{center}\n}\n\\end{table}\n}\n\n\\paragraph{SGD (freeze-embed, no momentum).} Across our datasets and models, SGD (freeze-embed) performed competitively with AdamW, while using one less optimizer state\/parameter and hence less memory. We can potentially gain additional memory savings by using a more basic SGD without momentum. Note that momentum has been shown to be important when training from scratch, but its benefit while fine-tuning has not been explored much. So for our SGD (freeze-embed, no momentum) method, on all our datasets, we fine-tune a CLIP ViT-B\/16 model with SGD, freeze the embedding layer, and do not use momentum. In Table~\\ref{tab:clip_results}, we see that SGD (freeze-embed, no momentum) is competitive with SGD (freeze-embed) and AdamW, even having an edge on some datasets. This is promising, but since we only evaluated on CLIP ViT-B\/16, more experiments are needed to derive stronger conclusions about the accuracy of SGD (freeze-embed, no momentum).\n\n\\paragraph{GPU memory profiling.} We profiled all methods on a Titan-X GPU. On a ViT-B\/16, AdamW uses $16\\%$ and $36\\%$ more memory than SGD (freeze-embed) and SGD (freeze-embed, no momentum) respectively. The gains are better for larger models: on a ViT-L\/14, AdamW uses $18\\%$ and $48\\%$ more memory respectively. On a ViT-H\/14, AdamW runs out of memory, while SGD (freeze-embed) and SGD (freeze-embed, no momentum) used 10.1 GB and 7.6 GB respectively, out of 12.2 GB. Note that the gains from SGD (freeze-embed) would be even higher with gradient checkpointing, which reduces activation memory. See more details in Appendix~\\ref{app:profiling_gpu_memory}.\n\n\\paragraph{Gradual-unfreezing.} The success of freeze-embed for SGD is inline with our hypothesis that it is beneficial to change the lower layers less during fine-tuning. We could further refine this idea---instead of just freezing the first ``embedding'' layer, we could start by freezing the entire pretrained model (except for the head) and gradually unfreeze the rest of the model over training. \nStrategies like this have been explored by ULMFiT~\\citep{howard2018universal} and others~\\citep{mukherjee2019distilling, romero2020targeted}.\nAn advantage of gradual-unfreezing is that in earlier stages of training we tune a smaller fraction of the model, which speeds up training---for example, for WILDS-FMoW on an A100 GPU, the average runtime decreases by over 30\\%. \n\nFor gradual-unfreezing, we found that naively using a single learning rate throughout this process or even a cosine learning rate schedule is not sufficient to achieve good performance. Instead, we fit an exponential learning rate decay law for our experiments (see details in Appendix~\\ref{app:setup}). %\nThe performance of gradual-unfreezing on CLIP ViT-B\/16 is shown in Table~\\ref{tab:clip_results}. On some datasets, gradual-unfreezing performed particularly well. For example, it got an OOD accuracy of 93.2\\% on DomainNet and 96.5\\% on Camelyon---which are both competitive with SGD (freeze-embed) and AdamW on a much larger CLIP ViT-L\/14 model. On average, gradual-unfreezing gets slightly better results both ID and OOD, while being $30\\%$ faster. \nOverall though, we find that the most consistent improvements come from simply freezing the embedding layer, which suggests that the embedding layer plays a particularly prominent role in modern vision architectures.\n\n\n\n\\paragraph{SGD (freeze-embed) and AdamW outperform LAMB and LARS.}\nWe also ran two alternative adaptive gradient methods, LARS~\\citep{You2017LargeBT} and LAMB~\\citep{you2020large}---also sweeping over 6 learning rates and early stopping.\nThese are alternate methods with layerwise normalization that can avoid over-training of large gradient layers. Moreover, like SGD and SGD (freeze-embed), LARS also has a lower memory footprint than AdamW. In Table~\\ref{tab:clip_results}, we see that while LARS and LAMB get higher accuracies than SGD, they do worse than SGD (freeze-embed) and AdamW both ID and OOD. In this case, our modification with freeze-embed appears to be more effective. \n\n\n\n\n\\begin{wraptable}{R}{0.34\\textwidth}\n\\vspace{-10pt}\n\\caption{Test accuracy on CIFAR-10. }\n\\label{tab:clip_cifar_results}\n\\centering\n\\vspace{-7pt}\n\\resizebox{\\linewidth}{!}{\n\\begin{tabular}{ccc}\n\\toprule\n & {\\small CLIP ViT-B\/16} & {\\small CLIP ViT-L\/14} \\\\\n\\midrule\n{ SGD} & 98.0 & 99.0 \\\\\n{ AdamW} & 98.3 & \\textbf{99.3} \\\\\n\\midrule\n{ \\begin{tabular}{cc}SGD \\\\ (freeze-embed) \\end{tabular}} & \\textbf{98.4} & \\textbf{99.3} \\\\\n\\bottomrule\n\\end{tabular}\n}\n\\end{wraptable}\n\n\\paragraph{CIFAR-10 results.} As a proof of concept for standard (non-OOD) transfer learning, we fine-tune CLIP ViT models on CIFAR-10. In Table~\\ref{tab:clip_cifar_results}, we see that even at high accuracies, AdamW and SGD (freeze-embed) manage to improve performance. \nSGD (freeze-embed) gets 20\\% and 30\\% lower error than SGD on CLIP ViT-B\/16 and CLIP ViT-L\/14, respectively. %\n\n\\section{Detailed experiments on freeze-embedding}\\label{sec:mainexp}\n\n\nWe consider a simple variation of SGD fine-tuning where we freeze the embedding layer and only perform SGD updates on the rest of the network---we call this method ``SGD (freeze-embed)''. In this section we discuss the results of fine-tuning our 7 models on 5 distribution shift benchmarks mentioned in Section~\\ref{sec:problem_setting}. We compare three methods: SGD, AdamW, and our proposed SGD (freeze-embed). \nWe use the implementations of SGD and AdamW in PyTorch. For each method, we train for the same number of epochs using a cosine learning rate schedule, and sweep over 6 starting learning rates (ensuring that the optimal learning rate is in the middle of the sweep). For all datasets we follow prior work~\\citep{kumar2022finetuning} and pick the best learning rate and early stop based on the ID validation accuracy. See Appendix~\\ref{app:setup} for additional details. \n\nTable~\\ref{tab:ood_bigtable_final} and Table~\\ref{tab:id_bigtable_final} show the OOD and ID accuracies, respectively, of the three methods across our models and datasets. For each model and dataset, we also highlight the relative gain\/loss of AdamW and SGD (freeze-embed) from regular SGD in green\/red. We discuss the main observations below. \n\\begin{enumerate}[1.]\n \\item \\textbf{AdamW outperforms SGD.} We see that AdamW largely outperforms SGD, often by substantial margins on ViT and ConvNeXt models. Particularly in OOD evaluation, the gaps are remarkable. In the few instances where SGD performs better the gaps are much smaller. The differences between SGD and AdamW are generally more modest for older ResNet models. \n \\item \\textbf{SGD (freeze-embed) is competitive with or better than AdamW.} \n For each individual model, averaged across the datasets SGD (freeze-embed) is consistently the best or tied-best method on OOD accuracy, and only minimally worse than AdamW on ID accuracy (right columns of Table~\\ref{tab:ood_bigtable_final}-\\ref{tab:id_bigtable_final}). Averaged across all the models and datasets, SGD (freeze-embed) performs the best OOD, getting an average OOD accuracy of 76.7\\% (vs. 71.9\\% for SGD and 76.0\\% for AdamW). On ID data, SGD (Freeze-embed) closes 85\\% of the gap between SGD and AdamW, getting an average accuracy of 91.3\\% (vs. 90.2\\% for SGD and 91.5\\% for AdamW). \n \\item \\textbf{Larger CLIP model gains more from SGD (freeze-embed) and AdamW.} On a CLIP-ViT-B\/16 we see that SGD (freeze-embed) and AdamW get about $8\\%$ higher OOD accuracy than SGD. Upon scaling to a larger CLIP-ViT-L\/14, which is also our best model for OOD performance, we see even higher gains over SGD. On CLIP-ViT-L\/14, SGD (freeze-embed) gets a 14.3\\% higher OOD accuracy than SGD, and a 0.7\\% higher OOD accuracy than AdamW. This suggests that our findings might be even more relevant for larger models.\n \\item \\textbf{SGD (freeze-embed) is \\textit{red} when AdamW is \\textit{red}.} Across all our models and datasets, we see that in instances where SGD (freeze-embed) is worse than SGD (i.e., highlighted as red), AdamW is also worse than SGD. This is not always the case the other way around. For example, on ViT B-\/16 fine-tuned on DomainNet and Camelyon, OOD performance of AdamW is worse than SGD, but SGD (freeze-embed) is competitive to the best of the two. At the same time, on Living-17 OOD evaluation, multiple models have both AdamW and SGD (freeze-embed) perform significantly worse than SGD. \n \\item \\textbf{SGD performs well when fine-tuning data is closer to pretraining. } Breaking down the results by datasets, the main trend we see is that with models that were pretrained on ImageNet-21k (all models here except CLIP) and fine-tuned on Living-17, the performance of SGD is typically higher than AdamW and SGD (freeze-embed). Images in Living-17 are derived from ImageNet-1K and hence arguably, in this case the fine-tuning distribution is closest to pretraining. This suggests that SGD works better in instances where fine-tuning and pretraining data are similar.\n \\item \\textbf{AdamW (freeze-embed) does not improve significantly over AdamW.} SGD (freeze-embed) was motivated by our hypothesis that AdamW would inherently avoid over-tuning of the embedding layer. If our hypothesis is true, unlike for SGD, freezing the embedding for AdamW would not be beneficial. In the Appendix, we expand the Tables~\\ref{tab:ood_bigtable_final}-\\ref{tab:id_bigtable_final} to include AdamW (freeze-embed) and indeed we see that freeze-embed does not provide complementary gains on top of AdamW. \n\\end{enumerate}\n\n\n\n\n\n\n\n\n\\begin{table}[h!]\n \\small \n \\caption{\n\\textbf{Out-of-distribution (OOD)} accuracies for fine-tuning 7 pretrained models on 5 datasets. We compare fine-tuning with SGD, AdamW, and SGD (freeze-embed). For each model and dataset, we also highlight the relative gain or loss of AdamW and SGD (freeze-embed) from SGD, in green (for positive) and red (for negative). Lighter shades of green\/red correspond to $<0.2$ gain\/loss. \nKey observations are: AdamW gets higher accuracies than SGD for modern ViT and ConvNeXt models. Averaged over the datasets (right column), SGD (freeze-embed) is consistently the best or tied-best method for all 7 models.\n\\label{tab:ood_bigtable_final}}\n\\begin{center}\n\\resizebox{\\textwidth}{!}{\n\\begin{tabular}{cccccccccccc|cc}\n\\toprule\n & & \\multicolumn{2}{c}{Living-17} & \\multicolumn{2}{c}{Waterbirds} & \\multicolumn{2}{c}{DomainNet} & \\multicolumn{2}{c}{FMoW} & \\multicolumn{2}{c}{Camelyon} & \\multicolumn{2}{c}{Avg.} \\\\\n\\midrule\nCLIP ViT-B\/16 & SGD & 80.0 & & 62.5 & & 72.8$^{\\dagger}$ & & 37.3 & & 86.8 & & 67.9 & \\\\\nCLIP ViT-B\/16 & AdamW & 82.8 & \\hspace{-1em}{\\hgreen{(+2.8)}} & 71.9 & \\hspace{-1em}{\\hgreen{(+9.4)}} & \\textbf{89.2} & \\hspace{-1em}{\\hgreen{(+16.4)}} & \\textbf{40.7} & \\hspace{-1em}{\\hgreen{(+3.4)}} & \\textbf{95.7} & \\hspace{-1em}{\\hgreen{(+8.9)}} & \\textbf{76.0} & \\hspace{-1em}{\\hgreen{(+8.1)}}\\\\\nCLIP ViT-B\/16 & SGD (freeze-embed) & \\textbf{83.2} & \\hspace{-1em}{\\hgreen{(+3.2)}} & \\textbf{73.7} & \\hspace{-1em}{\\hgreen{(+11.2)}} & 88.2 & \\hspace{-1em}{\\hgreen{(+15.4)}} & 40.2 & \\hspace{-1em}{\\hgreen{(+2.9)}} & 94.3 & \\hspace{-1em}{\\hgreen{(+7.5)}} & \\textbf{75.9} & \\hspace{-1em}{\\hgreen{(+8.0)}}\\\\\n\\midrule\nCLIP ViT-L\/14 & SGD & 84.2 & & 65.0 & & 60.8$^{\\dagger}$ & & 41.0 & & 83.2 & & 66.8 & \\\\\nCLIP ViT-L\/14 & AdamW & 88.0 & \\hspace{-1em}{\\hgreen{(+3.8)}} & \\textbf{85.2} & \\hspace{-1em}{\\hgreen{(+20.2)}} & \\textbf{93.8} & \\hspace{-1em}{\\hgreen{(+33.0)}} & 48.3 & \\hspace{-1em}{\\hgreen{(+7.3)}} & 95.9 & \\hspace{-1em}{\\hgreen{(+12.7)}} & 82.2 & \\hspace{-1em}{\\hgreen{(+15.4)}}\\\\\nCLIP ViT-L\/14 & SGD (freeze-embed) & \\textbf{90.5} & \\hspace{-1em}{\\hgreen{(+6.3)}} & 84.7 & \\hspace{-1em}{\\hgreen{(+19.7)}} & 93.1 & \\hspace{-1em}{\\hgreen{(+32.3)}} & \\textbf{49.9} & \\hspace{-1em}{\\hgreen{(+8.9)}} & \\textbf{96.5} & \\hspace{-1em}{\\hgreen{(+13.3)}} & \\textbf{83.0} & \\hspace{-1em}{\\hgreen{(+16.2)}}\\\\\n\\midrule\nSup ViT-B\/16 & SGD & \\textbf{89.5} & & 77.4 & & \\textbf{86.3} & & 33.5 & & 92.6 & & 75.8 & \\\\\nSup ViT-B\/16 & AdamW & 88.3 & \\hspace{-1em}{\\hred{(-1.2)}} & 81.6 & \\hspace{-1em}{\\hgreen{(+4.2)}} & 84.4 & \\hspace{-1em}{\\hred{(-1.9)}} & \\textbf{35.9} & \\hspace{-1em}{\\hgreen{(+2.4)}} & 87.9 & \\hspace{-1em}{\\hred{(-4.7)}} & 75.6 & \\hspace{-1em}{\\hred{(-0.2)}}\\\\\nSup ViT-B\/16 & SGD (freeze-embed) & 88.0 & \\hspace{-1em}{\\hred{(-1.5)}} & \\textbf{82.4} & \\hspace{-1em}{\\hgreen{(+5.0)}} & \\textbf{86.3} & \\hspace{-1em}{\\lgreen{(+0.0)}} & 34.4 & \\hspace{-1em}{\\hgreen{(+0.9)}} & \\textbf{93.7} & \\hspace{-1em}{\\hgreen{(+1.1)}} & \\textbf{77.0} & \\hspace{-1em}{\\hgreen{(+1.2)}}\\\\\n\\midrule\nDINO ViT-B\/16 & SGD & \\textbf{88.2} & & 56.1 & & 76.0 & & 33.6 & & 86.9 & & 68.2 & \\\\\nDINO ViT-B\/16 & AdamW & 87.4 & \\hspace{-1em}{\\hred{(-0.8)}} & 61.2 & \\hspace{-1em}{\\hgreen{(+5.1)}} & 77.4 & \\hspace{-1em}{\\hgreen{(+1.4)}} & \\textbf{35.8} & \\hspace{-1em}{\\hgreen{(+2.2)}} & \\textbf{91.9} & \\hspace{-1em}{\\hgreen{(+5.0)}} & 70.7 & \\hspace{-1em}{\\hgreen{(+2.5)}}\\\\\nDINO ViT-B\/16 & SGD (freeze-embed) & 86.7 & \\hspace{-1em}{\\hred{(-1.5)}} & \\textbf{67.9} & \\hspace{-1em}{\\hgreen{(+11.8)}} & \\textbf{78.4} & \\hspace{-1em}{\\hgreen{(+2.4)}} & \\textbf{35.9} & \\hspace{-1em}{\\hgreen{(+2.3)}} & 90.6 & \\hspace{-1em}{\\hgreen{(+3.7)}} & \\textbf{71.9} & \\hspace{-1em}{\\hgreen{(+3.7)}}\\\\\n\\midrule\nConvNext-Base & SGD & \\textbf{94.0} & & 80.2 & & 89.8 & & \\textbf{39.7} & & 83.0 & & 77.3 & \\\\\nConvNext-Base & AdamW & 90.3 & \\hspace{-1em}{\\hred{(-3.7)}} & \\textbf{89.8} & \\hspace{-1em}{\\hgreen{(+9.6)}} & 89.5 & \\hspace{-1em}{\\hred{(-0.3)}} & 38.4 & \\hspace{-1em}{\\hred{(-1.3)}} & \\textbf{89.5} & \\hspace{-1em}{\\hgreen{(+6.5)}} & \\textbf{79.5} & \\hspace{-1em}{\\hgreen{(+2.2)}}\\\\\nConvNext-Base & SGD (freeze-embed) & 92.6 & \\hspace{-1em}{\\hred{(-1.4)}} & 86.9 & \\hspace{-1em}{\\hgreen{(+6.7)}} & \\textbf{91.2} & \\hspace{-1em}{\\hgreen{(+1.4)}} & 38.2 & \\hspace{-1em}{\\hred{(-1.5)}} & 88.1 & \\hspace{-1em}{\\hgreen{(+5.1)}} & \\textbf{79.4} & \\hspace{-1em}{\\hgreen{(+2.1)}}\\\\\n\\midrule\nBiT ResNet-50 & SGD & \\textbf{84.3} & & \\textbf{76.5} & & 80.0 & & 34.1 & & 90.4 & & 73.1 & \\\\\nBiT ResNet-50 & AdamW & 83.1 & \\hspace{-1em}{\\hred{(-1.2)}} & 74.8 & \\hspace{-1em}{\\hred{(-1.7)}} & \\textbf{84.0} & \\hspace{-1em}{\\hgreen{(+4.0)}} & 33.8 & \\hspace{-1em}{\\hred{(-0.3)}} & 92.4 & \\hspace{-1em}{\\hgreen{(+2.0)}} & 73.6 & \\hspace{-1em}{\\hgreen{(+0.5)}}\\\\\nBiT ResNet-50 & SGD (freeze-embed) & 84.1 & \\hspace{-1em}{\\hred{(-0.2)}} & 75.5 & \\hspace{-1em}{\\hred{(-1.0)}} & 82.3 & \\hspace{-1em}{\\hgreen{(+2.3)}} & \\textbf{35.0} & \\hspace{-1em}{\\hgreen{(+0.9)}} & \\textbf{95.2} & \\hspace{-1em}{\\hgreen{(+4.8)}} & \\textbf{74.4} & \\hspace{-1em}{\\hgreen{(+1.3)}}\\\\\n\\midrule\nBiT ResNet-101 & SGD & 82.8 & & 76.9 & & \\textbf{86.2} & & \\textbf{38.0} & & 89.3 & & 74.6 & \\\\\nBiT ResNet-101 & AdamW & \\textbf{82.9} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{79.4} & \\hspace{-1em}{\\hgreen{(+2.5)}} & 83.5 & \\hspace{-1em}{\\hred{(-2.7)}} & 37.0 & \\hspace{-1em}{\\hred{(-1.0)}} & 89.7 & \\hspace{-1em}{\\hgreen{(+0.4)}} & 74.5 & \\hspace{-1em}{\\lred{(-0.1)}}\\\\\nBiT ResNet-101 & SGD (freeze-embed) & \\textbf{83.1} & \\hspace{-1em}{\\hgreen{(+0.3)}} & 77.3 & \\hspace{-1em}{\\hgreen{(+0.4)}} & 86.0 & \\hspace{-1em}{\\hred{(-0.2)}} & 36.0 & \\hspace{-1em}{\\hred{(-2.0)}} & \\textbf{95.5} & \\hspace{-1em}{\\hgreen{(+6.2)}} & \\textbf{75.6} & \\hspace{-1em}{\\hgreen{(+1.0)}}\\\\\n\\bottomrule\n\\multicolumn{14}{l}{$^{\\dagger}$\\footnotesize{SGD fine-tuning on DomainNet with CLIP is unstable leading to high variance in the results. The variance for other datasets were small.}}\n\\end{tabular}\n}\n\\end{center}\n\\end{table}\n\n\n\n\\begin{table}[h!]\n \\small \n\\caption{\n\\textbf{In-distribution (ID)} accuracies presented in the same format as the OOD accuracies in Table~\\ref{tab:ood_bigtable_final}. We see similar high level trends: AdamW gets higher accuracies than SGD on modern vision models, but the gaps are smaller at higher accuracies; and SGD (freeze-embed) is consistently competitively with AdamW.\n\\label{tab:id_bigtable_final}}\n\\begin{center}\n\\resizebox{\\textwidth}{!}{\n\\begin{tabular}{cccccccccccc|cc}\n\\toprule\n & & \\multicolumn{2}{c}{Living-17} & \\multicolumn{2}{c}{Waterbirds} & \\multicolumn{2}{c}{DomainNet} & \\multicolumn{2}{c}{FMoW} & \\multicolumn{2}{c}{Camelyon} & \\multicolumn{2}{c}{Avg.} \\\\\n\\midrule\nCLIP ViT-B\/16 & SGD & 97.8 & & 97.2 & & 88.8$^{\\dagger}$ & & 67.0 & & \\textbf{99.4} & & 90.0 & \\\\\nCLIP ViT-B\/16 & AdamW & \\textbf{98.1} & \\hspace{-1em}{\\hgreen{(+0.3)}} & \\textbf{97.7} & \\hspace{-1em}{\\hgreen{(+0.5)}} & \\textbf{95.0} & \\hspace{-1em}{\\hgreen{(+6.2)}} & \\textbf{70.1} & \\hspace{-1em}{\\hgreen{(+3.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{92.1} & \\hspace{-1em}{\\hgreen{(+2.1)}}\\\\\nCLIP ViT-B\/16 & SGD (freeze-embed) & \\textbf{98.2} & \\hspace{-1em}{\\hgreen{(+0.4)}} & \\textbf{97.8} & \\hspace{-1em}{\\hgreen{(+0.6)}} & \\textbf{94.9} & \\hspace{-1em}{\\hgreen{(+6.1)}} & \\textbf{70.0} & \\hspace{-1em}{\\hgreen{(+3.0)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{92.1} & \\hspace{-1em}{\\hgreen{(+2.1)}}\\\\\n\\midrule\nCLIP ViT-L\/14 & SGD & 98.4 & & 97.3 & & 84.3$^{\\dagger}$ & & 69.0 & & \\textbf{99.4} & & 89.7 & \\\\\nCLIP ViT-L\/14 & AdamW & \\textbf{98.9} & \\hspace{-1em}{\\hgreen{(+0.5)}} & \\textbf{98.8} & \\hspace{-1em}{\\hgreen{(+1.5)}} & 96.9 & \\hspace{-1em}{\\hgreen{(+12.6)}} & \\textbf{74.5} & \\hspace{-1em}{\\hgreen{(+5.5)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{93.7} & \\hspace{-1em}{\\hgreen{(+4.0)}}\\\\\nCLIP ViT-L\/14 & SGD (freeze-embed) & \\textbf{98.7} & \\hspace{-1em}{\\hgreen{(+0.3)}} & \\textbf{98.9} & \\hspace{-1em}{\\hgreen{(+1.6)}} & \\textbf{97.1} & \\hspace{-1em}{\\hgreen{(+12.8)}} & \\textbf{74.5} & \\hspace{-1em}{\\hgreen{(+5.5)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{93.7} & \\hspace{-1em}{\\hgreen{(+4.0)}}\\\\\n\\midrule\nSup ViT-B\/16 & SGD & \\textbf{98.6} & & \\textbf{99.1} & & \\textbf{91.7} & & 64.1 & & \\textbf{99.4} & & 90.6 & \\\\\nSup ViT-B\/16 & AdamW & \\textbf{98.7} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{99.0} & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{91.7} & \\hspace{-1em}{\\lred{(-0.0)}} & \\textbf{66.4} & \\hspace{-1em}{\\hgreen{(+2.3)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{91.1} & \\hspace{-1em}{\\hgreen{(+0.5)}}\\\\\nSup ViT-B\/16 & SGD (freeze-embed) & \\textbf{98.7} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{99.2} & \\hspace{-1em}{\\lgreen{(+0.1)}} & 91.5 & \\hspace{-1em}{\\hred{(-0.2)}} & 65.0 & \\hspace{-1em}{\\hgreen{(+0.9)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & 90.8 & \\hspace{-1em}{\\hgreen{(+0.2)}}\\\\\n\\midrule\nDINO ViT-B\/16 & SGD & \\textbf{98.4} & & 97.0 & & 88.2 & & 62.4 & & 99.4 & & 89.1 & \\\\\nDINO ViT-B\/16 & AdamW & \\textbf{98.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{97.9} & \\hspace{-1em}{\\hgreen{(+0.9)}} & \\textbf{89.4} & \\hspace{-1em}{\\hgreen{(+1.2)}} & \\textbf{66.0} & \\hspace{-1em}{\\hgreen{(+3.6)}} & \\textbf{99.6} & \\hspace{-1em}{\\hgreen{(+0.2)}} & \\textbf{90.3} & \\hspace{-1em}{\\hgreen{(+1.2)}}\\\\\nDINO ViT-B\/16 & SGD (freeze-embed) & \\textbf{98.4} & \\hspace{-1em}{\\lgreen{(+0.0)}} & 97.5 & \\hspace{-1em}{\\hgreen{(+0.5)}} & 89.0 & \\hspace{-1em}{\\hgreen{(+0.8)}} & 63.5 & \\hspace{-1em}{\\hgreen{(+1.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & 89.6 & \\hspace{-1em}{\\hgreen{(+0.5)}}\\\\\n\\midrule\nConvNext-Base & SGD & \\textbf{98.7} & & 99.0 & & 94.8 & & 66.3 & & 99.4 & & 91.6 & \\\\\nConvNext-Base & AdamW & \\textbf{98.6} & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\hgreen{(+0.5)}} & 94.5 & \\hspace{-1em}{\\hred{(-0.3)}} & \\textbf{68.8} & \\hspace{-1em}{\\hgreen{(+2.5)}} & \\textbf{99.7} & \\hspace{-1em}{\\hgreen{(+0.3)}} & \\textbf{92.2} & \\hspace{-1em}{\\hgreen{(+0.6)}}\\\\\nConvNext-Base & SGD (freeze-embed) & \\textbf{98.6} & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{99.4} & \\hspace{-1em}{\\hgreen{(+0.4)}} & \\textbf{95.1} & \\hspace{-1em}{\\hgreen{(+0.3)}} & 67.4 & \\hspace{-1em}{\\hgreen{(+1.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{92.0} & \\hspace{-1em}{\\hgreen{(+0.4)}}\\\\\n\\midrule\nBiT ResNet-50 & SGD & 97.4 & & \\textbf{98.4} & & \\textbf{89.3} & & 64.6 & & \\textbf{99.5} & & \\textbf{89.8} & \\\\\nBiT ResNet-50 & AdamW & 97.2 & \\hspace{-1em}{\\hred{(-0.2)}} & \\textbf{98.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{89.2} & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{65.1} & \\hspace{-1em}{\\hgreen{(+0.5)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{89.9} & \\hspace{-1em}{\\lgreen{(+0.1)}}\\\\\nBiT ResNet-50 & SGD (freeze-embed) & \\textbf{97.6} & \\hspace{-1em}{\\hgreen{(+0.2)}} & \\textbf{98.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{89.2} & \\hspace{-1em}{\\lred{(-0.1)}} & 64.8 & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.0)}} & \\textbf{89.9} & \\hspace{-1em}{\\lgreen{(+0.1)}}\\\\\n\\midrule\nBiT ResNet-101 & SGD & \\textbf{98.3} & & \\textbf{98.9} & & \\textbf{92.0} & & 66.0 & & \\textbf{99.4} & & \\textbf{90.9} & \\\\\nBiT ResNet-101 & AdamW & \\textbf{98.4} & \\hspace{-1em}{\\lgreen{(+0.1)}} & 98.6 & \\hspace{-1em}{\\hred{(-0.3)}} & 91.1 & \\hspace{-1em}{\\hred{(-0.9)}} & \\textbf{67.0} & \\hspace{-1em}{\\hgreen{(+1.0)}} & \\textbf{99.6} & \\hspace{-1em}{\\lgreen{(+0.2)}} & \\textbf{90.9} & \\hspace{-1em}{\\lred{(-0.0)}}\\\\\nBiT ResNet-101 & SGD (freeze-embed) & \\textbf{98.4} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{98.8} & \\hspace{-1em}{\\lred{(-0.1)}} & 91.5 & \\hspace{-1em}{\\hred{(-0.5)}} & 65.9 & \\hspace{-1em}{\\lred{(-0.1)}} & \\textbf{99.5} & \\hspace{-1em}{\\lgreen{(+0.1)}} & \\textbf{90.8} & \\hspace{-1em}{\\lred{(-0.1)}}\\\\\n\\bottomrule\n\\multicolumn{14}{l}{$^{\\dagger}$\\footnotesize{SGD fine-tuning on DomainNet with CLIP is unstable leading to high variance in the results. The variance for other datasets were small.}}\n\\end{tabular}\n}\n\\end{center}\n\\end{table}\n\n\n\n\n\n\n\n\\section{Discussion.}\nWe note that the methods we consider are not complex.\nWe showed that a minor tweak of freezing the embedding layer overwhelmingly improves the performance across the board when fine-tuning with SGD. %\nWe clarify that we do not claim that SGD (freeze-embed) is a substantially better method than AdamW in terms of accuracy. Rather, it is remarkable that with its simplicity, we can already achieve \\emph{comparable} or even slightly better accuracy than AdamW across a wide range of models and benchmarks, all while retaining the memory and computational edge of SGD over AdamW. \nThe broader point of our work is that pretrained models have a lot of useful information, but naively fine-tuning these models can lead to sub-optimal performance.\nExploring simple properties of these models such as the gradients of different layers, and designing simple modifications such as freezing just a small part of the model, can lead to state-of-the-art accuracies. %\n\\section{Introduction}\n\nFine-tuning large pretrained models on downstream tasks has become a dominant approach in deep learning~\\citep{kornblith2019better,chen2020simclr,zhai2020largescale}. The two most commonly used optimizers in current practice are SGD and AdamW~\\citep{kingma2015adam, Loshchilov2019DecoupledWD}\\footnote{We use SGD to refer to its usage in deep learning as minibatch stochastic gradient descent with momentum.}. While most modern vision architectures (ViTs, ConvNeXts, and variants) increasingly use AdamW for pretraining, it is still common to use SGD for fine-tuning. Part of the appeal is that SGD is more memory and compute efficient: AdamW maintains $4$ states\/parameter, while SGD only maintains $3$ states\/parameter~\\citep{Ginsburg2019TrainingDN,dettmers2022optimizers}. In training ultra-large models, the additional memory from even $1$ extra state\/parameter can be costly. At the same time, in terms of fine-tuning accuracies, prior work \\citep{dosovitskiy2021vit, Steiner2021HowTT, kumar2022finetuning} report similar performance between AdamW and SGD on ImageNet like domains that are closer to pretraining data. In contrast, we reach different conclusions when fine-tuning on datasets that are far from pretraining data or have substantial distribution shifts. \n\nWe examine 7 popular models, including vision transformers~\\citep{dosovitskiy2021vit,caron2021emerging,radford2021clip}, ConvNeXts~\\citep{liu2022convnet}, and ResNets~\\citep{Kolesnikov2020BigT,he2016resnet}, of different sizes and pretraining modalities. When pretrained on a large corpus and then fine-tuned, these models achieve near state-of-the-art performance on downstream benchmarks. \nIn addition to good transfer learning, we also want our fine-tuned models to handle practical distribution shifts gracefully. So we focus on 5 distribution shift datasets that have both in-distribution (ID) and out-of-distribution (OOD) evaluations: WILDS-FMoW, WILDS-Camelyon, Waterbirds, BREEDS-Living-17, DomainNet. These were selected to capture different types of data shifts (subpopulation shifts, spurious correlations, style shifts), including two real world shifts in medical imaging and satellite remote sensing from the WILDS benchmark~\\citep{koh2021wilds}. \n\n\\begin{figure}[thb]\n \\centering\n \\begin{subfigure}[b]{0.40\\textwidth}\n %\n \\centering\n \\includegraphics[width=\\textwidth]{figures\/illustration-vit.png}\n \\caption{Simplified schematic of ViT illustrating how we do freeze-embed.\n \\label{fig:vit_simplified}}\n \\end{subfigure}\n \\hfill\n \\begin{subfigure}[b]{0.55\\textwidth}\n \\centering\n \\label{fig:clip_results_summary}\n %\n %\n %\n %\n %\n %\n %\n %\n %\n %\n \\resizebox{\\linewidth}{!}{\n \\begin{tabular}{ccc}\n \\toprule\n & ID accuracy & OOD accuracy \\\\\n \\midrule\n SGD & {90.0\\%} & {67.9\\%}\\\\\n AdamW & \\hgreen{(+2.1\\%)} & \\hgreen{(+8.1\\%)} \\\\\n SGD (freeze-embed) & \\hgreen{(+2.1\\%)} & \\hgreen{(+8.0\\%)} \\\\\n SGD (freeze-embed, no mom.) & \\hgreen{(+2.2\\%)} & \\hgreen{\\textbf{(+9.0\\%)}} \\\\ \n Gradual-Unfreeze & \\hgreen{\\textbf{(+2.3\\%)}} & \\hgreen{(+8.3\\%)} \\\\\n \\bottomrule\n \\end{tabular}\n }\n \\caption{Performance of different fine-tuning methods on a CLIP ViT-B\/16 averaged over $5$ distribution shift datasets.\\label{fig:three graphs}}\n \\end{subfigure}\n \\setlength{\\belowcaptionskip}{-10pt}\n \\caption{We fine-tune 7 models including ViTs, DINO, CLIP, ConvNeXt, ResNet, on 5 distribution shift datasets (Living-17, Waterbirds, DomainNet, WILDS-Camelyon, WILDS-FMoW). Fine-tuning with SGD gets lower accuracies than AdamW on modern architectures (transformers and ConvNeXt), especially OOD. Interestingly, a minor tweak to SGD where we freeze the first ``embedding'' layer ($<1\\%$ of parameters---see Figure~\\ref{fig:vit_simplified}) is competitive with AdamW while using lower GPU memory. Further, dropping the momentum state in SGD gives additional gains in accuracy at even lower memory cost. Gradually unfreezing a model's layers using a carefully annealed learning rate can further improves accuracies, while reducing computation. %\n }\n\\end{figure}\n\nWe find that on newer models like ViTs and ConvNeXt, AdamW can have significantly higher accuracies, especially OOD. For example, averaged across the datasets, fine-tuning a CLIP ViT-B\/16 model with AdamW gets 2.1\\% higher accuracy ID and 8.1\\% higher accuracy OOD compared to SGD (Figure~\\ref{fig:three graphs}). These gains are consistent across models too---averaged across all models and datasets, AdamW gets 1.2\\% higher accuracy ID and 4.0\\% higher accuracy OOD (Tables~\\ref{tab:ood_bigtable_final}-\\ref{tab:id_bigtable_final}).\n\nA key difference between AdamW and SGD, is that AdamW normalizes the gradient update of each parameter using an estimate of their second moments. Thus, parameters with consistently high gradients will change less when using AdamW than with SGD.\nTowards understanding these dynamics better, we examine the gradients at each layer of our pretrained models.\nWe find that for the models where AdamW significantly outperforms SGD, the gradients at pretrained initialization of the first ``embedding'' layer are much larger than the gradients of the other layers.\n\nTo test if over-training of the embedding layer is in fact why SGD performs worse than AdamW, we consider a minor modification where we freeze the embedding layer and tune the rest of the model with SGD (Figure~\\ref{fig:vit_simplified})---we call this SGD (freeze-embed).\nIn vision transformer models, the embedding layers are only a small fraction (around 0.7\\% for ViT-B\/16) of the total parameters of the model, so a priori we might not expect a substantial difference in accuracies.\nHowever, surprisingly this simple freezing of the embedding layer consistently improves SGD performance across most models and datasets and achieved ID and OOD accuracies that are competitive with or better than AdamW (Figure \\ref{fig:three graphs}). \nAveraged across all datasets and models, {SGD (freeze-embed) gets 76.7\\% accuracy OOD (vs. 72.0\\% for SGD and 76.0\\% for AdamW)}. The analogous AdamW (freeze-embed) gets 76.5\\%, which does not improve over SGD (freeze-embed), supporting that freeze-embed may be the reason AdamW outperforms SGD (it is not an independent axis of improvement).\n\nInspired by our results from SGD (freeze-embed), we explored further variations of our method on CLIP ViTs. First, we tried a more memory efficient variation, SGD (freeze-embed, no momentum), which drops the momentum state in SGD. At least on CLIP models, we see that this variation gets better accuracy than SGD (freeze-embed) while giving additional memory gains. Second, we revisit the layerwise unfreezing technique proposed in prior work like ULMFiT~\\citep{howard2018universal} and related methods~\\citep{mukherjee2019distilling, romero2020targeted}. %\nWe find that with a certain exponential decay in learning rate, a gradual unfreezing procedure in some cases can lead to further gains in ID and OOD accuracies (Figure \\ref{fig:three graphs}).\nHowever, a large fraction of the gain over SGD appears to come from simply freezing the embedding layer, which suggests that the embedding layer plays a key role in modern vision architectures and merits further investigation. \n\nIn terms of resource comparison, our profiling on a Titan-X GPU shows that on a ViT-B\/16, AdamW uses $16\\%$ and $36\\%$ more memory than SGD (freeze-embed) and SGD (freeze-embed, no momentum), respectively. The memory overhead of AdamW increases with the size of the models. On a ViT-L\/14 the memory overheads of AdamW are $18\\%$, and $49\\%$, respectively. Gradual-unfreezing provides a gain in computational time of about $30\\%$ over AdamW.\n\nThese methods and insights, while simple, lead to state-of-the-art accuracies on all five datasets: WILDS-Camelyon, WILDS-FMoW, DomainNet, Waterbirds, and BREEDS Living-17, while being more compute and memory efficient than AdamW.\n\n\n\n\n\n\n\n\n\n\n\n\n\\section{Acknowledgements}\n\nWe thank Percy Liang, Tengyu Ma, Yuanzhi Li, and Zhiyuan Li for helpful comments.\n\n\\clearpage\n\n\\section{Additional related works}\n\nMany works in transfer learning propose freezing parameters while fine-tuning to preserve pretrained information. For example, linear probing, which freezes the entire model except the head~\\citep{kumar2022finetuning, wortsman2021robust} and zero-shot models~\\citep{radford2021clip} have been shown to improve OOD performance over standard fine-tuning. In NLP, methods such as prefix-tuning~\\citep{li2021prefix} and prompt-tuning~\\citep{lester2021power} have been shown to improve OOD accuracy. Other works propose regularizing parameters towards initialization, freezing \nthe first several layers, using\ndifferent learning rates for different layers, or tuning different layers for different examples~\\citep{long2013transfer, ge2017borrowing,howard2018universal, guo2019spottune,zhang2020sidetuning,zhu2020freelb,jiang2021smart,aghajanyan2021finetuning}.\nTypically, a large fraction of the model is frozen to preserve the pretrained information---a key difference in this work is that we find that freezing a very small fraction of the model (<1\\% of the parameters) can lead to substantial and consistent improvements in accuracy.\n\nOther optimizers have been proposed to reduce AdamW's memory footprint, including LARS~\\citep{You2017LargeBT} and AdaFactor~\\citep{shazeer2018adafactor}. Our method is simpler and achieves better accuracies with same or better memory gains. A complementary line of work \\cite{dettmers2022optimizers} study quantization mechanisms for optimizer states. These tools, although developed for AdamW, can also be used with SGD (freeze-embed) to get additional gains in memory. \n\n\n\\section{Scope and setup}\\label{sec:problem_setting}\n\n\nWe use the following notation: a network map $f_\\theta:\\mathcal{X}\\to\\mathcal{Y}$ is represented as a composition of layers as $f_\\theta = f^{(\\mathsf{head})}_{\\theta_{\\mathsf{head}}} \\circ f^{(\\mathsf{L})}_{\\theta_L} \\circ \\ldots \\circ f^{(\\mathsf{1})}_{\\theta_1} \\circ f^{(\\mathsf{embed})}_{\\theta_{\\mathsf{embed}}}$, where $\\theta=(\\theta_{\\mathsf{head}}, \\theta_L, \\ldots, \\theta_1, \\theta_{\\mathsf{embed}})$ denote all the parameters of the model. We use $f^{(\\mathsf{embed})}_{\\theta_{\\mathsf{embed}}}$ and $f^{(\\mathsf{head})}_\\theta_{\\mathsf{head}}$ to denote blocks that can conceptually be considered the ``embedding'' layer and the ``head'', respectively. %\n\n\n\\paragraph{Fine-tuning.} Consider networks that have been \\emph{pretrained} to get an initialization $\\theta^{\\mathsf{pretrain}}$. We focus on \\emph{fine-tuning} on a labeled dataset $D_{\\mathsf{train}}{\\color{olive} \\sim P_{\\mathsf{finetune}}}$ from a new task.\nConcretely, given a loss function $\\ell : \\mathcal{Y} \\times \\mathcal{Y} \\to \\mathbb{R}_{\\geq 0}$, we minimize the training loss $L(\\theta) = \\frac{1}{\\lvert D_{\\mathsf{train}} \\rvert} \\sum_{(x, y) \\in D_{\\mathsf{train}}} \\ell(f_{\\theta}(x), y)$ using iterative optimization algorithms starting from the initialization $\\theta^{\\mathsf{pretrain}}$. %\n\nWe evaluate the accuracy of fine-tuned models on held-out in-distribution (ID) and out-of-distribution (OOD) test datasets. For ID evaluation, we use samples $D_{\\mathsf{test}}^{\\mathsf{id}} \\sim {\\color{olive} P_{\\mathsf{finetune}}}$ from the same distribution as the fine-tuning training dataset.\nTo examine whether we have learned a robust model, we consider benchmarks that also provide OOD test examples $D_{\\mathsf{test}}^{\\mathsf{ood}} \\sim {\\color{purple} P_{\\mathsf{ood}}}$, which differs from the fine-tuning distribution $ {\\color{olive}P_{\\mathsf{finetune}}}$ in practically meaningful ways. \n\n\n\\subsection{Optimizers: SGD (with momentum) and AdamW}\n %\nThe two most common optimizers for minimizing the fine-tuning loss $L(\\theta)$ from pretrained initialization are SGD (with momentum) and AdamW. We will introduce other optimizers as needed. \nCompared to vanilla SGD (no momentum), which only stores the parameters and gradients as optimizer states, SGD (with momentum) stores 1 extra state per parameter (to track the first moment), while AdamW stores 2 extra states per parameter (to track the first and second moments)---see Appendix~\\ref{app:setup} for exact updates. This corresponds to a difference between AdamW and SGD of 4GB GPU memory per 1B parameter model during training\\footnote{The bottleneck for memory in older ResNe(X)ts is typically the number of activations, which is often much higher than the number of parameters. However, in modern large transformer training, memory requirements are of the same scale as the number of parameters. Further, techniques such as gradient accumulation and gradient checkpointing can make the activation memory small leaving the optimizer states as the main bottleneck. }. With the current scale of the models 100s of billions parameters and increasing, such memory overheads are very costly \\citep{dettmers2022optimizers}. Thus, understanding when and how we can use the cheaper SGD compared to AdamW can significantly improve training of ultra-large scale models. \n\n\n\n\n\\subsection{{Datasets and model architectures}}\n\n\\paragraph{Datasets.} We choose five fine-tuning benchmarks that capture different types of data shifts (subpopulation shifts, spurious correlations, style shifts), including two real world shifts in medical imaging and satellite remote sensing from the WILDS benchmark. %\nThe datasets we consider are:\n\\begin{compactenum}\n\\item \\textbf{Living-17}~\\citep{santurkar2020breeds} is a sub-population shift dataset from the BREEDS benchmark. The goal is to classify an image as one of 17 animal categories with ID and OOD data from different sub-categories. For example, in the ``bear'' category, the ID dataset contains black bears and sloth bears and the OOD dataset has brown bears and polar bears.\n\\item \\textbf{Waterbirds}~\\citep{sagawa2020group} is a spurious correlation dataset where the goal is to classify an image as a ``waterbird'' or ``landbird''. In the ID dataset, ``water'' backgrounds are typically correlated with ``waterbird'' labels, but are uncorrelated in the OOD dataset.\n\\item \\textbf{DomainNet}~\\citep{peng2019moment} is a domain adaptation benchmark. The ID dataset contains \\textit{sketch} images (e.g., drawings of apples, elephants, etc), and the OOD dataset contains \\textit{real} images of the same categories. We use the version of the dataset from~\\citet{tan2020coal}.\n\\item \\textbf{WILDS-FMoW}~\\citep{christie2018fmow, koh2021wilds} consists of remote sensing satellite images. The goal is to classify a satellite image into one of 62 categories such as ``impoverished settlement'' or ``hospital''. The ID dataset contains satellite images from across the world between 2002 and 2012, and the OOD dataset contains images from Africa in 2017.\n\\item \\textbf{WILDS-Camelyon}~\\citep{bandi2018detection, koh2021wilds} is a medical images dataset. The task here is to classify whether a tissue slide has a tumor or not. The ID and OOD datasets contain slides from different hospitals.\n\\end{compactenum}\n\n\n\\paragraph{Model Architectures.} We consider seven popular pretrained models listed below that span different architectures (vision transformers and convolutional networks), network sizes, and pretraining objectives (multi-modal, supervised, self-supervised). %\n\\begin{compactitem}\n\\item[(1-2)] CLIP ViT-B\/16 and CLIP ViT-L\/14~\\citep{radford2021clip}: CLIP vision transformers of two sizes pretrained on a custom multi-modal WebImageText (WIT) dataset. \n\\item[(3)] ViT-B\/16~\\citep{dosovitskiy2021vit}: vision transformer pretrained on Imagenet-21k.\n\\item[(4)] DINO ViT-B\/16~\\citep{caron2021emerging}: self-supervised ViT pretrained on ImageNet-1K. \n\\item[(5)] ConvNeXt-B~\\citep{liu2022convnet}: modernized convolutional network pretrained on ImageNet-21k using advanced data augmentations and MixUp as in \\cite{Touvron2021TrainingDI}.\n\\item[(6-7)] BiT ResNet-50 and BiT ResNet-101~\\citep{Kolesnikov2020BigT}: ResNetV2 models of two sizes pretrained on ImageNet-21k.\n\\end{compactitem}\n\n\n\\textit{$f^{(\\mathsf{embed})}_{\\theta_{\\mathsf{embed}}}$ and $f^{(\\mathsf{head})}_{\\theta_{\\mathsf{head}}}$}: For vision transformer models, we consider the patch-to-token embedding layer along with its layer norm if present as the \\textit{embedding layer}. For convolutional networks, the \\textit{embedding layer} refers to the ``stem'' block along with the first stage: the ``stem'' in ResNetV2 is a $7\\times 7$ convolution with stride $2$ followed by a $2\\times 2$ MaxPool; while in ConvNeXt it is a non-overlapping $4\\times 4$ convolution with stride $4$. For each downstream task, we replace the final layer of all the pretrained models with a randomly initialized classifier \\textit{head} $f^{(\\mathsf{head})}_{\\theta_{\\mathsf{head}}}$.\n\n\n\n\n \n\\section{Initial observations: SGD, AdamW, and layer gradients}\n\n\nModern deep learning models increasingly use AdamW for pretraining, where it has been repeatedly shown to produce better features for downstream tasks than SGD \\citep{dosovitskiy2021vit,liu2021Swin,liu2022convnet}. %\nFor fine-tuning, on the other hand, there are no systematic studies or a definitive answer as to whether AdamW or SGD should be used \\citep{dosovitskiy2021vit,Touvron2021TrainingDI}. %\nThe ablation study in \\citet{Touvron2021TrainingDI} even found that there is no difference in performance between AdamW and SGD when fine-tuning on ImageNet-1K. ConvNext \\citep{liu2022convnet} and Swin transformers \\citep{liu2021Swin} papers report using AdamW for fine-tuning, but they do not mention a comparison with SGD. In this work we focus on better understanding the dynamics of AdamW and SGD during the fine-tuning phase. \nDetailed results are discussed in Section~\\ref{sec:mainexp}. \nWe first highlight some initial observations below. \n\n\\subsection{AdamW vs SGD}\n\n\\paragraph{AdamW outperforms SGD.} We find that, generally speaking, fine-tuning with AdamW produces better results than with SGD, especially for more recent models like ViT variants and ConvNeXt. The gaps are more dramatic on out-of-distribution (OOD) test accuracies compared to in-distribution (ID). See Table~\\ref{tab:ood_bigtable_final} and Table~\\ref{tab:id_bigtable_final} for the full OOD and ID results, respectively.\nAveraged across the 7 models and 5 datasets, AdamW gets an {OOD accuracy of 76.0\\% (vs. 72.0\\% for SGD), and an ID accuracy of 91.5\\% (vs. 90.3\\% for SGD)}. We emphasize that this happens even though we sweep over 6 learning rates and early stop. Note also that these averages slightly underestimate the gaps in newer architectures as they also include the two older ResNet models, where we did not find significant differences. %\n\n\\paragraph{AdamW $\\approx$ SGD on BiT ResNets.}\nBreaking down the results by model type, we find that AdamW and SGD perform comparably for older convolutional networks, namely BiT ResNet-50 and BiT ResNet-101. For example, on a BiT ResNet-101, AdamW gets an average OOD accuracy of 74.5\\% (vs. 74.6\\% for SGD).\nHowever, for modern architectures including the modernized convolutional network (ConvNeXt), AdamW gets significantly higher accuracies.\n\n\\sgnote{I am removing accuracy gap for larger models is bigger to clip detailed evlauation section -- fr one we are not completely sure of the statement and it also does not fit in well with the initial section narrraitve --gradient outlier is smaller for clip vit-l}\n\n\\subsection{Examining layer gradients}\n\nA key operational difference between AdamW and SGD is that AdamW divides the gradient update for each parameter by a weighted running average of its second moments. So parameters with consistently high gradients will change less when using AdamW than with SGD. This suggests examining the gradients across different components of the neural network---if they vary a lot, then AdamW and SGD will behave very differently.%\n\nWe measure the average gradient norm at each layer, across minibatches of the training set.\nMore formally, recall our notation for network layers as $f_\\theta = f^{(\\mathsf{head})}_{\\theta_{\\mathsf{head}}} \\circ f^{(\\mathsf{L})}_{\\theta_L} \\circ \\ldots \\circ f^{(\\mathsf{1})}_{\\theta_1} \\circ f^{(\\mathsf{embed})}_{\\theta_{\\mathsf{embed}}}$. Given a minibatch $B=\\{ (x_1, y_1), \\ldots, (x_b, y_b) \\}$ of random samples from the training data, the stochastic gradient of layer $\\ell\\in \\{\\mathsf{embed},1,2,\\ldots,L,\\mathsf{head}\\}$ is given by: \n$g_\\ell(B) = \\frac{1}{|B|} \\sum_{i=1}^{|B|} \\nabla_{\\theta_\\ell} l(f_{\\theta^{\\mathsf{pretrain}}}(x_i), y_i)$. \nThe norm of the stochastic gradient, $\\|g_\\ell(B)\\|_2$, roughly measures how much layer $\\ell$ will change after one step of SGD from pretrained initialization. We use the average gradient norm across all minibatches $B_1, \\ldots, B_m$ in the training set $D_{\\mathsf{train}}$ as a measure of movement in the first SGD step. \n\\begin{equation}\n G^{\\mathsf{init}}_\\ell = \\frac{1}{m} \\sum_{t=1}^{m} \\|g_\\ell(B_t)\\|_2,\\text{ where }\\ell\\in \\{\\mathsf{embed},1,2,\\ldots,L,\\mathsf{head}\\}.\n \\label{eq:gradnormavg}\n\\end{equation}\nNote that we measure all the gradients at the pretrained initialization $\\theta^{\\mathsf{pretrain}}$---before performing any gradient updates. In Figure~\\ref{fig:gradient_norm}, we plot the layer-wise gradient norms $G^{\\mathsf{init}}_\\ell$ on DomainNet. Similar plots for other datasets and with alternative normalization are provided in Appendix~\\ref{app:gradnorm}.\n\n \n\n\\begin{figure}[t]\n \\centering\n \\includegraphics[width=0.69\\textwidth]{figures\/domain_net_grad_plot.png}\n \\caption{\n We visualize the layer-wise gradient norms our models on DomainNet at the pretrained initialization. For each layer, we plot the average minibatch gradient norm $G^{\\mathsf{init}}_\\ell$ as computed in \\eqref{eq:gradnormavg}. We highlight two special layers: gradient norms of the ``embedding'' layer parameters $G^{\\mathsf{init}}_{\\mathsf{embed}}$ are shown as {\\color{red}\\textbf{red-squares}}, and those of the classifier ``head''s $G^{\\mathsf{init}}_{\\mathsf{head}}$ are show as {\\color{green!60!black} \\textbf{green-triangles}}. The middle layer gradient norms are shown as \\textbf{black-circles}. For transformer models, we have separate (black) points for the MLP and the attention layers. %\n %\n }\n \\label{fig:gradient_norm}\n\\end{figure}\n\n\\paragraph{First-layer gradient is an outlier.}\nApriori, we expect the gradients of the classifier ``head'' (green-triangles) to be large as they are randomly initialized while the rest of the model is pretrained~\\citep{kumar2022finetuning}. The interesting observation we see in Figure~\\ref{fig:gradient_norm} (see also Appendix~\\ref{app:gradnorm}) is that for the recent architectures (Vision Transformers and ConvNeXt), gradient norms of the ``embedding'' layers ({red-squares}) stand out as outliers with much larger gradients than the other layers. These are also the models where see big gaps between AdamW and SGD in Tables~\\ref{tab:ood_bigtable_final}-\\ref{tab:id_bigtable_final}. \nThis suggests that the embedding layer plays a distinctive role in the transfer learning from modern architectures. \n\nWe emphasize again that Figure~\\ref{fig:gradient_norm} shows gradient norms at pretrained initialization \\emph{before} any updates have been performed. Thus, the large gradients of the embedding layer is \\textit{not the effect} of SGD vs AdamW fine-tuning. Rather, these trends hint at a potential \\textit{explanation} for the differences between them. \nSince SGD uses the same learning rate for all layers, we will end up make substantially larger updates to the embedding layer compared to other layers---leading to either over-tuning the embedding layer or under-tuning the remaining layers (which also includes the randomly initialized head). \nOver-training of the embedding layer is undesirable given the common wisdom that lower layers ought to be tuned less as they learn more transferable features~\\citep{kumar2022finetuning}. %\nAdamW on the other hand adaptively normalizes the movement of each parameter. %\n \nHow can we avoid the above issues with SGD? One possibility is to use different learning rates for different layers, but this might end up requiring extensive hyperparameter tuning. Another option is to use optimizers with layerwise normalization techniques like LARS \\citep{you2017crop} and LAMB \\citep{you2020large}. In our initial experiments (see Table~\\ref{tab:clip_results}), while these methods improved over SGD, they did not close the gap with AdamW. Instead, we found a much simpler modification to SGD that consistently leads to accuracies competitive with or better than AdamW while using lower memory. \n\n\n\n \n\n\\subsection{Freeze-Embedding}\n\nWhile the presence of large embedding layer gradients in Figure~\\ref{fig:gradient_norm} correlates with the observed performance gaps between AdamW and SGD, it is not clear that this observation or its potential issues discussed above are definitive \\emph{causes} for SGD performing worse than AdamW. To further test the intuition, in the next section, we consider a ``freeze-embed'' variation of fine-tuning, where we simply freeze the embedding layer to its pretrained initialization, and then fine-tune the rest of the model as usual. The embedding layer only consists of a small fraction of the model parameters (e.g., 0.7\\% in a base vision transformer), so apriori freezing the embedding layer is a very tiny tweak---and we would not expect a large change in accuracy. However, if the hypothesis above holds merit, then we would expect the modification to aid SGD but not AdamW. \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\\subsection{SoTA experiments and results}\nOur experiments get new state-of-the-art results for OOD accuracy on all 5 datasets. On 3\/5 datasets (Living-17, WILDS-FMoW, and WILDS-Camelyon), our proposed SGD (freeze-embed) does the best, while in other 2, AdamW has a small edge. Here, state-of-the-art means that the numbers we get are better than, to our knowledge, any reported number and all numbers on the official leaderboard, and are better than standard full fine-tuning with SGD. We show the best results from our paper in Table~\\ref{tab:sota_results} with a comparison to the previous state-of-the-art. \\sgnote{what about gradual unfreezing?} %\n\n\n\n\\begin{table}[h!]\n\\caption{\nOur OOD accuracy results compared with the best reported numbers in prior work on these datasets. We restrict to methods that \\emph{do not} use OOD data for hyperparameter selection or early stopping. To our knowledge, the previous state-of-the-art results are from~\\citet{wortsman2022modelsoups} for FMoW,~\\citet{Robey2021ModelBasedDG} for Camelyon,~\\citet{kumar2022finetuning} for Living-17 and the version of DomainNet introduced by~\\citet{tan2020coal}, and~\\citet{ghosal2022vision} for Waterbirds. The WILDS numbers and references are taken from the official WILDS leaderboard (as of 28 Sep 2022), and for Waterbirds we consider all methods that do not use group labels. {For Living-17, we omit models pretrained with ImageNet-1K as Living-17 is a subset of ImageNet-1K.} %\n}\n\\label{tab:sota_results}\n\\begin{center}\n\\resizebox{\\linewidth}{!}{\n\\begin{tabular}{cccccc}\n\\toprule\n & Living-17 & Waterbirds & DomainNet & FMoW & Camelyon\\\\\n \\midrule\n Best prior result & 87.6 & 89.3 & 87.2 & 47.6 & 93.3 \\\\\n \\midrule\n \\vspace{0.02in}\n Best result from our paper & \\textbf{90.5} & \\textbf{89.8} & \\textbf{93.8} & \\textbf{49.9} & \\textbf{96.5} \\\\\n \\vspace{0.02in}\n Optimizer for best result & \\begin{tabular}{@{}c@{}}SGD \\\\ (freeze-embed) \\end{tabular} & AdamW & AdamW & \\begin{tabular}{@{}c@{}}SGD \\\\ (freeze-embed) \\end{tabular} & \\begin{tabular}{@{}c@{}}SGD \\\\ (freeze-embed) \\end{tabular} \\\\\n \\vspace{0.02in}\n Model for best result & CLIPViT-L\/14 & ConvNeXt-B & CLIP ViT-L\/14 & CLIP ViT-L\/14 & CLIP ViT-L\/14 \\\\\n \\midrule\n SGD (freeze-embed) result & \\textbf{90.5} & 86.9 & {93.1} & \\textbf{49.9} & \\textbf{96.5} \\\\\n \\bottomrule\n\\end{tabular}\n}\n\\end{center}\n\\end{table}\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\n\nCompact star clusters around supermassive black holes (SMBHs) in galactic nuclei are the densest known stellar systems in the Universe. Rapid exchange of angular momentum between the stars and stellar remnants in these environments causes stars to be occasionally perturbed onto low angular momentum (``loss cone'') orbits, which bring them near or within the tidal radius of the SMBH.\n\nThe vast majority of ill-fated stars descend to the SMBH on nearly parabolic orbits, from initial distances comparable to the parsec-scale SMBH sphere of influence (e.g. \\citealt{Magorrian&Tremaine99,Wang&Merritt04,Stone&Metzger16}). Depending on the depth of the pericenter distance relative to the tidal radius, these ``plunge\" events result in a partial or complete dynamical disruption of the star accompanied by strong tidal compression, a phenomenon commonly known as a ``tidal disruption event\" (TDE; \\citealt{Hills75,Carter&Luminet83,Evans&Kochanek89,Lodato+09,Guillochon&RamirezRuiz13,Stone+13}). \nPrompt accretion by the SMBH of the gaseous debris of the disrupted star following a TDE was predicted to power a luminous flare (\\citealt{Rees88,Phinney89,Ulmer99}), characterized by a rise time of weeks to months and followed by a $\\propto t^{-5\/3}$ power-law decay in the bolometric light curve set by the declining rate of mass fallback at late times. \n\nDespite this initial picture, recent numerical and analytic works have demonstrated that it is non-trivial to circularize the highly eccentric stellar debris streams created by the TDE into the compact accretion disk needed to power a flare (e.g., \\citealt{Hayasaki+13,Shiokawa+15,Dai+15,Hayasaki+16,Guillochon&RamirezRuiz15,Bonnerot+16,Coughlin+16,Sadowski+16,Bonnerot+17,Tejada+17}). This has lead to speculation that only a small fraction of TDE are accompanied by luminous flares, with most instead being ``dark\" (\\citealt{Guillochon&RamirezRuiz15,Hayasaki+16}) or producing emission through less efficient mechanisms than standard thin-disk accretion (\\citealt{Shiokawa+15,Piran+15,Miller15,Metzger&Stone16}). This possibility is supported by the discrepency between the theoretically-predicted TDE rate (\\citealt{Stone&Metzger16,Kochanek16}) and the lower flare rate observed from optical surveys (e.g., \\citealt{vanVelzen+11,vanVelzen&Farrar14, Holoien+16}). \n\nIn addition to those stars on parabolic plunges fated to produce TDEs, a smaller fraction approach the SMBH on more tightly bound orbits with lower eccentricities. These ``extreme mass ratio inspirals\" (EMRIs) have received attention as gravitational wave sources for the Laser Interferometer Space Antenna (LISA; \\citealt{LISA17}). This is especially true when the EMRI bodies are compact remnants (white dwarfs, neutron stars, and stellar mass black holes) for which tidal forces play little to no role in their inspiral evolution prior to their final plunge into the event horizon (although see \\citealt{Zalamea+10}).\n\nEMRIs of {\\it main sequence} stars have received comparatively less attention than their compact remnants, in part because matter interactions alter the gravitational wave inspiral signal (\\citealt{Linial&Sari17}) and thus reduce their potential as pristine probes of general relativity. If a main sequence star approaches the tidal sphere on a nearly circular orbit and begins overflowing its Roche lobe, mass transfer onto the SMBH is stable, resulting in the star being slowly accreted over millions of years \\citep{King&Done93, Dai&Blandford13,Linial&Sari17}. When the response of the star to mass loss is adiabatic, or once its equation of state becomes dominated by electron degeneracy after it loses sufficient mass, the radius of the star expands and its orbit evolves to {\\it larger} semi-major axes as a the result of further mass loss. The system may be described during this phase as an extreme mass ratio ``outspiral\" (e.g., \\citealt{Dai&Blandford13,Linial&Sari17}), similar to the orbital evolution of cataclysmic variables following the period minimum.\n\nThe rate of EMRIs due to bodies entering the loss cone via two-body gravitational interactions is estimated to be $\\sim 1\\times 10^{-6}$ yr$^{-1}$ per galaxy (\\citealt{BarOr&Alexander16, Aharon&Perets16}; see also \\citealt{Hils&Bender95,Sigurdsson&Rees97,Freitag01,Ivanov02,Alexander&Hopman03,Hopman&Alexander06b}), roughly $2$ orders of magnitude lower than the TDE rate. Due to the effects of mass segregation in nuclear clusters, this rate is also dominated by stellar mass black holes instead of lower mass main sequence stars or white dwarfs (e.g.~\\citealt{Hopman&Alexander06b,Aharon&Perets16}). Although the eccentricities of these ``two-body\" EMRIs are much lower than those of the plunge events, they are usually still significant ($e \\gtrsim 0.5-0.9$ on scales of the tidal radius; \\citealt{Hopman&Alexander05}), such that the fate of most main sequence EMRIs delivered by two-body interactions will also be tidal disruption, though their light curves will differ from canonical $1-e\\ll 1$ TDEs \\citep{Hayasaki+13}.\n\nMore nearly circular EMRIs are created by the tidal separation of stellar binaries by the SMBH (\\citealt{Miller+05,AmaroSeoane+12}). This is the same process hypothesized to produce the cluster of S-stars orbiting Sgr A$^{*}$ (e.g., \\citealt{Perets+09}) and hypervelocity stars from our galactic centre (e.g.~\\citealt{Hills88,Sari+10}). \\citet{AmaroSeoane+12} estimate the rate of circular EMRIs to be $\\sim 10^{-7}$ yr$^{-1}$ per galaxy for an assumed binary fraction of $5\\%$ (lower than in the field due to the dissociation of the soft binaries in the dense stellar environment of the nuclear cluster). This rate could be up to two orders of magnitude higher in galactic nuclei with large numbers of massive perturbers \\citep{Perets+07} or nuclear spiral arms \\citep{Hamers&Perets17}.\n\n\nThis work develops an observable consequence of the existence of stable mass-transferring EMRIs, which is closely related to the fact that the lifetime of these systems is comparable to the average time interval between consecutive EMRIs. As we will show, this naturally predicts a collision, or a series of quasi-periodic collisions, between every two inspiraling (or, more typically, one inspiraling and one outspiraling) stars as their semi-major axes cross on a radial scale of $\\lesssim$ few AU. Such collisions, which happen deep within the potential well of the black hole at relative velocities up to several tenths of the speed of light, can seriously damage or completely obliterate both stars, leading to punctuated episodes of sizable gas production. \n\nRapid accretion of this gas by the SMBH powers a single luminous flare, or a series of periodic flares lasting hundreds to thousands of years or longer, caused by multiple grazing encounters between the stars separated by intervals of decades to centuries. Although this emission mechanism is qualitatively similar to the common picture of TDE flares, EMRI collision flares may be observed more frequently than would be naively guessed from the low EMRI rate. This is because standard TDEs may suffer from low radiative efficiencies due either to super-Eddington accretion rates \\citep{Ayal+00, Metzger&Stone16} or, conversely, difficulty circularizing highly eccentric debris streams \\citep{Hayasaki+13, Shiokawa+15, Guillochon&RamirezRuiz15, Hayasaki+16, Bonnerot+16}. Indeed, small accreted masses in putative TDE flares are consistent with the low bolometric energy fluences inferred by their optical\/UV SEDs relative to the expection of thin disk accretion, as shown in Fig.~\\ref{fig:Erad} (though the minority of flares seen to exhibit luminous IR dust echoes may have higher bolometric luminosities; \\citealt{vanVelzen+16}). Collisions among circularized EMRIs can make more judicious use of the available stellar mass budget, as accretion rates are generally sub-Eddington and collisionally liberated gas is produced on initially circular orbits.\n\n\nThis scenario raises the possibility that some nuclear transients currently identified as TDE flares may in fact be EMRI collision products, i.e. ``TDE Imposters\". Indeed, we show that otherwise puzzling behavior seen in some of these flares, such as light curves which decay exponentially in time rather than as power-laws, may find a natural explanation in the EMRI collision model. Viscous spreading of the accretion disks (out to radial scales of $\\gtrsim 10-100$ AU) made in regular gas production events over the prolonged interval of the collisional flaring activity also provides an alternative source for the extended reprocessing layer needed to explain the unexpectedly high optical luminosities of many TDE flares.\n\nThis paper is organized as follows. In $\\S\\ref{sec:emri}$ we review the evolution of stable mass transfer from a main sequence star onto a SMBH. In $\\S\\ref{sec:collision}$ we discuss the conditions required for a collision between two consecutive EMRI stars. In $\\S\\ref{sec:transient}$ we discuss the observable signatures of such a collision, including periodic flares from SMBH accretion, compare them to the observed population of TDE flares, and discuss the interactions of main sequence EMRIs with bona fide TDEs. In $\\S\\ref{sec:conclusions}$ we briefly summarize our conclusions. \n \n\n\\begin{figure*}[!t]\n\\includegraphics[width=1.0\\textwidth]{Eradplot2.pdf}\n\\hspace{0.0cm}\n\\caption{\\footnotesize\n{Total radiated energy $E_{\\rm rad}$ of optically-selected TDE flare candidates as a function of SMBH mass, calculated using bolometric light curve data compiled by \\citet{Hung+17} (estimated by fitting the optical\/NUV SEDs to a single temperature blackbody), and using redshifts from the Open TDE Catalog\\footnote{\\url{http:\/\/TDE.space}}. Purple circles show flares where the light curve is temporally resolved, while brown triangles show lower limits on $E_{\\rm rad}$ in cases when the light curve peak is not resolved. Overplot is the expected value of $E_{\\rm rad} = 0.1 (f_{\\rm in}M_{\\star})c^{2}$ following the accretion of a $M_{\\star} = 1M_{\\odot}$ star for different accretion efficiencies $f_{\\rm in}$, but limiting the radiated luminosity at all times to the Eddington luminosity for the given SMBH mass assuming a peak flare duration equal to the expected mass fall-back time. This is an updated version of a similar plot (Fig. 2) from \\citet{Stone&Metzger16}. The 12 data points represent the TDE candidates iPTF16axa, ASASSN-14ae, PS1-11af, PS1-10jh, ASASSN-14li, iPTF16fnl, ASASSN-15oi, TDE1, TDE2, D1-9, D3-13, and PTF09ge. Estimates for $M_\\bullet$ and its error range are taken from \\citet{Hung+17, Holoien+14, Chornock+14, Gezari+12, vanVelzen+16, Blagorodnova+17, Holoien+16b, vanVelzen+11, Gezari+08, Arcavi+14}. In two cases (ASASSN-14ae and ASASSN-15oi) the discovery papers do not quote errors on SMBH mass estimates, so for these we have plotted approximate error intervals corresponding to 0.3 dex of scatter typical to galaxy scaling relations.}\n}\n\\label{fig:Erad}\n\\end{figure*}\n\n\n\n\\section{EMRI Mass Transfer Evolution}\n\\label{sec:emri}\n\n\nWe consider stars inspiraling into the SMBH on nearly circular orbits when they reach the point of Roche lobe overflow (RLOF) on radial scales of a few AU (see below). As discussed above, this will not be satisfied for most of the main sequence EMRIs produced by two-body scattering or resonant relaxation, which instead will possess high eccentricies $e \\gtrsim 0.5$ at this separation and will likely undergo tidal disruption. \n\nHowever, EMRIs created by tidally detached binaries will generally possess lower eccentricities $e \\sim 0.01-0.05$ when their pericenters reach these distances (\\citealt{Miller+05,AmaroSeoane+12}). Depending on the competition between circularization of the orbit due to gravitational wave emission versus that due to tidal friction, these stars will either undergo tidal disruption or they will end up in circular, stably mass-transferring orbits (see discussion in \\citealt{AmaroSeoane+12}). We focus on the latter case, which accounts for a large portion of the allowed parameter space for a reasonable range in the theoretically uncertain value of the $Q$ parameter controlling the rate of tidal circularization.\n\nOnce in a nearly circular orbit of semi-major axis $a$, a star of mass $M_{\\star}$ orbiting the SMBH of mass $M_{\\bullet} \\gg M_{\\star}$ loses energy to gravitational wave (GW) emission on the timescale\n\\begin{equation}\n\\tau_{\\rm GW} \\equiv \\frac{a}{|\\dot{a}|} \\simeq \\frac{5}{64}\\frac{ c^{5} a^{4}}{G^{3}M_{\\star}M_\\bullet^{2}} \\approx 1.3\\times 10^{4}\\,{\\rm yr}\\,\\,\\frac{a_{\\rm AU}^{4}}{M_{\\star,\\odot}M_{\\bullet,7}^{2}},\n\\label{eq:tauGW}\n\\end{equation}\nto lowest post-Newtonian order. Here $M_{\\star,\\odot} \\equiv M_{\\star}\/M_{\\odot}$, $M_{\\bullet,7} \\equiv M_{\\bullet}\/10^{7}M_{\\odot}$, $a_{\\rm AU} \\equiv a\/$AU, and we have written the gravitational constant and the speed of light as $G$ and $c$, respectively.\n\nThe size of the star's Roche lobe in the extreme mass ratio limit is given by (\\citealt{Eggleton83})\n\\begin{equation}\nR_{\\rm L} \\simeq 0.462 a \\left(\\frac{M_{\\star}}{M_{\\bullet}}\\right)^{1\/3}.\n\\end{equation}\nThis becomes equal to the radius of the star $R_{\\star}$ below a critical semi-major axis\n\\begin{eqnarray}\na_{0} &\\simeq& 2.17 R_{\\star} \\left(\\frac{M_{\\bullet}}{M_{\\star}}\\right)^{1\/3} \\approx 2.16\\,{\\rm AU}\\,R_{\\star,\\odot}M_{\\bullet,7}^{1\/3}M_{\\star,\\odot}^{-1\/3} \\nonumber \\\\\n&\\approx& 2.16\\,{\\rm AU}\\,M_{\\bullet,7}^{1\/3}M_{\\star,\\odot}^{7\/15},\n\\label{eq:a0}\n\\end{eqnarray}\nwhere in the second line we have used a mass-radius relationship $R_{\\star} \\simeq R_{\\odot} M_{\\star,\\odot}^{4\/5}$ appropriate for low mass main sequence stars \\citep{Kippenhahn&Weigert90}. Below a critical black hole mass $M_{\\bullet} \\lesssim 7\\times 10^{7}M_{\\star,\\odot}^{7\/10}M_{\\odot}$, the star overflows its Roche lobe outside the innermost stable circular orbit (ISCO) $R_{\\rm isco} = 6GM_{\\bullet}\/c^{2}$ for a Schwarzschild black hole. \n\nThe GW inspiral time at Roche contact is\n\\begin{equation}\n\\tau_{\\rm GW,0} \\equiv \\tau_{\\rm GW}(a_{0}) \\approx 2.8\\times 10^{5}\\,{\\rm yr}\\,M_{\\star,\\odot}^{13\/15}M_{\\bullet,7}^{-2\/3}.\n\\label{eq:tauGW0}\n\\end{equation}\nFollowing Roche overflow, the star loses mass, primarily through the inner L1 Lagrange point, at a characteristic rate,\n\\begin{equation}\n\\dot{M_{\\star}} \\simeq -\\frac{M_{\\star}}{\\tau_{\\rm GW}}\n\\end{equation}\nAs the star loses mass, its radius changes according to $R_{\\star} \\propto M_{\\star}^{p}$, where the value of $p$ depends on the properties of the star and its response to mass loss (see below). \n\nCombining the above results, one finds\n\\begin{equation}\n\\frac{\\dot{M}_{\\star}}{M_{\\star}} = \\frac{-1}{\\tau_{\\rm GW,0}}\\left(\\frac{M_{\\star}}{M_{\\star,0}}\\right)^{\\frac{(7-12p)}{3}} = \\frac{-1}{\\tau_{\\rm GW,0}}\\left(\\frac{a}{a_{0}}\\right)^{\\frac{(7-12p)}{(3p-1)}},\n\\end{equation}\nwhere $M_{\\star,0}$ is the initial mass of the star. For a fixed value of $p$, this results in the following evolution as a function of time $t$ after the onset of Roche-lobe overflow,\n\\begin{equation}\n\\frac{M_{\\star}}{M_{\\star,0}} = \\left(1 - \\frac{12p-7}{3}\\frac{t}{\\tau_{\\rm GW,0}}\\right)^{\\frac{3}{12p-7}}\n\\label{eq:Mevo},\n\\end{equation}\n\\begin{equation}\n\\frac{a}{a_0} = \\left(1 - \\frac{12p-7}{3}\\frac{t}{\\tau_{\\rm GW,0}}\\right)^{\\frac{3p-1}{12p-7}}.\n\\label{eq:aevo}\n\\end{equation}\n\nIn reality, the value of $p$ evolves in time as the star loses mass. Following \\citet{Linial&Sari17}, for stars of initial mass $M_{\\star,0} \\lesssim 7.0M_{\\bullet,7}^{0.25} M_{\\odot}$, we have the following evolution\n\\begin{equation}\np = \\left\\{\n\\begin{array}{lr} 0.8, &\nM_{\\star} > M_{\\rm ad} \\\\\n4\/15, &\n1.2M_{\\odot}M_{\\bullet,7}^{0.1} < M_{\\star} < M_{\\rm ad}\\\\\n13\/21, &\n0.08M_{\\odot} (R_{\\star}\/0.1R_{\\odot})^{3} < M_{\\star} < 1.2M_{\\odot}M_{\\bullet,7}^{0.1}, \\\\\n\\approx 0, &\nM_{\\star} < 0.08M_{\\odot}(R_{\\star}\/0.1R_{\\odot})^{3} \\\\\n\\end{array}\n\\label{eq:p}\n\\right. ,\n\\end{equation}\nwhere $M_{\\rm ad} = 0.18M_{\\odot}(M_{\\star,0}\/M_{\\odot})^{17\/9}M_{\\bullet,7}^{-2\/9}$ is the critical mass at which the GW loss timescale $\\tau_{\\rm GW}$ equals the Kelvin-Helmholtz cooling timescale $\\tau_{\\rm KH}$. Stars with masses initially above this critical mass evolve close to the main sequence ($p = 0.8$), before evolving with $\\tau_{\\rm GW} = \\tau_{\\rm KH}$ at lower masses, with $p = 4\/15$ or $p = 13\/21$, depending on whether the stellar envelope is radiative or convective. In the final line of equation (\\ref{eq:p}), we have taken $p \\approx 0$ for stars below the hydrogen fusion limit to account for the radius being approximately independent of mass from brown dwarfs to Jupiter scale planets (e.g.~\\citealt{Chabrier+09}).\n\nThe above analysis assumes that mass transfer is stable, as occurs when upon mass loss the radius of the star decreases faster than its Roche lobe radius. Mass loss from the star feeds an accretion disk around the SMBH. A common assumption is that the gas disk transfers most of its angular momentum back to that of the orbit $J_{\\rm orb} \\simeq M_{\\star}(GM_{\\bullet}a)^{1\/2}$, which is therefore conserved\\footnote{In this stability analysis we are focusing on timescales much shorter than $\\tau_{\\rm GW}$, and therefore neglect angular momentum loss to gravitational radiation.}. Since \n\\begin{equation} \\frac{R_{\\rm L}}{R_{\\star}} \\propto aM_{\\star}^{1\/3-p} \\underset{\\rm J_{\\rm orb}=const}\\approx M_{\\star}^{-5\/3-p},\n\\end{equation}\nwe see that stable mass transfer requires $p > -5\/3$ in the conservative case, as is satisfied for all stages of evolution given in equation (\\ref{eq:p}). Even if no angular momentum is placed back into the stellar orbit, $R_{\\rm L}\/R_{\\star}$ still increases upon mass loss at fixed $a$ for $p > 1\/3$, as will be satisfied until the period minimum is reached and $p \\approx 0$.\n\n\\begin{figure*}[!t]\n\\includegraphics[width=0.5\\textwidth]{emri6}\n\\includegraphics[width=0.5\\textwidth]{emrirad6}\n\\includegraphics[width=0.5\\textwidth]{emri7}\n\\includegraphics[width=0.5\\textwidth]{emrirad7}\n\\hspace{0.0cm}\n\\caption{\\footnotesize\n{Evolution of semi-major axis (left panels) and stellar radius (right panels) as a function of time since the onset of Roche-lobe overflow onto the SMBH of mass $M_{\\bullet} = 10^{6}M_{\\odot}$ (top panel) and $10^{7}M_{\\odot}$ (bottom panel), shown for stars of several initial masses as marked. Squares and triangles denote, respectively, the point at which the stellar mass has decreased to one half and one tenth of its initial value.}\n}\n\\label{fig:orbit}\n\\end{figure*}\n\nFigure \\ref{fig:orbit} shows the evolution of the semi-major axis and stellar radius after RLOF contact as a function of time for SMBHs of mass $M_{\\bullet} = 10^{6}M_{\\odot}$ (top panel) and $10^{7}M_{\\odot}$ (bottom panel). Squares and triangles denote, respectively, the point at which the stellar mass has decreased to one half and one tenth of its initial value. \n\nLow mass stars $0.2-0.5M_{\\odot}$ lose half their mass in $0.1-0.5$ Myr, while higher mass $2-3M_{\\odot}$ stars require $1-3$ Myr to do the same. These timescales decrease with increasing SMBH mass, approximately as $\\propto \\tau_{\\rm GW,0} \\propto M_{\\bullet}^{-2\/3}$ (eq.~\\ref{eq:tauGW0}). \nThroughout most of their inspiral evolution, stars evolve from large to small semi-major axis in the convective regime $p = 13\/21$, and their semi-major axis evolves on a characteristic timescale (eqs.~\\ref{eq:Mevo}, \\ref{eq:aevo})\n\\begin{equation}\n\\tau_{\\rm GW}^{\\rm RLOF} = \\left(\\frac{a}{|\\dot{a}|}\\right)_{\\rm RLOF} = \\chi \\tau_{\\rm GW} \\underset{p = 13\/21}= \\frac{7}{2}\\tau_{\\rm GW}.\n\\label{eq:tauGWRLOF}\n\\end{equation} \nThis timescale is larger by a factor of $\\chi = 3\/(3p-1)$ than the inspiral time $\\tau_{\\rm GW}$ which occurs prior to the onset of mass transfer (eq.~\\ref{eq:tauGW0}).\n\n\nAt late times following the period minimum ($p = 0$), the orbit evolves to larger radii as $a \\propto t^{1\/7}$ while the mass decreases as $M_{\\star} \\propto t^{-3\/7}$. This relatively slow rate of outspiral implies that the star (now technically a brown dwarf) will retain substantial mass of $\\sim 0.01-0.1M_{\\odot}$ for a period of time $\\sim 1-10$ Myr. As we discuss below, even such a low mass (but high density) object is sufficient to damage or disrupt a more massive star in a collision given the enormous orbital velocities on these radial scales. \n\n\\section{Collision Between Successive EMRIs}\n\\label{sec:collision}\n\nMain sequence EMRIs which undergo stable mass transfer are estimated to occur in galactic nuclei at the rate $\\mathcal{R}_{\\rm emri} \\gtrsim 10^{-7}$ yr$^{-1}$ (\\citealt{AmaroSeoane+12}). The timescale between consecutive EMRIs of $\\sim 1\/\\mathcal{R}_{\\rm emri} \\lesssim 10$ Myr is therefore comparable to the slow outspiral timescale of a star undergoing RLOF (Fig.~\\ref{fig:orbit}). This implies the probable existence at any time in a galactic nucleus of a $\\sim 0.1M_{\\odot}$ star or brown dwarf undergoing mass transfer evolution (e.g.~\\citealt{Linial&Sari17}). It also raises the possibility for a strong interaction or collision between successive inspiraling\/outspiraling EMRIs. \n\nBased on the semi-major axis evolution (Fig.~\\ref{fig:orbit}) and the initial mass function of stars, one common way a collision could occur is between a star of initial mass $\\sim M_{\\odot}$ which has already already transferred most of its mass and is now migrating outwards as a brown dwarf of mass $M_{1} \\lesssim 0.1M_{\\odot}$ and radius $R_{1} \\approx 0.1R_{\\odot}$, and another star of similar initial mass $M_{2} \\sim M_{\\odot} > M_1$ and radius $R_{2} \\sim R_{\\odot} > R_1$ which has also begun RLOF but is still moving inwards and thus would cross the orbit of $M_1$ at a distance of $a \\sim 1$ AU with most of its initial mass still intact. We consider this example as a fiducial case. Note that, at the point of a collision, each star fills its Roche lobe and shares approximately the same semi-major axis; therefore the mean densities of the stars when they are interacting are equal, i.e. $M_{1}\/R_{1}^{3} \\simeq M_{2}\/R_{2}^{3}.$\n\nOur analysis in $\\S\\ref{sec:emri}$ assumes conservative mass transfer, which does not account for self-interaction between two EMRIs undergoing Roche-lobe overflow. For instance, if the accretion disk of the more massive inspiraling star interferes with the ability of the less massive star's disk to feed its angular momentum back into the orbit, this could destabilize the orbit of the outspiraling brown dwarf (because $p < 1\/3$ during the outspiral phase). It is well beyond the scope of this paper to address the complex interplay between mass transfer in three body systems, and so we leave this issue to future work. However, we note that if the EMRI rate is higher than we have assumed (e.g.~$\\gtrsim 10^{-5}-10^{-6}$ yr$^{-1}$ due to the influence of massive perturbers; \\citealt{Perets+07}) then even a collision between two consecutive stars which are still inspiraling ($p > 1\/3$) may occur as the more massive star overtakes a less massive one. Although the radial migration rate of the stars would differ in this case than the precise evolution predicted in $\\S\\ref{sec:emri}$, the qualitative collisional interaction we describe hereafter would not be altered.\n\nGiven the high rate of EMRIs of stellar mass black holes compared to those of main sequence ones, direct interactions between between inspiraling black holes and stars could be more common than star-star collisions. However, we show in Appendix \\ref{sec:A} that the collision velocity is so high that the tidal or accretion interaction between the star and the black hole passing through it is probably too small to influence the evolution of the star appreciably. \n\n\\subsection{Conditions for a Collision}\n\nNeither the orientation of the orbital plane or the orbital phases of the two stars will in general be aligned as they approach each other. However, a physical collision\\footnote{The orbital velocities of the stars greatly exceed their surface escape speeds, so that the effect of gravitational focusing on their cross section is negligible.} is still possible once the semi-major axes of the stars cross near a value $\\sim 1$ AU (eq.~\\ref{eq:a0}), as illustrated in Fig.~\\ref{fig:cartoon}. \n\nWe may neglect the comparatively slow outward radial motion of $M_1$ compared to the faster inspiral of $M_2$: the less massive $M_{1}$ can viewed as radially stationary for purposes of their interaction. The more massive star $M_{2}$ migrates inward a distance $\\delta r$ on a timescale given by $(\\delta r\/a)\\tau_{\\rm GW}^{\\rm RLOF}$, where $\\tau_{\\rm GW}^{\\rm RLOF} = \\chi\\tau_{\\rm GW}$ is the characteristic inspiral time assuming that $M_{2}$ is undergoing mass transfer (eq.~\\ref{eq:tauGWRLOF}). The number of orbits of period $\\tau_{\\rm orb} = 2\\pi (a^{3}\/GM_{\\bullet})^{1\/2}$ required for $M_2$ to migrate radially by $\\delta r$ is therefore\n\\begin{eqnarray}\n&&N_{\\rm GW} = \\frac{\\tau_{\\rm GW}^{\\rm RLOF}}{\\tau_{\\rm orb}}\\frac{|\\delta r|}{a} \\nonumber \\\\\n &\\approx& 1.3\\times 10^{6}\\chi_{3.5}\\frac{a_{\\rm AU}^{3\/2}}{M_{\\bullet,7}^{3\/2}}\\frac{R_{2,\\odot}}{M_{2,\\odot}}\\left(\\frac{\\delta r}{2R_{2}}\\right),\n\\end{eqnarray}\nwhere $\\chi_{\\rm 3.5} \\equiv \\chi\/3.5$.\n\nStars on orbits with precisely the same semi-major axis would possess identical orbital periods, modulo tiny reduced mass differences $\\sim \\mathcal{O}(M_{\\star}\/M_{\\bullet}) \\lesssim 10^{-6}$, and thus cannot collide. However, stars on orbits with a small but finite semi-major axis difference $|\\delta a| \\lesssim R_{2}$ are still able to produce a physical collision, as their periods differ by an amount $|\\delta \\tau_{\\rm orb}|\/\\tau_{\\rm orb} \\simeq (3\/2)|\\delta a|\/a$ and thus will share the same orbital phase, on average, after $N_{\\phi} \\approx \\tau_{\\rm orb}\/(2\\delta \\tau_{\\rm orb}) \\approx a\/(3|\\delta a|)$ orbits. \n\nA physical collision requires not only that both stars cross the same orbital phase, but also that their orbital planes cross at this phase, i.e. that they reside within a distance $l_{\\perp} \\sim 2^{3\/2}(R_{2}b)^{1\/2}$ of the line of ascending nodes of $M_{2}$ relative to the orbital plane of $M_{1}$, where $l_{\\perp}$ is the approximate length parallel to the surface of $M_{1}$ at times when the radial depth of $M_{1}$ into the atmosphere of $M_{2}$ is $b \\ll R_{2}$ ($b$ is also the impact parameter of the collision; see Fig.~\\ref{fig:cartoon}). This coincidence will occur only a fraction $2l_{\\perp}\/(2\\pi a)$ of the times the phases cross, where the factor of 2 accounts for the two locations where the orbital planes cross.\n\nCombining results, the number of orbits required for a physical collision - once their separation $|\\delta a| \\lesssim R_2$ is sufficiently small to enable one - is given by\n\\begin{eqnarray}\nN_{\\rm coll} &\\approx& \\frac{\\pi}{2^{3\/2}}\\frac{a}{(R_{2}b)^{1\/2}}N_{\\phi} \\nonumber \\\\\n&\\approx& 1.7\\times 10^{4} \\,\\frac{a_{\\rm AU}^{2}}{R_{2,\\odot}^{2}}\\left(\\frac{|\\delta a|}{R_{2}}\\right)^{-1}\\left(\\frac{b}{R_{2}}\\right)^{-1\/2}.\n\\label{eq:Ncoll}\n\\end{eqnarray}\nThe requisite condition for a single collision to occur before $M_2$ radially migrates past $M_1$ is that $N_{\\rm GW}\/N_{\\rm coll} \\gtrsim 1$ for $\\delta r \\lesssim 2 R_{2}$, $|\\delta a| \\sim R_{2}$, and $b \\sim R_{2}$, where \n\\begin{eqnarray}\n\\frac{N_{\\rm GW}}{N_{\\rm coll}} \\approx 77 \\frac{\\chi_{3.5}}{a_{\\rm AU}^{1\/2}}\\frac{R_{2,\\odot}^{3}}{M_{\\bullet,7}^{3\/2}M_{2,\\odot}}\\left(\\frac{|\\delta a|}{R_{2}}\\right)\\left(\\frac{\\delta r}{2R_{2}}\\right)\\left(\\frac{b}{R_{2}}\\right)^{1\/2}.\n\\label{eq:Nratio}\n\\end{eqnarray}\nThe fact that this ratio exceeds unity is a key result. It shows that at least a single collision between the two stars is likely for all SMBH masses of interest $M_{\\bullet} \\lesssim 3\\times 10^{7}M_{\\odot}$. \n\n\\subsection{Outcome of Stellar Collision}\n\n\n\\begin{figure}[!t]\n\\includegraphics[width=0.5\\textwidth]{cartoon.pdf}\n\\hspace{0.0cm}\n\\caption{\\footnotesize\n{Schematic diagram (not to scale) showing circular EMRI orbits around the SMBH of the effectively stationary low mass brown dwarf $M_1$ (red orbit) and the inward-migrating star $M_2 > M_1$ (blue orbit). The diagram is looking down on the orbital plane of $M_1$, near the time when the semi-major axes of the stars differ by an amount $\\delta a \\lesssim R_{2}$ and their orbital phases match along the line of ascending nodes of $M_{2}$ (defined by the plane of $M_{1}$). When a collision occurs, $M_1$ will penetrate inside $M_2$ with an impact parameter $b$ along a chord measuring approximately $2^{3\/2}(R_{2}b)^{1\/2}$. For clarity, both stars are drawn here occupying approximately the same orbital plane (though the orbit of $M_2$ is slightly inclined and flattened in projection), but in general the orbital inclinations will be misaligned and hence will only overlap along the line of ascending nodes of $M_{2}$ relative to the osculating reference plane defined by the orbit of $M_{1}$. The orbital planes will also be evolving significantly due to Lense-Thirring precession if the SMBH is spinning.}\n}\n\\label{fig:cartoon}\n\\end{figure}\n\nWe define the collision impact parameter $b$ as the distance measured from the center of $M_{1}$ to the outer edge of $M_{2}$ (Fig.~\\ref{fig:cartoon}). The impact parameter of the first collision $b = b_{\\rm 1st}$ will on average be equal to half the inward radial distance $\\delta r$ traveled between collisions. This value $b_{\\rm 1st} = \\delta r\/2$ is found by equating $N_{\\rm GW} = N_{\\rm coll}$ using equation (\\ref{eq:Nratio}) and assuming a grazing encounter $\\delta a \\approx R_{2}$, $b_{\\rm 1st} \\ll R_{2}$. This gives a value\n\\begin{equation} \n\\frac{b_{\\rm 1st}}{R_{2}} \\approx 0.06 \\chi_{3.5}^{-2\/3}a_{\\rm AU}^{1\/3}M_{\\bullet,7}\\frac{M_{2,\\odot}^{2\/3}}{R_{2,\\odot}^{2}},\n\\label{eq:impact}\n\\end{equation}\nwhich is typically a few percent of the radius of $R_{2}$. In most cases of interest $b_{\\rm 1st} \\lesssim R_{1} \\sim 0.1R_{\\odot}$ and hence $M_1$ will just graze the surface layers of $M_{2}$ instead of punching through its envelope at greater depth.\n\nThe orbital velocity at the time of collision is a mildly relativistic\\footnote{As noted before, in this work we treat the orbital dynamics of EMRI collisions in a primarily Newtonian way, which is accurate to leading order aside from the issue of nodal precession - which we account for in the post-Newtonian approximation. However, circular orbit speeds $v_{\\rm k}\\sim 0.1c$ may motivate future, fully general relativistic treatments of this scenario.}\n\\begin{eqnarray}\nv_{\\rm k} &\\simeq& \\left(\\frac{GM_{\\bullet}}{a}\\right)^{1\/2} \\approx 9.4\\times 10^{9}\\,{\\rm cm\\,s^{-1}}M_{\\bullet,7}^{1\/2}a_{\\rm AU}^{-1\/2}. \n\\label{eq:vc}\n\\end{eqnarray}\nDepending on the mutual inclination angle $i$ of the orbital planes of $M_2$ with respect to that of $M_{1}$, the collision will occur at a relative speed \n\\begin{equation}\nv_{\\rm c} = \\sqrt{2}(1-\\cos i)^{1\/2}v_{\\rm k},\n\\end{equation}\nThis value ranges from $v_{\\rm c} = 2 v_{\\rm k}$ for a head-on collision to $v_{\\rm c} \\ll v_{\\rm k}$ for a tail-on collision. Assuming an isotropic distribution of inclination angles, we find an average value of $\\langle v_{\\rm c}\\rangle = (4\/3)v_{\\rm k}$.\n\n\n\\begin{figure}[!t]\n\\includegraphics[width=0.5\\textwidth]{density}\n\\hspace{0.0cm}\n\\caption{\\footnotesize\n{Density $\\rho_{\\star}$ as a function of the distance below the stellar surface $b = r-R_{\\star}$ for main sequence stars of mass 0.2$M_{\\odot}$ (solid red line) and $0.5M_{\\odot}$ (solid blue line), compared to our adopted approximation $\\rho_{\\star} \\simeq 0.8(M_{\\star}\/R_{\\star}^{3})(b\/R)^{3\/2}$ (dashed lines).}\n}\n\\label{fig:density}\n\\end{figure}\n\n\n\\begin{figure}[!t]\n\\includegraphics[width=0.5\\textwidth]{collision}\n\\hspace{0.0cm}\n\\caption{\\footnotesize\n{Analytic estimate of average interval between stellar collisions $\\tau_{\\rm coll}$ in years (dashed red line; eq.~\\ref{eq:taucoll}), average mass released per collision $dM_{\\rm c} = \\delta M_{\\rm c,max}$ in solar masses (dotted blue line; eq.~\\ref{eq:dMc}) as a function of SMBH mass $M_{\\bullet}$. We have adopted characteristic parameters for the semi-major axis of the stars $a = 1$ AU, the stellar radius $R_{2} = R_{\\odot}$ and mass $M_{2} = M_{\\odot}$, and average collision velocity $v_{\\rm c} = \\langle v_{\\rm k}\\rangle$. For $M_{\\bullet} \\gtrsim M_{\\rm disr}$ the stars are almost completely disrupted in a single collision. If the collisional mass loss is smaller than we have assumed ($\\delta M_{\\rm c} < \\delta M_{\\rm c,max}$), then the value of $M_{\\rm disr}$ will increase and $\\tau_{\\rm coll}$ will decrease. Also shown are the estimated peak accretion luminosity $L_{\\rm pk}$ (brown dot-dashed line; eq.~\\ref{eq:Lpk}) and accretion timescale $t_{\\rm acc}$ (orange triple dot-dashed line; eq.~\\ref{eq:tacc}) for fiducial values of the disk viscosity $\\alpha = 0.01$, radius $r_{\\rm g} = 1$ AU, and SMBH accretion efficiency $\\eta = 0.1$. }\n}\n\\label{fig:collision}\n\\end{figure}\n\nTidal forces between the passing stars impart modest accelerations because the collision velocity is typically two to three orders of magnitude higher than the surface escape speeds of the stars (see Appendix \\ref{sec:A} for further discussion). However, the direct, albeit grazing, physical collision between the surfaces of the stars will result in powerful shock heating, leading to gaseous mass loss. Quantifying the collision properties, such as the total ejecta mass and its dependence on the impact parameter $b\/R_{2}$, would require 3D hydrodynamical simulations well beyond the scope of this work. Numerical simulations of stellar collisions exist in the literature (e.g.~\\citealt{Freitag&Benz05}), however these are generally for much lower velocities than considered here and do not involve stars which already fill their Roche surfaces. In what follows, we instead provide a rough analytic estimate of the mass loss and its impact on the subsequent evolution of the stars. This crude treatment is justified in part because our qualitative conclusions are insensitive to the precise amount of mass loss per collision.\n\nWe approximate $M_2$ as a polytrope of index $n = 3\/2$ appropriate for a lower main sequence convective star, in which case its density at a depth $b$ from its outer edge is very approximately given by\n\\begin{equation} \\rho_{\\star} \\approx 0.8\\left(\\frac{M_{2}}{R_{2}^{3}}\\right)\\left(\\frac{b}{R_{2}}\\right)^{3\/2}, \\end{equation} \nas is shown in Fig. \\ref{fig:density}. A larger value of $n = 3$ would be appropriate for the outer layers of stars with radiative envelopes (such as main sequence stars more massive than the Sun), but the subsequent treatment is easily generalized. We neglect non-spherical distortion of the star caused by its Roche-lobe filling shape.\n\nThe drag force on $M_1$ as it grazes the atmosphere of $M_2$ is approximately $F_{\\rm d} \\approx A(\\rho_{\\star}v_{\\rm c}^{2}\/2)$, where $A \\approx 2R_{1} b $ is the effective cross section of the encounter, assuming $ b \\lesssim R_{1}$ (Fig.~\\ref{fig:cartoon}). The energy dissipated by shock heating as $M_1$ passes across the distance $l_{\\perp} \\approx 2^{3\/2}(bR_{2})^{1\/2}$ through $M_2$ is therefore \n\\begin{eqnarray}\nE_{\\rm c} &\\approx& F_{\\rm d}l_{\\perp} \\approx 2.3M_{2}v_{\\rm c}^{2}\\frac{R_{1}}{R_{2}}\\left(\\frac{b}{R_{2}}\\right)^{3} \\\\\n&\\approx& 7.1\\times 10^{46}\\,{\\rm erg}\\,\\,\\,M_{\\bullet,7}\\frac{M_{2,\\odot}}{a_{\\rm AU}}\\left(\\frac{v_{\\rm c}}{\\langle v_{\\rm c}\\rangle}\\right)^{2}\\left(\\frac{b}{0.01R_{2}}\\right)^{3},\\nonumber\n \\label{eq:Ec}\n\\end{eqnarray}\nwhere in the second line and hereafter we take $R_{1} = 0.1R_{2}$. This energy is usefully compared to the gravitational binding energy of the stars\n\\begin{equation}\nE_{\\rm b} \\approx \\frac{GM_{\\star}^{2}}{R_{\\star}} \\approx 4\\times 10^{48}\\,{\\rm erg}\\, \\left(\\frac{M_{\\star}}{M_{\\odot}}\\right)^{2}\\left(\\frac{R_{\\star}}{R_{\\odot}}\\right)^{-1}.\n\\label{eq:Eb}\n\\end{equation}\n The ratio of the collision heating energy $E_{\\rm c}$ to the binding energy $E_{\\rm b,2}$ of $M_2$ is given by\n\\begin{eqnarray}\n \\frac{E_{\\rm c}}{E_{\\rm b,2}} &=& 0.02\n\\frac{M_{\\bullet,7}}{a_{\\rm AU}}\\frac{R_{2,\\odot}}{M_{2,\\odot}}\\left(\\frac{v_{\\rm c}}{\\langle v_{\\rm c}\\rangle}\\right)^{2}\\left(\\frac{b}{0.01R_{2}}\\right)^{3} \\nonumber \\\\\n&\\underset{b = b_{\\rm 1st}}\\approx& 3.8 \\chi_{3.5}^{-2}\nM_{\\bullet,7}^{4}R_{2,\\odot}^{-5}M_{2,\\odot}\\left(\\frac{v_{\\rm c}}{\\langle v_{\\rm c}\\rangle}\\right)^{2},\n\\label{eq:Mmax}\n\\end{eqnarray}\nwhere in the second line we have used the characteristic impact parameter $b_{\\rm 1st}$ (eq.~\\ref{eq:impact}) of the first collision.\n\nWe expect complete disruption of the star if $E_{\\rm c} \\gg E_{\\rm b,2}$. This occurs for collisions with impact parameter well above a critical value $b_{\\rm disr}$ given by\n\\begin{equation}\n\\frac{b_{\\rm disr}}{R_{2}} \\approx 0.039\\left(\\frac{a_{\\rm AU}}{M_{\\bullet,7}}\\frac{M_{2,\\odot}}{R_{2,\\odot}}\\right)^{1\/3}\\left(\\frac{v_{\\rm c}}{\\langle v_{\\rm c}\\rangle}\\right)^{-2\/3},\n\\label{eq:bdisrupt}\n\\end{equation}\nwhere we have taken $\\chi = 3.5$. This condition is achieved in the first collision ($b_{\\rm disr} = b_{\\rm 1st}$; eq.~\\ref{eq:impact}) if the SMBH mass greatly exceeds a critical value\n\\begin{equation}\nM_{\\bullet,\\rm disr} = 7.1\\times 10^{6}M_{\\odot} R_{\\rm 2,\\odot}^{5\/4}M_{2,\\odot}^{-1\/4}\\left(\\frac{v_{\\rm c}}{\\langle v_{\\rm c}\\rangle}\\right)^{-1\/2}\n\\label{eq:Mdisr}\n\\end{equation}\nFor $M_{\\bullet} \\lesssim M_{\\bullet,\\rm disr}$ we instead have $E_{\\rm c} \\ll E_{\\rm b,2}$ and both stars will instead survive the first collision at least partially intact. Although the above calculation is quite approximate and should be refined by future hydrodynamical simulations, the steep scaling $E_{\\rm c}\/E_{\\rm b, 2} \\propto M_\\bullet^4$ indicates two clear regimes for EMRI collisions: around larger SMBHs, a first encounter is likely destructive, while many encounters can occur around smaller SMBHs.\n\nAny collision will result in some mass loss from both stars. We assume that most of the total mass loss originates from the more massive star $M_2$, motivated as follows. As $M_{1}$ passes through the outer layers of $M_2$, the ram pressure of the interaction will drive dual shocks, through the outer layers of both stars. However, the density $\\rho_{2}$ of $M_{2}$ at the collision depth is typically 2 orders of magnitude or more lower than the density $\\rho_{1}$ of $M_{1}$ (both stars have equal {\\it mean} densities, but the collision occurs comparatively closer to the surface of $M_{1}$ than $M_{2}$). Since $\\rho_{1} \\gg \\rho_{2}$ the shock through $M_{1}$ will move with a velocity larger by a factor of ($\\rho_{2}\/\\rho_{1})^{1\/2}$ than the shock through $M_{2}$ and thus will carry an energy flux larger by the same factor of $\\gtrsim 10$ (which generally is comparable to or exceeds the ratio of the gravitational binding energy of the two stars).\n\nIn what follows, we make the crude approximation that the fractional mass lost from $M_{2}$ by the collision, $\\delta M_{\\rm c}$, is equal to the ratio of shock-deposited energy to the gravitational binding energy. In other words, we take\n\\begin{equation} \\frac{\\delta M_{\\rm c}}{M_2} = \\frac{\\delta M_{\\rm c,max}}{M_2} \\approx \\frac{E_{\\rm c}}{E_{\\rm b,2}},\n\\label{eq:dMc}\n\\end{equation} \n as given in equation (\\ref{eq:Mmax}). Equivalently,\n\\begin{equation} \\delta M_{\\rm c,max} \\approx 3.93M_{\\odot} \\chi_{3.5}^{-2}\nM_{\\bullet,7}^{4}R_{2,\\odot}^{-5}M_{2,\\odot}^{2}\\left(\\frac{v_{\\rm c}}{\\langle v_{\\rm c}\\rangle}\\right)^{2}. \n\\label{eq:Mc2} \\end{equation}\nEq.~\\ref{eq:dMc} provides only a rough upper limit on $\\delta M_{\\rm c}$; the true amount of mass loss could be significantly lower if low-density outer layers of $M_2$ are ejected at speeds $\\gg (GM_2\/R_2)^{1\/2}$. As we discuss in $\\S\\ref{sec:conclusions}$, our results for the long-term evolution of the stars are not qualitatively altered if the mass loss per collision is substantially lower than this maximum (though the range of SMBH masses responsible for the most interesting behavior will shift to higher values).\n\n\\subsection{Multiple Collision Evolution}\n\nIf the stars survive their first collision ($E_{\\rm c} \\ll E_{\\rm b,2}$, $\\delta M_{\\rm c} \\ll M_{2}$), then it is natural to ask whether and when subsequent collisions will occur. Will the stars collide again immediately, on the next orbit, or only after a significant delay required for the orbital phases to realign? \n\nThe semi-major axes of $M_1$ and $M_2$ differ by $\\delta a \\approx R_{2}$ at the time of the first collision, and hence their orbital periods differ by a factor $\\delta \\tau_{\\rm orb}\/\\tau_{\\rm orb} = (3\/2)(\\delta a\/a) \\approx (3\/2)(R_{2}\/a)$. The stars therefore accumulate a per-orbit phase difference of $\\delta \\phi\/2\\pi = \\delta \\tau_{\\rm orb}\/\\tau_{\\rm orb} = (3\/2)(R_{2}\/a)$, which is coincidentally comparable to the maximum phase difference between the stars that allows for a collision at the common line of ascending nodes, $\\delta \\phi_{\\rm max} =2 R_{2}\/(2\\pi a)$. Therefore, we conclude that the second collision will not generally occur on the next immediate orbit, but will instead be delayed by at least another $\\sim N_{\\rm coll} \\gtrsim 10^{4}$ (eq.~\\ref{eq:Ncoll}) orbits, corresponding to a minimum time delay of \n\\begin{equation}\n\\tau_{\\rm coll}^{\\rm min} = N_{\\rm coll}\\tau_{\\rm orb} \\approx 57 \\,\\,{\\rm yr}\\,\\,\\,\\frac{a_{\\rm AU}^{7\/2}}{M_{\\bullet,7}^{1\/2}R_{2,\\odot}^{2}}\\left(\\frac{b}{0.01R_{2}}\\right)^{-1\/2}.\n\\label{eq:taucoll1}\n\\end{equation}\n\nEven were this differential phase accumulation insufficient to prevent an immediate second collision, Lense-Thirring precession would cause the angular momenta of the stellar orbits to precess rapidly about the spin axis of the SMBH. This will advance the line of nodes of each orbit by a large fractional angle. At leading post-Newtonian order, and assuming circular orbits, this angular shift is (e.g., \\citealt{Merritt+10})\n\\begin{equation}\n\\frac{\\Delta\\Omega}{2\\pi} = 2 \\chi_{\\bullet}\\left(\\frac{a}{R_{\\rm g}}\\right)^{-3\/2} \\approx 0.06 \\chi_{\\bullet} a_{\\rm AU}^{-3\/2}M_{\\bullet,7}^{3\/2},\n\\label{eq:LT}\n\\end{equation}\nwhere $R_{\\rm g} \\equiv GM_{\\bullet}\/c^{2}$ and $-1<\\chi_{\\bullet}<1$ is the dimensionless spin parameter of the SMBH.\n\n\nOver the minimum time interval before the second collision $\\tau_{\\rm coll}^{\\rm min}$, GW radiation will move $M_2$ closer to $M_1$ on average by a distance $\\delta a \\approx 2b_{\\rm 1st}$ (eq.~\\ref{eq:impact}). If this were the whole story, then according to equation \\ref{eq:Ec}, one would expect the impact parameter of the second collision to be $\\sim 3$ times higher than the first and (according to equation \\ref{eq:Ec}) the energy released to be $\\sim 3^{3} \\sim 30$ times stronger. Likewise, the third collision would be $\\sim 30$ times stronger than the second, and so on; this sequence would rapidly terminate in a single, final, disruption once $b \\gtrsim b_{\\rm disr}$ (eq.~\\ref{eq:bdisrupt}). \n\nHowever, this simple runaway argument neglects the impact of mass loss on the radial separation between the stars.\\footnote{Change in the orbital energy due to collisions will cause the orbits of both $M_{1}$ and $M_{2}$ to acquire mild eccentricities. However, the magnitude of the collision energy required to induce even a small eccentricity $e \\sim 0.01$ is comparable to the binding energy of the stars.} \nUnder adiabatic mass loss, the radius of each star will expand slightly according to $R_{\\star} \\propto M_{\\star}^{-1\/3}$ (for assumed adiabatic index $\\gamma = 5\/3$). More importantly, the semi-major axis of each star will increase by a much larger amount $\\delta a_{\\rm c}\/a \\approx 2 (\\delta M_{\\rm c}\/M_{\\star}).$ This expression assumes conservative mass transfer: the gaseous disk created by the collision transfers its angular momentum back into the orbit of the mass-losing star with high efficiency.\n\nGiven our expectation that the fractional mass loss from $M_{2}$ will exceed that from $M_{1}$, the main effect on the system is to increase the semi-major axis of $M_{2}$ - and thus the radial separation of the orbits of $M_{1}$ and $M_{2}$ - by an amount\n\\begin{equation}\n \\frac{ \\delta a_{\\rm c}}{R_{\\rm 2}} \\approx 2\\frac{a}{R_{2}}\\frac{\\delta M_{\\rm c}}{M_2}.\n\\label{eq:bout}\n\\end{equation}\nAgain, our assumption is that most of the angular momentum lost by $M_{2}$ is placed back into its orbit, as opposed to the orbit of $M_{1}$. This is justified by our expectation that most of the mass loss from $M_{1}$, despite being struck obliquely by $M_{2}$, will nevertheless occur quasi-isotropically, forming a gaseous disk which lies in roughly the same orbital plane of $M_{1}$.\n\nSince this change in separation between the stars is typically much larger than the characteristic impact parameter of the first collision $b_{\\rm 1st}$ (eq.~\\ref{eq:impact}), this will introduce an additional delay until the next collision beyond the minimum value (eq.~\\ref{eq:taucoll1}) set by the double alignment of orbital phase and nodal line. Specifically, the time required to traverse this distance $\\delta a_{\\rm c}$ through gravitational wave radiation is\n\\begin{eqnarray}\n\\tau_{\\rm coll} &\\approx& \\tau_{\\rm GW}\\left(\\frac{\\delta a_{\\rm c}}{a}\\right) \\approx 2\\tau_{\\rm GW}\\left.\\frac{\\delta M_{\\rm c}}{M_{\\rm 2}}\\right|_{b = b_{\\rm 1st}}, \\nonumber \\\\\n&\\approx & 9.9\\times 10^{4}\\,{\\rm yr}\\,\\, \\chi_{3.5}^{-2}\\frac{a_{\\rm AU}^{4}M_{\\bullet,7}^{2}}{R_{2,\\odot}^{5}}\\left(\\frac{v_{\\rm c}}{\\langle v_{\\rm c}\\rangle}\\right)^{2}\\left(\\frac{\\delta M_{\\rm c}}{\\delta M_{\\rm c,max}}\\right). \\nonumber \\\\\n\\label{eq:taucoll}\n\\end{eqnarray}\nHere we have used equations (\\ref{eq:Mmax},\\ref{eq:dMc}) and have calculated the GW inspiral time $\\tau_{\\rm GW}$ neglecting mass transfer effects (eq.~\\ref{eq:tauGW}) because, for most of its inward return, $M_{2}$ is no longer overflowing its Roche Lobe (though we have retained the $\\chi$ dependence on the impact parameter $b_{\\rm 1st}$). This delay could be substantially shorter than estimated here if the mass loss per collision is much less than $\\delta M_{\\rm c,max}$ (\\ref{eq:dMc}).\n\nAfter this inspiral, the characteristic impact parameter and mass loss of each such collision will be similar to the first one, $b \\approx \\delta b_{\\rm 1st}$. Each collision will also release a comparable amount of mass as the first (eq.~\\ref{eq:Mc2}). Neglecting slow changes to the stellar properties caused by the collisions, the star will be completely destroyed over a total number of collisions very approximately given by\n\\begin{eqnarray}\nN_{\\rm c} &\\sim& \\left.\\frac{M_2}{\\delta M_{\\rm c}}\\right|_{b = b_{\\rm 1st}} \\nonumber \\\\\n&\\approx& 0.26\\chi_{3.5}^{2}\nM_{\\bullet,7}^{-4}R_{2,\\odot}^{5}M_{2,\\odot}^{-1}\\left(\\frac{v_{\\rm c}}{\\langle v_{\\rm c}\\rangle}\\right)^{-2}\\left(\\frac{\\delta M_{\\rm c}}{\\delta M_{\\rm c,max}}\\right)^{-1}.\n\\label{eq:Ncoll2}\n\\end{eqnarray}\nThis number is $\\gg 1$ for low mass SMBHs and approaches unity for $M_{\\bullet} = M_{\\bullet, \\rm disr}$ (eq.~\\ref{eq:Mdisr}). For $M_{\\bullet} \\ll M_{\\bullet,\\rm disr}$, the total duration of the interaction is just given by the gravitational wave inspiral time\n\\begin{equation}\n\\tau_{\\rm tot} = N_{\\rm c}\\tau_{\\rm coll} \\approx 2\\tau_{\\rm GW}, \n\\label{eq:tautot}\n\\end{equation} \nwhich ranges from $\\sim 10^{4}-10^{6}$ yr, depending on the SMBH mass. These different regimes of collisions are summarized in Figure \\ref{fig:collision}. \n\n\\section{Transient SMBH Accretion Events}\n\\label{sec:transient}\n\nWe have shown that collisional evolution between consecutive stellar EMRIs around SMBHs of mass $\\lesssim 10^{7}M_{\\odot}$ can result in repeated, prompt episodes of gas formation; the colliding stars liberate a mass $M_{\\rm g} \\le \\delta M_{\\rm c} \\sim 10^{-4}-1M_{\\odot}$, on a radial scale of $r_{\\rm g} \\sim 0.5-2$ AU, at periodic intervals of decades to centuries or longer, and lasting for a total duration of up to a million years. We now describe the observable signatures of these punctuated episodes of gas production.\n\nBy equating the thermal energy released per unit volume with the specific heat of radiation-dominated matter, $a T_{\\rm c}^{4} \\approx \\rho_{\\star}v_{\\rm c}^{2}\/2$, the immediate temperature of the shocked stellar material is $T_{\\rm c} \\sim 10^{8}$ K even for a head-on collision, too low to result in nuclear burning up to $^{56}$Ni. Without such a radioactive heating source, the expanding ejecta will cool rapidly via adiabatic expansion before becoming transparent and radiating the remaining thermal energy. This will produce a dim rapidly-evolving transient which would itself be very challenging to detect (see also \\citealt{Balberg+13}). \n\nA more important source of luminosity is the gravitational energy liberated by the accretion of the gaseous ejecta onto the SMBH. The ejected gas will possess an angular momentum similar to that of the stars, resulting in the formation of circular disk on a similar radial scale of $\\lesssim r_{\\rm g}$. Internal stresses (likely magneto-turbulent in origin) within the accretion flow will transport this angular momentum outwards, allowing the gas mass $M_{\\rm g}$ to accrete inwards on the characteristic accretion timescale\n\\begin{equation}\nt_{\\rm acc} \\approx \\frac{1}{\\alpha}\\frac{1}{\\Omega_k}\\left(\\frac{h}{r_{\\rm g}}\\right)^{-2} \\approx 18.4\\,{\\rm d}\\,\\,\\frac{r_{\\rm g,AU}^{3\/2}}{\\alpha_{-1}M_{\\bullet,7}^{1\/2}}\\left(\\frac{h}{0.1r_{\\rm g}}\\right)^{-2},\n\\label{eq:tpk}\n\\end{equation}\nwhere $\\Omega_{k} = (GM_{\\bullet}\/r_{\\rm g}^{3})^{1\/2}$ is the orbital angular velocity of the disk, $\\alpha\/=0.1\\alpha_{-1}$ is the Shakura-Sunyaev viscosity parameter, and $h$ is the vertical scale height of the disk.\n\nFollowing deposition of the gaseous material, the accretion rate will quickly rise to a peak value of $\\dot{M}_{\\rm pk} \\sim M_{\\rm g}\/t_{\\rm acc}$ (\\citealt{Pringle81}). For a radiation-pressure dominated disk with electron scattering opacity $\\kappa_{\\rm es}$, the vertical scale-height of the disk obeys $h = 3\\kappa \\dot{M}\/(8\\pi c) = \\frac{3}{2\\eta}(\\dot{M}\/\\dot{M}_{\\rm Edd})(GM_{\\bullet}\/c^{2}) \\simeq 2.2\\times 10^{13}(\\dot{M}\/\\dot{M}_{\\rm Edd})M_{\\bullet, 7}$ cm, where $\\dot{M}_{\\rm Edd} \\approx 1.6\\times 10^{25}M_{\\bullet,7}$ g s$^{-1}$ is the Eddington accretion rate for radiative efficiency $\\eta = 0.1$. Combining results, we find that\n\\begin{equation}\n\\frac{\\dot{M}_{\\rm pk}}{\\dot{M}_{\\rm Edd}} \\approx 5.9\\times 10^{-2}\\left(\\frac{M_{\\rm g}}{10^{-3}M_{\\odot}}\\right)^{-1}M_{\\bullet,7}^{-3\/2}r_{\\rm g,AU}^{7\/2}\\alpha_{-1}^{-1}\n\\end{equation}\nwith\n\\begin{equation}\n\\frac{h}{r_{\\rm g}} \\approx 0.087\\left(\\frac{M_{\\rm g}}{10^{-3}M_{\\odot}}\\right)^{-1}M_{\\bullet,7}^{-1\/2}r_{\\rm g,AU}^{5\/2}\\alpha_{-1}^{-1}\n\\end{equation}\nand\n\\begin{equation}\nt_{\\rm acc} \\approx 24\\,{\\rm d}\\,\\,\\ \\frac{\\alpha_{-1}M_{\\bullet,7}^{1\/2}}{r_{\\rm g,AU}^{7\/2}}\\left(\\frac{M_{\\rm g}}{10^{-3}M_{\\odot}}\\right)^{2},\n\\label{eq:tacc}\n\\end{equation}\nThe resulting peak accretion luminosity is given by\n\\begin{eqnarray}\n&&L_{\\rm pk} = \\eta \\dot{M}_{\\rm pk}c^{2} \\nonumber \\\\\n&\\approx& 8.5\\times 10^{43}\\,{\\rm erg\\,s^{-1}}\\,\\frac{r_{\\rm g,AU}^{7\/2}}{M_{\\bullet,7}^{1\/2}\\alpha_{-1}}\\left(\\frac{M_{\\rm g}}{10^{-3}M_{\\odot}}\\right)^{-1},\n\\label{eq:Lpk}\n\\end{eqnarray}\nwhere we have assumed a radiative efficiency $\\eta = 0.1$.\n\nFor a characteristic value of $M_{\\rm g} \\sim 10^{-3}M_{\\odot}$, as is expected in our fiducial models for $M_{\\bullet} \\approx 2\\times 10^{6}M_{\\odot}$ (eq.~\\ref{eq:Mc2}), we predict accretion-powered transients of peak luminosity $\\approx 10^{44}$ erg s$^{-1}$ and characteristic timescales $t_{\\rm acc} \\approx 40~{\\rm days}$. However, these properties scale sensitively with SMBH mass.\n\nThese precise scalings, in particular the unintuitive inverse relationship between peak accretion rate and gas disk mass, must be taken with caution. It is well known that the thermal and viscous stability of radiation pressure dominated disks remains an open issue (e.g.~\\citealt{Hirose+09,Jiang+16,Sadowski&Narayan16}), and the true behavior of these disks could differ significantly from the expectations of the $\\alpha$-models. \n\nThe evolution of the accretion rate at times after the peak ($t \\gg t_{\\rm acc}$) depends on the interaction between the outer edge of the gaseous disk and the stars. If most of the angular momentum of the disk is transferred back into the stellar orbit, then - in contrast to circularized TDE disks \\citep{Cannizzo+90} - the disk will not freely spread outwards beyond the orbit of the star. In this case the accretion rate will decay exponentially on a timescale set by the initial viscous timescale $t_{\\rm acc}$, i.e. we expect a bolometric light curve of the form\n\\begin{equation}\nL(t) \\sim L_{\\rm pk}e^{-t\/t_{\\rm acc}}, \\,\\,\\,\\, t \\gtrsim t_{\\rm acc}\n\\label{eq:exp}\n\\end{equation} \n\nOn the other hand, a portion of the disk may be free to viscously spread outwards beyond the orbit of the star. This could occur if the angular momentum of the gas produced by the collision places it into an orbital plane significantly different either star. It could also occur if the Bardeen-Petterson effect \\citep{Bardeen&Petterson75} aligns the disk into a different plane from both stars on a timescale short compared to the disk evolution timescale; such misalignment could also be accomplished by differential nodal precession between stellar orbits and the disk. In this case, the mass accretion rate would instead decay at late times as a power-law, $L \\propto t^{-\\alpha}$, where $\\alpha \\sim 1.1-1.3$ (e.g.~\\citealt{Cannizzo+90,Shen&Matzner14}), although we caution that this evolution could be complicated by possible thermodynamic state changes from radiation-pressure to gas-pressure dominated regimes (\\citealt{Shen&Matzner14}). In both cases, the predicted evolution differs from the canonical $L(t) \\propto t^{-5\/3}$ prediction for the late-time decay of the mass fall-back rate in TDEs.\n\n\\subsection{TDE Imposters}\n\nThe flare timescales and bolometric luminosities we predict from colliding main sequence EMRIs overlap with those of observed tidal disruption flare candidates (\\citealt{Komossa15}). However, unlike TDEs, which are singular events, a colliding EMRI pair may produce {\\it hundreds or thousands of mass production events} (eq.~\\ref{eq:Ncoll2}). This large number may be sufficient to at least partially overcome the $\\sim 2-3$ order of magnitude deficit between the predicted TDE and circular EMRI rate, allowing flares of the collisional EMRIs described here to be detected. This would especially be true if a large fraction of TDEs are ``dark\" due to inefficiency associated with accretion at super-Eddington rates (\\citealt{Strubbe&Quataert09,Metzger&Stone16}) or the process of debris circularization of the highly elliptical streams produced in most TDEs (\\citealt{Guillochon&RamirezRuiz15,Dai+15,Hayasaki+16}). \n\nThe total radiated energy inferred from optical TDE candidate flares ranges from $E_{\\rm rad} \\approx 10^{49}$ erg for iPTF16fnl (\\citealt{Blagorodnova+17}) and $3\\times 10^{50}$ erg for PS1-11af (\\citealt{Chornock+14}) to values up to $\\sim 10$ times higher, as compiled in Figure \\ref{fig:Erad}.\nThese radiated energies correspond to accreted masses in the range $\\sim 10^{-4}-10^{-2} M_{\\odot}$ for an assumed radiative efficiency of $\\eta = 0.1$. These often low radiated energies have been described as a ``missing energy problem'' \\citep{Piran+15}, though this problem has many possible resolutions in the TDE paradigm, including low accretion or radiative efficiencies in TDEs (e.g.~\\citealt{Piran+15, Metzger&Stone16}), large bolometric corrections \\citep{vanVelzen+16}, or the lower accreted mass of a partial tidal disruption event \\citep{Chornock+14}. \n\nAlternatively, these low radiated energies may indicate that some of the observed TDE candidates are in fact just one in a sequence of quasi-periodic EMRI collision flares, each producing a low-mass accretion transient. One way to distinguish these scenarios is to search for additional flares from the same galactic nucleus after the initial burst. The required wait time will usually be too long to serve as a definitive test (up to $\\sim 10^5~{\\rm yr}$ for fiducial parameters; see eqs. \\ref{eq:taucoll1}, \\ref{eq:taucoll}), though because $\\tau_{\\rm coll} \\propto R_{2, \\odot}^{-5}$ and $\\tau_{\\rm coll}^{\\rm min} \\propto R_{2, \\odot}^{-3\/2}$, repeated flares can happen on timescales shorter than a decade if the victim star is a few times the mass of the Sun, or is a sub-solar mass star that has bloated due to shock heating. A shorter flare duration would occur if the mass loss per collision is much less than our conservative upper limit on its value (eq.~\\ref{eq:dMc}).\n\nThe accretion timescale of the gaseous disks produced by stellar collisions, $t_{\\rm acc}$ (eq.~\\ref{eq:tacc}), is short compared to the interval between consecutive collisions. This implies that the light curve would appear as periodic spikes in luminosity, separated by quasi-periodic intervals ranging from decades to hundreds of millenia. Such quasi-periodic flaring may have been observed in IC3599, a Seyfert galaxy which produced a large-amplitude nuclear X-ray outburst in the 1990s (\\citealt{Brandt+95,Grupe+95}), initially interpreted as a TDE. However, IC3599 was then observed to repeat its flaring behavior \\citep{Grupe+15,Campana+15}. Based on modeling the light curves and disk temperature evolution, \\citet{Campana+15} claim the existence of 3 outbursts with a separation of $\\approx$ 10 years, each reaching a luminosity of $10^{43}$ erg s$^{-1}$. \n\nIndividual flares produced from EMRI collisions may also be distinguished from standard TDE flares by differences in the predicted late-time light curve decay. In cases when the orbits of the surviving stars absorb angular momentum from the gaseous disk, we could expect the light curve to decay exponentially at late times (eq.~\\ref{eq:exp}), a feature which may in fact be observed some TDE flares (e.g.,~NGC 247, \\citealt{Feng+15}; ASASSN-14li, \\citealt{Holoien+16}; iPTF16fnl, \\citealt{Blagorodnova+17}). On the other hand, if a sizable fraction of the gas from the collision is able to viscously spread beyond the orbits of the stars, we would expect a power-lower light curve decay shallower than the canonical $\\propto t^{-5\/3}$ fall-back rate. Such shallow decays are inferred from the X-ray sample of TDE flares compiled by \\citet{Auchettl+17}.\n\n\nOne of the most puzzling mysteries of optical TDE candidates concerns their observed color temperatures, which are roughly an order of magnitude lower than those predicted from compact disk emission models (e.g., \\citealt{Gezari+12,Cenko+12,Holoien+16}), which should instead peak in the extreme UV\/soft X-ray band (corresponding to the disk temperature at $\\sim 10R_{\\rm g}$). One explanation for this behavior is the existence of a dense layer of gas on radial scales $\\gtrsim 10-100$ AU, which reprocesses much of the accretion power to lower frequencies (\\citealt{Loeb&Ulmer97, Roth+16}). In TDE scenarios, this reprocessing material could be the result of a super-Eddington wind (\\citealt{Metzger&Stone16}) or highly eccentric, inefficiently circularized debris streams produced during the disruption process (e.g., \\citealt{Guillochon+14,Miller15}). \n\nA radially extended gaseous disk is also expected to arise naturally in the EMRI collision scenario, and could provide an alternative reprocessing screen. As discussed above, the gaseous disk deposited by a given collision at $r_{\\rm g} \\sim $ AU will in some cases carry its angular momentum outwards by viscously expanding \\citep{Cannizzo+90} beyond the orbits of the stars. Since total angular momentum is roughly conserved in this process, the disk mass which remains when the outer edge of the disk reaches a radius $r$ is $M(r) \\sim M_{\\rm g}(r\/r_{\\rm g})^{1\/2}$. The timescale for the gas from a collision event to reach $\\sim 10-100$ AU by viscous spreading is $\\sim 10^{3}-10^{4}$ yr \\citep{Cannizzo+90,Shen&Matzner14}, many orders of magnitude longer\\footnote{The disk evolution slows considerably once the midplane transitions from being radiation pressure dominated to being gas pressure dominated (e.g.~\\citealt{Shen&Matzner14}).} than the initial viscous timescale (flare time) and potentially comparable to the entire duration of the collisional interaction between the stars, $\\tau_{\\rm tot}$ (eq.~\\ref{eq:tautot}). \n\nThe accumulation of spreading disks produced by each of the hundreds to thousands of collisions which occur prior to a given typical collision could therefore place up to $\\sim 0.1-0.3M_{\\odot}$ over radial scales of $\\gtrsim 10-100$ AU, potentially sufficient to explain the observed reprocessing \\citep{Roth+16}. \nDue to Lense-Thirring precession of the stellar orbits, the collision plane will rotate between subsequent encounters around the SMBH spin axis (eq.~\\ref{eq:LT}), such that each gaseous disk would be created with its angular momentum pointed in a significantly different direction. However, differential Lense-Thirring precession will generally align each transient disk with the SMBH equatorial plane \\citep{Bardeen&Petterson75}, leading to a larger scale accretion flow that is coplanar. \n\nOnce UV\/X-ray irradiation from the flare intercepts the geometrically thin disk, the resulting heating will cause it to puff up vertically, blocking a larger fraction of the light than it would have given its initial vertical thickness. If the timescale for the collision evolution is sufficiently long, with $\\tau_{\\rm tot} \\gg 10^{4}$ yr (eq.~\\ref{eq:tautot}), then gas accretion from a TDE in the same nucleus might destroy the fossil disk ($\\S\\ref{sec:TDEstripping}$). However, in this case the viscous spreading-evolution of one (or several consecutive) TDE disks could itself deposit sufficient mass on large scales to replenish the repocessing disk. Thus, our new proposed scenario for the reprocessing layer is largely independent of the EMRI collision scenario, and could also apply to galaxies with a high TDE rate.\n\n\nThis fossil reprocessing disk could also serve as source of magnetic flux, to be swept towards the black hole by the debris from future TDEs \\citep{Tchekhovskoy+14,Kelley+14}, explaining why some TDEs are able to produce \npowerful magnetically-dominated jets (\\citealt{Giannios&Metzger11,Tchekhovskoy+14,Kelley+14}).\n\n\\subsection{Gas Ablation in True Tidal Disruption Events}\n\\label{sec:TDEstripping}\n\nThe rate of TDEs around small SMBHs is typically $\\sim 10^{-4}~{\\rm yr}^{-1}$, with a scatter of about an order of magnitude depending on the detailed properties of the specific galaxy \\citep{Stone&Metzger16}. Given that this exceeds our fiducial rate of circular EMRI inspirals by a factor of $\\sim 10^{2}-10^{4}$, the first mass-transferring star must survive this many gas production events in a galactic nucleus in order to undergo the collisional evolution described in this paper. This section considers whether such survival is feasible in the face of mass loss due to shock-heating from the interaction between the star and the gaseous TDE accretion disk.\n\nThe TDE results in a transient accretion event of duration $\\tau_{\\rm acc} \\sim$ months and average mass accretion rate $\\dot{M}_{\\rm acc} \\approx M_{\\rm acc}\/\\tau_{\\rm acc}$, where $M_{\\rm acc}$ is the total accreted mass. The star's semi-major axis distance $a$ is comparable to the tidal radius of a disrupted star, and the midplane density of the gaseous TDE disk at this location is approximately given by\n\\begin{equation}\n\\rho_{\\rm d} = \\frac{\\Sigma}{2h} = \\frac{\\dot{M}_{\\rm acc}}{6\\pi \\nu h} =\\frac{M_{\\rm acc}}{6\\pi \\alpha a^{3}\\Omega(h\/a)^{3}\\tau_{\\rm acc}},\n\\end{equation}\nwhere we have used the standard relationship for a steady-state disk $\\dot{M}_{\\rm acc} = 3\\pi \\nu \\Sigma$ with viscosity $\\nu = \\alpha (h\/a)^{2}a^{2}\\Omega$.\n\nIn general the orbital plane of the gaseous disk will not be aligned with that of the star, and so the star will be impacted by a ``headwind\" of gas at a relative velocity $v_{\\rm c}$ up to twice the orbital velocity $v_{\\rm k} = a\\Omega$. The shock created by the interaction of the star with the gaseous disk will ablate mass stellar mass. \n\nThe shock will penetrate to a depth inside the star approximately given by equality between ram pressure and the interior pressure of the star,\n\\begin{equation}\n\\rho_{\\rm d}v_{\\rm c}^{2}\/2 = P_{\\star} = \\bar{P}_{\\star}\\left(\\frac{\\rho_{\\star}}{\\bar{\\rho}_{\\star}}\\right)^{\\gamma},\n\\end{equation}\nwhere $\\bar{\\rho}_{\\star} \\equiv M_{\\star}\/(4\\pi R_{\\star}^{3}\/3)$ is the mean stellar density and $\\bar{P}_{\\star} \\simeq 0.04 GM_{\\star}^{2}\/R_{\\star}^{4}$ for a $\\gamma = 5\/3$ polytrope. The shocks thus initially penetrate to a depth where the stellar density equals\n\\begin{eqnarray}\n&&\\frac{\\rho_{\\star,\\rm sh}}{\\bar{\\rho}_{\\star}} \\approx 1.9\\left(\\frac{v_{\\rm c}^{2}R_{\\star}}{GM_{\\star}}\\frac{\\rho_{\\rm d}}{\\bar{\\rho}_{\\star}}\\right)^{3\/5} \\nonumber \\\\\n &&\\approx 1.9\\left[\\frac{2}{9\\alpha}\\left(\\frac{h}{a}\\right)^{-3}\\frac{1}{\\Omega \\tau_{\\rm acc}}\\left(\\frac{v_{\\rm c}}{v_{\\rm k}}\\right)^{2}\\left(\\frac{M_{\\bullet}}{M_{\\star}}\\right)\\left(\\frac{M_{\\rm acc}}{M_{\\star}}\\right)\\left(\\frac{R_{\\star}}{a}\\right)^{4}\\right]^{3\/5} \\nonumber \\\\\n&&\\approx 2.1\\times 10^{-4}\\frac{M_{\\bullet,7}^{3\/10}}{\\alpha_{-1}^{3\/5}a_{\\rm AU}^{3\/2}}\\left(\\frac{h\/a}{0.3}\\right)^{-9\/5}\\left(\\frac{v_{\\rm c}}{v_{\\rm k}}\\right)^{6\/5} \\nonumber \\\\\n&& \\times \\left(\\frac{M_{\\star}}{0.1M_{\\odot}}\\right)^{-3\/5}\\left(\\frac{M_{\\rm acc}}{M_{\\star}}\\right)^{3\/5}\\left(\\frac{R_{\\star}}{0.1R_{\\odot}}\\right)^{12\/5}\\left(\\frac{\\tau_{\\rm acc}}{{\\rm month}}\\right)^{-3\/5}.\n\\label{eq:rhopenetrate}\n\\end{eqnarray}\n\nWhile the star is within the gaseous disk, the shocks will cause mass ablation from its surface. The maximum rate of mass ablation is approximately equal to the rate at which gas passes through the shock,\n\\begin{equation}\n\\dot{M}_{\\star} = -\\pi R_{\\star}^{2}\\rho_{\\star, \\rm sh} v_{\\rm sh},\n\\end{equation}\nwhere $\\pi R_{\\star}^{2}$ is the cross section of the star and $v_{\\rm sh} \\approx (\\rho_{\\rm d}\/\\rho_{\\star, \\rm sh})^{1\/2}v_{\\rm c}$ is the velocity of the shock bring driven into the star (\\citealt{McKee&Cowie75}). \n\nCombining results, we find that the minimum timescale for the star to be destroyed by ablation is given by\n\\begin{eqnarray}\n&&\\frac{\\tau_{\\rm ablate}}{\\tau_{\\rm acc}} \\approx \\frac{1}{f_{\\rm d}\\tau_{\\rm acc}}\\frac{M_{\\star}}{|\\dot{M}_{\\star}|} = \\frac{4}{3f_{\\rm d}}\\frac{R_{\\star}}{\\tau_{\\rm acc} v_{\\rm c}}\\left(\\frac{\\rho_{\\star, \\rm sh}}{\\bar{\\rho}_{\\star}}\\right)^{-1\/2}\\left(\\frac{\\bar{\\rho}_{\\star}}{\\rho_{\\rm d}}\\right)^{1\/2} \\nonumber \\\\\n&=& \\frac{1}{f_{\\rm d}}\\left(\\frac{\\bar{\\rho}_{\\star}}{\\rho_{\\star, \\rm sh}}\\right)^{\\frac{1}{2}}\\left(8 \\alpha \\left(\\frac{M_{\\star}}{M_{\\rm acc}}\\right)\\left(\\frac{a}{R_{\\star}}\\right)\\left(\\frac{v_{\\rm k}}{v_{\\rm c}}\\right)^{2}\\left(\\frac{h}{a}\\right)^{3}\\frac{1}{\\tau_{\\rm acc}\\Omega}\\right)^{\\frac{1}{2}} \\nonumber \\\\\n&\\approx& \\frac{17}{f_{\\rm d}}\\left(\\frac{\\rho_{\\star, \\rm sh}}{10^{-4}\\bar{\\rho}_{\\star}}\\right)^{-1\/2}\\frac{\\alpha_{-1}^{1\/2}a_{\\rm AU}^{5\/4}}{M_{\\bullet,7}^{1\/4}}\\left(\\frac{M_{\\rm acc}}{M_{\\star}}\\right)^{-1\/2} \\nonumber \\\\\n&&\\times \\left(\\frac{h\/a}{0.3}\\right)^{3\/2}\\left(\\frac{v_{\\rm c}}{v_{\\rm k}}\\right)^{-1}\\left(\\frac{R_{\\star}}{0.1R_{\\odot}}\\right)^{-1\/2}\\left(\\frac{\\tau_{\\rm acc}}{{\\rm month}}\\right)^{-1\/2} \\nonumber \\\\\n&\\approx& 36\\frac{\\alpha_{-1}^{4\/5}a_{\\rm AU}^{2}}{M_{\\bullet,7}^{2\/5}}\\left(\\frac{M_{\\rm acc}}{M_{\\star}}\\right)^{-4\/5}\\left(\\frac{h\/a}{0.3}\\right)^{12\/5} \\left(\\frac{f_{\\rm d}}{h\/a} \\right)^{-1}\\label{eq:tauablate} \\\\\n&&\\left(\\frac{v_{\\rm c}}{v_{\\rm k}}\\right)^{-8\/5}\\left(\\frac{R_{\\star}}{0.1R_{\\odot}}\\right)^{-17\/10}\\left(\\frac{\\tau_{\\rm acc}}{{\\rm month}}\\right)^{-1\/5}\\left(\\frac{M_{\\star}}{0.1M_{\\odot}}\\right)^{3\/10},\\nonumber\n\\end{eqnarray}\nwhere $f_{\\rm d}$ is the fraction of the star's orbit spent in the midplane of the disk, and in the final line we have substitute in equation (\\ref{eq:rhopenetrate}). A stellar orbit misinclined relative to the plane of the disrupted star will have $f_{\\rm in} \\sim h\/a$, while one close to the same orbital plane would have $f_{\\rm in} \\sim 1$.\\footnote{However, $f_{\\rm in}$ may change even during the TDE itself due to Lense-Thirring precession of the stellar orbit (eq.~\\ref{eq:LT}).} \n\nWe thus see that $\\tau_{\\rm ablate} \\gg \\tau_{\\rm acc}$ for fiducial parameters, and thus the star should survive at least one TDE intact. However, the outcome is sensitive to the precise semi-major axis of the star and the total gas mass accreted in the TDE, $M_{\\rm acc}$, which could be as low as $\\sim 10^{-3}-10^{-2}M_{\\odot} \\sim 0.01-0.1M_{\\star}$ (Fig.~\\ref{fig:Erad}; \\citealt{Metzger&Stone16}), in which case $\\tau_{\\rm ablate}\/\\tau_{\\rm flare}$ would be larger by significant factor. Also note that equation (\\ref{eq:tauablate}) is likely a lower limit on the ablation timescale, because not all matter which passes through the shock will necessarily become unbound from its surface. This is because the specific thermal energy imparted to the shocked gas $\\sim v_{\\rm sh}^{2} \\sim (\\rho_{\\star, \\rm sh}\/\\bar{\\rho}_{\\star})v_{\\rm c}^{2} \\sim 10^{-4}(GM_{\\bullet}\/a)$ may be comparable to the gravitational binding of the star $\\sim v_{\\rm esc}^{2} \\sim GM_{\\star}\/R_{\\star}$; gas stripped from the stellar surface may therefore accumulate in a wake behind the star to become re-accreted once the flare ceases. \n\nWhat is less clear from the above numbers is whether the outspiraling brown dwarf can survive the large number of expected collisions during its lifetime. Once a second EMRI arrives on a quasi-circular orbit, the period of the collisional interaction is $\\sim 10^{4-6}~{\\rm yr}$ (Eq. \\ref{eq:tautot}). During this period, the expected number of TDEs is $\\sim 0.1-1000$ \\citep{Stone&Metzger16}. Large portions of this range are likely surviveable for the brown dwarf. The greater challenge for the brown dwarf is surviving long enough to greet an arriving second EMRI. The fiducial circular EMRI rate of $\\sim 10^{-7}~{\\rm yr}^{-1}$ would require the brown dwarf to survive $\\sim 10^{2-4}$ tidal ablation events, which will be much more challenging (Eq. \\ref{eq:tauablate}). However, we note that this fiducial circular EMRI rate could be enhanced by up to two orders of magnitude if binary orbits are perturbed outside the SMBH influence radius by massive objects (e.g. giant molecular clouds; \\citealt{Perets+07}) or non-axisymmetric components of the galactic potential \\citep{Hamers&Perets17}. The large estimated galaxy-to-galaxy scatter (at fixed SMBH mass) in the classical TDE rate \\citep{Stone&Metzger16} is not necessarily correlated with the comparably large scatter in the circular EMRI rate (as most of the TDEs are sourced from $\\sim {\\rm pc}$ scales, while tidally detached binaries can come from much larger distances), making it likely that at least a subset of galactic nuclei will produce EMRI collisions which are not seriously inhibited by ablation from interloping TDEs.\n\n\n\n\n\\section{Conclusions}\n\\label{sec:conclusions}\n\nThe inevitability of stellar collisions in galactic nuclei is well-documented (e.g.~\\citealt{Ginsburg&Loeb07,Antonini+10,Balberg+13, Leigh+16a}). However, past work has focused on singular collisions, or mergers of stars on eccentric orbits located far outside the tidal radius of the SMBH. Given the relatively large radius of gas produced in such collisions, any resulting accretion-powered flare produced by these collisions would probably be slowly evolving and very dim. \n\nHere we have explored a very different scenario: mildly relativistic physical colllisions between two (initially) main sequence stars on circular EMRI orbits undergoing stable Roche-lobe overflow. Focusing on the probably most common case of an inspiraling, low mass main sequence star interacting with an outspiraling brown dwarf, we have shown that at least a single collision between the stars is inevitable, when they occupy the same orbital phase at the line of nodes where their orbital planes cross (Fig.~\\ref{fig:cartoon}). \n\nThe initial collision is generally grazing. Although only a tiny fraction of the stars' surfaces geometrically intersect, the enormous relative velocities ($\\sim 0.1c$) cause massive shock heating of the stellar atmospheres. When the mass of the SMBH $M_{\\bullet} \\lesssim 7 \\times 10^{6}M_{\\odot}$, this heating is insufficient to destroy the stars in a single encounter, and only a small fraction of the stellar mass is liberated, primarily from the more massive star. This mass loss produces a gaseous accretion disk, which feeds the SMBH and causes a transient electromagnetic flare, potentially similar in appearance to observed candidate TDE flares. \nMass loss from the collision also causes the orbital semi-major axis of the outer star to expand, separating it from the orbit of the inner star and delaying the next interaction for at least a decade and perhaps many millenia; the stars must wait for gravitational wave inspiral to realign their orbits before they can once again collide. The net result of the ensusing string of grazing collisions is a ``death by a thousand cuts,'' producing a series of quasi-periodic accretion-powered flares, over a total duration of thousands of years or longer. Conversely, if $M_\\bullet \\gtrsim 7 \\times 10^6 M_\\odot$, the first collision is likely powerful enough to completely destroy one or both stars; the ensuing flare will be more analogous to a classical TDE.\n\nAlthough our estimates for the amount of shock heating and the resulting mass lost in grazing stellar collisions are crude, we expect that the qualitative features of the evolution described above should be qualitatively robust. If the mass loss is smaller (larger) than we have assumed, this will simply increase (decrease) the total number of collisions before the stellar mass is eroded and decrease (increase) the interval between the collisions. Future hydrodynamical simulations will better quantify the outcome of mildly relativistic stellar collisions and allow for a more accurate calibration of our model. Future simulation work is also needed to quantify the fraction of the angular momentum of collisionally liberated gas which is fed back into the stellar orbit, accounting for the possible role of Lense-Thirring precession both on the disk and stellar orbits. \n\nBecause the lifetime of the mass transfer evolution is comparable to the expected interval between EMRIs, colliding EMRI chains should occur at a rate comparable to the circular EMRI inspiral rate of $\\gtrsim 10^{-7}$ yr$^{-1}$ per galaxy \\citep{AmaroSeoane+12}. Although this is still 2-3 orders of magnitude smaller than the predicted or observed TDE rate, we nevertheless conclude that collisional EMRIs can still contribute an appreciable fraction of the observed TDE rate, serving as ``TDE imposters.\" This is because a given collisional interaction may produce a number $N_{\\rm c} \\sim 1-10^{4}$ of gas production events (eq.~\\ref{eq:Ncoll2}) each of mass $\\sim M_{\\odot}\/N_{\\rm c} \\sim 10^{-4}-1M_{\\odot}$. If accreted with high radiative efficiency, the luminosities produced after each collision could well explain those of many observed TDE flare candidates. \n\nUnlike in TDEs, the stellar debris from colliding EMRIs is tightly bound to the SMBH, allowing it to avoid the theoretically uncertain and perhaps lossy circularization process required to accrete highly eccentric TDE debris streams. Our model provides a natural explanation for some flare light curves which appear to decay exponentially (e.g.~iPTF-16fnl; \\citealt{Blagorodnova+17}), or as power-laws shallower than $t^{-5\/3}$, depending on how efficiently the gas angular momentum liberated in the collision is fed back into the stellar orbit. Viscous spreading of the gaseous disks produced by previous collisions in the chain can also provide a natural supply of radially extended, dense gas around the site of future collisions or TDEs, providing a possible medium for reprocessing the UV\/X-ray accretion luminosity down to optical frequencies.\n\nFuture work is required to explore this new transient scenario in greater detail. The rates of quasi-circular stellar EMRIs are quite uncertain, and hydrodynamic simulations are required to better understand mass loss in mildly relativistic stellar collisions. They are also required to confirm whether Roche-overflowing stars can survive the substantial gas ablation expected during the many TDEs experienced between collisional interaction events ($\\S\\ref{sec:TDEstripping}$). A population study of colliding EMRIs with a realistic distribution of initial stars and orbits would provide more accurate statistics on the expected range of outcomes. Also deserving of future study is the role of stellar-mass black hole EMRIs, which should periodically pass through the main sequence EMRIs over the course of their mass-transfer evolution (Appendix \\ref{sec:A}). \n\n\n\\acknowledgements\n\nWe thank Itai Linial, Cole Miller, and Re'em Sari for helpful comments on an early version of this manuscript. We also thank Tiara Hung and Suvi Gezari for providing data on optical TDE light curves. BDM gratefully acknowledges support from the National Science Foundation (AST-1410950, AST-1615084), NASA through the Astrophysics Theory Program (NNX16AB30G) and the Fermi Guest Investigator Program (NNX15AU77G, NNX16AR73G), the Research Corporation for Science Advancement Scialog Program (RCSA 23810), and the Alfred P.~Sloan Foundation. Financial support was provided to NCS by NASA through Einstein Postdoctoral Fellowship Award Number PF5-160145.\n\n\n\n\\clearpage\n\n\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\nIn recent years, energy harvesting cognitive radio networks (EH-CRNs) has emerged as a solution to the problem of spectrum scarcity and at the same time ensures perpetual operation of the communication devices \\cite{EH_CRN}. In the literature, the EH-CRNs operating in interweave, overlay and underlay mode have been studied in \\cite{interweave_1,interweave_2,interweave_3,interweave_4,interweave_5}, \\cite{overlay_1,overlay_2,\noverlay_3}, and \\cite{overlay_4,underlay_1,underlay_2,underlay_3}, respectively.\n\nIn \\cite{interweave_1}, authors considered an EH-CR network operating in interweave mode. The secondary user (SU) uses ambient radio signals and wireless power transfer to harvest RF energy. The authors used time homogeneous discrete Markov process to model the primary traffic. In each slot, the SU decides either to remain idle or to perform spectrum sensing and re-configures the detection threshold. The authors proposed a transmission policy such that expected total throughput of SU is maximized. They formulated the optimization problem as constrained partially observable Markov decision process (POMDP) and obtained a policy maximizing SU's throughput by designing the spectrum sensing policy and detection threshold jointly. In \\cite{interweave_2}, authors considered the system model of \\cite{interweave_1}, and used time homogeneous discrete Markov process to model the temporal correlation of the primary traffic. The authors upper bounded the achievable throughput of the SU, which is based on energy arrival rates, temporal correlation of primary traffic and detection threshold. The authors obtained an optimal detection threshold maximizing the upper bound on achievable throughput. In \\cite{interweave_3}, authors considered a CR network with energy harvesting secondary user in a single user multi-channel scenario. Based on energy availability of SU, channel conditions and belief state of PU's network, authors obtained a channel selection criterion. This channel selection criterion chooses the best subset among all the available channels for sensing. Then, using the proposed criterion, the authors constructed a channel-aware optimal and myopic sensing policy. In \\cite{interweave_4}, authors considered an EH-CR network where both the PU and SU have energy harvesting capability but they don't have any battery to store the harvested energy. So, if harvested energy is not used, it is discarded. Based on Markovian behavior of PU, to specify the interaction between the PUs and SUs in the system, authors adapted a hidden input Markov model. The authors proposed a two-dimensional spectrum and power sensing policy that improves the PU detection performance and estimates the primary transmit power level. In \\cite{interweave_5}, authors obtained an optimal detection threshold specifying a sensing policy that maximizes the expected total throughput of energy harvesting SU. Authors showed that when arrival rate of energy is less than it's expected consumption, decreased probability of accessing occupied channel may not affect the probability of accessing the vacant spectrum.\n\n\\indent In \\cite{overlay_1}, authors considered an EH-CR network operating in overlay scenario where the secondary user helps primary deliver it's data. The SU has energy harvesting capability and the authors used a discrete time queue to model the energy queue with Markov arrival and service processes. In the system model considered, when PU transmits, SU remains silent and receives some fraction of PU's data and stores it in a queue. Then, as PU becomes silent, SU relays primary data using decode and forward protocol. For the proposed system, the authors obtained inner and outer bounds on the stability region. In \\cite{overlay_2}, authors considered a CR network with joint information and energy cooperation. In the system model considered, the PU not only gives information to SU for relaying but feeds it with energy also. For such cooperation, authors proposed three schemes. In first, they considered an ideal backhaul for information and energy transfer between the two systems. Then, authors proposed power and time splitting schemes enabling the joint information-energy cooperation. Finally, authors obtained zero forcing solutions for all three schemes. In \\cite{overlay_3}, authors considered joint information and energy cooperation among the primary and secondary users. The SU relays primary data and gets spectrum access as a reward. Moreover, the PU feeds the SU with energy. The authors aim to maximize the primary rate subject to rate constraints of both the users. Then, authors analyzed the effects of SU rate constraint and finite battery on probability of cooperation and primary rate. In \\cite{overlay_4}, authors considered a scenario where PUs harvest energy from multiple access points (APs) while SUs have fixed power supply. In the \\emph{energy harvesting zone} centered at PU, nearest ST is selected to transfer energy to PU wirelessly. Also, there exist a \\emph{cooperative region} between PU and AP, where an ST is selected to relay primary data based on the channel quality between ST and AP, and in return, the ST is rewarded with some fraction of bandwidth of primary channel. Under performance constraints of primary system, authors aimed to maximize the throughput of secondary systems in a given area.\n\\begin{figure*}[!t]\n\\includegraphics[width=0.8\\linewidth]{system_model}\n\\centering\n\\caption{Primary and RF energy harvesting secondary users coexisting in an underlay scenario}\n\\label{fig:system_model}\n\\vspace{-3mm}\n\\end{figure*}\n\n\\indent In \\cite{underlay_1}, authors considered an underlay CR system where multiple PUs and energy harvesting SUs coexist. Each primary transmitter (PT) has two concentric zones, namely, \\emph{guard zone} and \\emph{harvesting zone}. If a secondary transmitter (ST) is located within the \\emph{harvesting zone}, it harvests energy from primary transmission, if it is located outside the \\emph{guard zone}, it transmits with fixed power, and otherwise remains idle. The authors considered independent homogeneous Poisson point processes (HPPP) to model PTs and STs, and maximized the spatial throughput of secondary network. In \\cite{underlay_2}, authors solved the secondary system throughput maximization problem using geometric waterfilling with peak power constraints (GWFPP). It is showed that the proposed algorithm outperforms the primal-dual interior point method (PD-IPM). In \\cite{underlay_3}, authors considered an underlay CR network where the SU harvests energy from PU's transmission. In each slot, some fraction of time is reserved for energy harvesting and remaining is reserved for information transfer. However, the authors assumed that the SU uses all of the harvested energy in that slot itself, which makes the optimization problem independent among the slots. The authors obtained an online myopic solution for time sharing between the energy harvesting phase and information transfer phase which maximizes the achievable rate of CR system.\n\n\\indent In this paper, we consider an underlay CR network with one PU and one SU transmitter-receiver pair operating in slotted fashion. The PT transmits with a fixed power whereas in each slot, the ST spends some fraction of the slot for EH and remaining for IT. However in each slot, SU is not bound to use all of the energy harvested in that slot, rather it can save the energy for future use. The main contributions of this paper are as follows:\n\\begin{itemize}\n\\item First, we obtained optimal offline time sharing between EH and IT phase, and secondary transmit power policy maximizing the sum achievable throughput of ST under energy causality constraint of ST and interference constraint at primary receiver (PR). We formulate the optimization problem as convex optimization problem and obtained the solution in closed form.\n\\item Second, we compare the optimal offline policy with an online myopic policy where unlike the offline policy, only instantaneous channel state information (CSI) is available at ST \\cite{underlay_3}. We formulate the optimization problem as convex optimization problem and decouple it into multiple parallel subproblems and obtained the optimal time sharing parameter in closed form.\n\\end{itemize}\nThe rest of the paper is organized as follows. We present the system model and problem formulation in section II. The optimal offline and the online myopic time-sharing and transmit power policies are obtained in section III, results are given in section IV and finally, we conclude in section V.\n\n\\emph{Notation}: A bold-faced symbol with a ``bar'' (e.g. $\\vec{v}$) represents a vector of length $M$. $[x]^+$ represents $\\max(x,0)$, and $\\vec{v}\\succeq0$ means that each component of vector $\\vec{v}$, $v_i$ is greater than or equal to 0. The calligraphic symbols (e.g. $\\mathcal{S}=\\{\\vec{s}_1,\\ldots\\vec{s}_N\\}$) represents a set of $N$ vectors. And, $\\vec{0}$ and $\\vec{1}$ represent the vectors of all zeros and ones respectively.\n\n\\section{System Model}\nWe consider a scenario where a primary user (PU) and a RF energy harvesting secondary user (SU) coexist in an underlay mode as shown in Fig. \\ref{fig:system_model}. Both the primary and secondary transmitters operate in slotted fashion. The PU has a reliable power supply whereas the SU harvests RF energy from PU's transmission and stores it in an infinite sized battery. We assume that the PU transmits with a constant power of $P_p$ in each slot. However in each slot, the secondary transmitter (ST) uses some fraction of the slot for harvesting energy from primary transmission and transmits in the remaining amount of time such that the interference at primary receiver remains below an acceptable threshold $P_{int}$. The objective is to maximize the sum achievable throughput of ST by the end of $M$ slots under energy causality constraints of SU and interference constraint of PU.\\\\\n\\begin{figure*}[!t]\n\\begin{align}\nE_s^{i*}=\\alpha_i^*\\left[\\frac{1}{\\ln2(\\sum_{j=i}^M\\lambda_j^*+\\gamma_i^*h_{sp}^i)}-\\frac{1}{\\theta_i}\\right]^+\\text{and }\n\\alpha_i^*=\\theta_iE_s^{i*}\\left[\\frac{1}{\\ln2\\left(\\log_2(1+\\theta_i\\beta_i^*)-\\sum_{j=i}^M\\eta P_p\\lambda_j^*+\\gamma_i^*P_{int}-\\mu_i^*\\right)}-1\\right]^+\\label{eq:opt_sol}\n\\end{align}\nwhere $\\beta_i^*=\\left[\\frac{1}{\\ln2(\\sum_{j=i}^M\\lambda_j^*+\\gamma_i^*h_{sp}^i)}-\\frac{1}{\\theta_i}\\right]^+$ and $\\theta_i=\\frac{h_{ss}^i}{\\sigma_s^2+h_{ps}^iP_p}$.\\\\\n\\noindent\\rule{\\linewidth}{0.4pt}\n\\vspace{-.8cm}\n\\end{figure*}\n\\indent In the system model, all the channel links are assumed to be i.i.d. Rayleigh faded with variances $\\sigma_{pp}^2,\\sigma_{ps}^2,\\sigma_{sp}^2$ and $\\sigma_{ss}^2$ for PT-PR, PT-SR, ST-PR and ST-SR link respectively, so the channel power gains $h_{pp},h_{ps},h_{sp}$ and $h_{ss}$ are i.i.d. exponentially distributed. Since we have considered an offline policy, we assume that complete channel state information (CSI) is known at ST non-causally as in \\cite{non_causal_csi}. The noise at both the receivers is assumed to be zero mean additive white Gaussian with variances $\\sigma_p^2$ and $\\sigma_s^2$ at PR and SR respectively. Let $\\alpha_i$ be the time sharing parameter between EH and IT phase such that in slot $i$, the ST harvests for $(1-\\alpha_i)$ fraction of time and transmits for $\\alpha_i$ fraction of time. The slot length is assumed to be 1 second without loss of generality. Let $P_s^i$ be the transmit power of ST in $i$th slot, the achievable rate of SU in bits\/seconds\/Hz is given by Shannon capacity formula:\n\\begin{align*}\nR_i(\\alpha_i,P_s^i)=\\alpha_i\\log_2\\left(1+\\frac{h_{ss}^iP_s^i}{\\sigma_s^2+h_{ps}^iP_p}\\right),\\; i=1,\\ldots,M.\n\\end{align*}\nThe optimization problem is given as:\n\\begin{subequations}\n\\begin{align}\n\\max_{\\vec{\\pmb{\\alpha}},\\vec{P}_s} \\quad & \\sum_{i=1}^M \\alpha_i\\log_2\\left(1+\\frac{h_{ss}^iP_s^i}{\\sigma_s^2+h_{ps}^iP_p}\\right)\\label{eq:opt_1}\\\\\n\\text{s.t.}\\quad & \\sum_{j=1}^i\\alpha_jP_s^j\\leq \\sum_{j=1}^i(1-\\alpha_j)\\eta P_p,\\quad i=1,\\ldots,M \\label{eq:opt_2}\\\\\n& \\qquad\\qquad \\text{(Energy causality constraint of SU)} \\nonumber\\\\\n& h_{sp}^iP_s^i\\leq P_{int}, \\quad i=1,\\ldots,M \\label{eq:opt_3}\\\\\n&\\qquad\\qquad\\qquad\\text{(Interference constraint of PU)} \\nonumber\\\\\n& \\vec{P}_s\\succeq \\vec{0},\\,\\vec{0}\\preceq \\vec{\\pmb{\\alpha}}\\preceq \\vec{1} \\label{eq:opt_4}\n\\end{align}\n\\end{subequations}\nwhere $0\\leq\\eta\\leq1$ and $P_{int}$ are the energy harvesting efficiency of SU and interference constraint of PR respectively. The constraint (\\ref{eq:opt_2}) is the energy causality constraint of ST, which states that the total energy consumed by the end of slot $i$ must be less than or equal to total energy harvested upto slot $i$.\n\\section{Optimal Time Sharing and Transmit Policy}\n\\indent The problem (\\ref{eq:opt_1})-(\\ref{eq:opt_4}) is not a convex optimization problem as the optimization variables $\\vec{P}$ and $\\vec{\\pmb{\\alpha}}$ appear in product form. Let $E_s^i$ denotes the energy consumed by ST in $i$th slot so that $E_s^i=\\alpha_iP_s^i$. Using change of variable $P_s^i=\\frac{E_s^i}{\\alpha_i}$, the optimization problem can be rewritten as:\n\\begin{subequations}\n\\begin{align}\n\\max_{\\vec{\\pmb{\\alpha}},\\vec{E}_s} \\quad & \\sum_{i=1}^M \\alpha_i\\log_2\\left(1+\\frac{h_{ss}^iE_s^i}{\\alpha_i(\\sigma_s^2+h_{ps}^iP_p)}\\right)\\label{eq:convex_opt_1}\\\\\n\\text{s.t.}\\quad & \\sum_{j=1}^iE_s^j\\leq \\sum_{j=1}^i(1-\\alpha_j)\\eta P_p,\\quad i=1,\\ldots,M \\label{eq:convex_opt_2}\\\\\n& \\qquad\\qquad \\text{(Energy causality constraint of SU)} \\nonumber\\\\\n& h_{sp}^iE_s^i\\leq \\alpha_i P_{int}, \\quad i=1,\\ldots,M \\label{eq:convex_opt_3}\\\\\n&\\qquad\\qquad\\qquad\\text{(Interference constraint of PU)} \\nonumber\\\\\n& \\vec{E}_s\\succeq \\vec{0},\\,\\vec{0}\\preceq \\vec{\\pmb{\\alpha}}\\preceq \\vec{1} \\label{eq:convex_opt_4}\n\\end{align}\n\\end{subequations}\nwhich is a convex optimization problem as the objective function is negative of sum of relative entropies $D(p_i||q_i)$ where $p_i=\\alpha_i$ and $q_i=\\alpha_i+\\frac{h_{ss}^iE_s^i}{\\sigma_s^2+h_{ps}^iP_p}$, and the constraints are affine inequalities. Hence, it can be solved efficiently using CVX. Firstly, we propose the necessary conditions our optimal policy must satisfy and then, we will obtain the optimal offline solution.\n\\subsection{Optimality Conditions}\n\\begin{proposition*}\nThe optimal time sharing and transmit power policy must satisfy $\\sum_{i=1}^ME_s^{i*}= \\sum_{i=1}^M(1-\\alpha^*_i)\\eta P_p$, i.e., the optimal policy must use all the harvested energy by end of the transmission.\n\\end{proposition*}\n\\begin{proof}\nWe prove this using contradiction. Let $\\{\\vec{E}'_s,\\vec{\\pmb{\\alpha}}'\\}$ be an optimal policy in which we have some residual energy remaining in the battery by the end of transmission, i.e., $\\sum_{j=1}^ME_s^{'j}<\\sum_{j=1}^M(1-\\alpha'_j)\\eta P_p$. Since the objective is a concave and monotonically increasing function of consumed energy, we could have consumed more energy in previous slots without violating the energy causality constraint. This way, we can also increase the transmission power. This would result in higher achievable rate, hence contradicts with our consideration of optimality.\n\\end{proof}\n\n\\begin{figure*}[!th]\n\\centering\n\\begin{minipage}{0.3\\linewidth}\n\\centering\n \\includegraphics[width=2.3in]{optimal_plot}\n \\caption{Average achievable sum rate of ST ($\\vec{R}$) versus number of secondary slots ($N$).}\n \\label{fig:opt_plot}\n\\end{minipage}\n\\hspace{3mm}\n\\begin{minipage}{0.3\\linewidth}\n\\centering\n \\includegraphics[width=2.3in]{comparison_myopic_2}\n \\caption{Average achievable sum rate of optimal and online myopic policies.}\n \\label{fig:comparison}\n\\end{minipage}\n\\hspace{3mm}\n\\begin{minipage}{0.3\\linewidth}\n\\centering\n\\centering\n \\includegraphics[width=2.3in]{diff_chan}\n \\caption{Average achievable rate of ST ($\\vec{R}$) versus number of secondary slots ($N$) under different channel conditions ($\\eta = 0.3$ and $P_{int}=0.1$).}\n \\label{fig:diff_chan}\n\\end{minipage}\n\\vspace{-0.3cm}\n\\end{figure*}\n\\subsection{Optimal Solution}\nThe Lagrangian of the problem (\\ref{eq:convex_opt_1})-(\\ref{eq:convex_opt_4}) is given as:\n\\begin{align}\n\\mathcal{L}(\\vec{x},\\vec{y})= &-\\sum_{i=1}^M\\alpha_i\\log_2\\left( 1+ \\frac{h_{ss}^iE_s^i}{\\alpha_i(\\sigma_s^2+h_{ps}^iP_p)}\\right)\\nonumber \\\\\n&+\\sum_{i=1}^M \\lambda_i \\left[\\sum_{j=1}^iE_s^j-\\sum_{j=1}^i(1-\\alpha_j)\\eta P_p \\right]\\nonumber \\\\\n&+\\sum_{i=1}^M\\gamma_i[h_{sp}^iE_s^i-P_{int}\\alpha_i]+\\sum_{i=1}^M\\mu_i(\\alpha_i-1) \\label{eq:lagrangian}\n\\end{align}\nwhere $\\vec{\\pmb{\\lambda}},\\vec{\\pmb{\\gamma}}$ and $\\vec{\\pmb{\\mu}}$ are the dual variables for the constraints (\\ref{eq:convex_opt_2}), (\\ref{eq:convex_opt_3}) and (\\ref{eq:convex_opt_4}) respectively and $\\vec{x}\\in\\mathcal{X}=\\{\\vec{E}_s,\\vec{\\pmb{\\alpha}}\\}$, and $\\vec{y}\\in\\mathcal{Y}=\\{\\vec{\\pmb{\\lambda}},\\vec{\\pmb{\\gamma}},\\vec{\\pmb{\\mu}}\\}$. The\nKarush-Kuhn-Tucker (KKT) stationarity conditions are:\n\\begin{align}\n\\frac{\\frac{\\theta_iE_s^{i*}}{\\alpha_i^*}}{\\ln2\\cdot\\left(1+\\frac{\\theta_iE_s^{i*}}{\\alpha_i^*}\\right)}-\\log_2\\left(1+\\frac{\\theta_iE_s^{i*}}{\\alpha_i^*}\\right)+\\sum_{j=i}^M\\eta P_p\\lambda_j^*\\nonumber\\\\\n-P_{int}\\gamma_i^*+\\mu_i^*&=0 \\label{eq:kkt_1}\\\\\n-\\frac{\\theta_i}{\\ln2\\left(1+\\frac{\\theta_iE_s^{i*}}{\\alpha_i^*}\\right)}+\\sum_{j=i}^M\\lambda_j^*+\\gamma_i^*h_{sp}^i&=0\\label{eq:kkt_2}\n\\end{align}\nwhere $\\theta_i=\\frac{h_{ss}^i}{\\sigma_s^2+h_{ps}^iP_p}$. And the complementary slackness conditions are\n\\begin{align}\n\\lambda_i^*\\left[\\sum_{j=1}^iE_s^{j*}-\\sum_{j=1}^i(1-\\alpha_j^*)\\eta P_p\\right]&=0\\\\\n\\gamma_i^*[h_{sp}^iE_s^{i*}-\\alpha_i^*P_{int}]&=0\\\\\n\\mu_i^*[\\alpha_i^*-1]&=0\n\\end{align}\nfor all $i=1,\\ldots,M$. To make computation more tractable, we neglect the dual variables associated with non-negativity constraints of $\\vec{E}_s$ and $\\vec{\\pmb{\\alpha}}$. We can include these constraints later by projecting the obtained results onto positive orthant. From (\\ref{eq:kkt_1}) and (\\ref{eq:kkt_2}) we obtain the optimal solution given in eq. (\\ref{eq:opt_sol}).\n\nSince the objective function is strictly concave, the optimal $\\vec{E}_s$ and $\\vec{\\pmb{\\alpha}}$ are unique. Since $P_s^{i*}=\\frac{E_s^{i*}}{\\alpha_i^*}$, the optimal transmit power of ST in $i$th slot is given as:\n\\begin{align}\nP_s^{i*}=\\left\\{\n\\begin{array}{cl}\n\\left[\\frac{1}{\\ln2(\\sum_{j=i}^M\\lambda_j^*+\\gamma_i^*h_{sp}^i)}-\\frac{1}{\\theta_i}\\right]^+, & 0<\\alpha_i\\leq1\\\\\n0, & \\alpha_i=0\n\\end{array}\n\\right.\\label{eq:opt_pwr}\n\\end{align}\n\\subsection{Online Myopic Policy}\n\\indent To compare our proposed scheme, we consider an online myopic policy as in \\cite{underlay_3}, in which only instantaneous channel gains are known at ST. However, unlike \\cite{underlay_3}, we consider rather more strict constraint for interference at PR. In our system model, we consider that in each slot, interference at PR must be less than the threshold $P_{int}$, whereas in \\cite{underlay_3}, authors considered that the probability of interference being greater than threshold should be arbitrarily small. As in \\cite{underlay_3}, in each slot the ST uses all the harvested energy in the same slot. Thus, in $i$th slot, the consumed energy will be $E_s^i=(1-\\alpha_i)\\eta P_p$. The optimal time sharing parameter $\\vec{\\pmb{\\alpha}}$, which maximizes the short term secondary sum rate, can be obtained by solving the following optimization problem:\n\\vspace{-0.1cm}\n\\begin{subequations}\n\\begin{align}\n\\max_{\\vec{\\pmb{\\alpha}}}\\quad & \\sum_{i=1}^M \\alpha_i \\log_2\\left(1+\\frac{1-\\alpha_i}{\\alpha_i}\\frac{h_{ss}^i\\eta P_p}{\\sigma_s^2+h_{ps}^iP_p}\\right) \\label{eq:subopt_1}\\\\\n\\text{s.t.}\\quad & h_{sp}^i(1-\\alpha_i)\\eta P_p\\leq\\alpha_i P_{int},\\quad i=1,\\ldots,M.\\label{eq:subopt_2}\\\\\n& \\vec{0}\\prec\\vec{\\pmb{\\alpha}}\\prec\\vec{1} \\label{eq:subopt_3}\n\\end{align}\n\\end{subequations}\n\\vspace{-0.1cm}\nThis is a convex optimization problem as optimization function is negative of sum of relative entropies, $D(p_i||q_i)$ where $p_i=\\alpha_i$ and $q_i=\\alpha_i+(1-\\alpha_i)\\frac{h_{ss}^i\\eta P_p}{\\sigma_s^2+h_{ps}^iP_p}$, and the constraints are linear inequalities. Since ST uses all the harvested energy in the same slot, the optimization problem becomes independent among slots and we can decouple the problem into $M$ parallel subproblems. By rearranging the terms, constraint (\\ref{eq:subopt_2}) can be written as $\\alpha_i\\leq\\frac{h_{sp}^i\\eta P_p}{P_{int}+h_{sp}^i\\eta P_p}$, which is $\\leq1$ unless $P_{int}=0$. Therefore, the constraints (\\ref{eq:subopt_2}) and (\\ref{eq:subopt_3}) can be merged together into a single constraint $0<\\alpha_i\\leq\\frac{h_{sp}^i\\eta P_p}{P_{int}+h_{sp}^i\\eta P_p}$. In $i$th slot, we solve the following convex optimization problem:\n\\begin{subequations}\n\\begin{align}\n\\max_{\\alpha_i} \\quad & \\alpha_i \\log_2\\left(1+\\frac{1-\\alpha_i}{\\alpha_i}\\frac{h_{ss}^i\\eta P_p}{\\sigma_s^2+h_{ps}^iP_p}\\right) \\label{eq:myopic_1}\\\\\n\\text{s.t.} \\quad & 0<\\alpha_i\\leq\\frac{h_{sp}^i\\eta P_p}{P_{int}+h_{sp}^i\\eta P_p}\n\\end{align}\n\\end{subequations}\nThe Lagrangian of the problem stated above is given as:\n\\begin{align*}\n\\mathcal{L}(\\alpha_i,\\lambda)=&-\\alpha_i \\log_2\\left(1+\\frac{1-\\alpha_i}{\\alpha_i}\\zeta_i\\right)+\\lambda\\left(\\alpha_i-\\Psi_i\\right)\n\\end{align*}\nwhere $\\zeta_i=\\frac{h_{ss}^i\\eta P_p}{\\sigma_s^2+h_{ps}^iP_p}$ and $\\Psi_i = \\frac{h_{sp}^i\\eta P_p}{P_{int}+h_{sp}^i\\eta P_p}$. Using the KKT optimality conditions, the closed form of optimal time sharing parameter $\\alpha_i$ is given as \\cite{myopic_solution}:\n\\begin{align}\n\\alpha_i^*=\\max\\left\\{\\frac{\\zeta_i}{\\zeta_i+z_i^*-1},\\frac{h_{sp}^i\\eta P_p}{P_{int}+h_{sp}^i\\eta P_p}\\right\\}\\label{eq:optimal_myopic}\n\\end{align}\nwhere $z_i^*>1$ is the unique solution of following equation:\n\\begin{align*}\nz_i\\ln z_i-z_i-\\zeta_i +1=0\n\\end{align*}\n\\section{Results and Discussions}\nFor simulation purpose, we initially assume that all channel links are i.i.d. Rayleigh distributed with variance $\\sigma_{pp}^2=\\sigma_{sp}^2=\\sigma_{ps}^2=\\sigma_{ss}^2=1$. The primary user transmits with power $P_p=2$ Watt in all the slots. The energy harvesting link is assumed to be static throughout the transmission and has an attenuation factor $\\eta$. Therefore, the energy harvested by ST in each slot is $E_h^i=(1-\\alpha_i)\\eta P_p$ Joule. The noise at both the receivers is assumed to be zero mean additive white Gaussian with equal variances $\\sigma_p^2=\\sigma_s^2=0.1$. In addition, we assume that there is no initial energy available in the battery. The results for Figs. \\ref{fig:opt_plot} and \\ref{fig:comparison} are obtained for the system settings as stated before, whereas for Fig. \\ref{fig:diff_chan}, we change the channel variances to analyze the effects of different channel conditions.\n\\subsection{Effects of harvesting efficiency and interference constraint}\nFig. \\ref{fig:opt_plot} shows the average achievable sum rate of ST ($\\vec{R}_{sum}$) averaged over different channel realizations versus number of secondary slots ($N$) for different values of interference threshold $P_{int}$ and energy harvesting efficiency $\\eta$ under the optimal offline policy. The average achievable sum rate is monotonically increasing with the number of secondary slots as expected. In addition, higher $\\eta$ results in higher achievable rate as with higher $\\eta$, secondary harvests more energy which allows it to transmit with higher power. Also, it can be observed that as the interference constraint at PR becomes stricter (i.e. $P_{int}$ decreases), the average achievable rate of ST reduces as the interference constraint puts an upper bound on the transmit power $\\vec{P}_s$. In addition, with stricter interference constraint, the rate at which $\\vec{R}_{sum}$ increases w.r.t. $N$, also reduces. \n\\subsection{Comparison of optimal offline and myopic policies}\nFig. \\ref{fig:comparison} shows the comparison of average achievable sum rate obtained using optimal offline and online myopic policies. The plot is obtained for a fixed energy harvesting efficiency $\\eta=0.3$. The figure clearly shows that the myopic policy with causal CSI performs worse than the optimal policy with non-causal CSI. This is expected as myopic policy does not have any knowledge of future channel gains and the ST needs to consume all the harvested energy in the same slot. Hence, the ST harvests only that much energy in a slot which it can consume in the same and tries to maximize the achievable rate of that slot only. It is observed that this difference in performances reduces as interference constraint becomes stricter. This is because in offline policy, with stricter constraint, the ST harvests very less amount of energy and transmits with very low power and saves very little amount of energy for future use.\n\\subsection{Effects of different channel conditions}\nFig. \\ref{fig:diff_chan} shows the average achievable sum rate of SU under different channel conditions. The results for weak ST-PR and weak PT-SR links are obtained by choosing $\\sigma_{sp}^2=0.1$ and $\\sigma_{ps}^2=0.1$ for ST-PR and PT-SR links respectively, whereas the variance of other channel links are assumed to be 1. From the figure it is observed that as ST-PR link becomes weak, ST's achievable rate increases significantly. This is because weak ST-PR link is as good as loose interference constraint on PR, which allows ST to transmit with higher power yielding higher sum rate. Also, weak ST-SR link decreases the sum rate as due to interference constraint, the ST transmit power is upper bounded by $\\frac{P_{int}}{h_{sp}^i}$ and small channel coefficients of ST-SR link cause the sum-rate to decrease. The effects of strong direct links ($\\sigma_{pp}^2=\\sigma_{ss}^2=1$ and $\\sigma_{ps}^2=\\sigma_{sp}^2=0.1$) and strong interference links ($\\sigma_{pp}^2=\\sigma_{ss}^2=0.1$ and $\\sigma_{ps}^2=\\sigma_{sp}^2=1$) are also shown. As expected, the system performance is much better in the case of strong direct links as compared to the case of strong interference links.\n\\section{Conclusion}\n\\indent We considered an energy harvesting underlay cognitive radio system operating in slotted fashion. We considered a case where PU is equipped with a reliable power source whereas the SU harvests energy from PU's transmission. Each secondary slot is divided into two phases: EH and IT phase. Assuming complete CSI to be available non-causally at ST, we obtained an optimal offline time sharing and transmit power policy which maximizes the sum achievable rate of SU. Also, we obtained closed form expressions for time sharing parameter $\\vec{\\pmb{\\alpha}}$ and consumed energy $\\vec{E}_s$ so that optimal values of these parameters can be found iteratively. In addition, considering only causal CSI to be available at ST, we obtained an online myopic policy maximizing the achievable sum rate of SU. We compared the performance of both the policies and it is observed that the offline policy outperforms the myopic policy. But since the myopic policy needs only causal CSI at ST, it is more practical than the offline policy.\n\n\\footnotesize\n\\bibliographystyle{IEEEtr}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Acknowledgements}\nThis work was supported in Poland by the National Science Centre under the Project No.~UMO-2017\/27\/B\/ST3\/02881. We thank Ingrid Mertig for a critical reading of the paper and insightful comments.\n\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}} +{"text":"\\section{Introduction}\n\nOur understanding of dark matter structures has increased significantly over the recent years. This progress has mainly been driven by numerical simulations which have\nidentified a range of universalities of the dark matter structures. One of the first general\nproperties to be suggested was the radial density profile \\citep{1996ApJ...462..563N,1998ApJ...499L...5M,2004MNRAS.353..624D,2006AJ....132.2685M,2006AJ....132.2701G}, whose radial behaviour was shown to change from a fairly shallow decline in the central region to a much steeper decline in the outer regions. This behaviour has been confirmed observationally for galaxy clusters, both through X-ray observations \\citep{2004ApJ...604..116B,2005A&A...435....1P,2005A&A...441..893A,2006ApJ...640..691V,2006A&A...446..429P}, and also more recently through strong and weak lensing observations \\citep{2004ApJ...604...88S,2005ApJ...619L.143B,2006ApJ...642...39C,2008arXiv0802.4292L}.\n\nA slightly less intuitive quantity to be considered is the dark matter velocity anisotropy defined by\n\\begin{equation}\\label{eq:be}\n\\beta \\equiv 1 - \\frac{\\sigma^2_t}{\\sigma^2_r},\n\\end{equation}\nwhere $\\sigma^2_t$ and $\\sigma^2_r$ are the 1-dimensional tangential and radial velocity dispersions in a spherical system~\\citep{1987gady.book.....B}. This anisotropy was shown in pure dark matter simulations to increase radially from zero in the central region to roughly 0.5 in the outer region~\\citep{1997ApJ...485L..13C,1996MNRAS.281..716C,2006NewA...11..333H}. For collisional systems, in contrast, the velocity anisotropy is explicitly zero in the equilibrated regions. Therefore, eventually inferring $\\beta$ from observational data is an important test of whether dark matter is in fact collisionless, as assumed in the standard model of structure formation. On this note, it has been shown that the Galactic velocity anisotropy can affect the detection rates of direct dark matter searches \\citep{2008PhRvD..77b3509V}, and it is in principle measurable in a direction-sensitive detector \\citep{2007JCAP...06..016H}.\n\nThe most massive bound structures in the Universe are clusters of galaxies, which consist of an extended dark matter halo, an X-ray emitting plasma making up the intracluster medium (ICM), and the individual galaxies. While the contribution of galaxies to the total mass is small, approximately 10 $\\%$ of the cluster mass resides in the ICM. The present generation of X-ray satellites, \\emph{XMM-Newton} and \\emph{Chandra}, allows very accurate measurements of azimuthally-averaged radial profiles of density and temperature of the ICM. These are used, under the assumption of hydrostatic equilibrium and spherical symmetry of both gas and total mass distributions, to estimate total, gas, and dark matter mass profiles \\citep{1980ApJ...241..552F}.\n\nBelow we infer the radial velocity anisotropy profile of dark matter in 16 galaxy clusters using a generally applicable framework without any parametrized modeling of the clusters. In short, we assume a universal relation between the effective temperature of dark matter and the ICM temperature, which allows us to solve the dynamics of the dark matter halo using the radial gas temperature and density profiles determined from X-ray data. We investigate the shape and validity of this temperature relation in two cosmological simulations of galaxy clusters, based on independent numerical codes. We apply our method to 16 galaxy clusters from two different samples and find a velocity anisotropy significantly different from zero in the outer parts, in qualitative agreement with simulations. \n\nOur approach here is a generalization of the non-parametric analysis in \\citet{2007A&A...476L..37H} where $\\beta$ was inferred neglecting the radial dependence. We also note the parametrized analyses in \\citet{2004ApJ...611..175I} and \\citet{2007MNRAS.380.1521M}, where the total dark matter velocity dispersion was inferred assuming either $\\beta=0$, or the analytical $\\beta$-profiles of \\citet{2000ApJ...539..561C} or \\citet{1996MNRAS.281..716C} (see also \\citet{2008MNRAS.tmp..719W}). In particular, \\citet{2007MNRAS.380.1521M} found that the dark matter temperature and the ICM temperature were essentially the same in strong cooling-core clusters.\n\nThe structure of the paper is the following: In the next section, we discuss how we relate the temperature of dark matter to the observable gas temperature. In section 3 we show how we can then solve the dynamics of the dark matter. In section 4 we test the assumed temperature relation and our method on numerical simulations, and in section 5 we apply the method to observational data. Section 6 is the summary and discussion.\n\n\\section{The temperature of dark matter}\nThe equality of inertial and gravitational mass implies that the orbit of a test particle in a gravitational system is independent of mass. For example, the velocity of a circular orbit in a spherical mass distribution $v_c^2=GM(r)\/r$ depends only on the distance to the center of the system and the mass contained within that radius. Therefore it is natural to assume that, at a given radius, all species in a relaxed, spherical gravitational system have the same average specific kinetic energy. Obviously, they also have the same specific potential energy. In a gas system, equilibrium implies energy equipartition between all species. It is clear that the corresponding principle for a relaxed gravitational system is a common velocity dispersion, precisely because gravitational dynamics are independent of mass. Since the average velocity is associated with the thermal energy content, this relationship is expressed by\n\\begin{equation}\\label{eq:trl}\nT_{\\mathrm{DM}}=\\kappa T_\\mathrm{gas}.\n\\end{equation}\nThe parameter $\\kappa$ is constant as long as the impact of radiative or entropy-changing processes affecting the gas is negligible and the system is relaxed. Therefore, we allow for a radial dependence, $\\kappa=\\kappa (r\/r_{2500})$, where $r_{2500}$ is the scale radius within which the mean total density is $2500$ times the critical density at the redshift of the cluster. \n\nThe dark matter temperature in (\\ref{eq:trl}) is naturally not well-defined as there is no thermodynamic equilibrium for a collisionless gas. Instead, we simply define an effective dark matter temperature which is proportional to the three-dimensional velocity dispersion,\n\\begin{eqnarray}\nk_BT_{\\mathrm{DM}}&=&\\frac{1}{3}\\mu m_H\\sigma^2_\\mathrm{DM}\\\\\n&=&\\frac{1}{3}\\mu m_H\\left(\\sigma_r^2+2\\sigma_t^2\\right).\\label{eq:tdm}\n\\end{eqnarray}\nThe velocity dispersion has been decomposed into the contributions from the one-dimensional radial and tangential dispersions. We choose the constant of proportionality to be the mean molecular mass of the intracluster gas simply to allow $\\kappa$ to be of order unity. Equations (\\ref{eq:trl})--(\\ref{eq:tdm}) are equivalent to assuming that the specific energies of gas and dark matter particles are the same up to a factor of $\\kappa$, on average. The same conjecture was made in \\citet{2007A&A...476L..37H} but with $\\kappa=1$ explicitly. \n\nIt should be mentioned that the temperature relation (\\ref{eq:trl}) was recently analyzed in simulations by \\citet{2008ApJ...672..122E}. Whereas we allow a possible radial variation in the temperature relation, those authors considered averages within $r_{200}$ and found that\n\\begin{equation}\n\\tilde{\\kappa}_{10^{-3}{\\rm cm}^{-3}$ either formed stars or was heated by an entropy, $\\Delta S=1000\\, {\\rm keV \\, cm}^2$. This choice was determined stochastically by selecting a random number, $r$, from the unit interval and heating the particle if $r<0.1$, i.e. a 10 per cent probability of being heated. This high level of feedback was necessary to reproduce the observed excess entropy in clusters (see \\citet{Kay:2006iz} for further details).\n\nTo select the cluster sample, we first consider all clusters at $z=0$ with X-ray temperatures, $kT>2\\, {\\rm keV}$; this produces 95 objects, with virial masses, \n$M_{\\rm vir}>1.3\\times 10^{14}h^{-1}{\\rm M}_{\\odot}$ (correspondingly, $> 15,000$ dark matter particles). We then select those clusters with 3D substructure statistic, $s<0.05$. The substructure statistic \\citep{1998MNRAS.296.1061T} measures the displacement of the centre of mass from the potential minimum of the cluster (taken to be its centre), relative to $r_{500}$, which is the scale radius within which the mean total density is $500$ times the critical density. By making this cut, we therefore exclude all clusters that show significant signs of dynamical activity, i.e. major mergers. \n\n\\subsection{V06}\nThe second sample is a subsample of the one presented in \\citet{2006NewA...12...71V} which we refer to as V06. These simulations assumed a concordance flat $\\Lambda$CDM with the same cosmological parameters as for the CLEF simulation.\n\nThe simulation ensemble of galaxy clusters was constructed according to\na procedure described in \\citep{2008arXiv0808.1111P}. Here we briefly summarize the most important aspects. The hydrodynamic simulations were run using an entropy-conserving multistep TREESPH code for a sample of 153 clusters spanning a range from $\\simeq 1.5 \\times 10^{15} h^{-1} M_{\\odot}$ down to $M_{vir}\\simeq 1.5 \\times 10^{14} h^{-1} M_{\\odot}$. The initial conditions ($z_{in}=49$) were extracted from a set of purely N-body cosmological simulations in which clusters of galaxies were identified from the particle distribution at $z=0$ using a friends--of--friends algorithm. In order to investigate the effect of the implemented gas processes on the energy equipartition between gas end dark matter particles, we performed both adiabatic and radiative simulations. The radiative simulations are of course more realistic than the adiabatic ones, because they additionally take into account radiative cooling, star formation, energy and metal feedback \\citep{2003MNRAS.339.1117V}. More details concerning the simulation technique and the implementation of physical processes of the gas are given in \\citet{2006NewA...12...71V}.\n\nIn order to avoid contamination from dynamically perturbed clusters, we select the 20 most relaxed objects at $z=0$. The selection is based on the power ratio method, which measures the amount of substructure in X-ray surface brightness maps. The map sources a pseudo-potential which is expanded in plane harmonics, and the ratio of the third coefficient to the zeroth is a measure of substructure. More details are given in \\citet{2008arXiv0808.1111P}. \n\n\\subsection{The temperature relation}\\label{sec:simtrl}\n\n\\begin{figure}[tbp]\n\\begin{center}\n\\epsscale{1}\n\\plotone{f1}\n\\caption{Radial profile of $\\kappa=T_{\\mathrm{DM}}\/T_{\\mathrm{gas}}$ for the samples of clusters obtained from the CLEF and V06 simulations comprising 67 and 20 clusters, respectively. We plot the median and $1\\sigma$ percentiles taken over each sample. The vertical line indicates the largest radius of the observational data sample, while the vertical lines indicate the mean and standard deviation of the $\\kappa$-profile that we use in the fiducial analysis. Note that, for the CLEF sample, only eight clusters contribute to the innermost bin.}\n\\label{fig:kap}\n\\end{center}\n\\end{figure}\n\n\nWe examine the temperature relation (\\ref{eq:trl}) in the two simulated samples by comparing the gas mass-weighted temperature to the rescaled dark matter velocity dispersion. The resulting $\\kappa$-profiles are shown in fig.~\\ref{fig:kap} and clearly $\\kappa\\approx1$ for both samples. Since we apply somewhat different criteria to select the two simulation samples, it is not surprising to find slightly different profiles. This indicates a systematic uncertainty of $\\pm0.1$ in the simulated $\\kappa$ profiles. The kinetic energy associated with bulk motions of both gas and dark matter particles is at most a few percent of the thermal energy within $2\\,r_\\mathrm{2500}$, outside which bulk motion is not negligible. This is in agreement with what was found in \\citet{2003astro.ph..5250A}.\nDue to the standard problem of limited force resolution, the simulations do not probe the innermost region reliably. Therefore we exclude data inside a cutoff radius ($56\\,h^{-1}\\,$kpc for CLEF, $0.1\\,r_{2500}$ for V06), which means we cannot estimate $\\kappa$ in the central region where gas physics can make a significant impact. \n\nThe adiabatic version of the V06 sample exhibits a larger median $\\kappa$-profile which is constant about $1.2$ within $r_{2500}$ and increases steadily to 1.4 at $r_{200}$. This is comparable with the earlier work of \\citet{2004MNRAS.351..237R}, where the specific energy of dark matter was seen to be larger than that of the gas by 20--30\\% in adiabatic simulations. \n\n\\subsection{Reconstructing the velocity anisotropy}\n\n\\begin{figure}[htbp]\n\\epsscale{1}\n\\begin{center}\n\\plotone{f2}\n\\caption{Comparison of estimated and true values of the physical quantities involved in determining the velocity anisotropy $\\beta$ in our simulations. Top, the ratio of the reconstructed total density to the true; bottom, the ratio of the reconstructed $\\sigma_r^2$ to the true one. Error bars show the $1\\sigma$ percentiles taken over the sample members.}\n\\label{fig:simsteps}\n\\end{center}\n\\end{figure}\n\n\nIn order to test the method outlined above for determining $\\beta$, we reconstruct the anisotropy profiles observed in the simulated samples. Here, we assume $\\kappa=1$ for all radii even though we expect deviations at small radii. First we derive the integrated mass profile $M(r)$ for each cluster assuming hydrostatic equilibrium (\\ref{eq:he}), and from that the total density profile. The numerical derivatives involved are calculated using three-point quadratic interpolation. The estimated density profile, shown in fig.~\\ref{fig:simsteps} (top), displays a satisfactory agreement with the actual density profile for both the CLEF and V06 samples. The only exception is at the outermost radii above $r_{2500}$ where the density is underestimated. Next, we calculate the radial velocity dispersion (\\ref{eq:srsq}) by interpolating the integrand from $r=0$ using a four-point natural spline interpolation. We compare the resulting radial velocity dispersion with the actual in fig.~\\ref{fig:simsteps} (bottom) which shows that there is good agreement except for the deviation at large radii already seen in the density profiles.\n\n\n\\begin{figure}[tbp]\n\\begin{center}\n\\epsscale{1}\n\\plotone{f3}\n\\caption{Reconstructed velocity anisotropies for the simulated samples. The hatched bands show the actual $\\beta$-profiles of the samples. Error bars show the $1\\sigma$ percentiles taken over the sample members.}\n\\label{fig:simbeta}\n\\end{center}\n\\end{figure}\n\n\nFinally we determine the velocity anisotropy parameter $\\beta$. We find similar results whether we calculate $\\beta_{\\mathrm{Je}}$ or $\\beta_{\\mathrm{tr}}$, however the temperature relation yields less noisy results. The median velocity anisotropy profiles are shown in fig.~\\ref{fig:simbeta} together with the median actual profile. The reconstructed profile tracks the actual anisotropy well in the inner parts but overestimates $\\beta$ in the outer parts. There is also considerable noise in the results. \n\nIn order to understand the origin of the deviations at large radii and the significant scatter in our results, we investigate the systematics of the analysis, as applied to the CLEF sample (similar conditions hold for the V06 sample). First, we substitute the dark matter density estimated from hydrostatic equilibrium with the true density. The $\\beta$-profiles calculated on this basis are shown in the top panels of fig.~\\ref{fig:sys}. The agreement between the estimated and actual $\\beta$ is considerably improved, and the error bars are significantly reduced. This clearly indicates that, in the fiducial analysis, the numerical derivatives necessary to estimate $\\rho_\\mathrm{DM}$ are responsible for the large error bars. Since we do not want to do any parametrized modeling of the gas properties, the numerical derivatives are liable to amplify noise and induce systematic deviations in the outermost bin, where the quantities are only constrained to one side. Additionally, this explains why $\\beta_\\mathrm{Je}$ appears more noisy in the fiducial analysis since an additional derivative must be calculated. The test also shows that there is a deviation from hydrostatic equilibrium at large radii which is part of the reason why $\\beta$ is overestimated. As a second test, we additionally use the true three-dimensional velocity dispersion instead of using the temperature relation. This yields further improvement as to how well the reconstructed $\\beta$ tracks the true one, as shown in the bottom panels of fig.~\\ref{fig:sys}. This implies that it is possible to get the correct scale of the radial velocity dispersion, calculated as an integral from the center, despite the lack of resolved data in the inner radii. We note that, with respect to observational data, the tests we apply here can possibly be utilized in the future, e.g.~with accurate density profiles inferred from gravitational lensing, and with more detailed knowledge of $\\kappa$ from improved simulations. We conclude that the numerical simulations provide proof that our method is robust and that it is indeed possible to infer the $\\beta$-profile despite lacking knowledge of $\\kappa$ in the center.\n\n\n\\begin{figure}[tbp]\n\\begin{center}\n\\epsscale{1}\n\\plotone{f4}\n\\caption{Systematics of the reconstruction of the $\\beta$ profiles for the CLEF simulation. Again, $\\beta$ is recovered both from (\\ref{eq:btr}) (left) and (\\ref{eq:bje}) (right). The true dark matter density is substituted for the estimated, and in the bottom panels we additionally use the true total velocity dispersion instead of estimating it from $T_{\\mathrm{DM}}=\\kappa T_\\mathrm{gas}$.}\\label{fig:sys}\n\\end{center}\n\\end{figure}\n\n\n\\section{Observations}\nNext we apply our analysis to observational data from which the radial gas density and temperature profiles are recovered. This is done strictly using non-parametric methods, i.e.~no modeling of the gas properties is involved. Our data consists of the deprojected density and temperature profiles of two samples of clusters at low and intermediate redshift, respectively. The deprojected profiles were obtained from X-ray data analysis published in earlier work (details below). We consider clusters which appear relaxed and close to spherical, and for which sufficient spectroscopic data are available to analyze several annuli, so that the radial variations of the gas density and temperature are resolved with good statistics. \n\nThe first set of eleven clusters at low redshift is based on X-ray data from {\\it XMM-Newton} of the clusters: A262, A496, A1795, A1837, A2052, A4059, S\\'ersic 159$-$3, MKW3s, MKW9, NGC533, and 2A0335+096. These objects are highly relaxed cool-core (CC) clusters selected as to match the requirements described above. The objects were part of the sample analyzed in \\citet{2004A&A...413..415K} (see this paper for an extensive presentation of the data analysis), in which deprojected radial temperature and density profiles were derived from spatially resolved spectroscopy. We adopt the radial bin selection of \\citet{2005A&A...433..101P} in order to ensure a robust determination of gas temperature and density for the full radial range. Note that data for A2052 and S\\'ersic 159$-$3 were also used in the analysis by \\citet{2007A&A...476L..37H} where a constant velocity anisotropy was assumed.\n\nThe other set of five intermediate redshift X-ray galaxy clusters (RXJ1347.5, A1689, A2218, A1914, A611) is from the {\\it Chandra} sample analyzed in \\citet{Morandi:2007aw}. The radial deprojected temperature and density profiles were retrieved through resolved spectral analysis in a set of annuli, selected to collect at least 2000 net counts, by assuming spherical geometry and by using the definition of `effective volume' (see \\citet{Morandi:2007aw} for further details).\n\n\n\\section{Results}\\label{sec:res}\n\n\\begin{figure*}[tbp]\n\\begin{center}\n\\epsscale{1}\n\\plotone{f5}\n\\caption{Three steps in the calculation of the velocity anisotropy for S\\'ersic~159$-$3. Left, the inferred total density; center, the radial velocity dispersion; right, the $\\beta$-profiles. The gas density and temperature profiles are also shown. The scale radius for this cluster is estimated to be $r_{2500}=337\\pm13\\,$kpc. Error bars indicate the propagated statistical uncertainties on the ICM temperature and density profile, taken as the $1\\sigma$ percentiles of 1000 Monte Carlo samples. This is unlike in the previous figures where the error bars indicate the spread over the numerically simulated samples. In the right panel, the radial positions of $\\beta_\\mathrm{tr}$ and $\\beta_\\mathrm{Je}$ have been offset slightly for clarity.}\n\\label{fig:beAS}\n\\end{center}\n\\end{figure*}\n\n\\begin{figure*}[htbp]\n\\begin{center}\n\\epsscale{1}\n\\plotone{f6}\n\\caption{Median velocity anisotropy profiles for the remaining 15 clusters of our sample. The estimated scale radii are also shown, and the symbols are the same as in fig.~\\ref{fig:beAS}.}\n\\label{fi:bsmpl}\n\\end{center}\n\\end{figure*}\n\n\nWe determine the dark matter velocity anisotropy profile $\\beta(r)$ of each cluster according to the recipe in section \\ref{se:th} using a Monte Carlo method. For each radial bin the deprojected gas temperature and density are sampled assuming Gaussian uncertainties, i.e.~a random number is chosen from a Gaussian distribution with mean equal to the estimated temperature or density and a standard deviation equal to the uncertainty of the estimate. The bins are sampled independently. The parameter $\\kappa$ is also sampled for each bin, assuming a Gaussian distribution with a mean of 1 and a standard deviation of 0.1, which is a reasonable value according to the simulations. The sampled profiles are used to reconstruct the total mass through (\\ref{eq:he}), and then the integrand, the radial velocity dispersion, and the velocity anisotropy are calculated in each bin. The sampled set of profiles is accepted only if the temperature and density as well as the reconstructed dark matter density and radial velocity dispersion are all non-negative in all bins. For each sample, we also estimate the scale radius $r_{2500}$ and the mass $M_{2500}$ contained within that radius. Table \\ref{tb:prop} summarizes the properties of the clusters in our sample.\n\nThe numerical methods for calculating derivatives and integrals are the same as for the simulated samples, i.e.~three-point quadratic interpolation is used for derivatives and four-point spline interpolation is used for the integral in (\\ref{eq:srsq}). The integration results are stable to using two-point linear, three-point quadratic, or four-point least squares quadratic interpolation instead. \n\nIndividual steps of the reconstruction are shown in fig.~\\ref{fig:beAS} for the cluster S\\'ersic~159$-$3, and the deprojected input data are also displayed. We always plot the median and $1\\sigma$ percentiles since spurious outliers in individual Monte Carlo samples can bias the mean and standard deviation significantly. The size of the error bars is mostly determined by the uncertainties of the temperatures, to a lesser degree by the uncertainties of the ICM densities, and it is virtually insensitive to the 10\\% variation assumed for the $\\kappa$-profile.\n\nAs can be seen in the right panel of fig.~\\ref{fig:beAS}, the agreement between $\\beta_\\mathrm{tr}$ and $\\beta_\\mathrm{Je}$ indicates that numerical effects associated with the integration and differentiations are small. On the other hand, $\\beta$ becomes unphysically large in the outermost bins since the reconstructed radial velocity dispersion for some samples becomes greater than the total velocity dispersion. This result is similar to that found in the blind analysis of the simulation samples. As discussed above, this behaviour is mainly due to a deviation from hydrostatic equilibrium of the gas, and to a lesser degree to edge effects making the numerical differentiations less well determined in the outermost bin. It is possible that systematic uncertainties in the input data or radial variations in $\\kappa$ for individual clusters also play a role. In principle, we could impose $\\sigma_r^2<\\sigma^2$, thereby forcing $\\beta<1$, as another physical condition on each Monte Carlo sample, but we prefer not to do so in order to have a consistency check.\n\nWe repeat the data analysis for the remaining 15 clusters of our sample and the resulting velocity anisotropy profiles are shown in fig.~\\ref{fi:bsmpl}. In almost all cases the anisotropy is small in the inner radial bins and increases to between $0.5$ and $1.0$ in the outer parts. There is good agreement between the two derivations of $\\beta$ for all clusters, indicating that numerical issues are under control.\n\nSince the qualitative behaviour of the velocity anisotropy profiles are similar, we combine all our data into a single `stacked' profile, shown in fig.~\\ref{fi:stack}. In the region where direct comparison is possible, the measured stacked profile is very similar to the reconstructed $\\beta$ profiles for the simulation samples (the green line), and within $r_{2500}$ there is also agreement with the actual velocity anisotropy of the simulation samples (hatched band). The velocity anisotropy is likely overestimated outside $r_{2500}$ for the same reason as for the simulated samples, i.e.~deviation from hydrostatic equilibrium, but the effect appears to be even stronger for the observational data. Interior to the cut-off radius of the numerical simulations, the observations tend to $\\beta\\sim0.3$. This is somewhat surprising since numerical simulations at all mass scales generally have very little anisotropy towards the center of structures. While we cannot exclude the possibility that cluster halos are anisotropic even at low radii, our result can also be explained by the neglected stellar contribution $\\rho_\\star$ to the total mass density. To first order, this contribution enters our analysis in the Jeans equation through the estimated dark matter density $\\widetilde{\\rho}_\\mathrm{DM}=\\rho_\\mathrm{DM}+\\rho_\\star$. In terms of $\\delta_\\star=\\rho_\\star\/\\rho_\\mathrm{DM}$, the Jeans equation becomes\n\\begin{eqnarray}\n\\sigma_r^2\\left(\\frac{d\\ln \\widetilde{\\rho}_{\\mathrm{DM}}}{d\\ln r}+\\frac{d\\ln \\sigma_r^2}{d\\ln r}+2\\beta-\\frac{d\\ln (1+\\delta_\\star)}{d\\ln r}\\right)&&\\nonumber\\\\=-\\frac{GM(r)}{r}&&,\n\\end{eqnarray}\nwhere the slope of $(1+\\delta_\\star)$ is negative since the stellar density must fall off faster than the dark matter density. This means that we overestimate the velocity anisotropy in the central region by not accounting for the stellar mass. Indeed, if we assume that 50\\% of the total mass in the innermost bin is made up of stars, the velocity anisotropy in the two innermost bins becomes consistent with zero. There is also a second order correction through the appearance of $\\widetilde{\\rho}_\\mathrm{DM}$ in (\\ref{eq:srsq}) instead of $\\rho_\\mathrm{DM}$, but this correction must be small since the density contributes to both the integrand and the normalization factor.\n\n\n\\begin{figure}[htbp]\n\\begin{center}\n\\epsscale{1}\n\\plotone{f7}\n\\caption{Median velocity anisotropy profile of all 16 clusters in our dataset. In this case the error bars denote the $1\\sigma$ percentiles of the combined probability density of all clusters within the bin. The actual and reconstructed $\\beta$-profiles from the simulations are also shown. The left vertical line is the innermost radius probed in the CLEF simulations and the right vertical line shows, roughly, the onset of significant deviations from hydrostatic equilibrium in the simulations, see fig.~\\ref{fig:simsteps}.}\n\\label{fi:stack}\n\\end{center}\n\\end{figure}\n\n\n\\begin{deluxetable}{rccc}\n\\tablewidth{0pt}\n\\tablecaption{Properties of our cluster sample\\label{tb:prop}}\n\\tablehead{\\colhead{Cluster}&{$z$}&{$r_{2500}\/$kpc}&{$M_{2500}\/M_\\odot$}}\n\\startdata\nA262 & 0.015 & $256\\pm28$ & $(2.7\\pm0.8)\\times10^{13}$\\\\\nA496 & 0.032 & $398\\pm10$ & $(1.0\\pm0.2)\\times10^{14}$\\\\\nA1795 & 0.064 & $504\\pm22$ & $(1.9\\pm0.2)\\times10^{14}$\\\\\nA1837 & 0.071 & $374\\pm26$ & $(8.0\\pm1.7)\\times10^{13}$\\\\\nA2052 & 0.036 & $362\\pm11$ & $(6.7\\pm0.6)\\times10^{13}$\\\\\nA4059 & 0.047 & $445\\pm21$ & $(1.3\\pm0.2)\\times10^{14}$\\\\\nS\\'ersic~159$-$3 & 0.057 & $337\\pm17$ & $(5.7\\pm0.8)\\times10^{13}$\\\\\nMKW3s & 0.046 & $404\\pm14$ & $(9.5\\pm0.9)\\times10^{13}$\\\\\nMKW9 & 0.040 & $279\\pm44$ & $(3.2\\pm1.5)\\times10^{13}$\\\\\nNGC533 & 0.018 & $191\\pm15$ & $(9.7\\pm2.2)\\times10^{12}$\\\\\n2A0335+096 & 0.034 & $350\\pm40$ & $(6.9\\pm2.5)\\times10^{13}$\\\\ \\hline\nA611 & 0.29 & $519\\pm52$ & $(2.5\\pm0.6)\\times10^{14}$\\\\\nA1689 & 0.18 & $609\\pm4$ & $(3.5\\pm0.7)\\times10^{14}$\\\\\nA1914 & 0.17 & $590\\pm44$ & $(3.3\\pm0.8)\\times10^{14}$\\\\\nA2218 & 0.18 & $535\\pm51$ & $(2.5\\pm0.7)\\times10^{14}$\\\\\nRXJ1347.5-1145 & 0.45 & $710\\pm60$ & $(7.3\\pm1.4)\\times10^{14}$\n\\enddata\n\\end{deluxetable}\n\n\n\\begin{figure*}[tbp]\n\\begin{center}\n\\epsscale{1}\n\\plotone{f8}\n\\caption{The effect of assuming different $\\kappa$-profiles on the stacked velocity anisotropy profile. Top left, the five $\\kappa$-profiles. Others, the resulting sample averaged $\\beta$-profiles calculated assuming the numbered $\\kappa$-profile. In all cases, $\\beta$ is greater than zero in the outer parts. }\n\\label{fi:ksys}\n\\end{center}\n\\end{figure*} \n\n\nFinally, we investigate how the assumed shape of the $\\kappa$-profile affects our results. We try five different profiles as functions of $x=r\/r_{2500}$ with noise added as before, and calculate the velocity anisotropy profiles for each. The $\\kappa$-profiles are chosen so as to mimick either the effects of gas radiative cooling or AGN heating in the central regions, or to check the results if the dark matter is generally hotter or cooler than the gas. The radially varying profiles we try are extreme cases of the simulation profiles, fig.~\\ref{fig:kap}. Typically, the result is that the $\\beta$-profile is shifted in the central regions while the outer regions are largely unaffected, as shown in fig.~\\ref{fi:ksys}. This analysis confirms that there is a significant velocity anisotropy at large radii, independent of the specific assumptions about the temperature relation.\n\n\n\\section{Summary and discussion}\nIn this paper, we have presented a non-parametric method to infer the velocity anisotropy of dark matter in clusters of galxies from the observable temperature and density of the intracluster medium. We assume that the intracluster medium has the same specific energy as the dark matter, and we investigate the validity of this assumption in two different cosmological simulations of the formation of galaxy clusters. Both confirm the simplest possible form of the relation, namely $T_\\mathrm{DM}\\approx T_\\mathrm{gas}$ in the radial range which is resolved. \n\nWe have tested how well our method can reconstruct the actual velocity anisotropy in the simulated clusters, and we have found good agreement between the two, although the reconstruction is sensitive to systematic biases connected with deviations from hydrostatic equilibrium. \n\nWe have applied our method to the radial ICM density and temperature profiles of 16 galaxy clusters based on {\\it Chandra} and {\\it XMM-Newton} X-ray data. The shape of the velocity anisotropy profiles is always consistent with that seen in simulations, which tends to zero at the innermost radius where the temperature relation is calibrated. It then increases to about 0.5 at $r_{2500}$ and even larger in the outer regions. The same is true of the fiducial analysis applied to simulated data and is likely caused by a deviation from hydrostatic equilibrium outside $r_{2500}$. We also find a significant anisotropy even if we assume radially varying $\\kappa$-profiles, such as can be expected given the strong gas cooling and AGN heating in the core of many clusters, or if we assume $\\kappa\\ne 1$. The agreement between the observed velocity anisotropy and that predicted in numerical simulations shows that we are beginning to understand also the dynamical aspects of dark matter in halos.\n\nIn the innermost radial bins we measure a rather large anisotropy, but this is most likely an overestimation due to the neglect of the stellar mass in the center. This can be used as a means to estimate the stellar mass profile of galaxy clusters if one assumes that the velocity dispersion to be isotropic in the central regions. Similarly, our method may be used as a general test of whether a cluster is relaxed. A reconstructed velocity anisotropy which deviates significantly from the simulated profiles would be a strong hint that the data do not support the assumption of hydrostatic equilibrium.\n\nThe inferred velocity anisotropy profiles are significantly different from zero which means that the collective behaviour of dark matter is unlike that of baryonic particles in gases. This shows that dark matter is effectively collisionless on the timescale of $\\tau\\sim10^9$, the dynamical timescale of galaxy clusters. By taking typical values at $\\sim0.3\\,r_{2500}$ and allowing only a few scatterings within the time $\\tau$, this corresponds to an order--of--magnitude upper limit to the scattering cross-section of roughly $\\sigma\/m=(\\rho_{\\textrm{DM}}\\tau v)^{-1}\\lesssim1\\,$cm$^2$g$^{-1}$. This limit is similar to what has been found for merging clusters \\citep{2004ApJ...606..819M,2008arXiv0806.2320B}, and within an order of magnitude of the scattering cross-section for self-interacting dark matter proposed in \\citet{Spergel:1999mh}.\n\nWe emphasize that improvements to the numerical simulations in the near future will improve our understanding of the $\\kappa$ profile and hopefully track the impact of radiative effects in the center. We also hope that improved understanding of deviations from hydrostatic equilibrium will allow us to estimate how large the suspected bias at large radii is. On the observational side, the main problem at present is the uncertainty in the temperature profile. Improvements can be expected both with regards to the deprojection analysis and the amount of data available. Obviously, there is also the possibility of including a kinematical analysis of the galaxy clusters in our method.\n\n\\acknowledgments\nWe thank Jens Hjorth, Gary A.~Mamon, and Kristian Pedersen for comments. The Dark Cosmology Centre is funded by the Danish National Research Foundation. SE acknowledges the financial contribution from contract ASI-INAF I\/023\/05\/0 and I\/088\/06\/0.\n\n{\\it Facilities:} \\facility{XMM}, \\facility{CXO} \n\n\n\n\\bibliographystyle{apj}\n","meta":{"redpajama_set_name":"RedPajamaArXiv"}}