Add Batch 9045ddac-9567-47e8-a500-618e5db4557e data
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +64 -0
- 2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/664b03cc-930c-4e1b-82e2-c0fa8e156edc_content_list.json +0 -0
- 2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/664b03cc-930c-4e1b-82e2-c0fa8e156edc_model.json +0 -0
- 2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/664b03cc-930c-4e1b-82e2-c0fa8e156edc_origin.pdf +3 -0
- 2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/full.md +725 -0
- 2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/images.zip +3 -0
- 2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/layout.json +0 -0
- 2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/2350d3e1-6905-4f55-8805-079a64ed171d_content_list.json +0 -0
- 2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/2350d3e1-6905-4f55-8805-079a64ed171d_model.json +0 -0
- 2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/2350d3e1-6905-4f55-8805-079a64ed171d_origin.pdf +3 -0
- 2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/full.md +1011 -0
- 2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/images.zip +3 -0
- 2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/layout.json +0 -0
- 2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/96da049d-38d8-4169-a950-4c99505746b0_content_list.json +0 -0
- 2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/96da049d-38d8-4169-a950-4c99505746b0_model.json +0 -0
- 2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/96da049d-38d8-4169-a950-4c99505746b0_origin.pdf +3 -0
- 2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/full.md +0 -0
- 2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/images.zip +3 -0
- 2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/layout.json +0 -0
- 2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/1fb15cab-4e43-4531-b52f-6b8eba7ffe4f_content_list.json +0 -0
- 2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/1fb15cab-4e43-4531-b52f-6b8eba7ffe4f_model.json +0 -0
- 2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/1fb15cab-4e43-4531-b52f-6b8eba7ffe4f_origin.pdf +3 -0
- 2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/full.md +458 -0
- 2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/images.zip +3 -0
- 2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/layout.json +0 -0
- 2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/7bc02b8d-49ae-4820-be36-fb7156836a7f_content_list.json +0 -0
- 2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/7bc02b8d-49ae-4820-be36-fb7156836a7f_model.json +0 -0
- 2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/7bc02b8d-49ae-4820-be36-fb7156836a7f_origin.pdf +3 -0
- 2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/full.md +748 -0
- 2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/images.zip +3 -0
- 2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/layout.json +0 -0
- 2025/Anytime-Constrained Equilibria in Polynomial Time/437cf6e2-1a05-420f-883a-2978c1445710_content_list.json +0 -0
- 2025/Anytime-Constrained Equilibria in Polynomial Time/437cf6e2-1a05-420f-883a-2978c1445710_model.json +0 -0
- 2025/Anytime-Constrained Equilibria in Polynomial Time/437cf6e2-1a05-420f-883a-2978c1445710_origin.pdf +3 -0
- 2025/Anytime-Constrained Equilibria in Polynomial Time/full.md +637 -0
- 2025/Anytime-Constrained Equilibria in Polynomial Time/images.zip +3 -0
- 2025/Anytime-Constrained Equilibria in Polynomial Time/layout.json +0 -0
- 2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/ccb0cd66-ac75-4a6c-89ae-39fc9d56daa4_content_list.json +0 -0
- 2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/ccb0cd66-ac75-4a6c-89ae-39fc9d56daa4_model.json +0 -0
- 2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/ccb0cd66-ac75-4a6c-89ae-39fc9d56daa4_origin.pdf +3 -0
- 2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/full.md +694 -0
- 2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/images.zip +3 -0
- 2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/layout.json +0 -0
- 2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/7ca7b32d-67f4-495d-b0cb-edce9eb3ba9f_content_list.json +0 -0
- 2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/7ca7b32d-67f4-495d-b0cb-edce9eb3ba9f_model.json +0 -0
- 2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/7ca7b32d-67f4-495d-b0cb-edce9eb3ba9f_origin.pdf +3 -0
- 2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/full.md +0 -0
- 2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/images.zip +3 -0
- 2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/layout.json +0 -0
- 2025/Approximately Correct Label Distribution Learning/d91f6fd6-a16b-40da-851e-409162b42b5b_content_list.json +0 -0
.gitattributes
CHANGED
|
@@ -297,3 +297,67 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 297 |
2025/AnalogGenie-Lite_[[:space:]]Enhancing[[:space:]]Scalability[[:space:]]and[[:space:]]Precision[[:space:]]in[[:space:]]Circuit[[:space:]]Topology[[:space:]]Discovery[[:space:]]through[[:space:]]Lightweight[[:space:]]Graph[[:space:]]Modeling/1dad59d1-1f4b-4f9e-bcd0-521b4812a521_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 298 |
2025/Analytical[[:space:]]Construction[[:space:]]on[[:space:]]Geometric[[:space:]]Architectures_[[:space:]]Transitioning[[:space:]]from[[:space:]]Static[[:space:]]to[[:space:]]Temporal[[:space:]]Link[[:space:]]Prediction/3d113d60-7aef-4d71-863e-ae01839dfb25_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 299 |
2025/Analytical[[:space:]]Lyapunov[[:space:]]Function[[:space:]]Discovery_[[:space:]]An[[:space:]]RL-based[[:space:]]Generative[[:space:]]Approach/5ac38fe6-45c2-4b1b-9e57-0c2e45720567_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 297 |
2025/AnalogGenie-Lite_[[:space:]]Enhancing[[:space:]]Scalability[[:space:]]and[[:space:]]Precision[[:space:]]in[[:space:]]Circuit[[:space:]]Topology[[:space:]]Discovery[[:space:]]through[[:space:]]Lightweight[[:space:]]Graph[[:space:]]Modeling/1dad59d1-1f4b-4f9e-bcd0-521b4812a521_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 298 |
2025/Analytical[[:space:]]Construction[[:space:]]on[[:space:]]Geometric[[:space:]]Architectures_[[:space:]]Transitioning[[:space:]]from[[:space:]]Static[[:space:]]to[[:space:]]Temporal[[:space:]]Link[[:space:]]Prediction/3d113d60-7aef-4d71-863e-ae01839dfb25_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 299 |
2025/Analytical[[:space:]]Lyapunov[[:space:]]Function[[:space:]]Discovery_[[:space:]]An[[:space:]]RL-based[[:space:]]Generative[[:space:]]Approach/5ac38fe6-45c2-4b1b-9e57-0c2e45720567_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 300 |
+
2025/Analyze[[:space:]]Feature[[:space:]]Flow[[:space:]]to[[:space:]]Enhance[[:space:]]Interpretation[[:space:]]and[[:space:]]Steering[[:space:]]in[[:space:]]Language[[:space:]]Models/664b03cc-930c-4e1b-82e2-c0fa8e156edc_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 301 |
+
2025/Angle[[:space:]]Domain[[:space:]]Guidance_[[:space:]]Latent[[:space:]]Diffusion[[:space:]]Requires[[:space:]]Rotation[[:space:]]Rather[[:space:]]Than[[:space:]]Extrapolation/2350d3e1-6905-4f55-8805-079a64ed171d_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 302 |
+
2025/Annealing[[:space:]]Flow[[:space:]]Generative[[:space:]]Models[[:space:]]Towards[[:space:]]Sampling[[:space:]]High-Dimensional[[:space:]]and[[:space:]]Multi-Modal[[:space:]]Distributions/96da049d-38d8-4169-a950-4c99505746b0_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 303 |
+
2025/Antidote_[[:space:]]Post-fine-tuning[[:space:]]Safety[[:space:]]Alignment[[:space:]]for[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]against[[:space:]]Harmful[[:space:]]Fine-tuning[[:space:]]Attack/1fb15cab-4e43-4531-b52f-6b8eba7ffe4f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 304 |
+
2025/AnyEdit_[[:space:]]Edit[[:space:]]Any[[:space:]]Knowledge[[:space:]]Encoded[[:space:]]in[[:space:]]Language[[:space:]]Models/7bc02b8d-49ae-4820-be36-fb7156836a7f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 305 |
+
2025/Anytime-Constrained[[:space:]]Equilibria[[:space:]]in[[:space:]]Polynomial[[:space:]]Time/437cf6e2-1a05-420f-883a-2978c1445710_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 306 |
+
2025/Approximate[[:space:]]Differential[[:space:]]Privacy[[:space:]]of[[:space:]]the[[:space:]]$_ell_2$[[:space:]]Mechanism/ccb0cd66-ac75-4a6c-89ae-39fc9d56daa4_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 307 |
+
2025/Approximate[[:space:]]Forest[[:space:]]Completion[[:space:]]and[[:space:]]Learning-Augmented[[:space:]]Algorithms[[:space:]]for[[:space:]]Metric[[:space:]]Minimum[[:space:]]Spanning[[:space:]]Trees/7ca7b32d-67f4-495d-b0cb-edce9eb3ba9f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 308 |
+
2025/Approximately[[:space:]]Correct[[:space:]]Label[[:space:]]Distribution[[:space:]]Learning/d91f6fd6-a16b-40da-851e-409162b42b5b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 309 |
+
2025/Approximating[[:space:]]Latent[[:space:]]Manifolds[[:space:]]in[[:space:]]Neural[[:space:]]Networks[[:space:]]via[[:space:]]Vanishing[[:space:]]Ideals/5f4ebaa8-27c1-47e1-ad09-a6752869e449_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 310 |
+
2025/Approximation[[:space:]]to[[:space:]]Smooth[[:space:]]Functions[[:space:]]by[[:space:]]Low-Rank[[:space:]]Swish[[:space:]]Networks/735bd550-f74b-4486-8d44-3f1917103e98_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 311 |
+
2025/Arbitrarily-Conditioned[[:space:]]Multi-Functional[[:space:]]Diffusion[[:space:]]for[[:space:]]Multi-Physics[[:space:]]Emulation/4a0403c0-be1b-4437-8d2f-6cd47714137b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 312 |
+
2025/Archetypal[[:space:]]SAE_[[:space:]]Adaptive[[:space:]]and[[:space:]]Stable[[:space:]]Dictionary[[:space:]]Learning[[:space:]]for[[:space:]]Concept[[:space:]]Extraction[[:space:]]in[[:space:]]Large[[:space:]]Vision[[:space:]]Models/a5ff2b3e-4e72-4aaf-82fc-b7a437219570_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 313 |
+
2025/Are[[:space:]]High-Quality[[:space:]]AI-Generated[[:space:]]Images[[:space:]]More[[:space:]]Difficult[[:space:]]for[[:space:]]Models[[:space:]]to[[:space:]]Detect_/65511e31-b352-4139-a8e5-ad47d1450ff8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 314 |
+
2025/Are[[:space:]]LLMs[[:space:]]Prescient_[[:space:]]A[[:space:]]Continuous[[:space:]]Evaluation[[:space:]]using[[:space:]]Daily[[:space:]]News[[:space:]]as[[:space:]]the[[:space:]]Oracle/9fa2c116-b405-4c1b-8034-726e9327df44_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 315 |
+
2025/Are[[:space:]]Large[[:space:]]Brainwave[[:space:]]Foundation[[:space:]]Models[[:space:]]Capable[[:space:]]Yet[[:space:]]_[[:space:]]Insights[[:space:]]from[[:space:]]Fine-Tuning/ddbe7be6-8146-46cd-9a46-191447ae7840_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 316 |
+
2025/Are[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]Ready[[:space:]]for[[:space:]]Multi-Turn[[:space:]]Tabular[[:space:]]Data[[:space:]]Analysis_/fdfd8c7d-0a1c-4b04-80b4-4d5a5fdb7182_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 317 |
+
2025/Are[[:space:]]Sparse[[:space:]]Autoencoders[[:space:]]Useful_[[:space:]]A[[:space:]]Case[[:space:]]Study[[:space:]]in[[:space:]]Sparse[[:space:]]Probing/d9abffa8-7a9e-4b7d-bba3-70192cb84a39_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 318 |
+
2025/Armijo[[:space:]]Line-search[[:space:]]Can[[:space:]]Make[[:space:]](Stochastic)[[:space:]]Gradient[[:space:]]Descent[[:space:]]Provably[[:space:]]Faster/7d9a0385-63ec-4226-99d6-fca28348dd1c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 319 |
+
2025/ArrayDPS_[[:space:]]Unsupervised[[:space:]]Blind[[:space:]]Speech[[:space:]]Separation[[:space:]]with[[:space:]]a[[:space:]]Diffusion[[:space:]]Prior/8307685d-4d91-4c79-b73a-2e90528046b0_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 320 |
+
2025/Arrow_[[:space:]]Accelerator[[:space:]]for[[:space:]]Time[[:space:]]Series[[:space:]]Causal[[:space:]]Discovery[[:space:]]with[[:space:]]Time[[:space:]]Weaving/4f835da7-a7d3-40a4-8709-3ab9a7744e07_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 321 |
+
2025/Assessing[[:space:]]Safety[[:space:]]Risks[[:space:]]and[[:space:]]Quantization-aware[[:space:]]Safety[[:space:]]Patching[[:space:]]for[[:space:]]Quantized[[:space:]]Large[[:space:]]Language[[:space:]]Models/67836d22-9d09-49ec-b5a0-c617a48a30b4_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 322 |
+
2025/AssistanceZero_[[:space:]]Scalably[[:space:]]Solving[[:space:]]Assistance[[:space:]]Games/b50c7a23-884e-430f-8088-66f0a248bf6c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 323 |
+
2025/AsymRnR_[[:space:]]Video[[:space:]]Diffusion[[:space:]]Transformers[[:space:]]Acceleration[[:space:]]with[[:space:]]Asymmetric[[:space:]]Reduction[[:space:]]and[[:space:]]Restoration/505b11ab-8c2b-4e99-9119-16c277294c6b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 324 |
+
2025/Asymmetric[[:space:]]Decision-Making[[:space:]]in[[:space:]]Online[[:space:]]Knowledge[[:space:]]Distillation_[[:space:]]Unifying[[:space:]]Consensus[[:space:]]and[[:space:]]Divergence/f5651e89-7f3b-4bdf-bd66-36ad36d58b09_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 325 |
+
2025/AtlasD_[[:space:]]Automatic[[:space:]]Local[[:space:]]Symmetry[[:space:]]Discovery/79dab927-740e-4ba0-b839-4efb399180f9_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 326 |
+
2025/Attention[[:space:]]Mechanisms[[:space:]]Perspective_[[:space:]]Exploring[[:space:]]LLM[[:space:]]Processing[[:space:]]of[[:space:]]Graph-Structured[[:space:]]Data/1d85d233-19a4-4e15-917c-bd4f58ccfa7b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 327 |
+
2025/Attention-Level[[:space:]]Speculation/f76fc31a-5f8f-4ab5-a373-c1544de4179f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 328 |
+
2025/Attention-Only[[:space:]]Transformers[[:space:]]via[[:space:]]Unrolled[[:space:]]Subspace[[:space:]]Denoising/ba734761-c0b0-4de5-a736-fd2baf217a6f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 329 |
+
2025/Attributes[[:space:]]Shape[[:space:]]the[[:space:]]Embedding[[:space:]]Space[[:space:]]of[[:space:]]Face[[:space:]]Recognition[[:space:]]Models/deefd412-bf34-4d09-ba83-82acd32bbfd8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 330 |
+
2025/AuPair_[[:space:]]Golden[[:space:]]Example[[:space:]]Pairs[[:space:]]for[[:space:]]Code[[:space:]]Repair/7442c1ed-d867-44cf-8d9f-9f95dc10fabe_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 331 |
+
2025/Audio[[:space:]]Flamingo[[:space:]]2_[[:space:]]An[[:space:]]Audio-Language[[:space:]]Model[[:space:]]with[[:space:]]Long-Audio[[:space:]]Understanding[[:space:]]and[[:space:]]Expert[[:space:]]Reasoning[[:space:]]Abilities/910871f8-a015-49e2-9e2e-6bad7cefb702_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 332 |
+
2025/Auditing[[:space:]]$f$-differential[[:space:]]privacy[[:space:]]in[[:space:]]one[[:space:]]run/bbaa5c62-5167-4616-b91e-34b4825c0ae9_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 333 |
+
2025/Auditing[[:space:]]Prompt[[:space:]]Caching[[:space:]]in[[:space:]]Language[[:space:]]Model[[:space:]]APIs/ae3ddaf7-42b5-4bb6-ad2d-c3fa89d12c40_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 334 |
+
2025/Auto-reconfiguration[[:space:]]for[[:space:]]Latency[[:space:]]Minimization[[:space:]]in[[:space:]]CPU-based[[:space:]]DNN[[:space:]]Serving/48d9ab5b-2971-435a-8f2e-23d9f4defc47_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 335 |
+
2025/AutoAL_[[:space:]]Automated[[:space:]]Active[[:space:]]Learning[[:space:]]with[[:space:]]Differentiable[[:space:]]Query[[:space:]]Strategy[[:space:]]Search/c85572b7-ea81-449a-aa31-512aefbddfed_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 336 |
+
2025/AutoAdvExBench_[[:space:]]Benchmarking[[:space:]]Autonomous[[:space:]]Exploitation[[:space:]]of[[:space:]]Adversarial[[:space:]]Example[[:space:]]Defenses/30290550-d639-4aab-bc32-281b9f3bb320_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 337 |
+
2025/AutoCATE_[[:space:]]End-to-End,[[:space:]]Automated[[:space:]]Treatment[[:space:]]Effect[[:space:]]Estimation/4d951d9f-b45b-425f-9af3-0a41c1d03e81_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 338 |
+
2025/AutoElicit_[[:space:]]Using[[:space:]]Large[[:space:]]Language[[:space:]]Models[[:space:]]for[[:space:]]Expert[[:space:]]Prior[[:space:]]Elicitation[[:space:]]in[[:space:]]Predictive[[:space:]]Modelling/68ce28cb-d152-4222-9f17-342d90a5f517_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 339 |
+
2025/AutoEval[[:space:]]Done[[:space:]]Right_[[:space:]]Using[[:space:]]Synthetic[[:space:]]Data[[:space:]]for[[:space:]]Model[[:space:]]Evaluation/36a13ea5-bb62-4a29-a428-48f55f3babf4_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 340 |
+
2025/AutoGFM_[[:space:]]Automated[[:space:]]Graph[[:space:]]Foundation[[:space:]]Model[[:space:]]with[[:space:]]Adaptive[[:space:]]Architecture[[:space:]]Customization/7a4bb280-4614-47ef-905c-ade620ddf1c7_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 341 |
+
2025/AutoML-Agent_[[:space:]]A[[:space:]]Multi-Agent[[:space:]]LLM[[:space:]]Framework[[:space:]]for[[:space:]]Full-Pipeline[[:space:]]AutoML/0ce92a5f-4e2d-45bf-aa0b-688d8757a502_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 342 |
+
2025/AutoStep_[[:space:]]Locally[[:space:]]adaptive[[:space:]]involutive[[:space:]]MCMC/c1282b21-3e1d-491b-8371-fb0a75dcf467_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 343 |
+
2025/Autoencoder-Based[[:space:]]Hybrid[[:space:]]Replay[[:space:]]for[[:space:]]Class-Incremental[[:space:]]Learning/ce4737fb-fbd0-4e99-8d5b-b7952b5be6d7_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 344 |
+
2025/Autoformulation[[:space:]]of[[:space:]]Mathematical[[:space:]]Optimization[[:space:]]Models[[:space:]]Using[[:space:]]LLMs/a4507ad2-bdd9-43f1-bcf8-768ae6a6a317_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 345 |
+
2025/Automated[[:space:]]Benchmark[[:space:]]Generation[[:space:]]for[[:space:]]Repository-Level[[:space:]]Coding[[:space:]]Tasks/fe4185d2-3321-49e4-8595-ce66afe9c695_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 346 |
+
2025/Automated[[:space:]]Hypothesis[[:space:]]Validation[[:space:]]with[[:space:]]Agentic[[:space:]]Sequential[[:space:]]Falsifications/6fd2f9f5-83d7-44c7-8dfa-3c44ea8710b9_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 347 |
+
2025/Automated[[:space:]]Red[[:space:]]Teaming[[:space:]]with[[:space:]]GOAT_[[:space:]]the[[:space:]]Generative[[:space:]]Offensive[[:space:]]Agent[[:space:]]Tester/ddec5434-1709-4fe8-a219-86afe1055f2f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 348 |
+
2025/Automatic[[:space:]]Differentiation[[:space:]]of[[:space:]]Optimization[[:space:]]Algorithms[[:space:]]with[[:space:]]Time-Varying[[:space:]]Updates/e14e8899-63b5-4357-92e5-2f5cb5b9fea7_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 349 |
+
2025/Automatic[[:space:]]Reward[[:space:]]Shaping[[:space:]]from[[:space:]]Confounded[[:space:]]Offline[[:space:]]Data/b844e376-db11-4e1e-91f5-2ab5992ec69a_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 350 |
+
2025/Automatically[[:space:]]Identify[[:space:]]and[[:space:]]Rectify_[[:space:]]Robust[[:space:]]Deep[[:space:]]Contrastive[[:space:]]Multi-view[[:space:]]Clustering[[:space:]]in[[:space:]]Noisy[[:space:]]Scenarios/3e15e002-06cc-4488-b24a-360e8264b846_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 351 |
+
2025/Automatically[[:space:]]Interpreting[[:space:]]Millions[[:space:]]of[[:space:]]Features[[:space:]]in[[:space:]]Large[[:space:]]Language[[:space:]]Models/dcf88fa8-ec30-4c1f-b2aa-efd87e3c77a8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 352 |
+
2025/Autonomy-of-Experts[[:space:]]Models/0abed37e-ec8e-4020-85c3-2a3b5cd17c83_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 353 |
+
2025/Average[[:space:]]Certified[[:space:]]Radius[[:space:]]is[[:space:]]a[[:space:]]Poor[[:space:]]Metric[[:space:]]for[[:space:]]Randomized[[:space:]]Smoothing/623da5c6-c5c0-4e53-8a3d-de508c58305f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 354 |
+
2025/Average[[:space:]]Sensitivity[[:space:]]of[[:space:]]Hierarchical[[:space:]]$k$-Median[[:space:]]Clustering/4829f26f-f17a-4226-9682-cf1bf7e92d0e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 355 |
+
2025/Avoiding[[:space:]]Catastrophe[[:space:]]in[[:space:]]Online[[:space:]]Learning[[:space:]]by[[:space:]]Asking[[:space:]]for[[:space:]]Help/052269c7-9b19-4453-a344-f2ea7da604eb_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 356 |
+
2025/Avoiding[[:space:]]Leakage[[:space:]]Poisoning_[[:space:]]Concept[[:space:]]Interventions[[:space:]]Under[[:space:]]Distribution[[:space:]]Shifts/2e149ae5-a6a9-4616-bb26-39cd982bfac8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 357 |
+
2025/Avoiding[[:space:]]spurious[[:space:]]sharpness[[:space:]]minimization[[:space:]]broadens[[:space:]]applicability[[:space:]]of[[:space:]]SAM/77739944-e1bb-41a7-a346-f481e8f07b10_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 358 |
+
2025/AxBench_[[:space:]]Steering[[:space:]]LLMs_[[:space:]]Even[[:space:]]Simple[[:space:]]Baselines[[:space:]]Outperform[[:space:]]Sparse[[:space:]]Autoencoders/e8c4a17e-e1bd-465d-88a5-aa27b710aa2c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 359 |
+
2025/B-score_[[:space:]]Detecting[[:space:]]biases[[:space:]]in[[:space:]]large[[:space:]]language[[:space:]]models[[:space:]]using[[:space:]]response[[:space:]]history/f55379c0-1f80-4d22-b09f-1aa9711bfb9b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 360 |
+
2025/BAME_[[:space:]]Block-Aware[[:space:]]Mask[[:space:]]Evolution[[:space:]]for[[:space:]]Efficient[[:space:]]N_M[[:space:]]Sparse[[:space:]]Training/7e6f34b7-581d-462c-93d3-c48589e061ae_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 361 |
+
2025/BARK_[[:space:]]A[[:space:]]Fully[[:space:]]Bayesian[[:space:]]Tree[[:space:]]Kernel[[:space:]]for[[:space:]]Black-box[[:space:]]Optimization/1a2ae6ef-88a5-4252-9097-a8d1ba97c820_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 362 |
+
2025/BARNN_[[:space:]]A[[:space:]]Bayesian[[:space:]]Autoregressive[[:space:]]and[[:space:]]Recurrent[[:space:]]Neural[[:space:]]Network/506dda4c-8f58-48a6-8d5c-181438d091fc_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 363 |
+
2025/BAnG_[[:space:]]Bidirectional[[:space:]]Anchored[[:space:]]Generation[[:space:]]for[[:space:]]Conditional[[:space:]]RNA[[:space:]]Design/08a463d9-9288-47c9-bf95-3c75ccfb51b3_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/664b03cc-930c-4e1b-82e2-c0fa8e156edc_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/664b03cc-930c-4e1b-82e2-c0fa8e156edc_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/664b03cc-930c-4e1b-82e2-c0fa8e156edc_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:efba1384374aeff4e7cb30497e56b4a596ecaf3c42de5ebbc3d3a62ca83c5a0f
|
| 3 |
+
size 1533424
|
2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/full.md
ADDED
|
@@ -0,0 +1,725 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Analyze Feature Flow to Enhance Interpretation and Steering in Language Models
|
| 2 |
+
|
| 3 |
+
Daniil Laptev<sup>12</sup> Nikita Balagansky<sup>12</sup> Yaroslav Aksenov<sup>1</sup> Daniil Gavrilov<sup>1</sup>
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We introduce a new approach to systematically map features discovered by sparse autoencoder across consecutive layers of large language models, extending earlier work that examined interlayer feature links. By using a data-free cosine similarity technique, we trace how specific features persist, transform, or first appear at each stage. This method yields granular flow graphs of feature evolution, enabling fine-grained interpretability and mechanistic insights into model computations. Crucially, we demonstrate how these cross-layer feature maps facilitate direct steering of model behavior by amplifying or suppressing chosen features, achieving targeted thematic control in text generation. Together, our findings highlight the utility of a causal, cross-layer interpretability framework that not only clarifies how features develop through forward passes but also provides new means for transparent manipulation of large language models.
|
| 8 |
+
|
| 9 |
+
# 1. Introduction
|
| 10 |
+
|
| 11 |
+
Large language models (LLMs) excel at generating coherent text but remain largely opaque in how they store and transform semantic information. Previous research has revealed that neural networks often encode concepts as linear directions within hidden representations (Mikolov et al., 2013), and that sparse autoencoders (SAEs) can disentangle these directions into monosemantic features in the case of LLMs (Bricken et al., 2023; Cunningham et al., 2023). Yet, most methods analyze a single layer or focus solely on the residual stream, leaving the multi-layer nature of feature emergence and transformation underexplored (Balagansky et al., 2024; Balcells et al., 2024).
|
| 12 |
+
|
| 13 |
+
In this paper, we propose a data-free approach, based on
|
| 14 |
+
|
| 15 |
+
cosine similarity, that aligns SAE features across multiple modules (MLP, attention, and residual) at each layer, capturing how features originate, propagate, or vanish throughout the model in a form of "flow graphs".
|
| 16 |
+
|
| 17 |
+
1. Cross-Layer Feature Evolution. Using the pretrained SAEs that can isolate interpretable monosemantic directions, we utilize information obtained from cosine similarity between their decoder weights to track how these directions evolve or appear across layers. This reveals distinct patterns of feature birth and refinement not seen in single-layer analyses.
|
| 18 |
+
|
| 19 |
+
2. Mechanistic Properties of Flow Graph. By building a flow graph, we uncover an evolutionary pathway, which is also an internal circuit-like computational pathway, where MLP and attention modules introduce new features to already existing ones or change them.
|
| 20 |
+
|
| 21 |
+
3. Multi-Layer Model Steering. We show that flow graphs can improve the quality of model steering by targeting multiple SAE features at once, and also offer a better understanding of the steering outcome. This framework provides the first demonstration of such multi-layer steering via SAE features.
|
| 22 |
+
|
| 23 |
+
Our method helps to discover the lifespan of SAE features, understand their evolution across layers, and shed light on how they might form computational circuits, thereby enabling more precise control over model behavior.
|
| 24 |
+
|
| 25 |
+
# 2. Preliminaries
|
| 26 |
+
|
| 27 |
+
# 2.1. Linear representation hypothesis
|
| 28 |
+
|
| 29 |
+
To understand how models encode and process the information they learn, one can examine the geometric structure of their hidden representations and weights. Research has shown (Mikolov et al., 2013; Marks & Tegmark, 2024; Gurnee & Tegmark, 2024; Engels et al., 2025) that linear directions carry semantically meaningful information and may be used by models to represent learned concepts. Observations of this kind led to the development of the linear representation hypothesis, which can be stated as follows.
|
| 30 |
+
|
| 31 |
+
Hidden states $\mathbf{h} \in \mathbb{R}^d$ can be represented as sparse linear combinations of features $\mathbf{f} \in \mathbb{R}^d$ that lie in linear subspaces $\mathbb{F} \subset \mathbb{R}^d$ . The impact of each feature is encoded by its magnitude $\|\mathbf{f}\|$ . The total number of these linear subspaces with unique semantics greatly exceeds $d$ , forcing the model to build an overcomplete basis in the feature space embedded in $\mathbb{R}^d$ . During a forward pass, the model typically uses only a small fraction of them. These subspaces are usually one-dimensional lines, but more complex structures can appear (Engels et al., 2025).<sup>1</sup>
|
| 32 |
+
|
| 33 |
+
# 2.2. SAE and Transcoders
|
| 34 |
+
|
| 35 |
+
To retrieve such linear directions, Sparse Autoencoders (SAEs) (Bricken et al., 2023; Cunningham et al., 2023) were introduced. They decompose the model's hidden state into a sparse weighted sum of interpretable features.
|
| 36 |
+
|
| 37 |
+
Let $\mathcal{F}^{(P)} = \{\mathcal{F}_i^{(P)}\mid i\in \{1,\dots,D\}\}$ , where $D\gg d$ is the dictionary size, be a collection of one-dimensional features learned by an SAE at position $P$ in the model (e.g., after the MLP block). Then the SAE can be represented as
|
| 38 |
+
|
| 39 |
+
$$
|
| 40 |
+
\mathbf {z} = \sigma (\mathbf {W} _ {\mathrm {e n c}} \mathbf {h} + \mathbf {b} _ {\mathrm {e n c}}),
|
| 41 |
+
$$
|
| 42 |
+
|
| 43 |
+
$$
|
| 44 |
+
\hat {\mathbf {h}} = \mathbf {W} _ {\mathrm {d e c}} \mathbf {z} + \mathbf {b} _ {\mathrm {d e c}},
|
| 45 |
+
$$
|
| 46 |
+
|
| 47 |
+
where $\mathbf{W}_{\mathrm{enc}}, \mathbf{b}_{\mathrm{enc}}, \mathbf{W}_{\mathrm{dec}}, \mathbf{b}_{\mathrm{dec}}$ are SAE parameters, $\sigma(\cdot)$ is a nonlinear activation function, $\mathbf{h} \in \mathbb{R}^d$ is a model's hidden state, $\mathbf{z} \in \mathbb{R}^{|\mathcal{F}|}$ is the feature activation, and $\hat{\mathbf{h}}$ is the SAE's reconstruction of the hidden state.
|
| 48 |
+
|
| 49 |
+
Sparse autoencoders are usually trained to reconstruct model hidden states while enforcing sparse feature activations:
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
L = L _ {\mathrm {r e c}} (\mathbf {h}, \hat {\mathbf {h}}) + L _ {\mathrm {r e g}} (\mathbf {z}).
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Typically, $L_{\mathrm{rec}} = \|\mathbf{h} - \hat{\mathbf{h}}\|_2^2$ , while $L_{\mathrm{reg}}(\mathbf{z})$ is an $l_0$ proxy.
|
| 56 |
+
|
| 57 |
+
The choice of activation function $\sigma (\cdot)$ is crucial for achieving the desired representation properties. JumpReLU (Rajamoharan et al., 2024) introduces a threshold parameter $\theta \in \mathbb{R}^{|\mathcal{F}|}$ that controls how large each pre-activation must be for the feature to become active:
|
| 58 |
+
|
| 59 |
+
$$
|
| 60 |
+
\sigma (\mathbf {z}) = \mathbf {z} H (\mathbf {z} - \theta),
|
| 61 |
+
$$
|
| 62 |
+
|
| 63 |
+
where $H$ is the Heaviside function.
|
| 64 |
+
|
| 65 |
+
Top-K (Makhzani & Frey, 2014; Gao et al., 2025), allows one to control the desired sparsity level by fixing $k$ :
|
| 66 |
+
|
| 67 |
+
$$
|
| 68 |
+
\sigma (\mathbf {h}) = \operatorname {t o p} _ {k} (W \mathbf {h} + b).
|
| 69 |
+
$$
|
| 70 |
+
|
| 71 |
+
Instead of taking the top- $k$ per sample, BatchTopK selects the top $k \times b$ activations over all samples in the batch (Bussmann et al., 2024).
|
| 72 |
+
|
| 73 |
+
Transcoders (Jermyn et al., 2024) are very similar to SAEs, but they reconstruct a different target. Typically, they are trained as interpretable approximations of MLPs:
|
| 74 |
+
|
| 75 |
+
$$
|
| 76 |
+
\hat {\mathbf {h}} _ {\text {p o s t}} = \mathrm {T C} (\mathbf {h} _ {\text {p r e}}),
|
| 77 |
+
$$
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
L _ {\mathrm {r e c}} = \left\| \mathbf {h} _ {\mathrm {p o s t}} - \hat {\mathbf {h}} _ {\mathrm {p o s t}} \right\| ^ {2},
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
where $\mathbf{h}_{\mathrm{pre}}$ is the pre-MLP hidden state, $\mathbf{h}_{\mathrm{post}}$ is the post-MLP hidden state, and $\hat{\mathbf{h}}_{\mathrm{post}}$ is the transcoder's prediction.
|
| 84 |
+
|
| 85 |
+
# 2.3. Features On Different Layers
|
| 86 |
+
|
| 87 |
+
Interconnections among SAE features trained on different layers of the same model have been reported and studied (Balagansky et al., 2024; Balcells et al., 2024; Ghilardi et al., 2024). Features in earlier layers tend to be low-level, often indicating word characteristics (e.g., words starting with certain letters), while features in later layers are typically more high-level and guide model behavior.
|
| 88 |
+
|
| 89 |
+
Sparse autoencoders are typically trained at three points in each layer: the output of the attention mechanism, the output of the MLP, and the residual stream. The latter is the main conduit of information within a transformer; MLP and attention modules read from it, process the data, and write their outputs back into it. According to Balagansky et al. (2024), most features in the residual stream remain relatively unchanged across layers. To identify similar features between different layers, one can define a permutation matrix $\mathbf{P}^{(A\rightarrow B)}$ that maps feature indices from layer $A$ to layer $B$ , both having the same number of features $|\mathcal{F}|$ :
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathbf {P} ^ {(A \rightarrow B)} = \underset {\mathbf {P} \in \mathcal {P} _ {| \mathcal {F} |}} {\arg \min } \sum_ {i = 1} ^ {d} \left\| \mathbf {W} _ {\mathrm {d e c} _ {i,:}} ^ {(B)} - \mathbf {W} _ {\mathrm {d e c} _ {i,:}} ^ {(A)} \mathbf {P} ^ {(A \rightarrow B)} \right\| ^ {2},
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
where $\mathbf{W}_{(\cdot)}^{(A)}\in \mathbb{R}^{d\times |\mathcal{F}|}$ is a parameter of the SAE trained on the residual stream after layer $A$ , and $\mathcal{P}_{|\mathcal{F}|}$ is the set of permutation matrices of size $|\mathcal{F}|\times |\mathcal{F}|$
|
| 96 |
+
|
| 97 |
+
Dunefsky et al. (2024) finds a computational graph through the MLP layers by training transcoders:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
\mathbf {z} \left(\mathbf {h} _ {\text {p r e}}\right) _ {i} \left(\mathbf {W} _ {\text {d e c}} ^ {(A) \intercal} \mathbf {W} _ {\text {e n c}} ^ {(B) \intercal}\right) _ {i,:}. \tag {1}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
Here, $\mathbf{W}_{\mathrm{dec}}^{(A)^\intercal}\mathbf{W}_{\mathrm{enc}}^{(B)^\intercal} \in \mathbb{R}^{|\mathcal{F}| \times |\mathcal{F}|}$ serves as a transition operator between the feature spaces of layers $A$ and $B$ , revealing which features in $B$ are ancestors for the $i$ th feature in $A$ .
|
| 104 |
+
|
| 105 |
+
Matrices $\mathbf{P}^{(A\to B)}$ and $\mathbf{W}_{\mathrm{dec}}^{(A)\intercal}\mathbf{W}_{\mathrm{enc}}^{(B)\intercal}$ are in some sense similar. We explore this further in Appendix F.
|
| 106 |
+
|
| 107 |
+
# 3. Method
|
| 108 |
+
|
| 109 |
+
# 3.1. Motivation
|
| 110 |
+
|
| 111 |
+
Although SAEs provide human-interpretable features, they do not explain how these features interact or how the
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 1. Schematic illustration of inner-layer matching. We select a feature with index $i$ on the SAE trained at the layer output. Its embedding $\mathbf{f}$ , which is the $i$ th column of this SAE's decoder weight, is compared to every column of other SAEs on the same layer (after the MLP and attention blocks, as well as with the SAE on the residual stream before some layer). These comparisons indicate the feature's source. See Section 3.3 for more details.
|
| 115 |
+
|
| 116 |
+
model's computation is carried out. Understanding this is crucial for more precise model manipulation.
|
| 117 |
+
|
| 118 |
+
A key principle is that such understanding can be obtained by linking features at different levels of a model (Balagansky et al., 2024; Dunefsky et al., 2024). If we want to find features shared by two SAEs trained at positions $A$ and $B$ , we need to discover a mapping
|
| 119 |
+
|
| 120 |
+
$$
|
| 121 |
+
\mathbf {T} ^ {A \rightarrow B}: \mathcal {F} ^ {(A)} \rightarrow \mathcal {F} ^ {(B)}.
|
| 122 |
+
$$
|
| 123 |
+
|
| 124 |
+
This drives methods (Balagansky et al., 2024; Balcells et al., 2024) for finding these shared features and architectures (Lindsey et al., 2024) that ensure persistent collections of features by design.
|
| 125 |
+
|
| 126 |
+
By grouping similar features, we can find those that remain the same across different positions (by repeatedly applying mapping rules) or uncover those unique to specific points in the model. This helps us understand how semantic structure and computational modes evolve, while SAE features serve as an interpretable proxy.
|
| 127 |
+
|
| 128 |
+
# 3.2. Feature matching
|
| 129 |
+
|
| 130 |
+
Several methods exist for matching features between layers and modules. One approach uses correlations between activations (Wang et al., 2025; Balcells et al., 2024), but it requires considerable data to compute activation statistics. Another is a data-free approach based on SAE weights (Dunefsky et al., 2024; Balagansky et al., 2024). We found that cosine similarity between decoder weights is a valuable similarity metric, and we focus on this approach.
|
| 131 |
+
|
| 132 |
+
Let $\mathbf{f} \in \mathbb{R}^d$ be the embedding of some feature $\mathcal{F}_i^{(A)}$ , trained
|
| 133 |
+
|
| 134 |
+
at position $A$ . This vector is the $i$ th column of $\mathbf{W}_{\mathrm{dec}}^{(A)}$ . Also let $\mathbf{W}_{\mathrm{dec}}^{(B)} \in \mathbb{R}^{d \times |\mathcal{F}|}$ be the decoder weights of an SAE trained at position $B$ . We find the matched feature index as
|
| 135 |
+
|
| 136 |
+
$$
|
| 137 |
+
j = \arg \max _ {k} \left(\mathbf {f} \cdot \mathbf {W} _ {\mathrm {d e c},: k} ^ {(B)}\right).
|
| 138 |
+
$$
|
| 139 |
+
|
| 140 |
+
Then we say that $\mathcal{F}_i^{(A)}$ corresponds to $\mathcal{F}_j^{(B)}$ . We assume that both $\mathbf{f}$ and the columns of $\mathbf{W}_{\mathrm{dec}}^{(B)}$ have unit norm.
|
| 141 |
+
|
| 142 |
+
More generally, we define
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
\mathbf {T} ^ {(A \rightarrow B)} = \mathbb {I} _ {x > 0} \left(\operatorname {t o p} _ {k} \left(\mathbf {W} _ {\mathrm {d e c}} ^ {(A) \intercal} \mathbf {W} _ {\mathrm {d e c}} ^ {(B)}\right)\right),
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where $\mathbb{I}_{x > 0}$ is an indicator function and $\mathrm{top}_k(\cdot)$ zeroes out values below the $k$ th order statistic. When $k = 1$ , this many-to-one matching extends the one-to-one approach in Balagansky et al. (2024). Although top- $k$ handles many-to-many cases, we focus on many-to-one as a substantial extension of previous work.
|
| 149 |
+
|
| 150 |
+
This technique assumes SAEs are trained on hidden states whose structure is aligned. For instance, Gemma Scope (Lieberum et al., 2024) attention SAEs are trained before a nonlinear transformation at dimension 2048, whereas MLP and residual SAEs are trained on dimension 2304, so our method cannot be applied there. As shown in Section 5.1, the data distribution can also affect these results.
|
| 151 |
+
|
| 152 |
+
# 3.3. Tracking the evolution of feature
|
| 153 |
+
|
| 154 |
+
There are four main computational points in a standard transformer layer: the layer output $R_{L}$ , the MLP output $M$ , the attention output $A$ , and the previous layer output $R_{L-1}$
|
| 155 |
+
|
| 156 |
+

|
| 157 |
+
Figure 2. An illustration of the resulting flow graph, which we also use in the deactivation experiment (section 5.2). As a starting point, we select the feature on the 24th-layer residual with index 14548. For a detailed explanation of this graph, see Appendix E.
|
| 158 |
+
|
| 159 |
+
(the layer input). MLP and attention modules read from $R_{L-1}$ and their outputs produce $R_L$ .
|
| 160 |
+
|
| 161 |
+
We pick a feature from the SAE trained on $R_{L}$ with embedding $\mathbf{f} \in \mathbb{R}^{d}$ . Let $\mathbf{W}_{\mathrm{dec}}^{(P)} \in \mathbb{R}^{d \times |\mathcal{F}|}$ for $P \in \{M, A, R \equiv R_{L-1}\}$ be the corresponding decoder weights. We compute the similarity between the target feature and $P$ as the maximum cosine similarity over the columns of $\mathbf{W}_{\mathrm{dec}}^{(P)}$ :
|
| 162 |
+
|
| 163 |
+
$$
|
| 164 |
+
s ^ {(P)} = \max _ {k} \big (\mathbf {f} \cdot \mathbf {W} _ {\mathrm {d e c} _ {:, k}} ^ {(P)} \big),
|
| 165 |
+
$$
|
| 166 |
+
|
| 167 |
+
as illustrated in Figure 1. From these scores, we can infer how the feature relates to the previous layer or modules:
|
| 168 |
+
|
| 169 |
+
A) High $s^{(R)}$ and low $s^{(M)}, s^{(A)}$ : The feature likely existed in $R_{L-1}$ and was translated to $R_L$ .
|
| 170 |
+
B) High $s^{(R)}$ and high $s^{(M)}$ or $s^{(A)}$ : The feature was likely processed by the MLP or attention.
|
| 171 |
+
C) Low $s^{(R)}$ but high $s^{(M)}$ or $s^{(A)}$ : The feature may be newborn, created by the MLP or attention.
|
| 172 |
+
D) Low $s^{(R)}$ and low $s^{(M)}, s^{(A)}$ : The feature cannot be easily explained by maximum cosine similarity alone.
|
| 173 |
+
|
| 174 |
+
Thresholds for "high" and "low" are specific for each layer.
|
| 175 |
+
|
| 176 |
+
We use a backward-matching approach because it naturally answers, "Where did this feature come from?" Forward-matching answers, "Where does this feature go?" but is less helpful for finding novel or transformed features.
|
| 177 |
+
|
| 178 |
+
Long-range feature flows. As we progress through the model, semantics undergo substantial changes, making direct long-range matching challenging. We address this by performing short-range matching in consecutive layers and composing the resulting transformations. For a given feature, we construct a flow graph from the initial layer to the final layer. This flow graph traces a path that reveals how the feature's semantic properties evolve. An example of such a graph is presented in Figure 2.
|
| 179 |
+
|
| 180 |
+
Currently, individual SAE features or their groups (Engels et al., 2025) are treated as units for study. However, we believe that these flow graphs may also become a compelling area for future research.
|
| 181 |
+
|
| 182 |
+
# 3.4. Identification of linear feature circuits
|
| 183 |
+
|
| 184 |
+
Model behavior can be decomposed into computational subnetworks, called circuits, which perform task-specific operations (Elhage et al., 2021; Marks et al., 2025). Our method helps identify potential circuits where MLP and attention modules add or remove features in a mostly linear way. High values of $s^{(M)}$ or $s^{(A)}$ are strong indicators of these circuits. We validate this in our experiments, focusing on how a feature's meaning evolves. Examples appear in Appendix E.
|
| 185 |
+
|
| 186 |
+
# 3.5. Model steering
|
| 187 |
+
|
| 188 |
+
Flow graphs can also help steer the model toward desired behaviors by identifying feature sets we want to manipulate. By carefully selecting them, one can preserve both alignment and core model capabilities, and our method facilitates
|
| 189 |
+
|
| 190 |
+
discovery of such feature groups. By examining flow graphs built from those features, one can better understand and predict the behavior of the model after steering. Section 5.3 and Appendix B illustrate this process.
|
| 191 |
+
|
| 192 |
+
# 4. Experimental Setup
|
| 193 |
+
|
| 194 |
+
# 4.1. Models and SAEs
|
| 195 |
+
|
| 196 |
+
We conduct our main experiments with the Gemma 22B model (Gemma Team, 2024) and the Gemma Scope SAE pack (Lieberum et al., 2024) with a JumpReLU activation function and dictionary size of 16k features. We also test our approach on LLama Scope (He et al., 2024) (see Appendix D), which was trained with TopK activation function and was converted to a JumpReLU after training. In addition, we train our own JumpReLU SAEs for the attention output (before it is added back to the residual stream) on every layer of the Gemma model, following the Gemma Scope training pipeline.
|
| 197 |
+
|
| 198 |
+
We obtain interpretations from Neuronpedia $^2$ , which also serves as an additional evaluation tool. Interpretations for newly trained attention features were not available, and none were provided for LLama Scope.
|
| 199 |
+
|
| 200 |
+
# 4.2. Overview of experiments
|
| 201 |
+
|
| 202 |
+
We design our experiments to analyze how residual features emerge, propagate, and can be manipulated across model layers. Specifically, we aim to: (i) determine how features originate in different model components, (ii) assess whether deactivating a predecessor feature truly deactivates its descendant, and (iii) use these insights to steer the model's generation toward or away from specific topics.
|
| 203 |
+
|
| 204 |
+
Below is a concise summary of each experiment. See Appendices A and B for detailed setup.
|
| 205 |
+
|
| 206 |
+
Identification of feature predecessors. We first verify that cosine similarity relations used for single-layer analysis align with actual activation correlations. A target feature in the residual stream $R_{L}$ is matched with the previous residual $R_{L-1}$ , the MLP output $M$ , or the attention output $A$ features. If none are active, we label it "From nowhere." By applying this process on four diverse datasets, we confirm the above-stated relation, and we also analyze how these groups are distributed across layers.
|
| 207 |
+
|
| 208 |
+
Feature Deactivation. We measure causal relationships by intervening on hidden states: if deactivating a predecessor also deactivates target feature, we infer a causal link.
|
| 209 |
+
|
| 210 |
+
Given hidden states $\mathbf{h}$ at the predecessor's position (previous residual, MLP, or attention output), we apply transformation
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure 3. Example of cosine similarity vs. simultaneous activation with a predecessor (350 features were sampled per layer). "From MLP" and "From RES" groups are notably different: high $s^{(M)}$ and low $s^{(R)}$ suggest simultaneous activation with an MLP-module match. Cosine similarity serves as a good proxy for shared semantic and mechanistic properties.
|
| 216 |
+
|
| 217 |
+

|
| 218 |
+
|
| 219 |
+

|
| 220 |
+
|
| 221 |
+
$\mathbf{h} \gets \mathbf{h} + a(r - 1)\mathbf{v}$ , where $a$ is the predecessor's activation strength, $\mathbf{v}$ its embedding, and $r$ a rescaling coefficient ( $r = 0$ for deactivation). We expect this to remove the feature from the hidden state, preventing further propagation.
|
| 222 |
+
|
| 223 |
+
We evaluate four matching strategies: (1) random sampling from top-5 cosine-similarity matches, (2) permutation-based (Balagansky et al., 2024), (3) $\mathrm{top}_1$ cosine similarity (our method), and (4) $\mathrm{top}_5$ cosine similarity where all five matched features must be inactive to treat this predecessor as inactive. Effectiveness is quantified via successful deactivation rate and activation change (higher when new strength approaches 0).
|
| 224 |
+
|
| 225 |
+
Model Steering. We test whether multi-layer feature activation/deactivation can control theme generation. For a target topic, we intervene on relevant features across layers and assess text quality.
|
| 226 |
+
|
| 227 |
+
As a baseline we use initial features from which we build flow graphs. We compare single-layer (layer $l$ only) and cumulative (layers 0 to $l$ ) interventions, applying the same rescaling for deactivation. For activation, we add scaled embeddings. Multi-layer strategies include linear and exponential decay of steering coefficients with respect to the layer index, and constant scale for all layers (Appendix B).
|
| 228 |
+
|
| 229 |
+
We measure Behavioral (topic presence) and Coherence (language quality) scores, and use their product as final metric (for deactivation $(1 - \text{Behavioral}) \times \text{Coherence}$ ).
|
| 230 |
+
|
| 231 |
+

|
| 232 |
+
Figure 4. Percentage of statistically significant differences between groups for each module's similarity scores. AO means module $P$ is active in only one group, AB means active in both, and IB means inactive in both. For MLP, two groups differ in $s^{(R)}$ only $87\%$ of the time when MLP is active in both groups.
|
| 233 |
+
|
| 234 |
+
# 5. Results
|
| 235 |
+
|
| 236 |
+
# 5.1. Identification of feature predecessors
|
| 237 |
+
|
| 238 |
+
In this experiment, we validate the single-layer analysis patterns from Section 3.3 by checking when target residual features and their predecessors activate simultaneously. For each activated residual feature, we assign it to a group based on which predecessors are also active. For example, if both the previous residual and MLP predecessors are active, the feature is categorized as "From RES & MLP." We then examine the distributions of scores within these groups.
|
| 239 |
+
|
| 240 |
+
Figure 3 reveals visually distinct score distributions across different groups. We quantify these differences with a Mann-Whitney U test on every pair of groups, for each dataset and layer, and then compute the fraction of tests with $p < 0.001$ .
|
| 241 |
+
|
| 242 |
+
We observe that two groups may differ with respect to $s^{(P)}$ if module $P$ is active only in one group (and indistinguishable if $P$ is active or inactive in both groups). For example, "From MLP" and "From MLP & ATT" differ by $s^{(R)}, s^{(M)}, s^{(A)}$ in 67%, 72%, and 100% of tests, respectively. Figure 4 shows the total percentage of passed tests.
|
| 243 |
+
|
| 244 |
+
Figure 5 shows how these groups spread across layers, suggesting conceptual formation in earlier layers. From layers 0-5, "From nowhere" and "From RES" may reflect a high-entropy, early-stage process that stabilizes by about layer 5. After layer 18, where we see a bump for "From MLP", fewer new features emerge, and most features propagate from preceding layers.
|
| 245 |
+
|
| 246 |
+
There is also a three-part partition in the distribution of groups: approximately [0, 5] where uncertainty dominates, [6, 15] with somewhat stable dynamics, and [16, 25] where "From RES" group presence starts to rise and "From MLP" group diminishes after layer 18, implying that fewer new features appear in later layers.
|
| 247 |
+
|
| 248 |
+
We observe differences between datasets in the latter layers. The Python code dataset contains the least amount of natural
|
| 249 |
+
|
| 250 |
+

|
| 251 |
+
|
| 252 |
+

|
| 253 |
+
Figure 5. Percentages of each group at each layer of Gemma 2 2B, illustrating how feature formation proceeds in the model.
|
| 254 |
+
|
| 255 |
+

|
| 256 |
+
|
| 257 |
+

|
| 258 |
+
|
| 259 |
+

|
| 260 |
+
Figure 6. Deactivation methods compared. Group labels show which active predecessors were deactivated. The random approach underperforms, suggesting that choosing the top<sub>1</sub> feature is already meaningful for causal analysis.
|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
|
| 264 |
+
language, and TinyStories has the most natural and simple language structure. The rarity of groups with activated attention could stem from our SAE training rather than an inherent property of Gemma. However, in the LLama Scope case (Figure 19(b)), we observe a slightly similar pattern, which indicates that this is indeed the property they share.
|
| 265 |
+
|
| 266 |
+
We have observed that group identification performance is on par with Pearson correlation-based matching methodology. The latter reduced the "From nowhere" group presence, but did not consistently outperform our method and performed worse on out-of-distribution Python code. See more details in Appendix C.4.
|
| 267 |
+
|
| 268 |
+
# 5.2. Deactivation of features
|
| 269 |
+
|
| 270 |
+
We compare the top<sub>1</sub> approach (choosing the most similar predecessor by cosine similarity) with randomly picking one of the top<sub>5</sub> candidates. Figure 6 shows that the random method sharply reduces deactivation success, confirming that top<sub>1</sub> is informative for causal analysis.
|
| 271 |
+
|
| 272 |
+
For MLP and attention predecessors, $\mathrm{top}_1$ and $\mathrm{top}_5$ per
|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
Figure 7. Impact of different $r$ values on deactivation success, with rescaling of all available predecessors. When $r < 1$ , the activation change grows nonlinearly, indicating alternative causal pathways still convey information. Relative loss change measured as $(L_{\mathrm{new}} - L_{\mathrm{old}}) / L_{\mathrm{old}}$ is a proxy for forward pass impact.
|
| 276 |
+
|
| 277 |
+

|
| 278 |
+
Figure 8. Mean activation changes when deactivating one predecessor at a time. Deactivation of some predecessor causes less impact if this predecessor is not activated alone, which leads to the conclusion that combined groups exhibit circuit-like behavior.
|
| 279 |
+
|
| 280 |
+
form similarly. Differences arise mainly when a residual predecessor combines with another module, indicating that we might miss other types of causal relations.
|
| 281 |
+
|
| 282 |
+
Finally, we vary the rescaling coefficient $r$ to see how it affects deactivation results (Figure 7). Different groups react differently to rescaling. Positive rescaling (boosting active features) matters most when residual features mix with MLP or attention. Negative rescaling most strongly affects "From RES." Reducing "From RES & MLP" or "From RES & MLP & ATT" increases the loss change more than reducing "From RES" alone, highlighting MLP's critical role in these circuit-like interactions.
|
| 283 |
+
|
| 284 |
+
Figure 8 further shows that deactivating a single predecessor causes a greater activation strength drop if it is a group with a single predecessor, which may indicate circuit-like behavior in combined groups.
|
| 285 |
+
|
| 286 |
+
To compare our method with optimal performance, we test three approaches: (1) top-1 cosine similarity matching, (2) top-1 Pearson correlation matching, and (3) an exhaustive search for maximum achievable performance. The search procedure deactivates each active predecessor feature individually, with activation change computed only for target
|
| 287 |
+
|
| 288 |
+
<table><tr><td></td><td>Mean AC</td><td>Success rate</td></tr><tr><td>Top-1 Cosine</td><td>0.75</td><td>65%</td></tr><tr><td>Top-1 Pearson</td><td>0.74</td><td>65%</td></tr><tr><td>Exhaustive Search</td><td>0.83</td><td>73%</td></tr></table>
|
| 289 |
+
|
| 290 |
+
Table 1. Comparison of deactivation methods. The exhaustive search evaluates all activated predecessor features individually and reports maximum performance. The similar results between correlation-based and our data-free method validate our approach.
|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
Figure 9. Deactivating the "Scientific concepts and entities" theme. The dashed black line shows the default generation score. Red points mark the best layer for each $r$ in the single-layer method. Larger $r$ boosts performance but shifts the optimal layer earlier.
|
| 294 |
+
|
| 295 |
+
features identified by either cosine or Pearson matching as "From RES", "From MLP", or "From ATT" to ensure fair comparison and computational feasibility. Testing 1,894 features across two layers (each deactivated via all three methods) yields the results in Table 1, showing comparable performance between cosine and Pearson methods, additionally validating our data-free approach.
|
| 296 |
+
|
| 297 |
+
# 5.3. Model steering
|
| 298 |
+
|
| 299 |
+
To evaluate interventions based on flow graphs, we use them to suppress or activate topics in generation. Figure 10 demonstrates that our method identifies more effective steering features across layers compared to single-feature interventions on the initial feature set. The cumulative approach additionally provides two key advantages: (1) reduced sensitivity to hyperparameter choices, and (2) improved performance with smaller hidden state perturbations.
|
| 300 |
+
|
| 301 |
+
Figure 9 analyzes the impact of rescaling coefficient $r$ on deactivation effectiveness. We observe that larger $r$ values shift the optimal intervention point toward earlier layers, while smaller $r$ values distribute the intervention effect more evenly across the network depth.
|
| 302 |
+
|
| 303 |
+

|
| 304 |
+
Figure 10. Comparison of best deactivation scores. The green line indicates deactivation using only the initial feature set. Interventions on layers detected by our method (orange, blue) perform better across different $r$ values, suggesting additional discovered features reduce hyperparameter sensitivity.
|
| 305 |
+
|
| 306 |
+

|
| 307 |
+
Figure 11. Activation of specific topics. We compare single-layer steering and cumulative approaches with three rescaling strategies (Appendix B). Activating multiple similar features amplifies a topic's presence but may degrade overall text coherence.
|
| 308 |
+
|
| 309 |
+
Figure 10 shows that cumulative intervention outperforms the single-layer approach in a low $r$ regime, suggesting that small interventions distributed over multiple layers may be more effective for controllable generation.
|
| 310 |
+
|
| 311 |
+
For activation tasks, we boost topic presence by activating multiple similar directions. Figure 11 shows that cumulative methods typically strengthen the topic signal but can reduce text quality. In some cases, the effect is clear: steering a feature tied to "Religion and God" can shift outputs toward biblical text, and if we examine the flow graph for that feature, we see that earlier layers are indeed linked to it.
|
| 312 |
+
|
| 313 |
+
# 6. Discussion
|
| 314 |
+
|
| 315 |
+
Identification of feature predecessors. Our results indicate that (i) similarity of linear directions is indeed a good proxy for activation correlation, and (ii) the structure of these groups differs across layers, possibly reflecting the properties of information processing within the model.
|
| 316 |
+
|
| 317 |
+
We suspect that "From MLP," "From ATT," and "From MLP & ATT" primarily contain newborn features introduced at their respective layers, whereas groups that combine the
|
| 318 |
+
|
| 319 |
+
residual stream with a module tend to hold processed features. The decline of "From MLP" and the rise of "From RES" groups shown in Figure 5 may indicate that later layers form fewer new features than intermediate layers.
|
| 320 |
+
|
| 321 |
+
Deactivation of features. We (i) confirm that $\mathrm{top}_1$ similarity provides valuable information about causal dependencies, and (ii) conclude that groups respond differently to the deactivation of certain predecessors, indicating that they have distinct mechanistic properties and may exhibit circuit-like behavior. The fact that residual predecessors are the most influential could be explained by the nature of the residual stream as the main communication channel, so removing the feature at module will not prevent it from further propagation if it already exists in the residual stream.
|
| 322 |
+
|
| 323 |
+
Model steering. If we want to reduce a particular feature at inference, we typically adjust its magnitude. However, achieving a significant reduction may require large adjustment scales, which can alter the distribution of hidden states. Because we know which features contribute to the appearance of the feature we want to reduce, we can also adjust those. From this perspective, it is possible to make multiple smaller adjustments rather than one large one, avoiding dramatic changes to the overall distribution of hidden states.
|
| 324 |
+
|
| 325 |
+
Flow graphs may help to understand the effect of steering and identify related features, but the downstream result depends on the properties of the specific graph. Overall, we conclude that they allow to find impactful features for intervention. We hypothesize that removing topic-related information early allows later layers to recover general linguistic information, aligning with the ability of LLMs to "self-repair" after "damaging" the information processing flow by pruning or, in our case, intervention into the structure of hidden states (McGrath et al., 2023).
|
| 326 |
+
|
| 327 |
+
Overall, our method provides a straightforward way to identify and interpret the computational graph of the model without relying on additional data, achieving performance similar to Pearson correlation matching; the resulting graph can then be used for precise control over the model's internal structure. To the best of our knowledge, we are the first to use SAE features from different layers to control LLM generation. We believe that this work opens a new perspective for zero-shot steering.
|
| 328 |
+
|
| 329 |
+
# 7. Related Work
|
| 330 |
+
|
| 331 |
+
Multiple works have investigated feature circuits in language models. Conmy et al. (2023) proposed pruning connections between modules that do not affect the output. Ge et al. (2024) suggested using gradients to decide whether to prune connections between modules; they also demonstrated that their method can be used to find circuits on the feature
|
| 332 |
+
|
| 333 |
+
level with skip SAE, which is equivalent to transcoders. Dunefsky et al. (2024) showed that circuits can be found without a backward pass, relying solely on activations and transcoders' weights. Balagansky et al. (2024); Balcells et al. (2024) studied feature dynamics in the residual stream during the forward pass; however, these works focus exclusively on residual stream features and do not investigate the properties of the resulting computational graph or its application to steering. Additionally, SAE features as steering vectors were explored in Chalnev et al. (2024), but their approach is data-dependent and does not involve a multi-layer steering procedure. In contrast, our work advances these findings by introducing a straightforward and interpretable data-free method for multi-layer steering, which also enables the tracking of concept evolution across layers and the identification of computational circuits through targeting the weights of pretrained SAEs.
|
| 334 |
+
|
| 335 |
+
# 8. Conclusion
|
| 336 |
+
|
| 337 |
+
In our work, we propose using SAEs trained on different modules and layers of the base model to find a computational graph consisting of SAE features. Through our experiments, we validate that these graphs can describe most of the feature dynamics. Finally, we show that such graphs can be used for steering model behavior, thereby improving steering of LLMs with SAEs.
|
| 338 |
+
|
| 339 |
+
Advancements in model steering suggest focusing on more sophisticated steering approaches. For example, while we can reconstruct feature predecessors from multiple blocks in previous layers, it is evident that features are somewhat tangled across layers (when reducing the magnitude of a predecessor feature, all subsequent computations change). Thus, it may be helpful to concentrate on disentangling these connections across different layers. Other directions for better steering could also exist, thus opening new possibilities on further enhancing LLM controllable generation.
|
| 340 |
+
|
| 341 |
+
# Impact statement
|
| 342 |
+
|
| 343 |
+
Our work offers a method to systematically identify and manipulate latent features in large language models, thereby advancing the field of controllable generation. This improved controllability has positive implications for alignment, interpretability, and safe deployment of AI systems, as it can allow developers to steer models away from harmful or biased outputs. At the same time, similar techniques could be repurposed for unsafe or malicious behavior by those aiming to bypass safeguards or exploit hidden model pathways. These dual-use concerns highlight the importance of continued research and open discussion on controllable generation, rather than a cessation of study. By deepening our collective understanding, we are better equipped to de
|
| 344 |
+
|
| 345 |
+
velop robust norms, policies, and technical safeguards that promote beneficial applications while mitigating the risks of misuse.
|
| 346 |
+
|
| 347 |
+
# References
|
| 348 |
+
|
| 349 |
+
Balagansky, N., Maksimov, I., and Gavrilov, D. Mechanistic permutability: Match features across layers. In The Thirteenth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=MDvecs7EvO.
|
| 350 |
+
Balcells, D., Lerner, B., Oesterle, M., Ucar, E., and Heimersheim, S. Evolution of sae features across layers in llms, 2024. URL https://arxiv.org/abs/2410.08869.
|
| 351 |
+
Bricken, T., Templeton, A., Batson, J., Chen, B., Jermyn, A., Conerly, T., Turner, N., Anil, C., Denison, C., Askell, A., Lasenby, R., Wu, Y., Kravec, S., Schiefer, N., Maxwell, T., Joseph, N., Hatfield-Dodds, Z., Tamkin, A., Nguyen, K., McLean, B., Burke, J. E., Hume, T., Carter, S., Henighan, T., and Olah, C. Towards monoseismicity: Decomposing language models with dictionary learning. Transformer Circuits Thread, 2023. https://transformercircuits.pub/2023/monoseismic-features/index.html.
|
| 352 |
+
Bussmann, B., Leask, P., and Nanda, N. Batchtopk sparse autoencoders. arXiv preprint arXiv: 2412.06410, 2024.
|
| 353 |
+
Chalnev, S., Siu, M., and Conmy, A. Improving steering vectors by targeting sparse autoencoder features, 2024. URL https://arxiv.org/abs/2411.02193.
|
| 354 |
+
Conmy, A., Mavor-Parker, A. N., Lynch, A., Heimersheim, S., and Garriga-Alonso, A. Towards automated circuit discovery for mechanistic interpretability. In Thirty-seventh Conference on Neural Information Processing Systems, 2023.
|
| 355 |
+
Cunningham, H., Ewart, A., Riggs, L., Huben, R., and Sharkey, L. Sparse autoencoders find highly interpretable features in language models, 2023. URL https:// arxiv.org/abs/2309.08600.
|
| 356 |
+
Dunefsky, J., Chlenski, P., and Nanda, N. Transcoders find interpretable llm feature circuits. arXiv preprint arXiv: 2406.11944, 2024.
|
| 357 |
+
Eldan, R. and Li, Y. Tinystories: How small can language models be and still speak coherent english?, 2023. URL https://arxiv.org/abs/2305.07759.
|
| 358 |
+
Elhage, N., Nanda, N., Olsson, C., Henighan, T., Joseph†, N., Mann, B., Askell, A., Bai, Y., Chen, A., Conerly, T., DasSarma, N., Drain, D., Ganguli, D., Hatfield-Dodds, Z., Hernandez, D., Jones, A., Kernion, J.,
|
| 359 |
+
|
| 360 |
+
Lovitt, L., Ndousse, K., Amodei, D., Brown, T., Clark, J., Kaplan, J., McCandlish, S., and Olah, C. A mathematical framework for transformer circuits, 2021. URL https://transformer-circuits.pub/2021/framework/index.html.
|
| 361 |
+
Engels, J., Michaud, E. J., Liao, I., Gurnee, W., and Tegmark, M. Not all language model features are one-dimensionally linear. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=d63a4AM4hb.
|
| 362 |
+
Gao, L., la Tour, T. D., Tillman, H., Goh, G., Troll, R., Radford, A., Sutskever, I., Leike, J., and Wu, J. Scaling and evaluating sparse autoencoders. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=tcsZt9ZNKD.
|
| 363 |
+
Ge, X., Zhu, F., Shu, W., Wang, J., He, Z., and Qiu, X. Automatically identifying local and global circuits with linear computation graphs. arXiv preprint arXiv: 2405.13868, 2024.
|
| 364 |
+
Gemma Team. Gemma 2: Improving open language models at a practical size, 2024. URL https://arxiv.org/abs/2408.00118.
|
| 365 |
+
Ghilardi, D., Belotti, F., Molinari, M., and Lim, J. Accelerating sparse autoencoder training via layer-wise transfer learning in large language models. In Belinkov, Y., Kim, N., Jumelet, J., Mohebbi, H., Mueller, A., and Chen, H. (eds.), Proceedings of the 7th BlackboxNLP Workshop: Analyzing and Interpreting Neural Networks for NLP, pp. 530-550, Miami, Florida, US, November 2024. Association for Computational Linguistics. doi: 10.18653/v1/2024.blackboxnlp-1.32. URL https://aclanthology.org/2024.blackboxnlp-1.32/.
|
| 366 |
+
Gurnee, W. and Tegmark, M. Language models represent space and time, 2024. URL https://arxiv.org/abs/2310.02207.
|
| 367 |
+
Gurnee, W., Nanda, N., Pauly, M., Harvey, K., Troitskii, D., and Bertsimas, D. Finding neurons in a haystack: Case studies with sparse probing. Transactions on Machine Learning Research, 2023. ISSN 2835-8856. URL https://openreview.net/forum?id=JYs1R9IMJr.
|
| 368 |
+
He, Z., Shu, W., Ge, X., Chen, L., Wang, J., Zhou, Y., Liu, F., Guo, Q., Huang, X., Wu, Z., Jiang, Y.-G., and Qiu, X. Llama scope: Extracting millions of features from llama-3.1-8b with sparse autoencoders. arXiv preprint arXiv: 2410.20526, 2024.
|
| 369 |
+
|
| 370 |
+
Jermyn, A., Batson, J., and Olah, C. Random open problems. Transformer Circuits Thread, 2024. URL https://transformer-circuits.pub/2024/jan-update/index.html#open-problems.
|
| 371 |
+
Lieberum, T., Rajamanoharan, S., Conmy, A., Smith, L., Sonnerat, N., Varma, V., Kram'ar, J., Dragan, A., Shah, R., and Nanda, N. Gemma scope: Open sparse autoencoders everywhere all at once on gemma 2. BlackboxNLP Workshop on Analyzing and Interpreting Neural Networks for NLP, 2024. doi: 10.48550/arXiv.2408.05147.
|
| 372 |
+
Lindsey, J., Templeton, A., Marcus, J., Conerly, T., Batson, J., and Olah, C. Sparse crosscoders for cross-layer features and model diffing, 2024. URL https://transformer-circuits.pub/2024/crosscoders/index.html.
|
| 373 |
+
Makhzani, A. and Frey, B. k-sparse autoencoders, 2014. URL https://arxiv.org/abs/1312.5663.
|
| 374 |
+
Marks, S. and Tegmark, M. The geometry of truth: Emergent linear structure in large language model representations of true/false datasets, 2024. URL https:// arxiv.org/abs/2310.06824.
|
| 375 |
+
Marks, S., Rager, C., Michaud, E. J., Belinkov, Y., Bau, D., and Mueller, A. Sparse feature circuits: Discovering and editing interpretable causal graphs in language models. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=I4e82CIDxv.
|
| 376 |
+
McGrath, T., Rahtz, M., Kramar, J., Mikulik, V., and Legg, S. The hydra effect: Emergent self-repair in language model computations, 2023. URL https://arxiv.org/abs/2307.15771.
|
| 377 |
+
Mikolov, T., Yih, W.-t., and Zweig, G. Linguistic regularities in continuous space word representations. In Proceedings of the 2013 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 746-751, Atlanta, Georgia, June 2013. Association for Computational Linguistics. URL https://aclanthology.org/N13-1090/.
|
| 378 |
+
Penedo, G., Kydlícek, H., allal, L. B., Lozhkov, A., Mitchell, M., Raffel, C., Werra, L. V., and Wolf, T. The fineweb datasets: Decanting the web for the finest text data at scale. In The Thirty-eight Conference on Neural Information Processing Systems Datasets and Benchmarks Track, 2024. URL https://openreview.net/forum?id=n6Sckn2QaG.
|
| 379 |
+
Rajamanoharan, S., Lieberum, T., Sonnerat, N., Conmy, A., Varma, V., Kramár, J., and Nanda, N. Jumping ahead:
|
| 380 |
+
|
| 381 |
+
Improving reconstruction fidelity with jumprelu sparse autoencoders. arXiv preprint arXiv: 2407.14435, 2024.
|
| 382 |
+
Templeton, A., Conerly, T., Marcus, J., Lindsey, J., Bricken, T., Chen, B., Pearce, A., Citro, C., Ameisen, E., Jones, A., Cunningham, H., Turner, N. L., McDougall, C., MacDiarmid, M., Freeman, C. D., Sumers, T. R., Rees, E., Batson, J., Jermyn, A., Carter, S., Olah, C., and Henighan, T. Scaling monoseismicity: Extracting interpretable features from claude 3 sonnet. Transformer Circuits Thread, 2024. URL https://transformer-circuits.pub/2024/scaling-monoseismicity/index.html.
|
| 383 |
+
Wang, J., Ge, X., Shu, W., Tang, Q., Zhou, Y., He, Z., and Qiu, X. Towards universality: Studying mechanistic similarity across language model architectures. In The Thirteenth International Conference on Learning Representations, 2025. URL https://openreview.net/forum?id=2J18i8T0oI.
|
| 384 |
+
Zhang, Y., Luo, Y., Yuan, Y., and Yao, A. C.-C. Autonomous data selection with language models for mathematical texts, 2024. URL https://arxiv.org/abs/2402.07625.
|
| 385 |
+
|
| 386 |
+
# A. Detailed Experimental Setup
|
| 387 |
+
|
| 388 |
+
# A.1. Identification of feature predecessors
|
| 389 |
+
|
| 390 |
+
This experiment aims to validate our proposed approach for determining the origin of a feature. Specifically, we verify whether the cosine similarity relations described for single-layer analysis align with the correlation between the features' activations. For a target feature from $R_{L}$ , we consider it to originate from $R_{L-1}$ if the matched feature on $R_{L-1}$ is active while the matched features on $M$ and $A$ are inactive. There are seven possible combinations of activated predecessors; if none of these is active, the feature is assigned to an eighth group, "From nowhere."
|
| 391 |
+
|
| 392 |
+
We use four datasets for this analysis: FineWeb (Penedo et al., 2024) (general-purpose texts), TinyStories (Eldan & Li, 2023) (short synthetic stories), AutoMathText (Zhang et al., 2024) (math-related texts), and PythonGithubCode<sup>3</sup> (pure Python code). From each dataset, we select 250 random samples; for each sample, we pick 5 random tokens (excluding the BOS token). We then iterate over every activated feature on every layer and determine its group (i.e., which predecessor combination leads to that feature's activation).
|
| 393 |
+
|
| 394 |
+
# A.2. Deactivation of features
|
| 395 |
+
|
| 396 |
+
To further validate the proposed method, we measure the causal relationship between a feature and its predecessor by intervening directly in the model's hidden state. Specifically, we deactivate the predecessor by removing its corresponding decoder column from the relevant hidden state (i.e., at the MLP output, attention output, or previous layer output). We expect that deactivating the matched predecessor feature will also deactivate the target feature (at the end of the layer).
|
| 397 |
+
|
| 398 |
+
Feature rescaling. Consider a hidden state $\mathbf{h}_t \in \mathbb{R}^d$ for a specific token $t$ . Suppose we want to modify the strength of $f$ features within this hidden state. Let $\mathbf{V} \in \mathbb{R}^{d \times f}$ be the embeddings of these $f$ features, and let $\mathbf{a}_t \in \mathbb{R}^f$ be their activation strengths for token $t$ . We define rescaling as:
|
| 399 |
+
|
| 400 |
+
$$
|
| 401 |
+
\mathbf {h} _ {t} \leftarrow \mathbf {h} _ {t} + (r - 1) \left(\mathbf {a} _ {t} \cdot \mathbf {V} ^ {\intercal}\right),
|
| 402 |
+
$$
|
| 403 |
+
|
| 404 |
+
where $r$ is the rescaling coefficient. This method also allows us to rescale a feature to a desired strength for steering. We refer to rescaling as positive when $r \geq 1$ , and negative otherwise.
|
| 405 |
+
|
| 406 |
+
In the context of SAEs, we approximate hidden states with a linear combination of feature decoder columns (plus a bias term that does not depend on activation strength, and is therefore omitted). Setting $r = 0$ removes the selected features from the existing linear combination, which is (up to SAE reconstruction error) the same as setting those features' activations to zero.
|
| 407 |
+
|
| 408 |
+
Experimental protocol. In this experiment, we apply the above transformation only to the specific token where we detect the residual feature. We select 35 texts from FineWeb, choose 5 random tokens per text, and focus on layers 6, 12, and 18. For each layer-token pair, we randomly sample up to 25 features and deactivate them if they do not belong to the "From nowhere" group.
|
| 409 |
+
|
| 410 |
+
To assess the effectiveness of deactivation, we compare four matching methods:
|
| 411 |
+
|
| 412 |
+
- permutation: Deactivate the predecessor feature identified by permutation,
|
| 413 |
+
- top<sub>1</sub>: Deactivate the most similar predecessor feature (based on cosine similarity of decoder embeddings),
|
| 414 |
+
- $\mathrm{top}_k(k = 5)$ : Deactivate the five most similar predecessor features,
|
| 415 |
+
- random: Randomly choose one from the top five most similar features.
|
| 416 |
+
|
| 417 |
+
The top<sub>1</sub> method is our main focus. For each method, we first identify the group of the target feature and then perform the deactivation. For the top<sub>5</sub> method, we consider the predecessor active if at least one of the 5 selected features is active.
|
| 418 |
+
|
| 419 |
+
We evaluate two main metrics:
|
| 420 |
+
|
| 421 |
+
<table><tr><td>Feature index</td><td>Interpretation from Neuronpedia</td></tr><tr><td>3/res/9811</td><td>terms related to gravity and its influences</td></tr><tr><td>18/res/14053</td><td>terms related to theoretical frameworks and conceptual models</td></tr><tr><td>18/res/1336</td><td>references to Dark Matter and astronomical phenomena</td></tr><tr><td>20/res/4506</td><td>terms related to physical laws and scientific principles</td></tr><tr><td>21/res/13226</td><td>references to quantum concepts and theories</td></tr><tr><td>22/res/9002</td><td>terms related to models and their specifications,</td></tr><tr><td>22/res/15105</td><td>terms related to force and energy dynamics</td></tr><tr><td>23/res/4086</td><td>terms related to forces and dynamics in physical systems</td></tr><tr><td>24/res/7017</td><td>terms related to electromagnetic interactions and properties</td></tr><tr><td>24/res/14548</td><td>terms and references related to particle physics and standard model parameters</td></tr></table>
|
| 422 |
+
|
| 423 |
+
Table 2. Features initially chosen for deactivation of "Scientific concepts and entities" theme.
|
| 424 |
+
|
| 425 |
+
- Successful deactivations: The number of times a feature was deactivated, divided by the number of times it had an active predecessor.
|
| 426 |
+
- Activation change: Defined as $1 - \left(\mathbf{z}_i^{\mathrm{new}} / \mathbf{z}_i^{\mathrm{old}}\right)$ for target feature $i$ . This metric equals 1 when the feature is fully deactivated, and can be interpreted as a measure of causal dependency between predecessor and target features.
|
| 427 |
+
|
| 428 |
+
# B. Steering details
|
| 429 |
+
|
| 430 |
+
To further test whether our feature-matching approach enables effective model steering, we design a procedure to either suppress or promote particular themes in the generated text. We begin by identifying a small set of features for each theme, guided by Neuronpedia entries. We then build flow graphs (from layer 0 to layer 25) to trace how theme-related features evolve across the network. If the semantic meaning of a feature remains consistent and relevant, we add it to our target collection; otherwise, we continue searching until we have a satisfactory set of features.
|
| 431 |
+
|
| 432 |
+
We compare a single-layer steering strategy (affecting only the features of one layer) to a cumulative strategy (affecting features from the current and all previous layers) to see whether distributing interventions across the network can produce more robust thematic shifts. We also measure any corresponding changes in text coherence and the overall success in promoting or suppressing the target themes.
|
| 433 |
+
|
| 434 |
+
# B.1. Deactivation of theme
|
| 435 |
+
|
| 436 |
+
In the deactivation task, we target a theme we call "Scientific concepts and entities," which is related to black holes, quantum mechanics, and other advanced physics topics. The full list of related features is presented in Table 2.
|
| 437 |
+
|
| 438 |
+
Generation and evaluation setup. We use the prompt, "I think that the biggest problem of contemporary theoretical physics is", and generate text with a maximum length of 96 tokens, $\mathrm{top}_p = 0.7$ , and temperature $T = 1.27$ . To determine whether each theme is present in the generated text, we query a gpt4o-mini language model for a score from 0 to 5 on each theme, following an approach similar to Chalnev et al. (2024). We use the following system prompt for validation:
|
| 439 |
+
|
| 440 |
+
""You will receive a text that was generated by some language model.
|
| 441 |
+
|
| 442 |
+
You need to evaluate this text based on the following criteria:
|
| 443 |
+
|
| 444 |
+
1. Coherence score: text is grammatically correct, language is clear and coherent.
|
| 445 |
+
2. Behavioral score: text is directly related to some predefined subject.
|
| 446 |
+
|
| 447 |
+
The subjects are:
|
| 448 |
+
|
| 449 |
+
a) $\star \star$ Personalities, their influence and achievements $\star \star$ . Text may contain references to individual or group achievements or lack of results, discussion about Nobel prizes etc.
|
| 450 |
+
|
| 451 |
+
<table><tr><td>Theme</td><td>Feature index</td><td>Interpretation</td></tr><tr><td>Anger and frustration</td><td>12/res/4111</td><td>expressions of anger and frustration</td></tr><tr><td>Mental health issues</td><td>12/res/16226</td><td>ref. to mental health issues and their connections to other health conditions</td></tr><tr><td>Wedding and marriage</td><td>12/res/4230</td><td>terms related to weddings and marriage ceremonies</td></tr><tr><td>Religion and God</td><td>12/res/5483</td><td>spiritual themes related to faith and divine authority</td></tr></table>
|
| 452 |
+
|
| 453 |
+
Table 3. Initial choice of feature for activation task.
|
| 454 |
+
|
| 455 |
+
b) $\star \star$ Scientific concepts and entities $\star \star$ . Text relates to some specific scientific concepts, such as particles, black holes, particular theories, Standard Model, quantum wavefunctions, gravitation etc.
|
| 456 |
+
c) $\star \star$ Research methodology and experimentation $\star \star$ . Text relates to methodology and philosophy of science, scientific research techniques and procedures, especially method of experiment, empirical basis of theories etc.
|
| 457 |
+
|
| 458 |
+
Rate the behavioral score in this order, i.e. [a, b, c].
|
| 459 |
+
|
| 460 |
+
Give an integer score from 0 to 5 for each criteria.
|
| 461 |
+
|
| 462 |
+
Do not judge text based on ethical considerations, preferences etc., it is important for that evaluation to be objective.
|
| 463 |
+
|
| 464 |
+
```txt
|
| 465 |
+
Format your output as JSON: { "coherence": 5, "behavioral": [1, 1, 1] }
|
| 466 |
+
""
|
| 467 |
+
```
|
| 468 |
+
|
| 469 |
+
And the following input formatting:
|
| 470 |
+
|
| 471 |
+
```snap
|
| 472 |
+
```
|
| 473 |
+
Text:
|
| 474 |
+
\\"\\"\"
|
| 475 |
+
{text}
|
| 476 |
+
\\"\\"
|
| 477 |
+
```
|
| 478 |
+
|
| 479 |
+
# B.2. Activation of theme
|
| 480 |
+
|
| 481 |
+
We select the features used in Chalnev et al. (2024) (Table 3), so we do not significantly alter the initial feature choices.
|
| 482 |
+
|
| 483 |
+
Flow graph building. Starting from the target feature, we build a flow graph forward and backward, computing similarity scores $s^{(R)}, s^{(M)}, s^{(A)}$ for each residual feature, referencing its predecessors. We then cut our graph on layers where $s^{(R)}$ is below a threshold value $t^{(R)} = 0.5$ , forming the similarity span from $l_{\mathrm{start}}$ to $l_{\mathrm{end}}$ . We also remove features from modules using a threshold value of 0.15.
|
| 484 |
+
|
| 485 |
+
Feature activation transformation. For steering, we add scaled decoder columns of selected features:
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
\mathbf {h} _ {t} \leftarrow \mathbf {h} _ {t} + \mathbf {s} \cdot \mathbf {V} ^ {\intercal},
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
where $\mathbf{s} \in \mathbb{R}^f$ is a vector of scaling coefficients for $f$ features whose embeddings are in $\mathbf{V} \in \mathbb{R}^{d \times f}$ . We apply this transformation to all tokens to globally promote or suppress certain features.
|
| 492 |
+
|
| 493 |
+
Distribution of steering coefficient. To steer multiple related features, one can distribute a single steering coefficient across them, rather than manually tuning each feature. We consider two main strategies.
|
| 494 |
+
|
| 495 |
+
Let $s$ be the initial scaling coefficient and $l$ the layer index. We define exponential scaling of a related feature as:
|
| 496 |
+
|
| 497 |
+
$$
|
| 498 |
+
s ^ {\prime} = s \times e ^ {\alpha l},
|
| 499 |
+
$$
|
| 500 |
+
|
| 501 |
+
and linear scaling as:
|
| 502 |
+
|
| 503 |
+
$$
|
| 504 |
+
s ^ {\prime} = k \times l + b, \quad \text {w h e r e} \quad k = \frac {s ^ {*} - s}{l _ {\text {e n d}} - l _ {\text {s t a r t}}} \quad \text {a n d} \quad b = s - k \times l _ {\text {s t a r t}},
|
| 505 |
+
$$
|
| 506 |
+
|
| 507 |
+
where $l_{\mathrm{start}}, l_{\mathrm{end}}$ are the first and last layers on the obtained graph.
|
| 508 |
+
|
| 509 |
+
Our intuition is that the more features we steer across different layers, the less strength each subsequent feature should have. Exponential scaling with $\alpha < 0$ causes $s'$ to decrease monotonically. Linear scaling is essentially an interpolation between $(l_{\mathrm{start}}, s)$ and $(l_{\mathrm{end}}, s^*)$ . Constant scaling is a special case of both methods where $s' = s$ .
|
| 510 |
+
|
| 511 |
+
We also employ folding (Balagansky et al., 2024) to incorporate information about typical activation levels of different features, helping us distribute the coefficient more effectively. We set $\alpha = -0.05$ and $s^* = 1$ , based on generating a small batch of test completions and manually checking the trade-off between coherence and theme intensity.
|
| 512 |
+
|
| 513 |
+
The single method reported in 5.3 employs a per-layer activation strategy, and other methods are cumulative.
|
| 514 |
+
|
| 515 |
+
Generation and evaluation setup. We use the prompt, "I think", a maximum generation length of 36 tokens, $\mathrm{top}_p = 0.7$ , and temperature $T = 1.27$ . We validate the result with the following system prompt:
|
| 516 |
+
|
| 517 |
+
""You will receive a text that was generated by some language model.
|
| 518 |
+
|
| 519 |
+
You need to evaluate this text based on the following criteria:
|
| 520 |
+
|
| 521 |
+
1. Coherence score: text is grammatically correct, language is clear and coherent.
|
| 522 |
+
2. Behavioral score: text has explainable relation to some predefined subject.
|
| 523 |
+
|
| 524 |
+
Give an integer score from 0 to 5 for each criteria.
|
| 525 |
+
|
| 526 |
+
Do not judge text based on ethical considerations, preferences etc., it is important for that evaluation to be objective.
|
| 527 |
+
|
| 528 |
+
To evaluate behavioral score, also consider related terminology or entities which may be not directly discuss the subject, but associated with it. The name of the subject is just an orienting point for further search of $\star \star$ explainable $\star \star$ connection to that theme in text. For example, if subject is the History of Rome, then strong presence of latin or italian language, or discussion about not history, but architecture of ancient Rome should also lead to high behavioral score, because it has strong explainable connection.
|
| 529 |
+
|
| 530 |
+
Format your output as JSON:
|
| 531 |
+
|
| 532 |
+
```txt
|
| 533 |
+
{ "coherence":5, "behavioral":1
|
| 534 |
+
}
|
| 535 |
+
```
|
| 536 |
+
|
| 537 |
+
And the following input formatting:
|
| 538 |
+
|
| 539 |
+

|
| 540 |
+
(a)
|
| 541 |
+
|
| 542 |
+

|
| 543 |
+
(b)
|
| 544 |
+
|
| 545 |
+

|
| 546 |
+
Figure 12. (a) Percentage of feature groups obtained for each dataset. (b) Distribution of scores for layers 8 and 18. We observe a clear distinction between groups, which additionally indicates the validity of the proposed method.
|
| 547 |
+
Figure 13. Probability of group A (row) to appear in group B (column), aggregated over all layers. For example, if we take the "From ATT" group, then with a probability of 0.45, features from this group would appear in the "From RES & ATT" group. High scores for the "From nowhere" group represent its stochasticity.
|
| 548 |
+
|
| 549 |
+
```txt
|
| 550 |
+
```
|
| 551 |
+
```
|
| 552 |
+
```
|
| 553 |
+
```
|
| 554 |
+
```
|
| 555 |
+
```
|
| 556 |
+
```
|
| 557 |
+
``
|
| 558 |
+
```
|
| 559 |
+
|
| 560 |
+
# C. Additional results for experiments
|
| 561 |
+
|
| 562 |
+
# C.1. Identification of feature predecessors
|
| 563 |
+
|
| 564 |
+
The "From nowhere" group is the most present among all other groups (Figure 12(a)). This may be the consequence of sporadic activation of some features or a matching error. The absence of groups with attention module is probably the consequence of our training procedure, which clearly contrasts with the distribution for Llama Scope (Figure 19(a)).
|
| 565 |
+
|
| 566 |
+
In Figure 12(b), we see that certain groups are indeed distinct with respect to corresponding similarity scores, which we describe in Section 5.1. Figure 14 shows the percentage of tests passed with a p-value threshold 0.001 for each pair of groups, aggregated for each layer and dataset.
|
| 567 |
+
|
| 568 |
+
However, we observe that features may fall into different groups depending on the context and chosen token (Figure 13), which indicates that we need to estimate, for every feature, the most probable groups they fall into.
|
| 569 |
+
|
| 570 |
+
A three-part partition of the group distributions for both Gemma Scope (Figure 5) and Llama Scope (Figure 19(b)) aligns with earlier observations on monoseismicity of neurons across layers (Gurnee et al., 2023). Partitioning the model into the first $20\%$ , the next $40\%$ , and the final $40\%$ of layers reveals varying degrees of monoseismicity, which may have a connection with the three-part partition in the distribution of groups across layers – for Gemma Scope, we have mentioned
|
| 571 |
+
|
| 572 |
+

|
| 573 |
+
Figure 14. Percentage of statistically significant differences between groups with respect to a certain score.
|
| 574 |
+
|
| 575 |
+

|
| 576 |
+
|
| 577 |
+

|
| 578 |
+
|
| 579 |
+

|
| 580 |
+
(a)
|
| 581 |
+
|
| 582 |
+

|
| 583 |
+
(b)
|
| 584 |
+
Figure 15. (a) Percentage of features per each method. There was a total of 13106 activated features, and for every feature, four matching strategies were applied. We see that $\mathrm{top}_5$ method detects many more combined groups than other methods, especially "From RES & MLP". (b) Probability for a feature from some group $A$ (labeled as the subplot title) to become from group $B$ (shown in legend) after deactivation of some predecessor. Each bar shows the percentage of times the feature falls into a new category.
|
| 585 |
+
|
| 586 |
+
parts [0, 5], [6, 15], and [16, 25], and in the case of Llama Scope we observe segments [0,8], [9,16], and [17,31].
|
| 587 |
+
|
| 588 |
+
# C.2. Deactivation of features
|
| 589 |
+
|
| 590 |
+
We observe that the top<sub>5</sub> method happens to detect many more activated predecessors than other methods, and detects more combined groups as depicted in Figure 17(a).
|
| 591 |
+
|
| 592 |
+
Deactivation of a residual predecessor in the case of "From RES & MLP" and "From RES & ATT" with almost equal chance also deactivates the predecessor on the corresponding module or deactivates the target feature entirely, as depicted in Figure 15(b). This suggests that in those cases, the residual predecessor is indeed blocked from further propagation. However, in most cases, full deactivation (of all predecessors) is required to deactivate the target feature. In many cases, "Deactivated" and "From nowhere" are equally probable, which indicates remaining causal dependencies that we miss with our method.
|
| 593 |
+
|
| 594 |
+
We also observe the appearance of new groups, i.e., a feature might initially be "From MLP", but after deactivation of the MLP feature (which is actually a re-calculation of the full forward pass with intervention on the MLP module), we observe that sometimes the feature might have new predecessors, for example, on the attention module. This is unexpected since the MLP module actually comes after the attention module, but the presence of such groups is not so strong, so we think of it as sporadic behavior of internal computations.
|
| 595 |
+
|
| 596 |
+
We must take into account that there may be other causal relations for some feature to appear, for instance, interaction between different tokens on the attention module, different features, different modules, or even different layers. Furthermore, the appearance of a feature means a certain structure of the hidden state, and this structure was built by many previous layers where information was somehow encoded in a complex way by the interaction of many different components and
|
| 597 |
+
|
| 598 |
+

|
| 599 |
+
Figure 16. From each flow graph, we select features on a particular layer $l$ and perform steering with the four different strategies. Bars represent the best result for each layer among all scores $s$ . In some cases, steering on a layer other than 12 may improve results.
|
| 600 |
+
|
| 601 |
+
features. This is like an optimization process in a non-convex scenario, which may converge to some local minima with certain properties, and the information processing inside the model may converge to a certain structure of hidden states with certain semantics contained in it.
|
| 602 |
+
|
| 603 |
+
Therefore, in an ideal situation, to really deactivate some feature, we must somehow influence the hidden state to behave as if there never had been such a feature, its evolutionary ancestors, or any other causal predecessors, and they had never been involved in information processing. Our current steering procedure works in a "neighborhood" of some local hidden state "minima", but efficient deactivation consists of changing the convergence direction toward another hidden state "minima" at an early stage of computations. This most likely also applies to the activation of some feature.
|
| 604 |
+
|
| 605 |
+
# C.3. Model steering
|
| 606 |
+
|
| 607 |
+
We also measure the effect of steering on different layers. The best result among all available $s$ is shown in Figure 16. Note that single is a per-layer method, while the others are cumulative. We see that different layers perform differently, and while the initial features were located at the 12th layer, sometimes the best layer is located elsewhere.
|
| 608 |
+
|
| 609 |
+
We also have performed a small experiment to test the activation of another theme with many flow graphs using the same prompt as in the deactivation case. We start with the features described in Table 4 and build flow graphs from them. Then we manually choose some of the subgraphs based on semantic considerations and threshold values. The total amount of features selected on different layers is presented in Figure 15(a). After that, we steer the resulting features with manually obtained $s = 8$ and $\alpha = -0.05$ for the single-layer case, and $s = 3$ and $\alpha = -0.25$ with the exponential decrease method for the cumulative setting.
|
| 610 |
+
|
| 611 |
+
By using our method, we found influential features on the 5th layer that gave us the best result among all other layers (Figure 17(b)), while none of the initially found features were placed on that layer. However, we did not tune the hyperparameters properly, so there may be room for another conclusion.
|
| 612 |
+
|
| 613 |
+
# C.4. Comparison with Pearson Correlation Baseline
|
| 614 |
+
|
| 615 |
+
While data-driven methods provide useful insights, they face challenges with sparse SAEs and low-frequency features. Our data-free approach overcomes these limitations through adjustable top-k matching, particularly advantageous in sparse activation regimes.
|
| 616 |
+
|
| 617 |
+
We evaluated Pearson correlations on 100K non-special tokens from FineWeb's "default" subset for features in Gemma Scope's even layers and all layers of Pythia-70M-Deduped and GPT-2. Using an expanded sample size of 500 (Appendix A), we identified feature groups. Figure 18 presents results for the Gemma model.
|
| 618 |
+
|
| 619 |
+
<table><tr><td>Feature index</td><td>Interpretation from Neuronpedia</td></tr><tr><td>12/res/6778</td><td>references to testing and experimentation processes</td></tr><tr><td>16/res/13806</td><td>references to experimental studies and methodologies</td></tr><tr><td>18/res/1056</td><td>references to experiments and experimental protocols</td></tr><tr><td>18/res/7505</td><td>terms and phrases related to research activities and methodologies</td></tr><tr><td>23/res/10746</td><td>terms related to modeling and model-building in scientific contexts</td></tr><tr><td>24/res/11794</td><td>terms and phrases related to scientific reasoning and methodology</td></tr><tr><td>24/res/1027</td><td>concerns related to study validity and bias in research methodologies</td></tr><tr><td>24/res/7391</td><td>phrases related to inquiry and questioning</td></tr><tr><td>24/res/1714</td><td>references to academic studies and their outcomes</td></tr><tr><td>25/res/6821</td><td>terms related to experimental methods and results in scientific research</td></tr></table>
|
| 620 |
+
|
| 621 |
+
Table 4. Features initially chosen for activation of "Research methodology and experimentation" theme.
|
| 622 |
+
|
| 623 |
+

|
| 624 |
+
(a)
|
| 625 |
+
|
| 626 |
+

|
| 627 |
+
(b)
|
| 628 |
+
|
| 629 |
+

|
| 630 |
+
|
| 631 |
+

|
| 632 |
+
Figure 17. (a) Amount of features selected for activation of "Research methodology and experimentation" theme. Vertical lines represent the placement of the initially selected features. (b) Results for steering of selected features. Score is a total metric measured as Behavioral $\times$ Cumulative. We can see that despite none of the initial features being placed on the 5th layer, it gives us the best result.
|
| 633 |
+
|
| 634 |
+

|
| 635 |
+
|
| 636 |
+

|
| 637 |
+
|
| 638 |
+

|
| 639 |
+
Figure 18. Feature group identification comparison (Section 5.1) between $\mathrm{top}_1$ cosine similarity and Pearson correlation. While correlation better captures predecessors with under-trained embeddings, it exhibits stronger dataset dependence and sparsity sensitivity.
|
| 640 |
+
|
| 641 |
+

|
| 642 |
+
|
| 643 |
+

|
| 644 |
+
|
| 645 |
+
Correlation-based matching reduced the "From nowhere" group presence and improves predecessor identification on attention module, though potential misalignment between our attention SAEs and Gemma Scope's residual/MLP SAEs may affect quality. Results aligned closely with Llama Scope for Pythia (showing clearer attention features), while GPT-2 displayed increasing "From nowhere" presence in later layers.
|
| 646 |
+
|
| 647 |
+
The correlation method failed to consistently outperform top<sub>1</sub> cosine similarity, particularly on out-of-distribution Python code. Strong agreement emerged between methods for Gemma Scope and GPT-2 residual SAEs, but weaker alignment occurred for module-based SAEs, consistent with prior feature propagation studies.
|
| 648 |
+
|
| 649 |
+

|
| 650 |
+
(a)
|
| 651 |
+
|
| 652 |
+

|
| 653 |
+
(b)
|
| 654 |
+
|
| 655 |
+

|
| 656 |
+
|
| 657 |
+

|
| 658 |
+
(c)
|
| 659 |
+
|
| 660 |
+

|
| 661 |
+
|
| 662 |
+

|
| 663 |
+
(d)
|
| 664 |
+
Figure 19. (a) Distribution of groups for Llama Scope. We observe a clear distinction from Gemma Scope results (Figure 12(a)) due to a much smoother distribution. This may be a consequence of various factors: the architecture of the models or SAEs, the training procedure, differences in data distribution, etc. (b) Distribution of groups across multiple layers. We observe approximately the same pattern as for Gemma Scope (Figure 5), indicating shared properties between the models. (c) Distribution of scores for different groups. We see that the groups are slightly less distinct from each other compared to the case of Gemma Scope (Figure 12(b)), but they are still present. This is also reflected in (d) the separability of different groups based on their cosine similarity relations.
|
| 665 |
+
|
| 666 |
+
# D. Experiments with Llama Scope
|
| 667 |
+
|
| 668 |
+
We have also used the Llama Scope SAE pack (He et al., 2024) to evaluate our proposed approach and have found that it is well aligned with the results we observe for Gemma Scope. However, we did not perform a steering experiment or graph building, and we consider it as one of the future study directions. For these SAEs, the main picture remains the same.
|
| 669 |
+
|
| 670 |
+
First, they have a more uniform distribution of feature groups, with a clear prevalence of attention features (Figure 19(a)). This indicates that our attention SAEs for Gemma were perhaps not trained well enough. We suspect that experiments with other models will show that Llama Scope results are more accurate with respect to predecessors distribution.
|
| 671 |
+
|
| 672 |
+
Second, despite the uniformity, we observe that Llama Scope groups are slightly harder to separate from each other in terms of similarity scores (Figures 19(c) and 19(d)), which may also be the consequence of the different architecture of the model itself or because these SAEs initially were trained with the TopK activation function.
|
| 673 |
+
|
| 674 |
+
Third, the dynamics of the group distribution is slightly different (Figure 19(b)), but the overall pattern (with a three-part separation and an increase of "From RES" in the latter layers) and overall percentage is still approximately the same. Perhaps we may interpret this similarity between Llama Scope and Gemma Scope as an argument for the validity of our analysis; however, it still requires experimentation with other architectures and sizes.
|
| 675 |
+
|
| 676 |
+

|
| 677 |
+
Figure 20. Flow graph for the 12/res/14455 feature. As reported in Chalnev et al. (2024), steering of that feature might produce themes related to fashion, and we clearly observe that our flow graph captures this semantics in the earlier layers.
|
| 678 |
+
|
| 679 |
+
# E. Examples of flow graphs
|
| 680 |
+
|
| 681 |
+
In this section, we describe some of the interesting flow graphs we have found. For simplicity, we denote each feature as "layer index / module / feature index".
|
| 682 |
+
|
| 683 |
+
Particle physics graph. We start with the graph presented in Figure 2 that was built from feature 24/res/14548. Once we obtain it, we might explore how its semantics evolved across different layers. The full list of features with interpretations that belong to this graph is presented in Table 5.
|
| 684 |
+
|
| 685 |
+
From the first to the sixth layers, we have semantics mainly related to experiments and abstract particle physics. Then we have feature 7/res/16335 with the following scores: $s^{(M)} = 0.82$ for 7/mlp/6110, with semantics related to datasets and measurements, and $s^{(R)} = 0.3$ for 6/res/2452 with semantics about Dark Matter. After this, the semantic flow has a tighter connection to measurement and observation-related themes, while maintaining the quantum physics semantics.
|
| 686 |
+
|
| 687 |
+
We hypothesize the following relation: initially, the flow graph was related to science and experiment, and on the 7th layer it was transformed in a way that 7/mlp/6110 introduced a slightly new semantics to the already existing one, perhaps also replacing the vague "experimentation" theme. Thus, we think of this interaction as an example of a linear circuit, and feature 7/res/16335 falls into the processed category.
|
| 688 |
+
|
| 689 |
+
After the 7th layer, we observe a slight strengthening of particle physics semantics, perhaps because of some other interactions, while also introducing the bosons theme. From this layer, $s^{(R)}$ is large and $s^{(M)}$ is small. On the 17th layer, we encounter feature 17/res/8130 with $s^{(R)} = 0.48$ and $s^{(M)} = 0.79$ for 16/res/10649 and 17/mlp/8454, respectively. The MLP feature relates to gauge theories and theoretical matters, and the feature 17/res/8130 drifts toward gauge bosons and their interaction theme. We also hypothesize that at this particular point, the feature from MLP added new information to the already existing one; therefore, 17/res/8130 is also a processed feature.
|
| 690 |
+
|
| 691 |
+
After this, the semantic meaning sticks more to the Standard Model and particle interaction, but with less practical (such as measurements and data) and more theoretical aspects. We can also see that MLP features on layers from 20 to 24 are more related to theoretical aspects than their residual matches.
|
| 692 |
+
|
| 693 |
+
London graph. An interesting observation was made in Chalnev et al. (2024): steering feature 12/res/14455 with interpretation "mentions of London and its associated contexts" with a large steering coefficient led to the generation of a theme related to fashion, design, and exhibition. If we build the flow graph from this feature, we observe that in the first half it clearly has fashion-related semantics (Figure 20). This indicates that feature 12/res/14455 contains the semantics of its evolutionary predecessors. We also see feature 17/res/9260 with references to conferences (followed by feature 18/res/2010 with the same semantics), which relates to shows and exhibitions mentioned in Chalnev et al. (2024). Perhaps we might interpret this particular flow graph as "references to fashion and design exhibitions performed in London".
|
| 694 |
+
|
| 695 |
+

|
| 696 |
+
Figure 21. Flow graph for the 12/res/4230 feature. In this case, we observe that the second half of the model is closely related to wedding and marriage ceremonies. We believe that the "official" aspect in the interpretation of features in earlier layers is closely related to the fact that wedding ceremonies and marriage are themselves official procedures—the registration of a specific type of interpersonal relationship.
|
| 697 |
+
|
| 698 |
+

|
| 699 |
+
Figure 22. Two SAEs with a learned transition matrix $T$ can be seen as a transcoder from layer $t$ to layer $t + 1$ .
|
| 700 |
+
|
| 701 |
+
Wedding and marriage graph. We have observed in our experiments that steering feature 12/res/4230 with interpretation "terms related to weddings and marriage ceremonies" indeed increases the presence of ceremony-related tokens in a wedding context. If we obtain a flow graph for that feature, we see that it begins with themes related to official meetings and agreements, suggesting that the "ceremony" part of the flow graph interpretation may arise from this official context.
|
| 702 |
+
|
| 703 |
+
We conclude that these flow graphs may be used not only for interpretation and understanding of feature evolution, but they can also explain the outcomes of certain steering procedures.
|
| 704 |
+
|
| 705 |
+
# F. Similarity between Matching and Transcoders
|
| 706 |
+
|
| 707 |
+
Dunefsky et al. (2024) proposed using transcoders to study computational graphs, and Balagansky et al. (2024) proposed using a permutation $\mathbf{P}$ to find matching features across layers. In this section, we study the similarity between these two methods. Similarly to Balagansky et al. (2024), we chose explained variance as a metric to measure the quality of the translayer transcoder. See Figure 22 for the schematic overview of the transcoders obtained by transition mapping $\mathbf{T}^{t\rightarrow t + 1}$ .
|
| 708 |
+
|
| 709 |
+
Setup. We use SAE trained on the residual stream after layers 14 and 15. We vary the methodology to find and apply the transition $\mathbf{T}$ . In our cases, we consider only a linear map so that $\mathbf{T} \in \mathbb{R}^{|\mathcal{F}| \times |\mathcal{F}|}$ .
|
| 710 |
+
|
| 711 |
+
First, we study how folding proposed in Balagansky et al. (2024) affects final transition performance. Results are presented in Figure 23. From these results, we conclude that folding is useful in the inference case to match different scales of activations across layers; in contrast, it has almost no effect on finding permutations, with the exceptional case of incorporating $b_{enc}$ to find permutations. Notably, the baseline with a simple approach of finding cosine similarity outperforms permutations.
|
| 712 |
+
|
| 713 |
+
Second, we compare cosine similarity with other methods to obtain the transition map $\mathbf{T}$ . Instead of relying on a matrix containing 0 and 1, we use the top $_k$ operator. Results are presented in Figure 24. Interestingly, folded $\mathrm{top}_2 W_{dec}^{(14)\top} W_{dec}^{(15)}$ outperforms the permutation baseline; however, cosine similarity $(\mathbf{I}_{x > 0} \operatorname{top}_1 W_{dec}^{(14)\top} W_{dec}^{(15)})$ performs best.
|
| 714 |
+
|
| 715 |
+

|
| 716 |
+
Figure 23. Explained variance of the various permutation variants. $(\mathbf{I}_{x > 0}$ top ${}_1W_{\mathrm{dec}}^{(14)\top}W_{\mathrm{dec}}^{(15)})$ performs best. See Appendix F for more details.
|
| 717 |
+
|
| 718 |
+
Cosine similarity between decoders' vectors
|
| 719 |
+
|
| 720 |
+

|
| 721 |
+
Figure 24. Comparison of various $k$ in $\mathrm{top}_k$ operator and different weights of the SAE. Cosine similarity $(\mathbf{I}_{x > 0}$ top ${}_{1}W_{\mathrm{dec}}^{(14)\top}W_{\mathrm{dec}}^{(15)})$ performs best. See Appendix F for more details.
|
| 722 |
+
|
| 723 |
+
<table><tr><td>Layer</td><td>Feature index</td><td>Interpretation</td></tr><tr><td rowspan="2">0</td><td>0/mlp/12987</td><td>punctuation, particularly quotation marks and dialogue indicators</td></tr><tr><td>0/res/14403</td><td>elements that indicate neglect or care in familial relationships</td></tr><tr><td rowspan="2">1</td><td>1/mlp/16168</td><td>mentions of astronomical phenomena and their characteristics</td></tr><tr><td>1/res/13755</td><td>metaphorical language and scientific terminologies related to variables and coefficients</td></tr><tr><td rowspan="5"></td><td>2/res/12939</td><td>numerical data or metrics related to surveys and observations</td></tr><tr><td>3/res/16138</td><td>scientific terminology related to study results and causes</td></tr><tr><td>4/res/11935</td><td>terms related to particle physics and their interactions</td></tr><tr><td>5/res/14558</td><td>numeric or symbolic representations related to mathematical notation or scientific data</td></tr><tr><td>6/res/2452</td><td>key terms related to Dark Matter detection and experimental setups</td></tr><tr><td rowspan="2">7</td><td>7/mlp/6110</td><td>terms related to datasets and classification in statistical or machine learning contexts</td></tr><tr><td>7/res/16335</td><td>technical terminologies related to particle physics measurements</td></tr><tr><td rowspan="9"></td><td>8/res/9666</td><td>scientific measurements and data related to particle physics</td></tr><tr><td>9/res/8318</td><td>references to particle physics concepts and measurements</td></tr><tr><td>10/res/13754</td><td>technical terms and measurements related to particle physics</td></tr><tr><td>11/res/7614</td><td>terms related to particle physics and specifically the properties of W and Z bosons</td></tr><tr><td>12/res/2812</td><td>statistical terms and measurements associated with quark interactions</td></tr><tr><td>13/res/4955</td><td>terms and concepts related to particle physics experiments and measurements...</td></tr><tr><td>14/res/5262</td><td>keywords related to particle physics, specifically concerning quarks and their properties</td></tr><tr><td>15/res/9388</td><td>concepts related to particle physics measurements and events</td></tr><tr><td>16/res/10649</td><td>complex scientific terms and metrics related to particle physics experiments</td></tr><tr><td rowspan="2">17</td><td>17/mlp/8454</td><td>theoretical concepts and key terms related to physics and gauge theories</td></tr><tr><td>17/res/8130</td><td>terms related to gauge bosons and their interactions within the context of particle physics</td></tr><tr><td rowspan="2"></td><td>18/res/11987</td><td>technical and scientific terminology related to particle physics</td></tr><tr><td>19/res/15694</td><td>references to scientific measurements and results related to particle physics...</td></tr><tr><td rowspan="2">20</td><td>20/mlp/601</td><td>terms associated with quantum mechanics and transformations</td></tr><tr><td>20/res/12523</td><td>terms and concepts related to particle physics and the Standard Model</td></tr><tr><td rowspan="2">21</td><td>21/mlp/594</td><td>technical terminology and classifications related to data or performance metrics</td></tr><tr><td>21/res/14511</td><td>scientific terminology and concepts related to fundamental physics...</td></tr><tr><td rowspan="2">22</td><td>22/mlp/14728</td><td>references to gauge symmetries in theoretical physics</td></tr><tr><td>22/res/11460</td><td>terms and concepts related to particle physics and theoretical frameworks</td></tr><tr><td rowspan="2">23</td><td>23/mlp/6936</td><td>terms related to theoretical physics and particle interactions</td></tr><tr><td>23/res/9592</td><td>terms related to particle physics and their interactions</td></tr><tr><td rowspan="2">24</td><td>24/mlp/11342</td><td>terms and concepts related to theoretical physics and particle interactions</td></tr><tr><td>24/res/14548</td><td>terms and references related to particle physics and standard model parameters</td></tr><tr><td></td><td>25/res/1646</td><td>technical terms and measurements related to particle physics and the Standard Model</td></tr></table>
|
| 724 |
+
|
| 725 |
+
Table 5. Graph built from 24/res/14548 feature with MLP features dropped by threshold $t^{(M)} = 0.25$
|
2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:923c550acf3735b5b65af34b4488bbf100426616436c12d777cc5b725bc5c103
|
| 3 |
+
size 1690239
|
2025/Analyze Feature Flow to Enhance Interpretation and Steering in Language Models/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/2350d3e1-6905-4f55-8805-079a64ed171d_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/2350d3e1-6905-4f55-8805-079a64ed171d_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/2350d3e1-6905-4f55-8805-079a64ed171d_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b2698e7e59ef8c9072ac71089ed9b572aa66f001863abe0b7c315dd3b283ead3
|
| 3 |
+
size 16398013
|
2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/full.md
ADDED
|
@@ -0,0 +1,1011 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Angle Domain Guidance: Latent Diffusion Requires Rotation Rather Than Extrapolation
|
| 2 |
+
|
| 3 |
+
Cheng Jin<sup>1</sup> Zhenyu Xiao<sup>*1</sup> Chutao Liu<sup>*2</sup> Yuantao Gu<sup>1</sup>
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Classifier-free guidance (CFG) has emerged as a pivotal advancement in text-to-image latent diffusion models, establishing itself as a cornerstone technique for achieving high-quality image synthesis. However, under high guidance weights, where text-image alignment is significantly enhanced, CFG also leads to pronounced color distortions in the generated images. We identify that these distortions stem from the amplification of sample norms in the latent space. We present a theoretical framework that elucidates the mechanisms of norm amplification and anomalous diffusion phenomena induced by classifier-free guidance. Leveraging our theoretical insights and the latent space structure, we propose an Angle Domain Guidance (ADG) algorithm. ADG constrains magnitude variations while optimizing angular alignment, thereby mitigating color distortions while preserving the enhanced text-image alignment achieved at higher guidance weights. Experimental results demonstrate that ADG significantly outperforms existing methods, generating images that not only maintain superior text alignment but also exhibit improved color fidelity and better alignment with human perceptual preferences.
|
| 8 |
+
|
| 9 |
+
# 1. Introduction
|
| 10 |
+
|
| 11 |
+
The Stable Diffusion series (Rombach et al., 2022; Esser et al., 2024), along with other latent-diffusion-based generative models (Ramesh et al., 2022; Labs, 2024), has revolutionized text-to-image generation and related downstream tasks (Zhang et al., 2023; Zhao et al., 2024; Zhang et al.,
|
| 12 |
+
|
| 13 |
+
*Equal contribution ${}^{1}$ Department of Electronic Engineering, Tsinghua University, Beijing, China ${}^{2}$ Zhili College, Tsinghua University, Beijing, China. Correspondence to: Yuantao Gu <gyt@tsinghua.edu.cn>.
|
| 14 |
+
|
| 15 |
+
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 16 |
+
|
| 17 |
+
2024). These models operate by performing diffusion in the latent space, which is then decoded into the image space, effectively transforming textual descriptions into high-quality images with intricate details and compelling visual effects. A key component of this process is the Classifier-Free Guidance (CFG) mechanism (Ho & Salimans, 2021), which enhances generation quality through linear extrapolation of the conditional score function with a guidance weight.
|
| 18 |
+
|
| 19 |
+
Despite its effectiveness, CFG introduces several challenges. Research has shown that increasing the guidance weight improves text alignment but at the cost of reduced sample diversity (Ho & Salimans, 2021). More critically, when the guidance weight surpasses a certain threshold, the quality of the generated images deteriorates significantly, leading to a loss of detail and overall visual degradation. Theoretically, this phenomenon may be attributed to the non-commutativity between the tilting process, driven by the conditional likelihood, and the noise addition process (Wu et al., 2024; Chidambaram et al., 2024). This non-commutativity results in a deviation of the CFG-generated samples from the target distribution, manifesting as performance degradation, particularly at high guidance weights.
|
| 20 |
+
|
| 21 |
+
Several approaches have been proposed to mitigate these issues. Techniques such as variable weighting schemes and additional Langevin sampling iterations have been introduced to counteract the decline in image quality (Chung et al., 2025; Xia et al., 2024; Bradley & Nakkiran, 2024; Sadat et al., 2025). While these methods have shown some efficacy in reducing quality degradation for specific tasks, they remain constrained by their reliance on a linear combination of conditional score functions. This linear framework limits their ability to maintain generation quality, highlighting the need for a more comprehensive solution.
|
| 22 |
+
|
| 23 |
+
In this paper, we first observe that higher guidance weights are associated with larger sample norms in latent space, leading to high image saturation and color distortion. We then provide a theoretical analysis of the CFG mechanism, demonstrating that the linear extrapolation of the score function inevitably causes norm amplification and anomalous diffusion behavior. Building on this analysis, we propose an Angle Domain Guidance (ADG) algorithm, inspired by the high-dimensional Gaussian assumption in latent space
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
|
| 27 |
+

|
| 28 |
+
|
| 29 |
+

|
| 30 |
+
Figure 1. Comparison of ADG and CFG using the same random seed with the prompt "A bathroom with a toilet and a bathtub." At low guidance weights, ADG accurately aligns with the prompt, while CFG fails to do so. At high guidance weights, ADG remains stable, whereas CFG suffers from abnormal saturation and color distortion.
|
| 31 |
+
|
| 32 |
+

|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
|
| 36 |
+
inherent in variational autoencoders. The ADG algorithm transforms the score function into an expectation over a time-dependent distribution, which is then enhanced in the angular domain before being re-mapped back into the score function for diffusion. Experimental results on the COCO dataset demonstrate that the ADG algorithm outperforms the baseline, particularly in generating images that are better aligned with textual descriptions, underscoring its potential to overcome the limitations of existing methods. The implementation is available at github.com/jinc7461/ADG.
|
| 37 |
+
|
| 38 |
+
# 2. Background
|
| 39 |
+
|
| 40 |
+
# 2.1. Conditional Diffusion Model
|
| 41 |
+
|
| 42 |
+
Diffusion models are composed of two fundamental processes: a forward process that gradually transforms the target distribution into Gaussian noise, and a reverse process that reconstructs the target distribution from the noise distribution (Song et al., 2021b). The forward process is governed by the following stochastic differential equation (SDE):
|
| 43 |
+
|
| 44 |
+
$$
|
| 45 |
+
\mathrm {d} \boldsymbol {x} _ {t} = \boldsymbol {f} (\boldsymbol {x} _ {t}, t) \mathrm {d} t + g (t) \mathrm {d} \boldsymbol {w}, \quad \boldsymbol {x} _ {0} \sim p _ {0} (\cdot | c), \tag {1}
|
| 46 |
+
$$
|
| 47 |
+
|
| 48 |
+
where $\boldsymbol{w}$ denotes the Wiener process, and $p_0(\cdot |c)$ represents the conditional target distribution, with $c$ denoting a condition (such as text in text-to-image models). Specifically, $p_0(\cdot |\emptyset)$ represents the unconditional distribution.
|
| 49 |
+
|
| 50 |
+
In this work, we adopt the widely used Variance Preserving (VP) SDE (Song et al., 2021b) for the forward process:
|
| 51 |
+
|
| 52 |
+
$$
|
| 53 |
+
\mathrm {d} \boldsymbol {x} _ {t} = - \frac {\beta (t)}{2} \boldsymbol {x} _ {t} \mathrm {d} t + \sqrt {\beta (t)} \mathrm {d} \boldsymbol {w}, \quad \boldsymbol {x} _ {0} \sim p _ {0} (\cdot | \boldsymbol {c}), \tag {2}
|
| 54 |
+
$$
|
| 55 |
+
|
| 56 |
+
where the dynamics ensure that $p_T$ approximates a standard Gaussian distribution for sufficiently large $T$ . The transition distribution of $\boldsymbol{x}_t$ conditioned on $\boldsymbol{x}_0$ is given by:
|
| 57 |
+
|
| 58 |
+
$$
|
| 59 |
+
\left. \boldsymbol {x} _ {t} \right| \boldsymbol {x} _ {0} \sim \mathcal {N} \left(\sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0}, \bar {\beta} _ {t} \mathbf {I}\right), \tag {3}
|
| 60 |
+
$$
|
| 61 |
+
|
| 62 |
+
where $\bar{\alpha}_t = \exp \left(\int_0^t -\beta (\tau)\mathrm{d}\tau\right)$ and $\bar{\beta}_t = 1 - \bar{\alpha}_t$
|
| 63 |
+
|
| 64 |
+
The reverse process, which reconstructs the target distribution, corresponds to the time-reversed SDE:
|
| 65 |
+
|
| 66 |
+
$$
|
| 67 |
+
\mathrm {d} \tilde {\boldsymbol {x}} _ {t} = \left[ - \frac {\beta (t)}{2} \tilde {\boldsymbol {x}} _ {t} - \beta (t) \nabla_ {\tilde {\boldsymbol {x}} _ {t}} \log p _ {t} (\tilde {\boldsymbol {x}} _ {t} | \boldsymbol {c}) \right] \mathrm {d} t + \sqrt {\beta (t)} \mathrm {d} \tilde {\boldsymbol {w}}, \tag {4}
|
| 68 |
+
$$
|
| 69 |
+
|
| 70 |
+
where $\tilde{\boldsymbol{w}}$ represents the reverse Wiener process, $p_t$ is the distribution of $\boldsymbol{x}_t$ in (2), and $\nabla \log p_t$ is referred to as the
|
| 71 |
+
|
| 72 |
+
score function. Alternatively, the sampling process can be described by the following reverse-time ordinary differential equation (ODE):
|
| 73 |
+
|
| 74 |
+
$$
|
| 75 |
+
\mathrm {d} \bar {\boldsymbol {x}} _ {t} = \left[ - \frac {\beta (t)}{2} \bar {\boldsymbol {x}} _ {t} - \frac {\beta (t)}{2} \nabla_ {\bar {\boldsymbol {x}} _ {t}} \log p _ {t} (\bar {\boldsymbol {x}} _ {t} | \boldsymbol {c}) \right] \mathrm {d} t, \tag {5}
|
| 76 |
+
$$
|
| 77 |
+
|
| 78 |
+
which eliminates the stochastic noise sampling during the process, making it more commonly used in practice.
|
| 79 |
+
|
| 80 |
+
According to classical results from probability theory (Anderson, 1982), if the reverse-time process—either SDE or ODE—is initialized with $q_{T} = p_{T}$ , then the marginal distributions match at all times, i.e., $q_{t} = p_{t}$ for all $t \in [0,T]$ . Consequently, if it is possible to sample from $p_{T}$ and obtain the score function $\nabla_{\pmb{x}} \log p_t(\pmb{x}|c)$ for different times $t$ , one can generate samples from the target distribution $p_0$ by discretizing either (4) or (5).
|
| 81 |
+
|
| 82 |
+
Since the score function $\nabla_{\pmb{x}}\log p_t(\pmb {x}|c)$ is generally intractable and $p_T$ is approximated as a standard Gaussian distribution, practical first-order discretization methods for (4) and (5) correspond to the DDPM sampler (Ho et al., 2020) and DDIM sampler (Song et al., 2021a), respectively:
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array}{l} \boldsymbol {x} _ {t - \Delta t} = \sqrt {\frac {\bar {\alpha} _ {t - \Delta t}}{\bar {\alpha} _ {t}}} \boldsymbol {x} _ {t} + \left(1 - \frac {\bar {\alpha} _ {t}}{\bar {\alpha} _ {t - \Delta t}}\right) \boldsymbol {s} _ {\theta} (\boldsymbol {x} _ {t}, t, \boldsymbol {c}) \\ + \sqrt {1 - \frac {\bar {\alpha} _ {t}}{\bar {\alpha} _ {t - \Delta t}}} \boldsymbol {\eta}, \tag {6} \\ \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
$$
|
| 89 |
+
\boldsymbol {x} _ {t - \Delta t} = \sqrt {\frac {\bar {\alpha} _ {t - \Delta t}}{\bar {\alpha} _ {t}}} \boldsymbol {x} _ {t} + \frac {1}{2} \left(1 - \frac {\bar {\alpha} _ {t}}{\bar {\alpha} _ {t - \Delta t}}\right) \boldsymbol {s} _ {\theta} (\boldsymbol {x} _ {t}, t, c), \tag {7}
|
| 90 |
+
$$
|
| 91 |
+
|
| 92 |
+
where $s_{\theta}(\pmb{x}_t,t,\pmb{c})$ is a neural network trained to approximate the score function, $\pmb{\eta} \sim \mathcal{N}(\mathbf{0},\mathbf{I})$ , and $\pmb{x}_T \sim \mathcal{N}(\mathbf{0},\mathbf{I})$ .
|
| 93 |
+
|
| 94 |
+
To enhance the stability of neural network training, in practice, the network is trained to approximate $-\sqrt{\beta_t}\nabla \log p_t$ by $\epsilon_{\theta}$ , rather than directly approximating $\nabla \log p_t$ by $s_{\theta}$ . This approach mitigates numerical instabilities and improves convergence during training.
|
| 95 |
+
|
| 96 |
+
# 2.2. Classifier-Free Guidance
|
| 97 |
+
|
| 98 |
+
While the theoretical foundations of vanilla conditional sampling based on diffusion models are well-established, directly using (4) or (5) for generation often results in low-quality outputs (Ho & Salimans, 2021). To address this limitation, the Classifier-Free Guidance (CFG) technique was introduced. CFG aims to sample from a modified distribution $p_{0,\omega}(\boldsymbol{x}) \propto p_0(\boldsymbol{x})p^\omega (\boldsymbol{c}|\boldsymbol{x})$ , which represents the unconditional data distribution tilted by the conditional likelihood. Using Bayes' theorem, this distribution can be reformulated as:
|
| 99 |
+
|
| 100 |
+
$$
|
| 101 |
+
p _ {0, \omega} (\pmb {x}) \propto p _ {0} ^ {1 - \omega} (\pmb {x}) p _ {0} ^ {\omega} (\pmb {x} | \pmb {c}),
|
| 102 |
+
$$
|
| 103 |
+
|
| 104 |
+
and the gradient of the log-probability becomes:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\nabla \log p _ {0, \omega} (\boldsymbol {x}) = (1 - \omega) \nabla \log p _ {0} (\boldsymbol {x}) + \omega \nabla \log p _ {0} (\boldsymbol {x} | \boldsymbol {c}).
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
Inspired by this formulation, the Classifier-Free Guidance (CFG) method replaces the score function $\nabla_{\bar{\mathbf{x}}_t}\log p_t(\bar{\mathbf{x}}_t|\mathbf{c})$ with a weighted combination of the unconditional and conditional score functions, denoted as $s_{\mathrm{cfg},\omega}(\bar{\mathbf{x}}_t,t,\mathbf{c})$ , defined as:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\begin{array}{l} \mathbf {s} _ {\mathrm {c f g}, \omega} (\bar {\boldsymbol {x}} _ {t}, t, \boldsymbol {c}) = (1 - \omega) \nabla_ {\bar {\boldsymbol {x}} _ {t}} \log p _ {t} (\bar {\boldsymbol {x}} _ {t} | \emptyset) \\ + \omega \nabla_ {\bar {x} _ {t}} \log p _ {t} (\bar {x} _ {t} | c), \tag {8} \\ \end{array}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
in the reverse process. For the ODE sampler, this process can be expressed as:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\mathrm {d} \bar {\boldsymbol {x}} _ {t} = \left[ - \bar {\boldsymbol {x}} _ {t} - \boldsymbol {s} _ {\text {c f g}, \omega} (\bar {\boldsymbol {x}} _ {t}, t, \boldsymbol {c}) \right] \mathrm {d} t. \tag {9}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
In the above equation, $\omega$ , referred to as the guidance weight, quantifies the strength of the tilting toward the conditional distribution which is always bigger than 1. However, due to the non-commutativity of the tilting process with the forward process, for any $t > 0$
|
| 123 |
+
|
| 124 |
+
$$
|
| 125 |
+
\nabla \log p _ {t, \omega} (\boldsymbol {x}) \neq \boldsymbol {s} _ {\mathrm {c f g}, \omega} (\boldsymbol {x}, t, \boldsymbol {c}), \tag {10}
|
| 126 |
+
$$
|
| 127 |
+
|
| 128 |
+
where $p_{t,\omega}(\boldsymbol{x})$ is the distribution of $\boldsymbol{x}_t$ in (2) with $p_0(\cdot|\boldsymbol{c})$ replaced by $p_{t,\omega}$ . This discrepancy implies that CFG does not strictly correspond to a sampling process targeting $p_0,\omega$ as the true target distribution.
|
| 129 |
+
|
| 130 |
+
# 3. Revisiting Classifier-Free Guidance
|
| 131 |
+
|
| 132 |
+
# 3.1. Norm Amplification in CFG
|
| 133 |
+
|
| 134 |
+
While Classifier-Free Guidance (CFG) effectively addresses the limitations of vanilla conditional diffusion models, it introduces notable side effects. Specifically, increasing the guidance weight has a significant impact on the generated samples: they exhibit larger $\ell_2$ -norms, and the corresponding decoded images show higher saturation levels, often accompanied by distortion. Figure 2 illustrates this phenomenon, depicting how the $\ell_2$ -norm of $x_0$ varies with changes in the guidance weight, and the relationship between the latent variable norm and image saturation.
|
| 135 |
+
|
| 136 |
+
This phenomenon can be understood through the interplay between the conditional and unconditional distributions. When CFG operates on a conditional probability distribution that aligns with the "surface" of the unconditional distribution, the generated samples tend to deviate further from the overall distribution, resulting in larger norms. To formalize this, we consider the case of a Gaussian mixture model:
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
p _ {0} (\boldsymbol {x}) = \sum_ {c = 1} ^ {C} \pi_ {c} \mathcal {N} (\boldsymbol {x} | \boldsymbol {\mu} _ {c}, \mathbf {I}), \tag {11}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
where $\pi_c$ denotes the mixing coefficient satisfying $\sum_{c=1}^{C} \pi_c = 1$ , and the conditional distribution is given by:
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
p _ {0} (\boldsymbol {x} | c) = \mathcal {N} (\boldsymbol {x} | \boldsymbol {\mu} _ {c}, \mathbf {I}).
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
Definition 3.1 (surface class). A class $c^*$ is a surface class if there exists a hyperplane defined by $\boldsymbol{w}^\top \boldsymbol{x} + b = 0$ such that $\boldsymbol{w}^\top \boldsymbol{\mu}_{c^*} + b = 0$ , and for all $c \neq c^*$ , $(\boldsymbol{w}^\top \boldsymbol{\mu}_c + b) < 0$ , indicating that $\boldsymbol{\mu}_c$ lies strictly on the same side of the hyperplane and $\boldsymbol{w}$ points to the outer side of the uncoditional distribution.
|
| 149 |
+
|
| 150 |
+
We focus on a surface class $c^*$ , defined as a class whose mean $\pmb{\mu}_{c^*}$ lies at a vertex of the polytope formed by $\{\pmb{\mu}_c\}_{c=1}^C$ . This concept is formalized in Definition 3.1.
|
| 151 |
+
|
| 152 |
+

|
| 153 |
+
2.a Latent Variable Norm with Different Guidance Weights
|
| 154 |
+
|
| 155 |
+

|
| 156 |
+
2.b Relationship Between Latent Variable Norm and Image Saturation
|
| 157 |
+
|
| 158 |
+
Figure 2. Average latent variable norm $(\ell_2)$ and image saturation under different guidance weights using CFG with SD3.5 (d=38). Prompts are randomly selected from 100 samples in the COCO dataset. As the guidance weight increases, the norm of the hidden space samples generated by the CFG algorithm increases, which leads to oversaturation of the corresponding images.
|
| 159 |
+
|
| 160 |
+
Samples generated by CFG diffusion (9) are more likely to
|
| 161 |
+
|
| 162 |
+
move toward the outer regions of the distribution compared to samples generated by standard conditional diffusion (5). This tendency is captured in Theorem 3.2, which quantifies the norm amplification effect.
|
| 163 |
+
|
| 164 |
+
Theorem 3.2 (Norm amplification). For the same initial point $\boldsymbol{x}_T$ , let $\hat{\boldsymbol{x}}_0$ denote the sample obtained using the CFG sampler (9), and $\boldsymbol{x}_0$ denote the sample obtained using the ODE sampler (5). Then:
|
| 165 |
+
|
| 166 |
+
$$
|
| 167 |
+
\boldsymbol {w} ^ {\top} \hat {\boldsymbol {x}} _ {0} > \boldsymbol {w} ^ {\top} \boldsymbol {x} _ {0}, \tag {12}
|
| 168 |
+
$$
|
| 169 |
+
|
| 170 |
+
indicating that CFG-sampled points align more strongly with the outer direction defined by $\mathbf{w}$ .
|
| 171 |
+
|
| 172 |
+
The result highlights how CFG encourages samples to move toward outer regions, with their $\ell_2$ -norms growing as the guidance weight increases. Figure 3 visualizes this behavior, showing how samples deviate from the data distribution under different guidance weights.
|
| 173 |
+
|
| 174 |
+
# 3.2. Anomalous Diffusion in CFG
|
| 175 |
+
|
| 176 |
+
Building on Theorem 3.2, we further investigate the geometric and probabilistic properties of CFG sampling in the latent space. Specifically, we define a family of time-dependent latent manifolds $\mathcal{M}_t$ as:
|
| 177 |
+
|
| 178 |
+
$$
|
| 179 |
+
\mathcal {M} _ {t} = \left\{\boldsymbol {x} \mid \boldsymbol {s} _ {\text {c f g}, \omega} ^ {\top} \left(\boldsymbol {x}, t, c ^ {*}\right) \nabla \log p _ {t} \left(\boldsymbol {x} \mid c ^ {*}\right) \leq 0 \right\}. \tag {13}
|
| 180 |
+
$$
|
| 181 |
+
|
| 182 |
+
Regions defined by $\mathcal{M}_t$ exhibit anomalous diffusion, where the update direction of sampled points tends toward areas with lower probability density.
|
| 183 |
+
|
| 184 |
+
Theorem 3.3 (Anomalous diffusion). For the unit normal vector $\pmb{w}$ of the hyperplane in Definition 3.1, there exists a constant $C_1 > 0$ , dependent on $p_0, \omega$ , and $t$ , such that:
|
| 185 |
+
|
| 186 |
+
$$
|
| 187 |
+
\bar {\alpha} _ {t} \boldsymbol {\mu} _ {c ^ {*}} + k \boldsymbol {w} \in \mathcal {M} _ {t}, \quad \forall k \in (0, C _ {1} ]. \tag {14}
|
| 188 |
+
$$
|
| 189 |
+
|
| 190 |
+
Furthermore, the constant $C_1$ increases as the guidance weight $\omega$ becomes larger.
|
| 191 |
+
|
| 192 |
+
Theorem 3.3 establishes that CFG sampling induces anomalous diffusion phenomena within the neighborhood extending beyond the boundaries of the conditional distribution. As the guidance weight $\omega$ increases, the anomalous regions defined by $\mathcal{M}_t$ expand, amplifying the deviation of CFG-generated samples from the original conditional distribution.
|
| 193 |
+
|
| 194 |
+
To provide theoretical insight while maintaining conciseness, we outline the proof of Theorem 3.3. First, we characterize the score function via Lemma 3.4.
|
| 195 |
+
|
| 196 |
+
Lemma 3.4 (Lemma 1 of (Huang et al., 2023)). For any $t \in (0, T]$ , the score function is given by:
|
| 197 |
+
|
| 198 |
+
$$
|
| 199 |
+
\nabla_ {\boldsymbol {x}} \log p _ {t} (\boldsymbol {x} | \boldsymbol {c}) = \frac {\sqrt {\bar {\alpha} _ {t}} \hat {\boldsymbol {x}} _ {0} ^ {(c)} - \boldsymbol {x}}{\bar {\beta} _ {t}}, \tag {15}
|
| 200 |
+
$$
|
| 201 |
+
|
| 202 |
+

|
| 203 |
+
3.a $\omega = 1$
|
| 204 |
+
|
| 205 |
+

|
| 206 |
+
3.b $\omega = 3$
|
| 207 |
+
Figure 3. Generated sample distributions of a four-component Gaussian mixture model under varying guidance weights. True component means are marked, and samples corresponding to surface classes move further from the distribution as $\omega$ increases.
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
3.c $\omega = 5$
|
| 211 |
+
|
| 212 |
+
where
|
| 213 |
+
|
| 214 |
+
$$
|
| 215 |
+
\hat {\boldsymbol {x}} _ {0} ^ {(c)} = \mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {\boldsymbol {c}, t, \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ],
|
| 216 |
+
$$
|
| 217 |
+
|
| 218 |
+
$$
|
| 219 |
+
q _ {\boldsymbol {c}, t, \boldsymbol {x}} (\boldsymbol {x} _ {0}) \propto p _ {0} (\boldsymbol {x} _ {0} | \boldsymbol {c}) \exp \left(- \frac {\| \boldsymbol {x} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0} \| _ {2} ^ {2}}{2 \bar {\beta} _ {t}}\right).
|
| 220 |
+
$$
|
| 221 |
+
|
| 222 |
+
Lemma 3.4 shows that the score function can be characterized by the expectation of the conditional distribution tilted by a time-dependent Gaussian distribution. Using this result, $s_{\mathrm{cfg},\omega}$ can be rewritten as:
|
| 223 |
+
|
| 224 |
+
$$
|
| 225 |
+
\begin{array}{l} \pmb {s} _ {\mathrm {c f g}, \omega} = (\omega - 1) \frac {\bar {\alpha} _ {t} (\hat {\pmb {x}} _ {0} ^ {(c)} - \hat {\pmb {x}} _ {0} ^ {(\emptyset)})}{\bar {\beta} _ {t}} \\ + \frac {\bar {\alpha} _ {t} \hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)} - \boldsymbol {x}}{\bar {\beta} _ {t}}. \tag {16} \\ \end{array}
|
| 226 |
+
$$
|
| 227 |
+
|
| 228 |
+
The distinction between $s_{\mathrm{cfg},\omega}$ and $\nabla_{\pmb{x}}\log p_t(\pmb{x}|c^*)$ lies in the first term of (16). For a point $\pmb{x} = \bar{\alpha}_t\pmb{\mu}_{c^*} + k\pmb{w}$ with sufficiently small $k$ , we find:
|
| 229 |
+
|
| 230 |
+
$$
|
| 231 |
+
\boldsymbol {w} ^ {\top} \left(\hat {\boldsymbol {x}} _ {0} ^ {(c)} - \hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)}\right) > \epsilon , \tag {17}
|
| 232 |
+
$$
|
| 233 |
+
|
| 234 |
+
where $\epsilon > 0$ . Further, noting that $\nabla_{\pmb{x}} \log p_t(\pmb{x} | c^*) = -k \pmb{w}$ , we have:
|
| 235 |
+
|
| 236 |
+
$$
|
| 237 |
+
\boldsymbol {s} _ {\mathrm {c f g}, \omega} ^ {\top} (\boldsymbol {x}, t, c ^ {*}) \nabla \log p _ {t} (\boldsymbol {x} | c ^ {*}) < - \epsilon k + k ^ {2}, \tag {18}
|
| 238 |
+
$$
|
| 239 |
+
|
| 240 |
+
thereby proving the original proposition.
|
| 241 |
+
|
| 242 |
+
From the analysis, it can be seen that the CFG method is equivalent to enhancing $\hat{\pmb{x}}_0^{(c)}$ to $\hat{\pmb{x}}_0^{(c)} + (\omega -1)(\hat{\pmb{x}}_0^{(c)} - \hat{\pmb{x}}_0^{(\emptyset)})$ . While this enhancement effectively amplifies features that align with the target distribution, it unintentionally leads to excessively large norms, causing oversaturation and distortion artifacts when the guidance weight is high.
|
| 243 |
+
|
| 244 |
+
# 4. Angle-Domain Guidance Sampling (ADG)
|
| 245 |
+
|
| 246 |
+
Building upon the insights presented in Section 3, we identify Classifier-Free Guidance (CFG) as an operation that
|
| 247 |
+
|
| 248 |
+
reinforces $\hat{x}_0$ linearly, leading to generated samples with excessively high norms. While CFG effectively captures features aligned with the target distribution, it also inflates sample magnitudes, resulting in oversaturation, artifacts, and unrealistic images at high guidance weights. To mitigate these issues, we propose the Angle-Domain Guidance Sampling (ADG) method, which focuses on the directional alignment of samples with the target while limiting changes in their magnitudes. A simplified version of ADG is provided in Appendix E as Algorithm 8.
|
| 249 |
+
|
| 250 |
+
# 4.1. Motivation for ADG
|
| 251 |
+
|
| 252 |
+
The primary motivation underlying ADG is that the directional information encoded in $\hat{x}_0$ is often sufficient to guide samples toward the target distribution. Latent space diffusion models are typically based on the assumption of a high-dimensional isotropic Gaussian inherent in variational autoencoders (Kingma, 2013), which concentrates around a spherical shell with a fixed radius (Wainwright, 2019). Although due to limitations in network capacity, training data, and other factors, the latent space distribution cannot be fully modeled by a high-dimensional Gaussian, this assumption still offers valuable insights. Specifically, CFG can be seen as enhancing $\hat{x}_0$ in the linear domain, while emphasizing the differences in both the angle and magnitude between $\hat{x}_0^{(c)}$ and $\hat{x}_0^{(\emptyset)}$ . While norm adjustments may marginally improve semantic alignment, excessive norm amplification at high guidance weights becomes detrimental, resulting in oversaturation and distortion. Therefore, ADG shifts the focus to differences in the angular domain, while constraining variations in the magnitude domain.
|
| 253 |
+
|
| 254 |
+
# 4.2. Methodology
|
| 255 |
+
|
| 256 |
+
The proposed ADG algorithm is comprehensively described in Algorithm 1. Figure 5 illustrates the distinct behaviors of $\hat{x}_0$ under ADG compared to CFG, emphasizing the enhanced stability and directional control achieved by ADG.
|
| 257 |
+
|
| 258 |
+

|
| 259 |
+
|
| 260 |
+

|
| 261 |
+
|
| 262 |
+

|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
|
| 266 |
+

|
| 267 |
+
|
| 268 |
+

|
| 269 |
+
|
| 270 |
+

|
| 271 |
+
|
| 272 |
+

|
| 273 |
+
|
| 274 |
+

|
| 275 |
+
|
| 276 |
+

|
| 277 |
+
|
| 278 |
+

|
| 279 |
+
Figure 4. Comparison of generated images using different guidance strategies for the prompt "Part of a small bathroom in need of repair." The rows correspond to different guidance algorithms: ADG (top), CFG (middle), and CFG++ (bottom). The columns represent increasing guidance weights: 2, 4, 6, 8, and 10 (from left to right).
|
| 280 |
+
|
| 281 |
+

|
| 282 |
+
|
| 283 |
+

|
| 284 |
+
|
| 285 |
+

|
| 286 |
+
|
| 287 |
+

|
| 288 |
+
|
| 289 |
+
Unlike CFG, which often leads to exaggerated magnitudes in $\hat{x}_0$ , ADG introduces a refined mechanism that prioritizes alignment with direction. Moreover, Proposition 4.1 formalizes the constraints imposed by ADG on the magnitude of $\hat{x}_0$ . These constraints ensure a balanced trade-off between directional guidance and structural integrity, resulting in improved sample quality.
|
| 290 |
+
|
| 291 |
+
Algorithm 1 Angle-Domain Guidance Sampling (ADG)
|
| 292 |
+
|
| 293 |
+
Require: $\boldsymbol{x}_T \sim \mathcal{N}(0, \mathbf{I}), 1 < \omega \in \mathbb{R}$ , Decoder $\mathcal{D}$
|
| 294 |
+
|
| 295 |
+
for $t = T$ to 1 do
|
| 296 |
+
|
| 297 |
+
$$
|
| 298 |
+
\hat {\boldsymbol {x}} _ {0} ^ {(c)} = (\boldsymbol {x} _ {t} - \sqrt {1 - \bar {\alpha} _ {t}} \epsilon_ {\theta} (\boldsymbol {x}, t, c)) / \sqrt {\bar {\alpha} _ {t}}
|
| 299 |
+
$$
|
| 300 |
+
|
| 301 |
+
$$
|
| 302 |
+
\hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)} = (\boldsymbol {x} _ {t} - \sqrt {1 - \bar {\alpha} _ {t}} \epsilon_ {\theta} (\boldsymbol {x}, t, \emptyset)) / \sqrt {\bar {\alpha} _ {t}}
|
| 303 |
+
$$
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
\gamma = \operatorname {a r c c o s} \left(\frac {(\hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)}) ^ {\top} \hat {\boldsymbol {x}} _ {0} ^ {(c)}}{\| \hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)} \| _ {2} \| \hat {\boldsymbol {x}} _ {0} ^ {(c)} \| _ {2}}\right)
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
$$
|
| 310 |
+
\gamma_ {\omega} = \text {t h r e s h o l d} ((\omega - 1) \gamma , \pi / 3)
|
| 311 |
+
$$
|
| 312 |
+
|
| 313 |
+
$$
|
| 314 |
+
\hat {\boldsymbol {x}} _ {0, \omega} = \cos (\gamma_ {\omega}) \hat {\boldsymbol {x}} _ {0} ^ {(\boldsymbol {c})} + \frac {\sin (\gamma_ {\omega})}{\sin (\gamma)} \left(\hat {\boldsymbol {x}} _ {0} ^ {(\boldsymbol {c})} - \operatorname {p r o j} _ {\hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)}} \left(\hat {\boldsymbol {x}} _ {0} ^ {(\boldsymbol {c})}\right)\right)
|
| 315 |
+
$$
|
| 316 |
+
|
| 317 |
+
$$
|
| 318 |
+
\boldsymbol {x} _ {t - 1} = \sqrt {\bar {\alpha} _ {t - 1}} \hat {\boldsymbol {x}} _ {0, \omega} + \sqrt {1 - \bar {\alpha} _ {t - 1}} \frac {\boldsymbol {x} _ {t} - \bar {\alpha} _ {t} \hat {\boldsymbol {x}} _ {0 , \omega}}{\sqrt {1 - \bar {\alpha} _ {t}}}
|
| 319 |
+
$$
|
| 320 |
+
|
| 321 |
+
end for
|
| 322 |
+
|
| 323 |
+
$$
|
| 324 |
+
I = \mathcal {D} (\boldsymbol {x} _ {0})
|
| 325 |
+
$$
|
| 326 |
+
|
| 327 |
+
Proposition 4.1. For any $t \in (0, T]$ , $\hat{\pmb{x}}_{0,\omega}$ and $\hat{\pmb{x}}_0^{(c)}$ defined
|
| 328 |
+
|
| 329 |
+
in Algorithm 1 satisfy the following property:
|
| 330 |
+
|
| 331 |
+
$$
|
| 332 |
+
\left\| \hat {\boldsymbol {x}} _ {0, \omega} \right\| _ {2} \leq \sqrt {2} \left\| \hat {\boldsymbol {x}} _ {0} ^ {(c)} \right\| _ {2}. \tag {19}
|
| 333 |
+
$$
|
| 334 |
+
|
| 335 |
+
ADG demonstrates remarkable flexibility, making it adaptable to a wide range of sampling frameworks. It is compatible with advanced deterministic samplers, such as DPM-Solver (Lu et al., 2022a;b), as well as stochastic samplers like DDPM. This versatility arises from the fact that all sampling algorithms can be expressed as weighted combinations of $\boldsymbol{x}_t$ , $\hat{\boldsymbol{x}}_0$ , and Gaussian noise. By replacing the original $\hat{\boldsymbol{x}}_0$ with $\hat{\boldsymbol{x}}_{0,\omega}$ derived from ADG, the method seamlessly generalizes across various diffusion-based approaches. Additionally, ADG extends naturally to flow-matching generative models (Lipman et al., 2023), which are mathematically equivalent to diffusion models with some assumptions(Patel et al., 2024). Detailed derivations of ADG's extension to flow-matching models are provided in Appendix F.
|
| 336 |
+
|
| 337 |
+
# 5. Experiment
|
| 338 |
+
|
| 339 |
+
# 5.1. Text-To-Image Task
|
| 340 |
+
|
| 341 |
+
To evaluate the effectiveness of our proposed method, we conduct experiments using Stable Diffusion v3.5 (d=38)
|
| 342 |
+
|
| 343 |
+
Table 1. Results of 10 NFE generation with SD v3.5 (d=38) on COCO10k, best performance includes finer grained data.
|
| 344 |
+
|
| 345 |
+
<table><tr><td rowspan="2">METHOD</td><td colspan="3">ω = 2</td><td colspan="3">ω = 4</td><td colspan="3">ω = 6</td></tr><tr><td>CLIP ↑</td><td>IR ↑</td><td>FID ↓</td><td>CLIP ↑</td><td>IR ↑</td><td>FID ↓</td><td>CLIP ↑</td><td>IR ↑</td><td>FID ↓</td></tr><tr><td>ADG (PROPOSED)</td><td>0.315</td><td>0.727</td><td>17.4</td><td>0.319</td><td>0.928</td><td>17.1</td><td>0.321</td><td>0.964</td><td>16.9</td></tr><tr><td>CFG</td><td>0.316</td><td>0.711</td><td>17.5</td><td>0.318</td><td>0.835</td><td>16.9</td><td>0.317</td><td>0.586</td><td>17.1</td></tr><tr><td>CFG++ (λ = ω/12.5)</td><td>0.315</td><td>0.574</td><td>17.1</td><td>0.306</td><td>-0.148</td><td>18.0</td><td>0.282</td><td>-0.980</td><td>19.8</td></tr><tr><td>APG</td><td>0.315</td><td>0.651</td><td>17.5</td><td>0.317</td><td>0.910</td><td>17.2</td><td>0.319</td><td>0.964</td><td>16.9</td></tr><tr><td></td><td colspan="3">ω = 10</td><td colspan="3">ω = 15</td><td colspan="3">BEST PERFORMANCE</td></tr><tr><td></td><td>CLIP ↑</td><td>IR ↑</td><td>FID ↓</td><td>CLIP ↑</td><td>IR ↑</td><td>FID ↓</td><td>CLIP ↑</td><td>IR ↑</td><td>FID ↓</td></tr><tr><td>ADG (PROPOSED)</td><td>0.322</td><td>0.970</td><td>16.6</td><td>0.324</td><td>0.940</td><td>16.8</td><td>0.324</td><td>0.970</td><td>16.6</td></tr><tr><td>CFG</td><td>0.304</td><td>-0.142</td><td>17.7</td><td>0.290</td><td>-0.659</td><td>20.3</td><td>0.318</td><td>0.843</td><td>16.6</td></tr><tr><td>CFG++ (λ = ω/12.5)</td><td>0.257</td><td>-1.509</td><td>21.4</td><td>0.246</td><td>-1.680</td><td>22.6</td><td>0.315</td><td>0.574</td><td>17.1</td></tr><tr><td>APG</td><td>0.318</td><td>0.935</td><td>16.4</td><td>0.316</td><td>0.691</td><td>16.1</td><td>0.319</td><td>0.966</td><td>16.1</td></tr></table>
|
| 346 |
+
|
| 347 |
+

|
| 348 |
+
Figure 5. Comparison of angular domain guidance (ADG) and classifier-free guidance (CFG). The left diagram illustrates the ADG update, which preserves the latent variable norm by focusing on angular adjustments, while the right diagram shows the CFG, which amplifies the norm due to direct linear adjustments. The black line represents the potential manifold structure.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
|
| 352 |
+
on the COCO dataset(Lin et al., 2014), comparing against CFG (Ho & Salimans, 2021), CFG++ (Chung et al., 2025), and APG (Sadat et al., 2025). For CFG++ and APG, we adopt the recommended parameter setting from the original papers. We assess sample quality using three metrics: FID (Heusel et al., 2017), CLIP score (Radford et al., 2021), and ImageReward (Xu et al., 2024). ImageReward is designed to align with human preferences, evaluating images based on text alignment, aesthetic appeal, and safety considerations. Quantitative results are summarized in Table 1, while Figure 4 provides a qualitative comparison of generated images. To ensure a fair comparison, fine-grained experimental results for the baseline methods are included in the appendix. The "Best performance" column in Table 1 aggregates these results.
|
| 353 |
+
|
| 354 |
+
Our experiments reveal several key advantages of ADG. First, ADG demonstrates robustness at high guidance
|
| 355 |
+
|
| 356 |
+
weights, maintaining stable performance even under conditions where baselines exhibit significant color distortions and quality degradation. Second, ADG consistently outperforms baselines across all guidance weights in text-image consistency metrics (CLIP and IR) while remaining competitive in FID. Notably, ADG achieves substantial improvements in IR, indicating better alignment with human preferences. Finally, ADG exhibits a wide operational range, delivering superior generation performance across a broad spectrum of guidance weights. In contrast, baseline methods experience rapid performance decay beyond their optimal operating points, highlighting the limitations of these methods in comparison to ADG.
|
| 357 |
+
|
| 358 |
+
# 5.2. Ablation Study
|
| 359 |
+
|
| 360 |
+
We investigate two variants of the proposed ADG algorithm, described in Appendix E as Algorithm 6 and Algorithm 7. The first variant removes the maximum turning angle constraint, while the second introduces normalization to the norm of $\hat{x}_{0,\omega}$ . Table 2 presents the performance metrics for these variants under $\omega = 8$ .
|
| 361 |
+
|
| 362 |
+
Table 2. Results of 10 NFE generation with SD v3.5 (d=38) on COCO10k under $\omega = 8$ .
|
| 363 |
+
|
| 364 |
+
<table><tr><td>Method</td><td>CLIP ↑</td><td>IR ↑</td><td>FID ↓</td></tr><tr><td>ADG (Proposed)</td><td>0.322</td><td>0.970</td><td>16.7</td></tr><tr><td>ADG w/o angle constraint</td><td>0.275</td><td>-0.782</td><td>28.6</td></tr><tr><td>ADG w normalization</td><td>0.322</td><td>0.958</td><td>16.6</td></tr></table>
|
| 365 |
+
|
| 366 |
+
The experimental results indicate that normalization has a limited impact on ADG's performance. The comparable performance between the normalized ADG and the original framework demonstrates that the ADG algorithm effectively controls the norm of generated samples. This finding further confirms that angular domain adjustment, rather than norm adjustment, serves as the primary mechanism for enhancing
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
6.a ADG
|
| 370 |
+
|
| 371 |
+

|
| 372 |
+
6.b ADG without angle constraint
|
| 373 |
+
Figure 6. Comparison of different ADG variants. ADG without angle constraint exhibits significant degradation, while ADG with normalization remains stable.
|
| 374 |
+
|
| 375 |
+

|
| 376 |
+
6.c ADG with normalization
|
| 377 |
+
|
| 378 |
+
text-image alignment.
|
| 379 |
+
|
| 380 |
+
Furthermore, the necessity of the maximum turning angle constraint is evident. Removing this constraint leads to a substantial decline in performance across all evaluation metrics. As illustrated in Figure 6, the unconstrained variant exhibits severe instability, particularly when the angular deviation $(\omega -1)\gamma$ urpasses the critical threshold of $\pi$ , leading to pathological guidance directions and ultimately catastrophic generation failures.
|
| 381 |
+
|
| 382 |
+
# 5.3. Compatibility with High order Samplers
|
| 383 |
+
|
| 384 |
+
To demonstrate the compatibility of our proposed Angular Domain Guidance (ADG) algorithm with different models and samplers, we conducted experiments with SD v2.1 using DPM-Solver sampler(Lu et al., 2022a). As shown in Table 3, ADG consistently outperforms CFG across all evaluation metrics, achieving higher CLIP scores and ImageReward while maintaining competitive FID performance. These results highlight ADG's seamless integration with high-order samplers and its ability to enhance performance across multiple dimensions.
|
| 385 |
+
|
| 386 |
+
Table 3. Results of 25 NFE generation with SD v2.1 on COCO 10k using DPM-Solver under $\omega = 8$
|
| 387 |
+
|
| 388 |
+
<table><tr><td>METHOD</td><td>CLIP ↑</td><td>IR ↑</td><td>FID ↓</td></tr><tr><td>ADG (PROPOSED)</td><td>0.322</td><td>0.467</td><td>16.6</td></tr><tr><td>CFG</td><td>0.313</td><td>0.399</td><td>16.6</td></tr></table>
|
| 389 |
+
|
| 390 |
+
# 6. Discussion
|
| 391 |
+
|
| 392 |
+
Angle Domain Guidance (ADG) is introduced as an alternative to the widely adopted Classifier-Free Guidance (CFG) in latent-diffusion-based text-to-image (T2I) genera
|
| 393 |
+
|
| 394 |
+
tion. ADG addresses critical limitations of CFG, including norm amplification and oversaturation under high guidance weights, by leveraging angular-domain updates in the latent space. This heuristic approach stabilizes the sampling process and consistently improves semantic alignment, image fidelity, and diversity metrics.
|
| 395 |
+
|
| 396 |
+
The theoretical analysis presented in this work primarily focuses on the limitations of CFG. Specifically, we demonstrate how linear-domain amplification in CFG leads to deviations from the target distribution, resulting in undesirable artifacts such as oversaturation. While these insights informed the design of ADG, it is important to note that, like CFG, ADG remains a heuristic approach without formal theoretical guarantees.
|
| 397 |
+
|
| 398 |
+
In comparison to existing methods, ADG introduces a novel perspective by shifting the focus from linear to angular-domain adjustments. This shift not only mitigates the identified issues with CFG but also ensures seamless integration with current samplers and latent diffusion frameworks. However, ADG is specifically designed for latent diffusion models, which dominate modern T2I generation due to their computational efficiency. If future advancements explore diffusion processes in the image domain, ADG may require significant adaptations to remain effective.
|
| 399 |
+
|
| 400 |
+
The ADG framework is highly extensible and can be adapted to other generative tasks, such as video synthesis(Liu et al., 2024), 3D content generation(Lin et al., 2023) or depth inpainting(Sun et al., 2025). Future research could also explore integrating ADG with techniques aimed at reducing sampling iterations(Li & Cai, 2024; Lu et al., 2022a), to enhance its efficiency for real-time applications. These extensions would further solidify ADG's role as a versatile and robust solution for advancing generative modeling.
|
| 401 |
+
|
| 402 |
+
# 7. Conclusion
|
| 403 |
+
|
| 404 |
+
We present Angular Domain Guidance (ADG), a novel approach designed to address the limitations of Classifier-Free Guidance (CFG) in diffusion-based text-to-image generation. By leveraging angular-domain updates in the latent space, ADG enable stable and high-quality image generation. Experimental results demonstrate that ADG consistently outperforms existing methods across multiple evaluation metrics, including semantic alignment, image fidelity, and diversity. These findings underscore ADG's potential as a robust and effective alternative for advancing text-to-image generation.
|
| 405 |
+
|
| 406 |
+
# Acknowledgements
|
| 407 |
+
|
| 408 |
+
This work was supported by NSAF (Grant No. U2230201) and a Grant from the Guoqiang Institute, Tsinghua University. The authors are affiliated with the Department of Electronic Engineering and the Beijing National Research Center for Information Science and Technology at Tsinghua University.
|
| 409 |
+
|
| 410 |
+
# Impact Statement
|
| 411 |
+
|
| 412 |
+
This work re-examines the foundational mechanisms of guidance in latent diffusion models and presents a principled alternative to the widely used Classifier-Free Guidance (CFG). By conducting a theoretical analysis of CFG's failure modes—particularly norm amplification and anomalous diffusion under high guidance weights—the paper identifies key limitations in linear-domain extrapolation. The proposed Angle Domain Guidance (ADG) algorithm addresses these issues through angular-domain updates, offering a conceptually novel and practically effective framework. By shifting guidance from algebraic extrapolation to geometric rotation, ADG provides a new lens for understanding and designing structure-preserving sampling strategies in generative modeling.
|
| 413 |
+
|
| 414 |
+
# References
|
| 415 |
+
|
| 416 |
+
Anderson, B. D. Reverse-time diffusion equation models. Stochastic Processes and their Applications, 12(3):313-326, 1982.
|
| 417 |
+
Bradley, A. and Nakkiran, P. Classifier-free guidance is a predictor-corrector. arXiv preprint arXiv:2408.09000, 2024.
|
| 418 |
+
Chidambaram, M., Gatmiry, K., Chen, S., Lee, H., and Lu, J. What does guidance do? a fine-grained analysis in a simple setting. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
|
| 419 |
+
Chung, H., Kim, J., Park, G. Y., Nam, H., and Ye, J. C.
|
| 420 |
+
|
| 421 |
+
CFG++: Manifold-constrained classifier free guidance for diffusion models. In The Thirteenth International Conference on Learning Representations, 2025.
|
| 422 |
+
Esser, P., Kulal, S., Blattmann, A., Entezari, R., Müller, J., Saini, H., Levi, Y., Lorenz, D., Sauer, A., Boesel, F., et al. Scaling rectified flow transformers for high-resolution image synthesis. In *Forty-first International Conference on Machine Learning*, 2024.
|
| 423 |
+
Heusel, M., Ramsauer, H., Unterthiner, T., Nessler, B., and Hochreiter, S. GANs trained by a two time-scale update rule converge to a local nash equilibrium. Advances in neural information processing systems, 30, 2017.
|
| 424 |
+
Ho, J. and Salimans, T. Classifier-free diffusion guidance. In NeurIPS 2021 Workshop on Deep Generative Models and Downstream Applications, 2021.
|
| 425 |
+
Ho, J., Jain, A., and Abbeel, P. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840-6851, 2020.
|
| 426 |
+
Huang, X., Dong, H., Yifan, H., Ma, Y., and Zhang, T. Reverse diffusion monte carlo. In The Twelfth International Conference on Learning Representations, 2023.
|
| 427 |
+
Kingma, D. P. Auto-encoding variational bayes. arXiv preprint arXiv:1312.6114, 2013.
|
| 428 |
+
Labs, B. F. Flux. https://github.com/black-forest-labs/flux, 2024.
|
| 429 |
+
Li, G. and Cai, C. Provable acceleration for diffusion models under minimal assumptions. arXiv preprint arXiv:2410.23285, 2024.
|
| 430 |
+
Lin, C.-H., Gao, J., Tang, L., Takikawa, T., Zeng, X., Huang, X., Kreis, K., Fidler, S., Liu, M.-Y., and Lin, T.-Y. Magic3d: High-resolution text-to-3d content creation. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 300-309, 2023.
|
| 431 |
+
Lin, T.-Y., Maire, M., Belongie, S., Hays, J., Perona, P., Ramanan, D., Dollar, P., and Zitnick, C. L. Microsoft coco: Common objects in context. In Computer vision-ECCV 2014: 13th European conference, zurich, Switzerland, September 6-12, 2014, proceedings, part v 13, pp. 740-755. Springer, 2014.
|
| 432 |
+
Lipman, Y., Chen, R. T., Ben-Hamu, H., Nickel, M., and Le, M. Flow matching for generative modeling. In 11th International Conference on Learning Representations, ICLR 2023, 2023.
|
| 433 |
+
Liu, Y., Zhang, K., Li, Y., Yan, Z., Gao, C., Chen, R., Yuan, Z., Huang, Y., Sun, H., Gao, J., et al. Sora: A review on
|
| 434 |
+
|
| 435 |
+
background, technology, limitations, and opportunities of large vision models. arXiv preprint arXiv:2402.17177, 2024.
|
| 436 |
+
Lu, C., Zhou, Y., Bao, F., Chen, J., Li, C., and Zhu, J. DPM solver: A fast ODE solver for diffusion probabilistic model sampling in around 10 steps. Advances in Neural Information Processing Systems, 35:5775-5787, 2022a.
|
| 437 |
+
Lu, C., Zhou, Y., Bao, F., Chen, J., Li, C., and Zhu, J. DPM-solver++: Fast solver for guided sampling of diffusion probabilistic models. arXiv preprint arXiv:2211.01095, 2022b.
|
| 438 |
+
Patel, Z., DeLoye, J., and Mathias, L. Exploring diffusion and flow matching under generator matching. arXiv preprint arXiv:2412.11024, 2024.
|
| 439 |
+
Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pp. 8748-8763. PMLR, 2021.
|
| 440 |
+
Ramesh, A., Dhariwal, P., Nichol, A., Chu, C., and Chen, M. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 1(2):3, 2022.
|
| 441 |
+
Rombach, R., Blattmann, A., Lorenz, D., Esser, P., and Ommer, B. High-resolution image synthesis with latent diffusion models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 10684-10695, 2022.
|
| 442 |
+
Sadat, S., Hilliges, O., and Weber, R. M. Eliminating oversaturation and artifacts of high guidance scales in diffusion models. In The Thirteenth International Conference on Learning Representations, 2025.
|
| 443 |
+
Song, J., Meng, C., and Ermon, S. Denoising diffusion implicit models. In International Conference on Learning Representations, 2021a.
|
| 444 |
+
Song, Y., Sohl-Dickstein, J., Kingma, D. P., Kumar, A., Ermon, S., and Poole, B. Score-based generative modeling through stochastic differential equations. In International Conference on Learning Representations, 2021b.
|
| 445 |
+
Sun, T., Hu, D., Dai, Y., and Wang, G. Diffusion-based depth inpainting for transparent and reflective objects. IEEE Transactions on Circuits and Systems for Video Technology, 35(1):394-404, 2025. doi: 10.1109/TCSVT.2024.3434740.
|
| 446 |
+
Wainwright, M. J. High-dimensional statistics: A non-asymptotic viewpoint, volume 48. Cambridge university press, 2019.
|
| 447 |
+
|
| 448 |
+
Wu, Y., Chen, M., Li, Z., Wang, M., and Wei, Y. Theoretical insights for diffusion guidance: A case study for gaussian mixture models. In *Forty-first International Conference on Machine Learning*, 2024.
|
| 449 |
+
Xia, M., Xue, N., Shen, Y., Yi, R., Gong, T., and Liu, Y.-J. Rectified diffusion guidance for conditional generation. arXiv preprint arXiv:2410.18737, 2024.
|
| 450 |
+
Xu, J., Liu, X., Wu, Y., Tong, Y., Li, Q., Ding, M., Tang, J., and Dong, Y. ImageReward: Learning and evaluating human preferences for text-to-image generation. Advances in Neural Information Processing Systems, 36, 2024.
|
| 451 |
+
Zhang, J., Zhuang, J., Jin, C., Li, G., and Gu, Y. Unleashing the denoising capability of diffusion prior for solving inverse problems. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024.
|
| 452 |
+
Zhang, L., Rao, A., and Agrawala, M. Adding conditional control to text-to-image diffusion models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 3836-3847, 2023.
|
| 453 |
+
Zhao, S., Chen, D., Chen, Y.-C., Bao, J., Hao, S., Yuan, L., and Wong, K.-Y. K. Uni-controlnet: All-in-one control to text-to-image diffusion models. Advances in Neural Information Processing Systems, 36, 2024.
|
| 454 |
+
|
| 455 |
+
# A. Related Work
|
| 456 |
+
|
| 457 |
+
# A.1. Theoretical Analyses of Classifier-Free Guidance
|
| 458 |
+
|
| 459 |
+
To the best of our knowledge, four key studies have provided theoretical analyses of Classifier-Free Guidance (CFG). Below, we elucidate the connections and distinctions between our theoretical contributions and these prior works.
|
| 460 |
+
|
| 461 |
+
# Comparison to Chidambaram et al.(Chidambaram et al., 2024).
|
| 462 |
+
|
| 463 |
+
This work studies the performance of the CFG-based ODE sampling method in two scenarios: (1) one-dimensional compactly supported distributions with two components, and (2) one-dimensional Gaussian mixture distributions with two components. They conclude that as the guidance weight increases, the sampling process tends to concentrate on the edges of the conditional distribution. Additionally, even a small nonzero error in score estimation can cause sampling results to deviate significantly from the target distribution's support under sufficiently large guidance weights.
|
| 464 |
+
|
| 465 |
+
The key difference in our theoretical analysis lies in its broader applicability to high-dimensional settings with multiple components. We demonstrate that the phenomenon of sampling concentrating on the edges only occurs for surface classes, a distinction that is absent in (Chidambaram et al., 2024) due to the nature of their one-dimensional two-component scenarios, where all classes inherently behave as surface classes. By incorporating this insight, our work provides a more nuanced understanding of CFG's behavior in complex, high-dimensional generative tasks, offering theoretical explanations for phenomena that remain unaddressed in their framework.
|
| 466 |
+
|
| 467 |
+
# Comparison to Wu et al.(Wu et al., 2024).
|
| 468 |
+
|
| 469 |
+
This work investigates the impact of the guidance weight on sampling performance under Gaussian Mixture Models (GMMs). The authors evaluate two key metrics: "classification confidence," characterized by the conditional likelihood of the output distribution, and "distribution diversity," quantified by the differential entropy of the output distribution. They theoretically prove that CFG sampling not only increases classification confidence but also reduces distribution diversity.
|
| 470 |
+
|
| 471 |
+
Our work differs from theirs in two significant aspects. First, we operate under more relaxed assumptions; while (Wu et al., 2024) requires the components of the Gaussian mixture to be approximately orthogonal, our analysis accommodates more general configurations of GMMs. Second, we argue that high classification confidence is not always desirable. For example, in a one-dimensional GMM with two components centered at 1 and -1, respectively, and sharing the same variance 1, a sampling point located at 1000 exhibit extremely high classification confidence but would not constitute a meaningful sample from the target distribution.
|
| 472 |
+
|
| 473 |
+
# Comparison to Bradley and Nakkiran(Bradley & Nakkiran, 2024).
|
| 474 |
+
|
| 475 |
+
This work analyzes CFG under the assumption that both the conditional and unconditional distributions follow zero-mean one-dimensional Gaussian distributions. Under this assumption, they derive a closed-form solution for the output distribution, showing that it does not correspond to the expected gamma-weighted distribution. Additionally, they conduct numerical studies on one-dimensional two-component Gaussian mixture models, finding that the output distribution similarly fails to match the expected gamma-weighted distribution.
|
| 476 |
+
|
| 477 |
+
The authors further reinterpret CFG as a predictor-corrector method, alternating between a denoising predictor (based on the ODE of the conditional distribution) and a sharpening corrector (employing Langevin dynamics). This perspective provides new insights into the iterative nature of CFG sampling.
|
| 478 |
+
|
| 479 |
+
In contrast, our work extends beyond the limitations of one-dimensional Gaussian assumptions. We study CFG in high-dimensional settings involving multi-component distributions and introduce the notion of surface classes. Our analysis reveals that phenomena such as norm amplification are closely linked to the geometry of these surface classes, providing a more general and nuanced understanding of CFG behavior in complex generative settings.
|
| 480 |
+
|
| 481 |
+
# Comparison to Xia et al.(Xia et al., 2024).
|
| 482 |
+
|
| 483 |
+
This work builds on the findings of (Bradley & Nakkiran, 2024) and extends the data assumptions to high-dimensional isotropic Gaussian distributions with different parameters for the conditional and unconditional distributions. Under these assumptions, the authors derive a closed-form solution for the CFG output distribution and further confirm its inconsistency with the gamma-weighted distribution. Additionally, they propose relaxing the constraints in the gamma-weighted distribution by introducing more flexible guidance coefficients, allowing the corrected distribution to better align with diffusion theory.
|
| 484 |
+
|
| 485 |
+
In contrast, we abandon the Gaussian distribution assumption to gain deeper insights into the behavior of CFG output distributions in more general scenarios. Our analysis covers high-dimensional settings with multiple components and highlights the geometric and probabilistic distinctions that emerge in such cases. Specifically, we introduce the concept of surface classes, demonstrating that the phenomena of norm amplification and edge sampling predominantly occur for surface classes. By broadening the theoretical scope and proposing practical solutions such as angular-domain adjustments, our work addresses the limitations of CFG in real-world generative tasks with greater generality and flexibility.
|
| 486 |
+
|
| 487 |
+
# A.2. Improvements to Classifier-Free Guidance
|
| 488 |
+
|
| 489 |
+
# Comparison to CFG++(Chung et al., 2025).
|
| 490 |
+
|
| 491 |
+
This work, inspired by diffusion model-based inverse problem solvers, proposes performing denoising under the guidance of a weight smaller than 1, followed by re-noising guided by the unconditional distribution. However, this method is equivalent to using a time-varying guidance weight in CFG, defined as $\omega_{t} = \lambda \frac{\sqrt{\beta_{t}\bar{\alpha}_{t - 1}}}{\sqrt{\beta_{t}\bar{\alpha}_{t - 1}} - \sqrt{\beta_{t - 1}\bar{\alpha}_{t}}}$ . CFG++ remains confined to the framework of linear-domain guidance and still exhibits color distortions under high $\lambda$ . Additionally, our experiments reveal that its optimal guidance weight is highly sensitive to the inference step size, further limiting its applicability (see Appendix G.5).
|
| 492 |
+
|
| 493 |
+
Algorithm 2 CFG++
|
| 494 |
+
```latex
|
| 495 |
+
Require: $\boldsymbol{x}_T \sim \mathcal{N}(0, \mathbf{I}), 0 < \lambda \leq 1$
|
| 496 |
+
for $t = T$ to 1 do
|
| 497 |
+
$\boldsymbol{\epsilon}_{t,\omega}^{(\boldsymbol{c})} = (1 - \lambda)\epsilon_{\theta}(\boldsymbol{x}, t, \emptyset) + \lambda \epsilon_{\theta}(\boldsymbol{x}, t, \boldsymbol{c})$ $\hat{\boldsymbol{x}}_0^{(\boldsymbol{c})} = (\boldsymbol{x}_t - \sqrt{1 - \bar{\alpha}_t}\boldsymbol{\epsilon}_{t,\omega}^{(\boldsymbol{c})}) / \sqrt{\bar{\alpha}_t}$ $\boldsymbol{x}_{t-1} = \sqrt{\bar{\alpha}_{t-1}}\hat{\boldsymbol{x}}_0^{(\boldsymbol{c})} + \sqrt{1 - \bar{\alpha}_{t-1}}\epsilon_{\theta}(\boldsymbol{x}, t, \emptyset)$
|
| 498 |
+
end for
|
| 499 |
+
```
|
| 500 |
+
|
| 501 |
+
# Comparison to PCG(Bradley & Nakkiran, 2024).
|
| 502 |
+
|
| 503 |
+
This work decomposes each iteration of the DDPM-style CFG sampler into a denoising step, corresponding to one step of DDIM, and a sharpening step, corresponding to one step of Langevin dynamics. The proposed PCG algorithm performs one denoising step followed by $N$ sharpening steps within each iteration, aiming to enhance the output. However, this enhancement is also carried out within the linear domain. Due to the $N$ -fold increase in the number of function evaluations (NFE) compared to standard CFG algorithms, its practicality is significantly reduced. Furthermore, the authors explicitly state, "we do present PCG primarily as a tool to understand CFG." As such, we did not compare the proposed algorithm in this work with our method.
|
| 504 |
+
|
| 505 |
+
Algorithm 3 PCG
|
| 506 |
+
```txt
|
| 507 |
+
Require: $x_{T}\sim \mathcal{N}(0,\mathbf{I}),1 < \omega \in \mathbb{R}$
|
| 508 |
+
for $t = T$ to 1 do
|
| 509 |
+
$\begin{array}{rl} & {\pmb {s} = -\bar{\beta}_t\epsilon_\theta (\pmb {x}_t,t,\pmb {c})}\\ & {\hat{\pmb{x}}_0^{(c)} = (\pmb {x}_t - \sqrt{1 - \bar{\alpha}_t}\epsilon_\theta (\pmb {x}_t,t,\pmb {c})) / \sqrt{\bar{\alpha}_t}}\\ & {\pmb{x}_{t - 1} = \sqrt{\bar{\alpha}_{t - 1}}\hat{\pmb{x}}_0^{(c)} + \sqrt{1 - \bar{\alpha}_{t - 1}}\frac{\pmb{x}_t - \hat{\pmb{x}}_0^{(c)}}{\sqrt{1 - \bar{\alpha}_t}}}\\ & {\kappa = \left(1 - \frac{\bar{\alpha}_t}{\bar{\alpha}_{t - 1}}\right)}\\ & {\mathrm{for~}k = 1\mathrm{~to~}N\mathrm{~do}}\\ & {\eta \sim \mathcal{N}(0,\mathbf{I})}\\ & {\epsilon_{t - 1,\omega}^{(c)} = (1 - \omega)\epsilon_\theta (\pmb {x},t - 1,\emptyset) + \omega \epsilon_\theta (\pmb {x},t - 1,\pmb {c})}\\ & {\pmb{x}_{t - 1} = \pmb{x}_{t - 1} - \frac{\kappa}{2}\frac{\epsilon_{t - 1,\omega}^{(c)}}{\beta_{t - 1}} +\sqrt{\kappa}\eta} \end{array}$
|
| 510 |
+
end for
|
| 511 |
+
end for
|
| 512 |
+
```
|
| 513 |
+
|
| 514 |
+
# Comparison to ReCFG(Xia et al., 2024).
|
| 515 |
+
|
| 516 |
+
This work relaxes the constraint of the weighting coefficients summing to one in traditional CFG by introducing a precomputed lookup table $f$ . Strict implementation of ReCFG requires precomputing this lookup table for all conditions, which is impractical for open-condition models like T2I. For datasets like ImageNet, where images have explicit category labels, the authors propose precomputing the table based on categories rather than text conditions. However, in real-world scenarios, text prompts do not always correspond to specific categories, making this method unsuitable for general T2I tasks. Consequently, we do not compare their algorithm with ours.
|
| 517 |
+
|
| 518 |
+
# Algorithm 4 ReCFG
|
| 519 |
+
|
| 520 |
+
Require: $\pmb{x}_T \sim \mathcal{N}(0, \mathbf{I}), 1 < \omega \in \mathbb{R}$ , trained lookup table $f$ .
|
| 521 |
+
|
| 522 |
+
for $t = T$ to 1 do
|
| 523 |
+
|
| 524 |
+
$$
|
| 525 |
+
\lambda = f (\boldsymbol {c})
|
| 526 |
+
$$
|
| 527 |
+
|
| 528 |
+
$$
|
| 529 |
+
\boldsymbol {\epsilon} _ {t, \omega} ^ {(c)} = \lambda (1 - \omega) \epsilon_ {\theta} (\boldsymbol {x}, t, \emptyset) + \omega \epsilon_ {\theta} (\boldsymbol {x}, t, \boldsymbol {c})
|
| 530 |
+
$$
|
| 531 |
+
|
| 532 |
+
$$
|
| 533 |
+
\hat {\pmb {x}} _ {0} ^ {(c)} = (\pmb {x} _ {t} - \sqrt {1 - \bar {\alpha} _ {t}} \pmb {\epsilon} _ {t, \omega} ^ {(c)}) / \sqrt {\bar {\alpha} _ {t}}
|
| 534 |
+
$$
|
| 535 |
+
|
| 536 |
+
$$
|
| 537 |
+
\boldsymbol {x} _ {t - 1} = \sqrt {\bar {\alpha} _ {t - 1}} \hat {\boldsymbol {x}} _ {0, \omega} + \sqrt {1 - \bar {\alpha} _ {t - 1}} \boldsymbol {\epsilon} _ {t, \omega} ^ {(c)}
|
| 538 |
+
$$
|
| 539 |
+
|
| 540 |
+
end for
|
| 541 |
+
|
| 542 |
+
# Comparison to APG(Sadat et al., 2025)
|
| 543 |
+
|
| 544 |
+
This work attributes image oversaturation and degradation to the parallel component of the difference vector $\Delta \hat{\pmb{x}}_0 = \hat{\pmb{x}}_0^{(c)} - \hat{\pmb{x}}_0^{(\emptyset)}$ with respect to $\hat{\pmb{x}}_0^{(c)}$ , denoted as $\Delta \hat{\pmb{x}}_{0,\parallel}$ . Building on this observation, they propose reducing the influence of the parallel component in CFG by replacing $\Delta \hat{\pmb{x}}_{0,CFG} = \Delta \hat{\pmb{x}}_{0,\parallel} + \Delta \hat{\pmb{x}}_{0,\perp}$ with $\Delta \hat{\pmb{x}}_{0,APG} = \eta \Delta \hat{\pmb{x}}_{0,\parallel} + \Delta \hat{\pmb{x}}_{0,\perp}$ , where $\eta < 1$ , to mitigate its adverse effect on image quality. In addition, this work introduces an extra negative momentum mechanism and imposes a constraint on the norm of $\Delta \hat{\pmb{x}}_0$ . While removing the parallel component slows the norm growth, it does not fully resolve the issue of norm amplification. However, its algorithm does not directly constrain the norm of $\Delta \hat{\pmb{x}}_{0,CFG}$ , and thus fails to address the issue of excessive latent norm under high guidance weights. As a result, image degradation still occurs when the guidance weight is large.
|
| 545 |
+
|
| 546 |
+
# Algorithm 5 APG
|
| 547 |
+
|
| 548 |
+
Require: $\mathbf{x}_T \sim \mathcal{N}(0, \mathbf{I}), 1 < \omega \in \mathbb{R}, \beta < 0, r \in \mathbb{R}_+, 0 \leq \eta < 1$
|
| 549 |
+
|
| 550 |
+
$$
|
| 551 |
+
\Delta \hat {\boldsymbol {x}} _ {0, h i s t o r y} = \mathbf {0}
|
| 552 |
+
$$
|
| 553 |
+
|
| 554 |
+
for $t = T$ to 1 do
|
| 555 |
+
|
| 556 |
+
$$
|
| 557 |
+
\hat {\boldsymbol {x}} _ {0} ^ {(\boldsymbol {c})} = (\boldsymbol {x} _ {t} - \sqrt {1 - \bar {\alpha} _ {t}} \epsilon_ {\theta} (\boldsymbol {x}, t, \boldsymbol {c})) / \sqrt {\bar {\alpha} _ {t}}
|
| 558 |
+
$$
|
| 559 |
+
|
| 560 |
+
$$
|
| 561 |
+
\hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)} = (\boldsymbol {x} _ {t} - \sqrt {1 - \bar {\alpha} _ {t}} \epsilon_ {\theta} (\boldsymbol {x}, t, \emptyset)) / \sqrt {\bar {\alpha} _ {t}}
|
| 562 |
+
$$
|
| 563 |
+
|
| 564 |
+
$$
|
| 565 |
+
\Delta \hat {\boldsymbol {x}} _ {0} = \hat {\boldsymbol {x}} _ {0} ^ {(c)} - \hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)}
|
| 566 |
+
$$
|
| 567 |
+
|
| 568 |
+
$$
|
| 569 |
+
\Delta \hat {\boldsymbol {x}} _ {0} ^ {\parallel} = \frac {\langle \Delta \hat {\boldsymbol {x}} _ {0} , \hat {\boldsymbol {x}} _ {0} ^ {(c)} \rangle}{\langle \hat {\boldsymbol {x}} _ {0} ^ {(c)} , \hat {\boldsymbol {x}} _ {0} ^ {(c)} \rangle} \hat {\boldsymbol {x}} _ {0} ^ {(c)}
|
| 570 |
+
$$
|
| 571 |
+
|
| 572 |
+
$$
|
| 573 |
+
\Delta \hat {\boldsymbol {x}} _ {0} ^ {\perp} = \Delta \hat {\boldsymbol {x}} _ {0} - \Delta \hat {\boldsymbol {x}} _ {0} ^ {\parallel}
|
| 574 |
+
$$
|
| 575 |
+
|
| 576 |
+
$$
|
| 577 |
+
\Delta \hat {\mathbf {x}} _ {0} = \eta \Delta \hat {\mathbf {x}} _ {0} ^ {\parallel} + \Delta \hat {\mathbf {x}} _ {0} ^ {\perp}
|
| 578 |
+
$$
|
| 579 |
+
|
| 580 |
+
$$
|
| 581 |
+
\Delta \hat {\boldsymbol {x}} _ {0} = \Delta \hat {\boldsymbol {x}} _ {0} \min \left(1, \frac {r}{\| \Delta \hat {\boldsymbol {x}} _ {0} \|}\right)
|
| 582 |
+
$$
|
| 583 |
+
|
| 584 |
+
$$
|
| 585 |
+
\Delta \hat {\boldsymbol {x}} _ {0, h i s t o r y} = \Delta \hat {\boldsymbol {x}} _ {0} - \beta \Delta \hat {\boldsymbol {x}} _ {0, h i s t o r y}
|
| 586 |
+
$$
|
| 587 |
+
|
| 588 |
+
$$
|
| 589 |
+
\hat {\boldsymbol {x}} _ {0, \omega} = \hat {\boldsymbol {x}} _ {0} ^ {(\boldsymbol {c})} + (\omega - 1) \Delta \hat {\boldsymbol {x}} _ {0, h i s t o r y}
|
| 590 |
+
$$
|
| 591 |
+
|
| 592 |
+
$$
|
| 593 |
+
\boldsymbol {x} _ {t - 1} = \sqrt {\bar {\alpha} _ {t - 1}} \hat {\boldsymbol {x}} _ {0, \omega} + \sqrt {1 - \bar {\alpha} _ {t - 1}} \frac {\boldsymbol {x} _ {t} - \bar {\alpha} _ {t} \hat {\boldsymbol {x}} _ {0 , \omega}}{\sqrt {1 - \bar {\alpha} _ {t}}}
|
| 594 |
+
$$
|
| 595 |
+
|
| 596 |
+
end for
|
| 597 |
+
|
| 598 |
+
# B. Proof of Theorem 3.2
|
| 599 |
+
|
| 600 |
+
We now consider a strengthened proposition of Theorem 3.2:
|
| 601 |
+
|
| 602 |
+
Theorem B.1. Assume the data follows the model (11) and $c^*$ is the surface class of the distribution. Consider two state
|
| 603 |
+
|
| 604 |
+
variables $\mathbf{x}_t$ and $\mathbf{z}_t$ governed by the following ODEs:
|
| 605 |
+
|
| 606 |
+
$$
|
| 607 |
+
\frac {\mathrm {d} \boldsymbol {x} _ {t}}{\mathrm {d} t} = \frac {\beta (t)}{2} \left[ - \boldsymbol {x} _ {t} - \nabla_ {\boldsymbol {x} _ {t}} \log p _ {t} \left(\boldsymbol {x} _ {t} \mid c ^ {*}\right) \right], \tag {20}
|
| 608 |
+
$$
|
| 609 |
+
|
| 610 |
+
$$
|
| 611 |
+
\frac {\mathrm {d} \boldsymbol {z} _ {t}}{\mathrm {d} t} = \frac {\beta (t)}{2} \left[ - \boldsymbol {z} _ {t} - (1 + \omega) \nabla_ {\boldsymbol {z} _ {t}} \log p _ {t} \left(\boldsymbol {z} _ {t} \mid c ^ {*}\right) + \omega \nabla_ {\boldsymbol {z} _ {t}} \log p _ {t} \left(\boldsymbol {z} _ {t}\right) \right]. \tag {21}
|
| 612 |
+
$$
|
| 613 |
+
|
| 614 |
+
If the initial conditions satisfy $\pmb{x}_T^\top \pmb{\mu}_{c^*} \leq \pmb{z}_T^\top \pmb{\mu}_{c^*}$ , then for any $t \in [0, T)$ , the following inequality holds:
|
| 615 |
+
|
| 616 |
+
$$
|
| 617 |
+
\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {\mu} _ {c ^ {*}} < \boldsymbol {z} _ {t} ^ {\top} \boldsymbol {\mu} _ {c ^ {*}}.
|
| 618 |
+
$$
|
| 619 |
+
|
| 620 |
+
Proof. For Gaussian distributions and Gaussian mixture distributions, the score functions admit closed-form expressions. For the conditional score function:
|
| 621 |
+
|
| 622 |
+
$$
|
| 623 |
+
\begin{array}{l} \nabla_ {\boldsymbol {x}} \log p _ {t} (\boldsymbol {x} | c ^ {*}) = \nabla_ {\boldsymbol {x}} \left(- \frac {d}{2} \log (2 \pi) - \frac {\| \boldsymbol {x} - \bar {\alpha} _ {t} \boldsymbol {\mu} _ {c ^ {*}} \| _ {2} ^ {2}}{2}\right) \\ = - \boldsymbol {x} + \bar {\alpha} _ {t} \boldsymbol {\mu} _ {c ^ {*}}, \tag {22} \\ \end{array}
|
| 624 |
+
$$
|
| 625 |
+
|
| 626 |
+
and for the marginal score function:
|
| 627 |
+
|
| 628 |
+
$$
|
| 629 |
+
\begin{array}{l} \nabla_ {\boldsymbol {x}} \log p _ {t} (\boldsymbol {x}) = \frac {\nabla_ {\boldsymbol {x}} \left(\sum_ {c = 1} ^ {C} \pi_ {c} \mathcal {N} (\boldsymbol {x} | \bar {\alpha} _ {t} \boldsymbol {\mu} _ {c} , \mathbf {I})\right)}{\sum_ {c = 1} ^ {C} \pi_ {c} \mathcal {N} (\boldsymbol {x} | \bar {\alpha} _ {t} \boldsymbol {\mu} _ {c} , \mathbf {I})} \\ = - \boldsymbol {x} + \bar {\alpha} _ {t} \sum_ {c = 1} ^ {C} \pi_ {c} ^ {*} (\boldsymbol {x}) \boldsymbol {\mu} _ {c}, \tag {23} \\ \end{array}
|
| 630 |
+
$$
|
| 631 |
+
|
| 632 |
+
where $\pi_c^*(\pmb{x}) = \frac{\pi_c \mathcal{N}(\pmb{x} | \bar{\alpha}_t \pmb{\mu}_c, \mathbf{I})}{\sum_{c' = 1}^{C} \pi_{c'} \mathcal{N}(\pmb{x} | \bar{\alpha}_t \pmb{\mu}_{c'}) \mathbf{I}}$ .
|
| 633 |
+
|
| 634 |
+
Substituting (22) and (23) into (20) and (21) yields:
|
| 635 |
+
|
| 636 |
+
$$
|
| 637 |
+
\frac {\mathrm {d} \boldsymbol {x} _ {t}}{\mathrm {d} t} = \frac {\beta (t)}{2} \left[ - \bar {\alpha} _ {t} \boldsymbol {\mu} _ {c ^ {*}} \right], \tag {24}
|
| 638 |
+
$$
|
| 639 |
+
|
| 640 |
+
$$
|
| 641 |
+
\frac {\mathrm {d} \boldsymbol {z} _ {t}}{\mathrm {d} t} = \frac {\beta (t)}{2} \left[ - \bar {\alpha} _ {t} \boldsymbol {\mu} _ {c ^ {*}} - \omega \bar {\alpha} _ {t} \left(\boldsymbol {\mu} _ {c ^ {*}} - \sum_ {c = 1} ^ {C} \pi_ {c} ^ {*} (\boldsymbol {x}) \boldsymbol {\mu} _ {c}\right) \right]. \tag {25}
|
| 642 |
+
$$
|
| 643 |
+
|
| 644 |
+
By taking the projection along $\pmb{w}^{\top}\pmb{\mu}_{c^{*}}$ , we have:
|
| 645 |
+
|
| 646 |
+
$$
|
| 647 |
+
\frac {\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x} _ {t}}{\mathrm {d} t} = \frac {\beta (t)}{2} \left[ - \bar {\alpha} _ {t} \boldsymbol {w} ^ {\top} \boldsymbol {\mu} _ {c ^ {*}} \right], \tag {26}
|
| 648 |
+
$$
|
| 649 |
+
|
| 650 |
+
$$
|
| 651 |
+
\frac {\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {z} _ {t}}{\mathrm {d} t} = \frac {\beta (t)}{2} \left[ - \bar {\alpha} _ {t} \boldsymbol {w} ^ {\top} \boldsymbol {\mu} _ {c ^ {*}} - \omega \bar {\alpha} _ {t} \sum_ {c = 1} ^ {C} \pi_ {c} ^ {*} (\boldsymbol {x}) \left(\boldsymbol {w} ^ {\top} \boldsymbol {\mu} _ {c ^ {*}} - \boldsymbol {w} ^ {\top} \boldsymbol {\mu} _ {c}\right) \right]. \tag {27}
|
| 652 |
+
$$
|
| 653 |
+
|
| 654 |
+
From Definition 3.1, it follows that:
|
| 655 |
+
|
| 656 |
+
$$
|
| 657 |
+
\boldsymbol {w} ^ {\top} \boldsymbol {\mu} _ {c ^ {*}} - \boldsymbol {w} ^ {\top} \boldsymbol {\mu} _ {c} < 0, \quad \forall c \neq c ^ {*},
|
| 658 |
+
$$
|
| 659 |
+
|
| 660 |
+
which implies:
|
| 661 |
+
|
| 662 |
+
$$
|
| 663 |
+
\frac {\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {z} _ {t}}{\mathrm {d} t} < \frac {\mathrm {d} \boldsymbol {w} ^ {\top} \boldsymbol {x} _ {t}}{\mathrm {d} t}, \quad \forall t \in [ 0, T).
|
| 664 |
+
$$
|
| 665 |
+
|
| 666 |
+
Using the ODE comparison theorem and the initial condition $\pmb{x}_T^\top \pmb{\mu}_{c^*} \leq \pmb{z}_T^\top \pmb{\mu}_{c^*}$ (notice that the ODE is time-reversed), we conclude that:
|
| 667 |
+
|
| 668 |
+
$$
|
| 669 |
+
\boldsymbol {x} _ {t} ^ {\top} \boldsymbol {\mu} _ {c ^ {*}} < \boldsymbol {z} _ {t} ^ {\top} \boldsymbol {\mu} _ {c ^ {*}}, \quad \forall t \in [ 0, T).
|
| 670 |
+
$$
|
| 671 |
+
|
| 672 |
+

|
| 673 |
+
|
| 674 |
+
# C. proof of Theorem 3.3
|
| 675 |
+
|
| 676 |
+
Using Lemma 3.4, we express the score functions as:
|
| 677 |
+
|
| 678 |
+
$$
|
| 679 |
+
\nabla_ {\boldsymbol {x}} \log p _ {t} (\boldsymbol {x} | c ^ {*}) = \frac {\sqrt {\bar {\alpha} _ {t}} \mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {c ^ {*} , t , \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ] - \boldsymbol {x}}{\bar {\beta} _ {t}}, \tag {28}
|
| 680 |
+
$$
|
| 681 |
+
|
| 682 |
+
$$
|
| 683 |
+
\nabla_ {\boldsymbol {x}} \log p _ {t} (\boldsymbol {x} | \emptyset) = \frac {\sqrt {\bar {\alpha} _ {t}} \mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {\emptyset , t , \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ] - \boldsymbol {x}}{\bar {\beta} _ {t}}, \tag {29}
|
| 684 |
+
$$
|
| 685 |
+
|
| 686 |
+
where the conditional distributions $q_{c^*,t,\pmb{x}}$ and $q_{\emptyset ,t,\pmb{x}}$ are given by:
|
| 687 |
+
|
| 688 |
+
$$
|
| 689 |
+
q _ {c ^ {*}, t, \boldsymbol {x}} (\boldsymbol {x} _ {0}) \propto \mathcal {N} (\boldsymbol {x} _ {0}; \boldsymbol {\mu} _ {c ^ {*}}, \mathbf {I}) \exp \left(- \frac {\| \boldsymbol {x} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0} \| _ {2} ^ {2}}{2 \bar {\beta} _ {t}}\right), \tag {30}
|
| 690 |
+
$$
|
| 691 |
+
|
| 692 |
+
$$
|
| 693 |
+
q _ {\emptyset , t, \boldsymbol {x}} (\boldsymbol {x} _ {0}) \propto \sum_ {c = 1} ^ {C} w _ {c} \mathcal {N} (\boldsymbol {x} _ {0}; \boldsymbol {\mu} _ {c}, \mathbf {I}) \exp \left(- \frac {\| \boldsymbol {x} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0} \| _ {2} ^ {2}}{2 \bar {\beta} _ {t}}\right). \tag {31}
|
| 694 |
+
$$
|
| 695 |
+
|
| 696 |
+
For $q_{c^*,t,\pmb{x}}$ , we calculate:
|
| 697 |
+
|
| 698 |
+
$$
|
| 699 |
+
\mathcal {N} \left(\boldsymbol {x} _ {0}; \boldsymbol {\mu} _ {c ^ {*}}, \mathbf {I}\right) \exp \left(- \frac {\| \boldsymbol {x} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0} \| _ {2} ^ {2}}{2 \bar {\beta} _ {t}}\right) \propto \exp \left(- \| \boldsymbol {x} _ {0} - \boldsymbol {\mu} _ {c ^ {*}} \| _ {2} ^ {2} - \frac {\| \boldsymbol {x} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0} \| _ {2} ^ {2}}{2 \bar {\beta} _ {t}}\right) \tag {32}
|
| 700 |
+
$$
|
| 701 |
+
|
| 702 |
+
$$
|
| 703 |
+
\propto \exp \left(- \left(1 + \frac {\bar {\alpha} _ {t}}{\bar {\beta} _ {t}}\right) \boldsymbol {x} _ {0} ^ {\top} \boldsymbol {x} _ {0} + 2 \left(\boldsymbol {\mu} _ {c ^ {*}} + \frac {\sqrt {\bar {\alpha} _ {t}}}{\bar {\beta} _ {t}} \boldsymbol {x}\right) ^ {\top} \boldsymbol {x} _ {0}\right). \tag {33}
|
| 704 |
+
$$
|
| 705 |
+
|
| 706 |
+
Since $\bar{\beta}_t = 1 - \mathrm{e}^{-2t}$ and $\bar{\alpha}_t = \mathrm{e}^{-2t}$ , the expectation is:
|
| 707 |
+
|
| 708 |
+
$$
|
| 709 |
+
\mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {c ^ {*}, t, \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ] = \bar {\beta} _ {t} \boldsymbol {\mu} _ {c ^ {*}} + \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x}. \tag {34}
|
| 710 |
+
$$
|
| 711 |
+
|
| 712 |
+
Substituting this back, we find:
|
| 713 |
+
|
| 714 |
+
$$
|
| 715 |
+
\nabla_ {\boldsymbol {x}} \log p _ {t} (\boldsymbol {x} | c ^ {*}) = \frac {\sqrt {\bar {\alpha} _ {t}} \left(\bar {\beta} _ {t} \boldsymbol {\mu} _ {c ^ {*}} + \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x}\right) - \boldsymbol {x}}{\bar {\beta} _ {t}} \tag {35}
|
| 716 |
+
$$
|
| 717 |
+
|
| 718 |
+
$$
|
| 719 |
+
= \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c ^ {*}} - \boldsymbol {x}. \tag {36}
|
| 720 |
+
$$
|
| 721 |
+
|
| 722 |
+
Thus, for $\pmb{x} = \sqrt{\bar{\alpha}_t}\pmb{\mu}_{c^*} + k\pmb{w}$ , we have:
|
| 723 |
+
|
| 724 |
+
$$
|
| 725 |
+
\nabla_ {\boldsymbol {x}} \log p _ {t} (\boldsymbol {x} | c ^ {*}) = - k \boldsymbol {w}. \tag {37}
|
| 726 |
+
$$
|
| 727 |
+
|
| 728 |
+
similarly, we have
|
| 729 |
+
|
| 730 |
+
$$
|
| 731 |
+
\sum_ {c = 1} ^ {C} w _ {c} \mathcal {N} \left(\boldsymbol {x} _ {0}; \boldsymbol {\mu} _ {c}, \mathbf {I}\right) \exp \left(- \frac {\| \boldsymbol {x} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0} \| _ {2} ^ {2}}{2 \bar {\beta} _ {t}}\right) \propto \sum_ {c = 1} ^ {C} w _ {c} \exp \left(- \| \boldsymbol {x} _ {0} - \boldsymbol {\mu} _ {c} \| _ {2} ^ {2} - \frac {\| \boldsymbol {x} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} _ {0} \| _ {2} ^ {2}}{2 \bar {\beta} _ {t}}\right) \tag {38}
|
| 732 |
+
$$
|
| 733 |
+
|
| 734 |
+
$$
|
| 735 |
+
\propto \sum_ {c = 1} ^ {C} w _ {c, \boldsymbol {x}} ^ {(1)} \mathcal {N} \left(\boldsymbol {x} _ {0}; \bar {\beta} _ {t} \boldsymbol {\mu} _ {c} + \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x}, \frac {1}{\sqrt {\bar {\beta} _ {t}}} \mathbf {I}\right), \tag {39}
|
| 736 |
+
$$
|
| 737 |
+
|
| 738 |
+
where
|
| 739 |
+
|
| 740 |
+
$$
|
| 741 |
+
w _ {c, \boldsymbol {x}} ^ {(1)} = w _ {c} \exp \left(\left\| \boldsymbol {x} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c} \right\| _ {2} ^ {2}\right). \tag {40}
|
| 742 |
+
$$
|
| 743 |
+
|
| 744 |
+
Let
|
| 745 |
+
|
| 746 |
+
$$
|
| 747 |
+
w _ {c, \boldsymbol {x}} ^ {(3)} = \frac {w _ {c} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c} , \mathbf {I})}{\sum_ {l = 1} ^ {C} w _ {l} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} , \mathbf {I})}.
|
| 748 |
+
$$
|
| 749 |
+
|
| 750 |
+
We then have:
|
| 751 |
+
|
| 752 |
+
$$
|
| 753 |
+
q _ {\emptyset , t, \boldsymbol {x}} \left(\boldsymbol {x} _ {0}\right) = \sum_ {c = 1} ^ {C} w _ {c, \boldsymbol {x}} ^ {(3)} \mathcal {N} \left(\boldsymbol {x} _ {0}; \bar {\beta} _ {t} \boldsymbol {\mu} _ {c} + \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x}, \frac {1}{\sqrt {\bar {\beta} _ {t}}} \mathbf {I}\right). \tag {41}
|
| 754 |
+
$$
|
| 755 |
+
|
| 756 |
+
From this, the expectation of $\pmb{x}_0$ with respect to $q_{\emptyset, t, \pmb{x}}$ becomes:
|
| 757 |
+
|
| 758 |
+
$$
|
| 759 |
+
\begin{array}{l} \mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {\emptyset , t, \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ] = \sum_ {c = 1} ^ {C} w _ {c, \boldsymbol {x}} ^ {(3)} \left(\bar {\beta} _ {t} \boldsymbol {\mu} _ {c} + \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x}\right) \\ = \sqrt {\bar {\alpha} _ {t}} \boldsymbol {x} + \bar {\beta} _ {t} \sum_ {c = 1} ^ {C} w _ {c, \boldsymbol {x}} ^ {(3)} \boldsymbol {\mu} _ {c}. \tag {42} \\ \end{array}
|
| 760 |
+
$$
|
| 761 |
+
|
| 762 |
+
Now consider the difference between the expectations under $q_{c^*,t,\pmb{x}}$ and $q_{\emptyset ,t,\pmb{x}}$ :
|
| 763 |
+
|
| 764 |
+
$$
|
| 765 |
+
\begin{array}{l} \mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {c ^ {*}, t, \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ] - \mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {\emptyset , t, \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ] = \bar {\beta} _ {t} \sum_ {c = 1} ^ {C} w _ {c, \boldsymbol {x}} ^ {(3)} (\boldsymbol {\mu} _ {c ^ {*}} - \boldsymbol {\mu} _ {c}) \\ = \bar {\beta} _ {t} \sum_ {c \neq c ^ {*}} w _ {c, x} ^ {(3)} \left(\boldsymbol {\mu} _ {c ^ {*}} - \boldsymbol {\mu} _ {c}\right), \tag {43} \\ \end{array}
|
| 766 |
+
$$
|
| 767 |
+
|
| 768 |
+
where the second equality uses the fact that for $c = c^*$ , the term cancels out.
|
| 769 |
+
|
| 770 |
+
Next, we calculate the dot product of $s_{cfg,\omega}$ with $\nabla \log p_t(\pmb{x}|c^*)$ :
|
| 771 |
+
|
| 772 |
+
$$
|
| 773 |
+
\begin{array}{l} \boldsymbol {s} _ {c f g, \omega} ^ {\top} \nabla \log p _ {t} (\boldsymbol {x} | c ^ {*}) = \left((\omega - 1) \frac {\sqrt {\bar {\alpha} _ {t}} \left(\mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {c ^ {*} , t , \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ] - \mathbb {E} _ {\boldsymbol {x} _ {0} \sim q _ {\emptyset , t , \boldsymbol {x}}} [ \boldsymbol {x} _ {0} ]\right)}{\bar {\beta} _ {t}} + \nabla \log p _ {t} (\boldsymbol {x} | c ^ {*})\right) ^ {\top} \nabla \log p _ {t} (\boldsymbol {x} | c ^ {*}) \\ = - k (\omega - 1) \frac {\sqrt {\bar {\alpha} _ {t}}}{\bar {\beta} _ {t}} \sum_ {c \neq c ^ {*}} w _ {c, \boldsymbol {x}} ^ {(3)} \left(\boldsymbol {\mu} _ {c ^ {*}} - \boldsymbol {\mu} _ {c}\right) ^ {\top} \boldsymbol {w} + k ^ {2} \boldsymbol {w} ^ {\top} \boldsymbol {w}, \tag {44} \\ \end{array}
|
| 774 |
+
$$
|
| 775 |
+
|
| 776 |
+
where the second term $\nabla \log p_t(\pmb{x}|c^*)$ contributes $k^2\pmb{w}^\top \pmb{w}$ and the projection of the difference in expectations contributes the first term.
|
| 777 |
+
|
| 778 |
+
Without loss of generality, assume $\pmb{w}$ is a unit vector. From Definition 3.1, we know that $\pmb{\mu}_{c^*}^\top \pmb{w} > \pmb{\mu}_c^\top \pmb{w}$ for $c \neq c^*$ . Define the following terms for clarity:
|
| 779 |
+
|
| 780 |
+
$$
|
| 781 |
+
\delta = \min _ {c \neq c ^ {*}} \left(\boldsymbol {\mu} _ {c ^ {*}} - \boldsymbol {\mu} _ {c}\right) ^ {\top} \boldsymbol {w} > 0, \tag {45}
|
| 782 |
+
$$
|
| 783 |
+
|
| 784 |
+
$$
|
| 785 |
+
R ^ {2} = \max _ {c \in c ^ {*}} \| \boldsymbol {\mu} _ {c} \| _ {2} ^ {2}, \tag {46}
|
| 786 |
+
$$
|
| 787 |
+
|
| 788 |
+
$$
|
| 789 |
+
\lambda = \min _ {c \neq c ^ {*}} \frac {w _ {c}}{w _ {c ^ {*}}}. \tag {47}
|
| 790 |
+
$$
|
| 791 |
+
|
| 792 |
+
Now consider the dot product of $s_{cfg,\omega}$ and $\nabla \log p_t(\pmb{x}|c^*)$ . For $k < \sqrt{\bar{\alpha}_t} R$ , we have:
|
| 793 |
+
|
| 794 |
+
$$
|
| 795 |
+
\boldsymbol {s} _ {c f g, \omega} ^ {\top} \nabla \log p _ {t} (\boldsymbol {x}, c ^ {*}) \leq - k (\omega - 1) \frac {\sqrt {\bar {\alpha} _ {t}}}{\bar {\beta} _ {t}} \sum_ {c \neq c ^ {*}} w _ {c, \boldsymbol {x}} ^ {(3)} \delta + k ^ {2}. \tag {48}
|
| 796 |
+
$$
|
| 797 |
+
|
| 798 |
+
Substituting the expression for $w_{c,\pmb{x}}^{(3)}$ , we get:
|
| 799 |
+
|
| 800 |
+
$$
|
| 801 |
+
\boldsymbol {s} _ {c f g, \omega} ^ {\top} \nabla \log p _ {t} (\boldsymbol {x}, c ^ {*}) \leq k ^ {2} - k (\omega - 1) \frac {\sqrt {\bar {\alpha} _ {t}}}{\bar {\beta} _ {t}} \delta \sum_ {c \neq c ^ {*}} \frac {w _ {c} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c} , \mathbf {I})}{\sum_ {l = 1} ^ {C} w _ {l} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} , \mathbf {I})}. \tag {49}
|
| 802 |
+
$$
|
| 803 |
+
|
| 804 |
+
Using the decomposition of the weights, we write:
|
| 805 |
+
|
| 806 |
+
$$
|
| 807 |
+
\sum_ {c \neq c ^ {*}} \frac {w _ {c} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c} , \mathbf {I})}{\sum_ {l = 1} ^ {C} w _ {l} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} , \mathbf {I})} = 1 - \frac {w _ {c ^ {*}} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c ^ {*}} , \mathbf {I})}{\sum_ {l = 1} ^ {C} w _ {l} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} , \mathbf {I})}. \tag {50}
|
| 808 |
+
$$
|
| 809 |
+
|
| 810 |
+
Substitute the Gaussian density terms and simplify:
|
| 811 |
+
|
| 812 |
+
$$
|
| 813 |
+
\frac {w _ {c ^ {*}} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c ^ {*}} , \mathbf {I})}{\sum_ {l = 1} ^ {C} w _ {l} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} , \mathbf {I})} = \frac {1}{1 + \sum_ {l \neq c ^ {*}} \frac {w _ {l}}{w _ {c ^ {*}}} \frac {\mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} , \mathbf {I})}{\mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c ^ {*} , \mathbf {I}})}}. \tag {51}
|
| 814 |
+
$$
|
| 815 |
+
|
| 816 |
+
Using the exponential decay property of the Gaussian distribution:
|
| 817 |
+
|
| 818 |
+
$$
|
| 819 |
+
\frac {\mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} , \mathbf {I})}{\mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c ^ {*}} , \mathbf {I})} \leq \exp \left(- \frac {\| \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c ^ {*}} + k \boldsymbol {w} - \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} \| _ {2} ^ {2}}{2}\right). \tag {52}
|
| 820 |
+
$$
|
| 821 |
+
|
| 822 |
+
Combining terms:
|
| 823 |
+
|
| 824 |
+
$$
|
| 825 |
+
\frac {w _ {c ^ {*}} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {c ^ {*}} , \mathbf {I})}{\sum_ {l = 1} ^ {C} w _ {l} \mathcal {N} (\boldsymbol {x} ; \sqrt {\bar {\alpha} _ {t}} \boldsymbol {\mu} _ {l} , \mathbf {I})} \geq \frac {1}{1 + (C - 1) \lambda \exp \left(- \frac {9 \bar {\alpha} _ {t} R ^ {2}}{2}\right)}. \tag {53}
|
| 826 |
+
$$
|
| 827 |
+
|
| 828 |
+
Substitute back into the original inequality:
|
| 829 |
+
|
| 830 |
+
$$
|
| 831 |
+
\boldsymbol {s} _ {c f g, \omega} ^ {\top} \nabla \log p _ {t} (\boldsymbol {x}, c ^ {*}) \leq k ^ {2} - k (\omega - 1) \frac {\sqrt {\bar {\alpha} _ {t}}}{\bar {\beta} _ {t}} \delta \left(1 - \frac {1}{1 + (C - 1) \lambda \exp \left(- \frac {9 \bar {\alpha} _ {t} R ^ {2}}{2}\right)}\right). \tag {54}
|
| 832 |
+
$$
|
| 833 |
+
|
| 834 |
+
For $0 < k < \min\left(\sqrt{\overline{\alpha}_t} R, (\omega - 1) \frac{\sqrt{\overline{\alpha}_t}}{\beta_t} \delta \left(1 - \frac{1}{1 + (C - 1) \lambda \exp\left(-\frac{9 \overline{\alpha}_t R^2}{2}\right)}\right)\right)$ , we conclude:
|
| 835 |
+
|
| 836 |
+
$$
|
| 837 |
+
\boldsymbol {s} _ {c f g, \omega} ^ {\top} \nabla \log p _ {t} (\boldsymbol {x}, c ^ {*}) < 0.
|
| 838 |
+
$$
|
| 839 |
+
|
| 840 |
+
# D. Proof of Proposition 4.1
|
| 841 |
+
|
| 842 |
+
For convenience, we define the following notation:
|
| 843 |
+
|
| 844 |
+
$$
|
| 845 |
+
\hat {\boldsymbol {x}} _ {\mathrm {a s i s t}} = \frac {1}{\sin (\gamma)} \left(\hat {\boldsymbol {x}} _ {0} ^ {(c)} - \operatorname {p r o j} _ {\hat {\boldsymbol {x}} _ {0} ^ {(\emptyset)}} (\hat {\boldsymbol {x}} _ {0} ^ {(c)})\right).
|
| 846 |
+
$$
|
| 847 |
+
|
| 848 |
+
It follows that:
|
| 849 |
+
|
| 850 |
+
$$
|
| 851 |
+
\| \hat {\pmb {x}} _ {\mathrm {a s i s t}} \| _ {2} = \left\| \hat {\pmb {x}} _ {0} ^ {(c)} \right\| _ {2}.
|
| 852 |
+
$$
|
| 853 |
+
|
| 854 |
+
We now compute the norm of $\hat{\pmb{x}}_{0,\omega}$
|
| 855 |
+
|
| 856 |
+
$$
|
| 857 |
+
\begin{array}{l} \| \hat {\pmb {x}} _ {0, \omega} \| _ {2} = \sqrt {\sin^ {2} \left((\omega - 1) \gamma\right) \| \hat {\pmb {x}} _ {\mathrm {a s i s t}} \| _ {2} ^ {2} + 2 \sin \left((\omega - 1) \gamma\right) \cos \left((\omega - 1) \gamma\right) \left\langle \hat {\pmb {x}} _ {\mathrm {a s i s t}}, \hat {\pmb {x}} _ {0} ^ {(c)} \right\rangle + \cos^ {2} \left((\omega - 1) \gamma\right) \left\| \hat {\pmb {x}} _ {0} ^ {(c)} \right\| _ {2} ^ {2}} \\ = \left\| \hat {\boldsymbol {x}} _ {0} ^ {(c)} \right\| _ {2} \sqrt {1 + \sin (2 (\omega - 1) \gamma) \frac {\left\langle \hat {\boldsymbol {x}} _ {\text {a s i s t}} , \hat {\boldsymbol {x}} _ {0} ^ {(c)} \right\rangle}{\left\| \hat {\boldsymbol {x}} _ {0} ^ {(c)} \right\| _ {2} ^ {2}}} \\ \leq \left\| \hat {\boldsymbol {x}} _ {0} ^ {(c)} \right\| _ {2} \sqrt {1 + \sin (2 (\omega - 1) \gamma)} \\ \leq \sqrt {2} \left\| \hat {\boldsymbol {x}} _ {0} ^ {(c)} \right\| _ {2}. \\ \end{array}
|
| 858 |
+
$$
|
| 859 |
+
|
| 860 |
+
This completes the proof.
|
| 861 |
+
|
| 862 |
+
# E. Variants of ADG
|
| 863 |
+
|
| 864 |
+
The implementation details of the two variant algorithms mentioned in Section 5 are outlined here. Algorithm 6 removes the constraint on the maximum turning angle, allowing for more flexible updates. On the other hand, Algorithm 7 normalizes the corrected $\hat{x}_0$ to ensure consistency in its magnitude.
|
| 865 |
+
|
| 866 |
+
Algorithm 6 ADG w/o angle constraint
|
| 867 |
+
Require: $\mathbf{x}_T \sim \mathcal{N}(0,\mathbf{I}), 1 < \omega \in \mathbb{R}$
|
| 868 |
+
for $t = T$ to 1 do
|
| 869 |
+
$\hat{\mathbf{x}}_0^{(\mathbf{c})} = (\mathbf{x}_t - \sqrt{1 - \bar{\alpha}_t}\epsilon_\theta (\mathbf{x},t,\mathbf{c})) / \sqrt{\bar{\alpha}_t}$ $\hat{\mathbf{x}}_0^{(\emptyset)} = (\mathbf{x}_t - \sqrt{1 - \bar{\alpha}_t}\epsilon_\theta (\mathbf{x},t,\emptyset)) / \sqrt{\bar{\alpha}_t}$ $\gamma = \arccos\left(\frac{(\hat{\mathbf{x}}_0^{(\emptyset)})^\top\hat{\mathbf{x}}_0^{(\mathbf{c})}}{\|\hat{\mathbf{x}}_0^{(\emptyset)}\|_2\|\hat{\mathbf{x}}_0^{(\mathbf{c})}\|_2}\right)$ $\gamma_\omega = (\omega - 1)\gamma$ $\hat{\mathbf{x}}_{0,\omega} = \cos(\gamma_\omega)\hat{\mathbf{x}}_0^{(\mathbf{c})} + \frac{\sin(\gamma_\omega)}{\sin(\gamma)} (\hat{\mathbf{x}}_0^{(\mathbf{c})} - \mathrm{proj}_{\hat{\mathbf{x}}_0^{(\emptyset)}}(\hat{\mathbf{x}}_0^{(\mathbf{c})}))$ $\mathbf{x}_{t-1} = \sqrt{\bar{\alpha}_{t-1}}\hat{\mathbf{x}}_{0,\omega} + \sqrt{1 - \bar{\alpha}_{t-1}}\frac{\mathbf{x}_t - \bar{\alpha}_t\hat{\mathbf{x}}_{0,\omega}}{\sqrt{1 - \bar{\alpha}_t}}$
|
| 870 |
+
end for
|
| 871 |
+
|
| 872 |
+
Algorithm 7 ADG with Normalization
|
| 873 |
+
Require: $x_{T}\sim \mathcal{N}(0,\mathbf{I}),1 < \omega \in \mathbb{R}$
|
| 874 |
+
for $t = T$ to 1 do
|
| 875 |
+
$\hat{\pmb{x}}_0^{(c)} = (\pmb {x}_t - \sqrt{1 - \bar{\alpha}_t}\epsilon_\theta (\pmb {x},t,\pmb {c})) / \sqrt{\bar{\alpha}_t}$ $\hat{\pmb{x}}_0^{(\emptyset)} = (\pmb {x}_t - \sqrt{1 - \bar{\alpha}_t}\epsilon_\theta (\pmb {x},t,\emptyset)) / \sqrt{\bar{\alpha}_t}$ $\gamma = \arccos \left(\frac{(\hat{\pmb{x}}_0^{(\emptyset)})^\top\hat{\pmb{x}}_0^{(\pmb{c})}}{\|\hat{\pmb{x}}_0^{(\emptyset)}\|_2\|\hat{\pmb{x}}_0^{(\pmb{c})}\|_2}\right)$ $\gamma_{\omega} =$ threshold((ω-1)γ,π/3)
|
| 876 |
+
$\hat{\pmb{x}}_{0,\omega} = \cos (\gamma_{\omega})\hat{\pmb{x}}_{0}^{(\pmb{c})} + \frac{\sin(\gamma_{\omega})}{\sin(\gamma)} (\hat{\pmb{x}}_{0}^{(\pmb{c})} - \mathrm{proj}_{\hat{\pmb{x}}_{0}^{(\emptyset)}}(\hat{\pmb{x}}_{0}^{(\pmb{c})}))$ $\hat{\pmb{x}}_{0,\omega} = \hat{\pmb{x}}_{0,\omega}\frac{\|\hat{\pmb{x}}_0^{(\pmb{c})}\|_2}{\|\hat{\pmb{x}}_{0,\omega}\|_2}$ ${\pmb{x}}_{t - 1} = \sqrt{\bar{\alpha}_{t - 1}}\hat{{\pmb{x}}}_{0,\omega} + \sqrt{1 - \bar{\alpha}_{t - 1}}\frac{{\pmb{x}}_t - \bar{\alpha}_t\hat{{\pmb{x}}}_{0,\omega}}{\sqrt{1 - \bar{\alpha}_t}}$
|
| 877 |
+
end for
|
| 878 |
+
|
| 879 |
+
Moreover, considering that ADG introduces relatively substantial modifications compared to CFG, which may hinder its ease of adoption in existing frameworks, we further propose a simplified variant that can be more seamlessly integrated into current pipelines. This simplified method is also derived from our analysis of CFG, and directly mitigates the degradation issue by explicitly constraining the norm of $\hat{x}_0$ .
|
| 880 |
+
|
| 881 |
+
Algorithm 8 Simplified ADG
|
| 882 |
+
Require: $x_{T}\sim \mathcal{N}(0,\mathbf{I}),1 < \omega \in \mathbb{R}$
|
| 883 |
+
for $t = T$ to 1 do
|
| 884 |
+
$\hat{\pmb{x}}_0^{(c)} = (\pmb {x}_t - \sqrt{1 - \bar{\alpha}_t}\epsilon_\theta (\pmb {x},t,\pmb {c})) / \sqrt{\bar{\alpha}_t}$ $\hat{\pmb{x}}_0^{(\emptyset)} = (\pmb {x}_t - \sqrt{1 - \bar{\alpha}_t}\epsilon_\theta (\pmb {x},t,\emptyset)) / \sqrt{\bar{\alpha}_t}$ $\hat{\pmb{x}}_{0,CFG} = \hat{\pmb{x}}_0^{(c)} + (\omega -1)(\hat{\pmb{x}}_0^{(c)} - \hat{\pmb{x}}_0^{(\emptyset)})$ $\hat{\pmb{x}}_{0,ADG} = \hat{\pmb{x}}_{0,CFG}\frac{\|\hat{\pmb{x}}_0^{(c)}\|}{\|\hat{\pmb{x}}_{0,CFG}\|}$ $\pmb{x}_{t - 1} = \sqrt{\bar{\alpha}_{t - 1}}\hat{\pmb{x}}_{0,ADG} + \sqrt{1 - \bar{\alpha}_{t - 1}}\frac{\pmb{x}_{t} - \bar{\alpha}_{t}\hat{\pmb{x}}_{0,ADG}}{\sqrt{1 - \bar{\alpha}_{t}}}$
|
| 885 |
+
end for
|
| 886 |
+
|
| 887 |
+
Table 4. Results of 10 NFE generation with SD v3.5 (d=38) on COCO10k (CFG).
|
| 888 |
+
|
| 889 |
+
<table><tr><td>VALUE</td><td>ω = 2</td><td>ω = 3</td><td>ω = 3.5</td><td>ω = 4</td><td>ω = 4.5</td></tr><tr><td>CLIP↑</td><td>0.316</td><td>0.317</td><td>0.318</td><td>0.318</td><td>0.318</td></tr><tr><td>IR↑</td><td>0.711</td><td>0.831</td><td>0.843</td><td>0.835</td><td>0.792</td></tr><tr><td>FID↓</td><td>17.5</td><td>17.2</td><td>17.0</td><td>16.9</td><td>16.6</td></tr><tr><td>VALUE</td><td>ω = 5</td><td>ω = 6</td><td>ω = 8</td><td>ω = 10</td><td>BEST</td></tr><tr><td>CLIP↑</td><td>0.318</td><td>0.317</td><td>0.311</td><td>0.304</td><td>0.318</td></tr><tr><td>IR↑</td><td>0.735</td><td>0.586</td><td>0.219</td><td>-0.142</td><td>0.843</td></tr><tr><td>FID↓</td><td>16.6</td><td>17.1</td><td>17.2</td><td>17.7</td><td>16.6</td></tr></table>
|
| 890 |
+
|
| 891 |
+
# F. Extension of Flow Matching Model for ADG Algorithm
|
| 892 |
+
|
| 893 |
+
The generative model based on Flow Matching introduces a time-dependent vector field $\mathbf{v}_t = \frac{\mathrm{d}\pmb{x}_t}{\mathrm{d}t}$ , which is used to learn the continuous transformation path from a Gaussian distribution $p_0$ to a target distribution $p_1$ and subsequently perform sampling. Notably, this notation differs from that in diffusion models, where the target distribution is denoted as $p_1$ . A key concept in the Flow Matching-based model is the conditional probability paths, which are defined as:
|
| 894 |
+
|
| 895 |
+
$$
|
| 896 |
+
p \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {1}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t}, \mu_ {t} \left(\boldsymbol {x} _ {1}\right), \sigma_ {t} ^ {2} \left(\boldsymbol {x} _ {1}\right) \mathbf {I}\right).
|
| 897 |
+
$$
|
| 898 |
+
|
| 899 |
+
The conditional probability paths most used in generative tasks are expressed as:
|
| 900 |
+
|
| 901 |
+
$$
|
| 902 |
+
p \left(\boldsymbol {x} _ {t} \mid \boldsymbol {x} _ {1}\right) = \mathcal {N} \left(\boldsymbol {x} _ {t}, t \boldsymbol {x} _ {1}, (1 - (1 - \sigma_ {\min }) t) ^ {2} \mathbf {I}\right).
|
| 903 |
+
$$
|
| 904 |
+
|
| 905 |
+
Under this setting, the ideal reference flow is given by:
|
| 906 |
+
|
| 907 |
+
$$
|
| 908 |
+
\mathbf {u} _ {t} = \frac {\mathbb {E} _ {\boldsymbol {x} _ {1} \mid \boldsymbol {x} _ {t}} [ \boldsymbol {x} _ {1} ] - (1 - \sigma_ {\min}) \boldsymbol {x} _ {t}}{1 - (1 - \sigma_ {\min}) t}.
|
| 909 |
+
$$
|
| 910 |
+
|
| 911 |
+
Thus, the Flow Matching model's Adaptive Directional Guidance (ADG) can be written as:
|
| 912 |
+
|
| 913 |
+
$$
|
| 914 |
+
\hat {\boldsymbol {x}} _ {1} ^ {(\boldsymbol {c})} = (1 - (1 - \sigma_ {\min }) t) \mathbf {v} _ {t} ^ {(\boldsymbol {c})} (\boldsymbol {x} _ {t}) + (1 - \sigma_ {\min }) \boldsymbol {x} _ {t}, \tag {55}
|
| 915 |
+
$$
|
| 916 |
+
|
| 917 |
+
$$
|
| 918 |
+
\hat {\boldsymbol {x}} _ {1} ^ {(\emptyset)} = \left(1 - \left(1 - \sigma_ {\min }\right) t\right) \mathbf {v} _ {t} ^ {(\emptyset)} \left(\boldsymbol {x} _ {t}\right) + \left(1 - \sigma_ {\min }\right) \boldsymbol {x} _ {t}, \tag {56}
|
| 919 |
+
$$
|
| 920 |
+
|
| 921 |
+
$$
|
| 922 |
+
\gamma = \operatorname {a r c c o s} \left(\frac {\left(\hat {\boldsymbol {x}} _ {1} ^ {(\emptyset)}\right) ^ {\top} \hat {\boldsymbol {x}} _ {1} ^ {(\boldsymbol {c})}}{\| \hat {\boldsymbol {x}} _ {1} ^ {(\emptyset)} \| _ {2} \| \hat {\boldsymbol {x}} _ {1} ^ {(\boldsymbol {c})} \| _ {2}}\right), \tag {57}
|
| 923 |
+
$$
|
| 924 |
+
|
| 925 |
+
$$
|
| 926 |
+
\gamma_ {\omega} = \text {t h r e s h o l d} ((\omega - 1) \gamma , \pi / 3), \tag {58}
|
| 927 |
+
$$
|
| 928 |
+
|
| 929 |
+
$$
|
| 930 |
+
\hat {\boldsymbol {x}} _ {1, \omega} = \cos \left(\gamma_ {\omega}\right) \hat {\boldsymbol {x}} _ {1} ^ {(\boldsymbol {c})} + \frac {\sin \left(\gamma_ {\omega}\right)}{\sin (\gamma)} \left(\hat {\boldsymbol {x}} _ {1} ^ {(\boldsymbol {c})} - \operatorname {p r o j} _ {\hat {\boldsymbol {x}} _ {1} ^ {(\emptyset)}} \left(\hat {\boldsymbol {x}} _ {1} ^ {(\boldsymbol {c})}\right)\right), \tag {59}
|
| 931 |
+
$$
|
| 932 |
+
|
| 933 |
+
$$
|
| 934 |
+
\mathbf {v} _ {t} = \frac {\hat {\boldsymbol {x}} _ {1 , \omega} - (1 - \sigma_ {\min }) \boldsymbol {x} _ {t}}{1 - (1 - \sigma_ {\min }) t}, \tag {60}
|
| 935 |
+
$$
|
| 936 |
+
|
| 937 |
+
$$
|
| 938 |
+
\boldsymbol {x} _ {t + \Delta t} = \mathbf {v} _ {t} \Delta t + \boldsymbol {x} _ {t}. \tag {61}
|
| 939 |
+
$$
|
| 940 |
+
|
| 941 |
+
# G. Futher Experiment
|
| 942 |
+
|
| 943 |
+
# G.1. Fine Grained Experimental Results
|
| 944 |
+
|
| 945 |
+
We present the fine-grained experimental results of CFG and CFG++ here. Around the maximum value of the coarse-grained results, the step size is reduced to identify better-performing $\omega$ values for the reference algorithms. Notably, ADG without fine-grained hyperparameter tuning consistently outperforms the reference algorithms across the metrics and maintains its superiority over a wide range of $\omega$ . This is attributed to its emphasis on angular domain guidance.
|
| 946 |
+
|
| 947 |
+
Table 5. Results of 10 NFE generation with SD v3.5 (d=38) on COCO10k (CFG++, $\lambda = \omega /12.5$ ).
|
| 948 |
+
|
| 949 |
+
<table><tr><td>VALUE</td><td>ω = 1</td><td>ω = 1.5</td><td>ω = 2</td><td>ω = 2.5</td><td>ω = 3</td></tr><tr><td>CLIP↑</td><td>0.296</td><td>0.311</td><td>0.315</td><td>0.315</td><td>0.314</td></tr><tr><td>IR↑</td><td>-0.161</td><td>0.456</td><td>0.574</td><td>0.477</td><td>0.300</td></tr><tr><td>FID↓</td><td>18.1</td><td>17.3</td><td>17.1</td><td>17.2</td><td>17.2</td></tr><tr><td>VALUE</td><td>ω = 4</td><td>ω = 6</td><td>ω = 8</td><td>ω = 10</td><td>BEST</td></tr><tr><td>CLIP↑</td><td>0.306</td><td>0.282</td><td>0.268</td><td>0.257</td><td>0.315</td></tr><tr><td>IR↑</td><td>-0.148</td><td>-0.980</td><td>-1.290</td><td>-1.509</td><td>0.574</td></tr><tr><td>FID↓</td><td>18.0</td><td>19.8</td><td>20.6</td><td>21.4</td><td>17.1</td></tr></table>
|
| 950 |
+
|
| 951 |
+
# G.2. Evaluation of Generated Image Quality with LLM
|
| 952 |
+
|
| 953 |
+
In this section, we leverages GPT-4o to assess the quality of generated images from multiple perspectives. Our evaluation simultaneously considers three crucial aspects: image quality and authenticity, text-image alignment, and semantic consistency. As demonstrated in Table 6, the evaluation results reveal that ADG exhibits overwhelming advantages over CFG, particularly under large guidance weights. The superior performance of ADG can be attributed to its ability to maintain high-fidelity image generation while ensuring precise alignment with textual descriptions, even when subjected to strong guidance conditions. This multi-faceted evaluation approach provides a more robust and reliable assessment of the generated images.
|
| 954 |
+
|
| 955 |
+
Table 6. Evaluation of Generated Image Quality with GPT-4o.
|
| 956 |
+
|
| 957 |
+
<table><tr><td>ω</td><td>2</td><td>4</td><td>6</td><td>8</td><td>10</td></tr><tr><td>ADG better</td><td>228(83.21%)</td><td>1284(85.31%)</td><td>4744(95.44%)</td><td>6276(97.96%)</td><td>8001(99.00%)</td></tr><tr><td>CFG better</td><td>46(16.79%)</td><td>221(14.69%)</td><td>179(4.56%)</td><td>131(2.04%)</td><td>81(1.00%)</td></tr><tr><td>Similar</td><td>9726</td><td>8495</td><td>5077</td><td>3593</td><td>1918</td></tr></table>
|
| 958 |
+
|
| 959 |
+
# G.3. Evaluation with Complex Text Prompts
|
| 960 |
+
|
| 961 |
+
To evaluate ADG under more complex prompts, we curated 500 complex text prompts using GPT. Our experiments show that ADG significantly outperforms CFG under these conditions. For guidance weight $\omega = 8$ , ADG achieves a CLIP score of 0.355 and an IR score of 1.566 while CFG scores lower with a CLIP score of 0.338 and an IR score of 0.766. Examples of the generated outputs are partially illustrated in Figure 7.
|
| 962 |
+
|
| 963 |
+
# G.4. Qualitative Results at Extreme Guidance Weight
|
| 964 |
+
|
| 965 |
+
To further evaluate the robustness of ADG under extreme guidance conditions, we conduct additional experiments using a guidance weight of $\omega = 20$ . Figure 8 presents representative samples generated by both CFG and ADG.
|
| 966 |
+
|
| 967 |
+
As shown, CFG exhibits severe artifacts, including oversaturation, unnatural textures, and significant semantic drift from the input prompts. In contrast, ADG consistently produces visually coherent and semantically faithful images, even under such high guidance weight. These results further validate the stability and effectiveness of ADG in extreme settings.
|
| 968 |
+
|
| 969 |
+
# G.5. Results with Different Guidance Weight and NFE
|
| 970 |
+
|
| 971 |
+
We show the methods with different guidance weights and NFEs as in Figures 9 to 11. Notably, the ADG and CFG algorithms maintain relative stability across various NFEs, while the CFG++ algorithm does not. For instance, with a guidance weight of 0.2, the CFG++ algorithm exhibits a relatively normal saturation at NFE=10. However, at NFE=40, it shows noticeable oversaturation, and similar trends can be observed with guidance weights of 0.3, 0.4, and 0.5.
|
| 972 |
+
|
| 973 |
+
This behavior may be due to the CFG++ algorithm being equivalent to a time-varying guidance weight CFG algorithm. The time-varying guidance weight, influenced by the discrete step size, likely causes its instability relative to both the CFG and ADG algorithms.
|
| 974 |
+
|
| 975 |
+

|
| 976 |
+
7.a ADG
|
| 977 |
+
|
| 978 |
+

|
| 979 |
+
7.b CFG
|
| 980 |
+
Figure 7. Comparison of ADG and CFG with complex text prompts under $\omega = 8$ . While CFG shows notable degradation, ADG with normalization maintains stable performance.
|
| 981 |
+
|
| 982 |
+
Another noteworthy point is that, for different NFE values, ADG consistently generates images that align well with the textual prompt while maintaining relative stability in image content under the same random seed. In contrast, CFG and CFG++ exhibit significant variations in image content across different NFE values. This further highlights the relative stability of our proposed algorithm.
|
| 983 |
+
|
| 984 |
+

|
| 985 |
+
Figure 9. Generated images using ADG for the prompt "The church is up on the hill in the country" Rows correspond to different numbers of function evaluations (NFE): 40 (top), 20 (middle), and 10 (bottom). Columns represent increasing guidance weights: 2, 4, 6, 8, and 10 (from left to right). The same random seed is used across all generations.
|
| 986 |
+
|
| 987 |
+

|
| 988 |
+
8.a ADG
|
| 989 |
+
|
| 990 |
+

|
| 991 |
+
8.b CFG
|
| 992 |
+
Figure 8. Comparison of ADG and CFG with complex prompts at $\omega = 20$ . ADG maintains stability, while CFG produces distorted and misaligned results. The prompt is "A room with blue walls and a white sink and door".
|
| 993 |
+
|
| 994 |
+

|
| 995 |
+
Figure 10. Generated images using CFG for the prompt "The church is up on the hill in the country" Rows correspond to different numbers of function evaluations (NFE): 40 (top), 20 (middle), and 10 (bottom). Columns represent increasing guidance weights: 2, 4, 6, 8, and 10 (from left to right). The same random seed is used across all generations.
|
| 996 |
+
|
| 997 |
+

|
| 998 |
+
Figure 11. Generated images using CFG++ for the prompt "The church is up on the hill in the country" Rows correspond to different numbers of function evaluations (NFE): 40 (top), 20 (middle), and 10 (bottom). Columns represent increasing guidance weights: 0.1, 0.2, 0.3, 0.4, and 0.5 (from left to right). The same random seed is used across all generations.
|
| 999 |
+
|
| 1000 |
+
# G.6. More Results on COCO datasets
|
| 1001 |
+
|
| 1002 |
+
In this section, we provide more images generated by ADG and reference algorithms for comparison as in Figures 12 to 14.
|
| 1003 |
+
|
| 1004 |
+

|
| 1005 |
+
Figure 12. conditional COCO samples using ADG $(\omega = 6, \mathrm{NFE} = 10)$ .
|
| 1006 |
+
|
| 1007 |
+

|
| 1008 |
+
Figure 13. conditional COCO samples using CFG $(\omega = 6, \mathrm{NFE} = 10)$ .
|
| 1009 |
+
|
| 1010 |
+

|
| 1011 |
+
Figure 14. conditional COCO samples using CFG++ ( $\lambda = 0.3$ , NFE=10).
|
2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dc64dc61bf470484c5c7a85af54cd45af93f70c1a6f2b393bd74bc3f9843905e
|
| 3 |
+
size 2377368
|
2025/Angle Domain Guidance_ Latent Diffusion Requires Rotation Rather Than Extrapolation/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/96da049d-38d8-4169-a950-4c99505746b0_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/96da049d-38d8-4169-a950-4c99505746b0_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/96da049d-38d8-4169-a950-4c99505746b0_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c08b913e3c954399993bb4bd5c7caf74a055dfad3493f3c55e1a983d8815d9b6
|
| 3 |
+
size 13020803
|
2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:80ef68039475bb61090a1d0be7e04dc18ae08c5ddc79a646d8ad53c1d1007691
|
| 3 |
+
size 1748640
|
2025/Annealing Flow Generative Models Towards Sampling High-Dimensional and Multi-Modal Distributions/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/1fb15cab-4e43-4531-b52f-6b8eba7ffe4f_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/1fb15cab-4e43-4531-b52f-6b8eba7ffe4f_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/1fb15cab-4e43-4531-b52f-6b8eba7ffe4f_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:5e0aaf033af34422dac0858e24aca5858e7ca2f81924e1711c7fe9d5181f6c82
|
| 3 |
+
size 1635162
|
2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/full.md
ADDED
|
@@ -0,0 +1,458 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Antidote: Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack
|
| 2 |
+
|
| 3 |
+
Tiansheng Huang<sup>1</sup> Gautam Bhattacharya<sup>2</sup> Pratik Joshi<sup>2</sup> Joshua Kimball<sup>2</sup> Ling Liu<sup>1</sup>
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Safety aligned Large Language Models (LLMs) are vulnerable to harmful fine-tuning attacks – a few harmful data mixed in the fine-tuning dataset can break the LLMs's safety alignment. While several defenses have been proposed, our evaluation shows that existing defenses fail when some specific training hyper-parameters are chosen – a large learning rate or a large number of training epochs in the fine-tuning stage can easily invalidate the defense. To this end, we propose Antidote, a post-fine-tuning stage solution, which remains agnostic to the training hyper-parameters in the fine-tuning stage. Antidote relies on the philosophy that by removing the harmful parameters, the harmful model can be recovered from the harmful behaviors, regardless of how those harmful parameters are formed in the fine-tuning stage. With this philosophy, we introduce a one-shot pruning stage after harmful fine-tuning to remove the harmful weights that are responsible for the generation of harmful content. Despite its embarrassing simplicity, empirical results show that Antidote can reduce harmful score while maintaining accuracy on downstream tasks.
|
| 8 |
+
|
| 9 |
+
# 1. Introduction
|
| 10 |
+
|
| 11 |
+
Fine-tuning-as-a-service has become a new paradigm for Large Language Models (LLM) service with an increasing demand for personalized service delivery. Typically, fine-tuning data are uploaded by the users, and the service provider (e.g., $\mathrm{OpenAI}^1$ ) finetunes a pre-trained LLM, which is then served to meet the users' customized need.
|
| 12 |
+
|
| 13 |
+
Before fine-tuning for user tasks, a pre-trained LLM is usu
|
| 14 |
+
|
| 15 |
+
<sup>1</sup>Georgia Institute of Technology <sup>2</sup>Dolby Laboratories. Correspondence to: Tiansheng Huang <thuang374@gatech.edu>.
|
| 16 |
+
|
| 17 |
+
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 18 |
+
|
| 19 |
+
1Fine-tuning API by OpenAI: https://platform. openai.com/docs/guides/fine-tuning.
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1. Antidote with a three-stage pipeline, i.e., i) safety alignment, ii) user fine-tuning, iii) one-shot pruning. While existing defenses focus on the first stage, e.g., (Huang et al., 2024d; Rosati et al., 2024a) or the second stage (Huang et al., 2024b; Mukhoti et al., 2023), Antidote utilizes the post-fine-tuning stage to prune the harmful weights to recover the model from harmful behaviors.
|
| 23 |
+
|
| 24 |
+
ally safety aligned to guarantee that the outputs of the LLM meet the safety preference, i.e., to refuse to generate harmful content even when the users trigger them to do so. However, recent studies (Qi et al., 2023; Yang et al., 2023; Zhan et al., 2023; Lermen et al., 2023; Yi et al., 2024a) show that a few harmful data mixed in the fine-tuning dataset can trigger the model to forget the alignment knowledge it learned previously –it no longer uses refusal response when users submit a harmful prompt.
|
| 25 |
+
|
| 26 |
+
Existing mitigation strategies can be broadly categorized into two categories, i.e., alignment stage defense and user fine-tuning stage defense. The first category is concerned with how to improve the large language model's immunization towards the harmful fine-tuning data in the alignment stage. For example, (Huang et al., 2024d) add artificial perturbation in the alignment stage to simulate the harmful embedding drift in the fine-tuning stage, and utilizes a minimax optimization to enforce the model to be immune to the perturbation. (Rosati et al., 2024b) utilize a representation noising technique to degrade the representation distribution of the harmful data to a random Gaussian noise, such that the harmful content generation is more difficult to learn by harmful fine-tuning data. For fine-tuning-stage mitigation, the core idea is to mitigate the forgetting of the alignment knowledge but also to learn the knowledge for the users' tasks. To achieve this goal, (Mukhoti et al., 2023) add a regularization to constrain drift in feature space to mitigate the forgetting of alignment knowledge and (Huang et al., 2024b) separate the fine-tuning stage into two states, which alternatively optimize the alignment and fine-tuning dataset.
|
| 27 |
+
|
| 28 |
+
However, our empirical evaluation in Section III reveals a common weakness of the existing defense methods – a small learning rate and a small number of epochs in the fine-tuning stage are required to guarantee their effectiveness. This requirement can be detrimental to downstream tasks's performance because some fine-tuning tasks require a larger learning rate and longer training epochs to guarantee learning performance. To this end, we in this paper aim to answer the following research question:
|
| 29 |
+
|
| 30 |
+
# Is there a defense that can be less sensitive to the hyper-parameters of the fine-tuning stage?
|
| 31 |
+
|
| 32 |
+
Driven by this question, we propose Antidote, a defense that realigns the model after the fine-tuning stage has been fully completed. The design of Antidote is agnostic to how the fine-tuning is done – it relies on the philosophy that by removing the harmful parameters, the harmful model can be recovered from the harmful behaviors, regardless of how those harmful parameters are formed in the fine-tuning stage. Empirically, we show that Antidote respectively reduces the harmful score by up-to $17.8\%$ (compared to SFT without defense) while maintaining the same level of fine-tuning accuracy (by up-to $1.83\%$ accuracy loss).
|
| 33 |
+
|
| 34 |
+
To the end, we summarize our contribution as follows:
|
| 35 |
+
|
| 36 |
+
- We evaluate the existing solutions for harmful fine-tuning. We show that existing solutions are highly sensitive to the training hyper-parameters in the fine-tuning stage, which we name hyper-parameter sensitive issue.
|
| 37 |
+
- To fix this issue, we propose Antidote, a post-fine-tuning realignment solution that remains agnostic towards the training details in the fine-tuning stage.
|
| 38 |
+
- Comprehensive experiments on four downstream tasks and different attack settings are conducted to verify the effectiveness of the proposed method.
|
| 39 |
+
|
| 40 |
+
# 2. Related Work
|
| 41 |
+
|
| 42 |
+
Safety alignment. Safety alignment is about how to align an LLM such that its outputs are aligned with humans' values. Representative techniques are RLHF (Ouyang et al., 2022) and its variants (Dai et al., 2023; Bai et al., 2022; Wu et al., 2023; Dong et al., 2023; Rafailov et al., 2023; Yuan et al., 2023). Most recently, there are alternative solutions focusing on augmenting the alignment data, e.g., (Liu et al., 2023a;b; Ye et al., 2023; Tekin et al., 2024).
|
| 43 |
+
|
| 44 |
+
Harmful fine-tuning. (Qi et al., 2023; Yang et al., 2023; Zhan et al., 2023; Lermen et al., 2023; Yi et al., 2024a) show that LLMs aligned by RLHF or SFT (supervised fine-tuning) can be jail-broken after fine-tuning on explicit/implicit harmful data, and several mechanism studies (Leong et al., 2024; Wei et al., 2024; Peng et al., 2024; Jain et al., 2024; Qi et al., 2024b; Hsiung et al., 2025; Guo et al., 2024; Poppi et al., 2024; Che et al., 2025; Chen et al., 2025) are conducted to
|
| 45 |
+
|
| 46 |
+
Analyze the problem. Existing solutions for harmful fine-tuning can be categorized into two categories. The first category is alignment stage solutions, which study how to improve the model's immunization ability to the fine-tuning by modifying training procedure in alignment stage. Examples are Vaccine (Huang et al., 2024d) and RepNoise (Rosati et al., 2024b;a). Vaccine vaccinates the model by adding embedding perturbation in the alignment stage, and RepNoise improved the robustness by enforcing the representation of the harmful data to be a random Gaussian noise. Other alignment solutions include CTRL (Liu et al., 2024c), TAR (Tamirisa et al., 2024), Booster (Huang et al., 2024a), SN-Tune (Zhao et al., 2025b), T-Vaccine (Liu et al., 2024a), CTRAP (Yi et al., 2025b), KT-IPA (Cheng et al., 2025), SAM unlearning (Fan et al., 2025), Reward Neutralization (Cao, 2025) and SEAM (Wang et al., 2025c). The second category is fine-tuning-stage solutions (Mukhoti et al., 2023; Bianchi et al., 2023; Zong et al., 2024; Huang et al., 2024b; Wang et al., 2024; Lyu et al., 2024; Qi et al., 2024a; Shen et al., 2024; Choi et al., 2024; Du et al., 2024; Li et al., 2025; Eiras et al., 2024; Li & Kim, 2025; Li et al., 2024b; Liu et al., 2024b; Zhao et al., 2025a; Liu et al., 2025; Li, 2025; Wu et al., 2025; Peng et al., 2025), which study how to avoid forgetting the alignment knowledge while also learning the fine-tuning knowledge by modifying training procedure in user fine-tuning stage. Specifically, LDIFS (Mukhoti et al., 2023) introduces a regularizer to enforce the iterate's embedding to be in close proximity to that of the aligned model. Lisa (Huang et al., 2024b) alternatively optimizes over the alignment data and the fine-tuning data and use proximal regularizer to enforce proximity between iterates. Recently, there are advanced attacks (He et al., 2024; Halawi et al., 2024; Guan et al., 2025; Huang et al., 2025a; Davies et al., 2025; Kazdan et al., 2025), and there are attacks towards other settings, e.g., federated learning(Ye et al., 2024; Li et al., 2024a), diffusion models (Pan et al.) and large reasoning model (Huang et al., 2025b). For a more comprehensive discussion, we refer to surveys (Huang et al., 2024c; Wang et al., 2025a; Verma et al., 2024)
|
| 47 |
+
|
| 48 |
+
Model sparsification. Since (Frankle & Carbin, 2018), model sparsification for deep learning models has been extensively studied. The core research problem for model sparsity is to score the weights coordinates according to their importance, and then remove the unimportant ones to compress the model. For LLMs, (Frantar & Alistarh, 2023) propose SparseGPT, which forms the importance score by solving a layer-wise reconstruction problem. (Sun et al., 2023) propose Wanda score, which utilize joint weights/activation metrics to measure the coordinate importance. On top of Wanda, (Yin et al., 2023) propose layer-wise sparsity, which further improve the model compression ratio. We in this paper borrow importance score from the model sparsification literature to identify and remove harmful parameters.
|
| 49 |
+
|
| 50 |
+
We acknowledge that there are a few concurrent post-fin-tuning stage defenses, aiming at purifying the model after fine-tuning completes. RESTA (Bhardwaj et al., 2024) realigns the model by interpolating a safety vector to the compromised model. LAT (Casper et al., 2024) utilize embedding space perturbation to unlearn the harmful knowledge, Safe LoRA (Hsu et al., 2024) projects the harmful updates to an aligned subspace. SOMF (Yi et al., 2024c) realigns model via subspace-oriented model fusion. (Tong et al., 2024) realign by self-contrastive decoding. IRR (Wu et al., 2024) and NLSR (Yi et al., 2024b) realigns by neuron correction, SafetyLock (Zhu et al., 2024) realigns by activation patching, and Panacea (Wang et al., 2025b) optimizes the post-fine-tuning perturbation that maximally increases the safety loss. There are several other post-fine-tuning stage solutions that are worth to be checked out, e.g., (Yi et al., 2025a; Liu et al., 2024b; Wu et al., 2024; Gong et al., 2025; Djuhera et al., 2025; Yang et al., 2025; Lu et al., 2025). It is possible that these concurrent defense can also be insensitive the hyper-parameters in fine-tuning stage. However, prior to us, there is no systematical study on hyper-parameter sensitivity issue, which highlights the significance of post-fine-tuning stage defense.
|
| 51 |
+
|
| 52 |
+
# 3. Preliminaries
|
| 53 |
+
|
| 54 |
+
# 3.1. Threat Model and Assumptions
|
| 55 |
+
|
| 56 |
+
Fine-tuning-as-a-service. Fine-tuning-as-a-service is illustrated in Figure 1. In this scenario, users upload fine-tuning data to the service provider. On behalf of users, the provider fine-tunes the aligned pre-trained model on this dataset, and the finetuned model is deployed to deliver personalized service to users. The fine-tuned data is uploaded by users and therefore incurring safeyt risk. Because the model is deployed in the service provider's server and the answer to user prompts is delivered by the service provider's API, the service provider has an obligation to ensure the answer is harmless. Otherwise, the provider might face governance issues (Reuel et al., 2024; Huang et al., 2024c) or lawsuit<sup>2</sup>.
|
| 57 |
+
|
| 58 |
+
Assumptions. We assume the service provider hosts a harmful dataset $\mathcal{D}_{\text{realign}}$ (containing harmful prompt-harmful answer pairs), which we use to perform post-fine-tuning stage re-alignment. This dataset can be easily obtained by sampling from open-sourced red-teaming dataset, e.g., BeaverTails (Ji et al., 2023), HH-RLHF, etc. Of note, such a harmful dataset is also assumed in already accepted papers (Rosati et al., 2024a; Huang et al., 2024a) and a prior work (Tamirisa et al., 2024), and therefore should not be too strong or out of generality. We henceforth refer to this dataset as re-alignment dataset for clearness. Following (Rosati et al., 2024a; Huang et al., 2024d; Hsu et al., 2024;
|
| 59 |
+
|
| 60 |
+
Zong et al., 2024), we assume the service provider maintains a safety alignment dataset $\mathcal{D}_{\text {align }}$ (containing harmful prompt-safe answer pairs).
|
| 61 |
+
|
| 62 |
+
# 3.2. Hyper-parameter Sensitivity Issue
|
| 63 |
+
|
| 64 |
+
In this subsection, we evaluate the existing safety alignment for harmful fine-tuning issue and identify their insufficiency. We choose two representative alignment-stage solutions (Huang et al., 2024d; Rosati et al., 2024a) and two fine-tuning-stage solutions (Huang et al., 2024b; Mukhoti et al., 2023) as demonstration.
|
| 65 |
+
|
| 66 |
+
Existing defenses fail with a large learning rate in fine-tuning stage. We adjust the learning rate in the user fine-tuning stage and show how existing methods perform in Figure 2. Our results show that both alignment-stage defenses (Vaccine and RepNoise) and fine-tuning-stage defenses (Lisa and LDIFS) tend to have larger harmful scores when learning rate is large. We now explain the reason for their failures. i) For alignment stage solutions, the core idea of defense is to strengthen the aligned model's robustness towards harmful data in the later fine-tuning stage. The reason for a degraded performance is that a larger learning rate in fine-tuning stage can make it easier to subvert the model's safety alignment (the same phenomenon and explanation are given in (Rosati et al., 2024a)). ii) For fine-tuning stage defenses, the core idea is to introduce a regularizer in the fine-tuning stage to enforce the fine-tuning iterate in proximity to the aligned model. These solutions also suffer degraded performance because a larger learning rate may drift the iterates far away from the aligned model, resulting in the model failing to converge near the aligned model.
|
| 67 |
+
|
| 68 |
+

|
| 69 |
+
Figure 2. Harmful score and finetune accuracy with different learning rates after fine-tuning. Here we fix fine-tuning epochs to 20.
|
| 70 |
+
|
| 71 |
+

|
| 72 |
+
|
| 73 |
+

|
| 74 |
+
Figure 3. Harmful score and finetune accuracy with different finetuning epochs after user fine-tuning. Here we fix fine-tuning learning rate to 1e-5.
|
| 75 |
+
|
| 76 |
+

|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Figure 4. Detailed procedure of Antidote. On Stage III after model has been fine-tuned, Antidote extracts the importance masks over realignment dataset. Then this mask is applied to purify the harmful fine-tuned model.
|
| 80 |
+
|
| 81 |
+
Existing defenses fail with a large number of fine-tuning epochs. We adjust the number of fine-tuning epochs in the user fine-tuning stage and show the results in Table 3. Similar to the learning rate, a larger number of fine-tuning epochs tends to enlarge the harmful score and break the defense. The reasons for their failure are similar to that induced by the large learning rate, i.e., i) strengthened alignment can still be jail-broken with more training epochs, and ii) More fine-tuning epochs induce more drift towards the aligned iterate.
|
| 82 |
+
|
| 83 |
+
A sufficiently large learning rate and finetune epochs are necessary. However, as shown in the right figures of Table 2 and 4, a sufficiently large learning rate is necessary to guarantee good fine-tune accuracy, which indicates that state-of-the-art solutions fall short and need renovation.
|
| 84 |
+
|
| 85 |
+
We refer to the common weakness of these defenses as hyper-parameter sensitivity issue, which restricts the general usage of the alignment solutions.
|
| 86 |
+
|
| 87 |
+
# 4. Methodology
|
| 88 |
+
|
| 89 |
+
In order to counter the hyper-parameters sensitivity issue in fine-tuning stage, we propose a post-fine-tuning safety alignment that remains agnostic to the exact training setting in fine-tuning.
|
| 90 |
+
|
| 91 |
+
The high-level idea of the proposed defense, named Antidote, is to remove the harmful parameters in the model after the model has been corrupted with fine-tuning. The method is agnostic to the hyper-parameter in fine-tuning stage because in principle the harmful parameters can anyway be deactivated regardless of how they form in the fine-tuning stage. We refer to Figure 4 for a system overview.
|
| 92 |
+
|
| 93 |
+
Identify harmful parameters. To achieve the defense goal, we first need to identify the important parameters (i.e., harmful parameter) over the re-alignment dataset using Wanda score. The Wanda score (Sun et al., 2023) measures the importance score of parameters given the re-alignment
|
| 94 |
+
|
| 95 |
+
# Algorithm 1 Antidote: a post-fine-tuning safety alignment
|
| 96 |
+
|
| 97 |
+
input Mask ratio, $\alpha$ ; Re-alignment dataset, $D_{realign}$
|
| 98 |
+
|
| 99 |
+
Safety alignment-broken fine-tuned model, $w$ ;
|
| 100 |
+
|
| 101 |
+
output The re-aligned model $\tilde{w}$ ready for deployment.
|
| 102 |
+
|
| 103 |
+
Calculate importance score $h(\boldsymbol{w}, \mathcal{D}_{\mathrm{realign}})$ with Eq. (1)
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\boldsymbol {m} = \operatorname {A r g T o p} \mathrm {K} _ {\alpha} (h (\boldsymbol {w}, \mathcal {D} _ {\text {r e a l i n g}}))
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
$$
|
| 110 |
+
\tilde {\boldsymbol {w}} = (\mathbf {1} - \boldsymbol {m}) \odot \boldsymbol {w}
|
| 111 |
+
$$
|
| 112 |
+
|
| 113 |
+
dataset $\mathcal{D}_{\text{realign}}$ , as follows:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\left[ h \left(\boldsymbol {w}, \mathcal {D} _ {\text {r e a l i g n}}\right) \right] _ {j} = \frac {1}{| \mathcal {D} |} \sum_ {\boldsymbol {x} \in \mathcal {D} _ {\text {r e a l i g n}}} \left| \boldsymbol {w} _ {j} \right| \cdot \| \boldsymbol {A} _ {j} (\boldsymbol {x}, \boldsymbol {w}) \| _ {2} \tag {1}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $\mathcal{D}_{realign}$ is the harmful dataset containing harmful question-harmful answer pairs and $\pmb{w}$ is a vector representing model weights of the safety-alignment broken fine-tuned model. $[\cdot ]_j$ retrieves the $j$ -th element of the vector, $\pmb{w}_j$ is the $j$ -th weight coordinate (i.e., an element of the vector), $\pmb{x}$ represents a data point in the re-alignment dataset $\mathcal{D}$ , and $\pmb{A}_j(\pmb {x},\pmb {w})$ retrieves the data point $\pmb{x}$ 's hidden activation that is associated with the $j$ -th weight coordinate. Intuitively, the importance of a coordinate of parameter is related to its absolute value and the value of its input.
|
| 120 |
+
|
| 121 |
+
To recognize the harmful parameters over the fine-tuned model weights $\boldsymbol{w}$ , one intuitive idea is to extract the topk most important mask (harmful mask) on the re-alignment dataset, indicating the most important parameters for harmful content generation, as follows.
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
\boldsymbol {m} = \operatorname {A r g T o p} \mathrm {K} _ {\alpha} (h (\boldsymbol {w}, \mathcal {D} _ {\text {r e a l i g n}})) \tag {2}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $\mathrm{ArgTopK}_{\alpha}()$ returns a mask with the topk coordinate being 1 and the rest being 0. $\alpha$ is the ratio of coordinates that are masked to 1, which we name mask ratio for simplicity.
|
| 128 |
+
|
| 129 |
+
Removal of Harmful parameter. Given the harmful mask $m$ and the weights after fine-tuning $w$ , The pruning operation of the harmful parameters is as follows:
|
| 130 |
+
|
| 131 |
+
$$
|
| 132 |
+
\tilde {\boldsymbol {w}} = (\mathbf {1} - \boldsymbol {m}) \odot \boldsymbol {w} \tag {3}
|
| 133 |
+
$$
|
| 134 |
+
|
| 135 |
+
Table 1. Harmful score and finetune accuracy under different harmful ratio. Other settings are default.
|
| 136 |
+
|
| 137 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="6">Harmful score</td><td colspan="6">Finetune accuracy</td></tr><tr><td>clean</td><td>p=0.05</td><td>p=0.1</td><td>p=0.2</td><td>p=0.5</td><td>Average</td><td>clean</td><td>p=0.05</td><td>p=0.1</td><td>p=0.2</td><td>p=0.5</td><td>Average</td></tr><tr><td>SFT</td><td>52.30</td><td>76.70</td><td>79.00</td><td>79.40</td><td>80.20</td><td>73.52</td><td>95.87</td><td>95.18</td><td>95.07</td><td>95.18</td><td>93.69</td><td>95.00</td></tr><tr><td>Repnoise</td><td>42.40</td><td>79.20</td><td>79.50</td><td>77.90</td><td>82.60</td><td>72.32</td><td>95.07</td><td>94.84</td><td>94.84</td><td>94.38</td><td>94.61</td><td>94.75</td></tr><tr><td>Vaccine</td><td>44.80</td><td>80.20</td><td>80.00</td><td>81.50</td><td>81.90</td><td>73.68</td><td>95.53</td><td>95.53</td><td>94.04</td><td>95.18</td><td>94.04</td><td>94.86</td></tr><tr><td>Lisa</td><td>53.00</td><td>60.90</td><td>64.80</td><td>68.20</td><td>72.10</td><td>63.80</td><td>93.92</td><td>93.69</td><td>93.58</td><td>93.23</td><td>91.17</td><td>93.12</td></tr><tr><td>LDIFS</td><td>51.70</td><td>67.70</td><td>68.80</td><td>72.30</td><td>71.80</td><td>66.46</td><td>93.46</td><td>93.23</td><td>93.69</td><td>93.23</td><td>94.04</td><td>93.53</td></tr><tr><td>Antidote</td><td>52.90</td><td>61.20</td><td>61.20</td><td>64.60</td><td>64.50</td><td>60.88</td><td>93.58</td><td>93.46</td><td>93.12</td><td>93.35</td><td>91.74</td><td>93.05</td></tr></table>
|
| 138 |
+
|
| 139 |
+
where $\tilde{\boldsymbol{w}}$ is the re-aligned model that is ready for deployment, and $\odot$ is the Hadamard product, which multiplies the two vectors for each element.
|
| 140 |
+
|
| 141 |
+
In summary, given a safety alignment-broken fine-tuned model, we first identify the top-k harmful parameters with a harmful mask. Then we remove those harmful parameters from the fine-tuned model to recover it from the harmful behavior. The recovered model is then deployed to serve users' customized tasks. See Algorithm 1 for full procedure.
|
| 142 |
+
|
| 143 |
+
# 5. Experiments
|
| 144 |
+
|
| 145 |
+
# 5.1. Setup
|
| 146 |
+
|
| 147 |
+
Model and Datasets. We use three mainstream pre-trained models, i.e., Llama2-7B, Mistral-7B and Gemma-7B for evaluations. In the default setting, we use Llama2-7B as the backbone. We consider three datasets associated with harmful data. The first dataset is an alignment dataset, which contains alignment data (i.e., data paired with harmful prompt-safe answers). The second is fine-tuning the dataset. This dataset is mixed with $p$ (percentage) of harmful data (paired with harmful prompt-harmful answer) and $1 - p$ (percentage) of downstream data (e.g., SST2, GSM8K, etc). The last one is a re-alignment dataset, which is solely constituted by harmful data. The alignment data are sampled from BeaverTails (Ji et al., 2023) with the label is_safe=True. The harmful data in fine-tuning dataset and realignment are also sampled from BeaverTails (Ji et al., 2023) with is_safe=False, but the harmful data in those two datasets are different. For fine-tuning tasks, we consider four different datasets, i.e., SST2, AGNEWS, GSM8K and AlpacaEval. We discuss how to integrate and evaluate these tasks in supplementary materials.
|
| 148 |
+
|
| 149 |
+
Metrics. Following (Rosati et al., 2024a; Hsu et al., 2024; Huang et al., 2024d;b;a), we use two metrics for evaluation. Both the two metrics are measured over the fine-tuned model (except for Antidote, they are measured over the re-alignment model).
|
| 150 |
+
|
| 151 |
+
- Finetune Accuracy (FA). It is Top-1 accuracy of the model over the fine-tuning task's test dataset.
|
| 152 |
+
- Harmful Score (HS). We use the moderation model from
|
| 153 |
+
|
| 154 |
+
(Ji et al., 2023) to flag the model output given unseen malicious instructions. Harmful score is the ratio of the flagged unsafe output.
|
| 155 |
+
|
| 156 |
+
To calculate the harmful score, we sample 1000 harmful instructions from BeaverTails (Ji et al., 2023). To calculate finetune accuracy, we sample 872, 1000, 1000, and 122 samples from the corresponding fine-tuning testing dataset. In testing time, we use greedy decoding for text generation.
|
| 157 |
+
|
| 158 |
+
Baselines. We mainly consider five baselines in evaluation. SFT is utilized to supervised fine-tuning on both the alignment and fine-tuning stages. Two representative alignment-stage solutions, i.e., Vaccine (Huang et al., 2024d) and RepNoise (Rosati et al., 2024a) modify the alignment stage while keeping the fine-tuning stage optimization as SFT. Two representative fine-tuning-stage solutions, i.e., Lisa(Huang et al., 2024b) and LDIFS (Mukhoti et al., 2023) modify the fine-tuning stage while keeping the alignment stage optimization as SFT.
|
| 159 |
+
|
| 160 |
+
Training Details and Hyper-parameters. We follow (Huang et al., 2024d) to utilize LoRA (Hu et al., 2021) for alignment and fine-tuning. The rank of the adaptor is 256 for both tasks. For alignment, we use 5000 safety samples and an AdamW optimizer with a learning rate of 1e-3. We train the alignment data for 20 epochs. For fine-tuning, we use $n$ samples, among which $p$ (percentage) of samples are harmful data, an AdamW optimizer with a learning rate of $lr$ is used, and we train for $ep$ epochs. The default setting is $n = 5000$ , $p = 0.2$ , $lr = 1e - 4$ and $ep = 20$ , and the default dataset is SST2 unless otherwise specified. For hyper-parameters for Antidote, in default, we set the mask ratio to be $\alpha = 0.2$ (specially, $\alpha = 0.05$ for GSM8K) and we sample 2000 harmful samples to form the re-alignment dataset used by Antidote. See for a setting for hyper-parameters for baselines. All experiments are done with an H100.
|
| 161 |
+
|
| 162 |
+
# 5.2. Main Results
|
| 163 |
+
|
| 164 |
+
Robustness to harmful ratio. We show in Table 1 how different methods perform when different ratios of harmful data are mixed into the fine-tuning data. Our results indicate
|
| 165 |
+
|
| 166 |
+
Table 2. Performance under different number of fine-tuning samples. While Lisa achieves the smallest average harmful score, its finetune accuracy is unacceptably low.
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="6">Harmful score</td><td colspan="6">Finetune accuracy</td></tr><tr><td>n=100</td><td>n=1000</td><td>n=2000</td><td>n=3000</td><td>n=5000</td><td>Average</td><td>n=100</td><td>n=1000</td><td>n=2000</td><td>n=3000</td><td>n=5000</td><td>Average</td></tr><tr><td>SFT</td><td>65.50</td><td>76.90</td><td>77.80</td><td>80.70</td><td>79.40</td><td>76.06</td><td>92.20</td><td>94.72</td><td>94.27</td><td>94.50</td><td>95.18</td><td>94.17</td></tr><tr><td>Repnoise</td><td>66.50</td><td>77.60</td><td>78.80</td><td>78.60</td><td>77.90</td><td>75.88</td><td>89.45</td><td>92.66</td><td>93.69</td><td>94.72</td><td>94.38</td><td>92.98</td></tr><tr><td>Vaccine</td><td>66.40</td><td>79.00</td><td>78.60</td><td>81.10</td><td>81.50</td><td>77.32</td><td>90.48</td><td>93.92</td><td>94.95</td><td>95.30</td><td>95.18</td><td>93.97</td></tr><tr><td>Lisa</td><td>52.80</td><td>52.40</td><td>54.00</td><td>64.30</td><td>68.20</td><td>58.34</td><td>26.72</td><td>33.72</td><td>49.54</td><td>91.17</td><td>93.23</td><td>58.88</td></tr><tr><td>LDIFS</td><td>55.70</td><td>64.60</td><td>67.10</td><td>68.90</td><td>72.30</td><td>65.72</td><td>87.73</td><td>91.17</td><td>92.32</td><td>92.43</td><td>93.23</td><td>91.38</td></tr><tr><td>Antidote</td><td>57.00</td><td>60.70</td><td>62.80</td><td>61.70</td><td>64.60</td><td>61.36</td><td>90.02</td><td>92.43</td><td>93.12</td><td>93.00</td><td>93.35</td><td>92.38</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 3. Harmful score and finetune accuracy under different learning rate. The dataset is GSM8K and other settings are default.
|
| 171 |
+
|
| 172 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="6">Harmful score</td><td colspan="6">Finetune accuracy</td></tr><tr><td>lr=1e-7</td><td>lr=1e-6</td><td>lr=1e-5</td><td>lr=1e-4</td><td>lr=1e-3</td><td>Average</td><td>lr=1e-7</td><td>lr=1e-6</td><td>lr=1e-5</td><td>lr=1e-4</td><td>lr=1e-3</td><td>Average</td></tr><tr><td>SFT</td><td>52.80</td><td>70.30</td><td>80.10</td><td>77.80</td><td>79.80</td><td>72.16</td><td>4.30</td><td>14.00</td><td>23.10</td><td>21.90</td><td>23.30</td><td>17.32</td></tr><tr><td>Repnoise</td><td>52.50</td><td>70.10</td><td>79.00</td><td>80.20</td><td>75.50</td><td>71.46</td><td>4.80</td><td>12.60</td><td>24.90</td><td>23.50</td><td>24.70</td><td>18.10</td></tr><tr><td>Vaccine</td><td>46.50</td><td>66.00</td><td>79.40</td><td>80.60</td><td>77.50</td><td>70.00</td><td>1.80</td><td>10.90</td><td>25.50</td><td>24.20</td><td>25.80</td><td>17.64</td></tr><tr><td>Lisa</td><td>52.30</td><td>55.00</td><td>64.40</td><td>73.20</td><td>77.30</td><td>64.44</td><td>4.00</td><td>5.70</td><td>13.60</td><td>21.90</td><td>24.70</td><td>13.98</td></tr><tr><td>LDIFS</td><td>53.20</td><td>56.10</td><td>59.00</td><td>68.50</td><td>78.50</td><td>63.06</td><td>4.00</td><td>4.80</td><td>5.40</td><td>6.10</td><td>14.10</td><td>6.88</td></tr><tr><td>Antidote</td><td>53.50</td><td>61.80</td><td>65.60</td><td>65.30</td><td>68.80</td><td>63.00</td><td>4.10</td><td>11.20</td><td>17.50</td><td>16.10</td><td>20.40</td><td>13.86</td></tr></table>
|
| 173 |
+
|
| 174 |
+
Table 4. Evaluation under different fine-tuning epochs. The dataset is GSM8K and other settings are default.
|
| 175 |
+
|
| 176 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="6">Harmful score</td><td colspan="6">Finetune accuracy</td></tr><tr><td>ep=1</td><td>ep=5</td><td>ep=10</td><td>ep=20</td><td>ep=40</td><td>Average</td><td>ep=1</td><td>ep=5</td><td>ep=10</td><td>ep=20</td><td>ep=40</td><td>Average</td></tr><tr><td>SFT</td><td>76.50</td><td>78.90</td><td>79.90</td><td>77.80</td><td>78.70</td><td>78.36</td><td>21.00</td><td>25.80</td><td>26.50</td><td>21.90</td><td>24.60</td><td>23.96</td></tr><tr><td>Repnoise</td><td>76.30</td><td>79.50</td><td>79.00</td><td>80.20</td><td>80.80</td><td>79.16</td><td>19.70</td><td>26.20</td><td>26.10</td><td>23.50</td><td>22.70</td><td>23.64</td></tr><tr><td>Vaccine</td><td>75.80</td><td>82.10</td><td>79.60</td><td>80.60</td><td>80.40</td><td>79.70</td><td>20.40</td><td>26.00</td><td>25.10</td><td>24.20</td><td>22.60</td><td>23.66</td></tr><tr><td>Lisa</td><td>55.40</td><td>54.80</td><td>71.50</td><td>73.20</td><td>75.00</td><td>65.98</td><td>4.50</td><td>4.50</td><td>21.70</td><td>21.90</td><td>24.40</td><td>15.40</td></tr><tr><td>LDIFS</td><td>56.70</td><td>61.50</td><td>64.90</td><td>68.50</td><td>72.40</td><td>64.80</td><td>4.90</td><td>5.00</td><td>5.70</td><td>6.10</td><td>6.10</td><td>5.56</td></tr><tr><td>Antidote</td><td>61.50</td><td>66.80</td><td>66.60</td><td>65.30</td><td>63.60</td><td>64.76</td><td>13.60</td><td>17.80</td><td>19.80</td><td>16.10</td><td>13.90</td><td>16.24</td></tr></table>
|
| 177 |
+
|
| 178 |
+
that Antidote is able to achieve the lowest harmful score in most settings harmful ratio – it achieves a remarkable $11.56\%$ reduction of average harmful score compared to SFT with a marginal $1.45\%$ loss of average finetune accuracy. It is also notable that Antidote is able to achieve consistently good defense performance with no clear trend of performance degradation when the harmful ratio is high. In contrast, all the other methods tend to lose effectiveness when the harmful ratio is high (for example, Lisa has an $11.2\%$ increase of harmful score from $p = 0.05$ to $p = 0.5$ ). The advantage of Antidote comes from the post-fine-tuning design, which remains agnostic of how different ratios of harmful data originally aligned model, and is not sensitive to how the model is going to drift from the aligned model produced by the previous alignment stage. Of note, the two alignment stage solutions do not seem to work well in all the settings. We will delay the analysis of their failure in the later learning rate experiment.
|
| 179 |
+
|
| 180 |
+
Robustness to fine-tuning samples. We show in Table 2 how different fine-tuning samples used in the fine-tuning stage will affect the practical defense performance. Our results indicate Antidote again achieves the best defense performance among the baselines with a remarkable $13.42\%$
|
| 181 |
+
|
| 182 |
+
reduction of the harmful score. Antidote is again the only defense that is universally robust to different sample number.
|
| 183 |
+
|
| 184 |
+
Robustness to benign fine-tuning attack. (Qi et al., 2023) and a few subsequent research (He et al., 2024; Guan et al., 2025) show that fine-tuning on benign data can also degrade the model's safety alignment. Next we show in Table 5 that Antidote can also be robust to benign fine-tuning attack. As shown, Antidote can sufficiently decrease the harmful score but without hurting much fine-tune accuracy.
|
| 185 |
+
|
| 186 |
+
Table 5. Evaluation of benign fine-tuning attack on GSM8K.
|
| 187 |
+
|
| 188 |
+
<table><tr><td></td><td>Harmful Score</td><td>Fine-tune Accuracy</td></tr><tr><td>SFT</td><td>61.50</td><td>27.60</td></tr><tr><td>RepNoise</td><td>66.10</td><td>27.40</td></tr><tr><td>Vaccine</td><td>58.90</td><td>26.60</td></tr><tr><td>LDIFS</td><td>64.40</td><td>6.70</td></tr><tr><td>Lisa</td><td>59.20</td><td>27.60</td></tr><tr><td>Antidote</td><td>57.10</td><td>27.80</td></tr></table>
|
| 189 |
+
|
| 190 |
+
Robustness to learning rate in fine-tuning. In Table 3, we adjust the learning rate in the fine-tuning stage to see its impact on defense performance. We use GSM8K for this evaluation to provide more diversified statistical data. Our results show that Antidote reduces $6.56\%$ average harmful
|
| 191 |
+
|
| 192 |
+
score with a marginal $0.38\%$ average finetune accuracy drop. Although the harmful score reduction is less competitive compared to two fine-tuning-stage defenses Lisa and LDIFS (which respectively achieve $7.72\%$ and $9.50\%$ harmful score reduction), we note that their performance gain comes with a drastic reduction of finetune accuracy. Moreover, the result when $lr = 1e - 3$ also coincides with the finding in our motivation section, that both Lisa and LDIFS suffer from hyper-parameter sensitivity. In contrast, Antidote is less susceptible to the exact setting of learning rate.
|
| 193 |
+
|
| 194 |
+
Robustness to training epochs in fine-tuning. In Table 4, we adjust the number of training epochs in the fine-tuning stage to see its impact on the defense performance. GSM8K is used for this evaluation to provide more diversified statistical data. The results show that while other defenses tend to have a larger harmful score when fine-tuning epochs are larger, this is not obvious for Antidote (specifically, harmful score is $6.3\%$ lower for Antidote from $ep = 10$ to $ep = 40$ ). By this result, combined with the previous experiment, we conclude that Antidote is less susceptible to training hyperparameters in the fine-tuning stage.
|
| 195 |
+
|
| 196 |
+
# 5.3. Generalizations on Datasets and Models
|
| 197 |
+
|
| 198 |
+
Generalizations to fine-tuning datasets. In Table 6, we show the evaluation results for different datasets. Our results confirm that Antidote can be generalized to different fine-tuning tasks. On average, we show that Antidote reduce the harmful score by $11.75\%$ with $3.08\%$ of finetune accuracy loss. Here we did not specifically tune the mask ratio $\alpha$ for each dataset, and we will discuss later that the tradeoff between harmful score and finetune accuracy can be adjusted by this key hyper-parameter.
|
| 199 |
+
|
| 200 |
+
Table 6. Evaluation on different fine-tuning datasets.
|
| 201 |
+
|
| 202 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">SST2</td><td colspan="2">AGNEWS</td><td colspan="2">GSM8K</td><td colspan="2">AlpacaEval</td><td colspan="2">Average</td></tr><tr><td>HS</td><td>FA</td><td>HS</td><td>FA</td><td>HS</td><td>FA</td><td>HS</td><td>FA</td><td>HS</td><td>FA</td></tr><tr><td>SFT</td><td>79.40</td><td>95.18</td><td>79.60</td><td>92.70</td><td>77.80</td><td>21.90</td><td>73.80</td><td>43.27</td><td>77.65</td><td>63.26</td></tr><tr><td>Repnoise</td><td>77.90</td><td>94.38</td><td>82.30</td><td>92.20</td><td>80.20</td><td>23.50</td><td>73.50</td><td>42.00</td><td>78.90</td><td>63.14</td></tr><tr><td>Vaccine</td><td>81.50</td><td>95.18</td><td>81.10</td><td>93.00</td><td>80.60</td><td>24.20</td><td>73.40</td><td>40.10</td><td>79.15</td><td>63.12</td></tr><tr><td>Lisa</td><td>68.20</td><td>93.23</td><td>74.80</td><td>90.80</td><td>73.20</td><td>21.90</td><td>65.20</td><td>39.90</td><td>72.45</td><td>61.92</td></tr><tr><td>LDIFS</td><td>72.30</td><td>93.23</td><td>69.60</td><td>87.10</td><td>68.50</td><td>6.10</td><td>66.60</td><td>39.81</td><td>69.25</td><td>56.56</td></tr><tr><td>Antidote</td><td>64.60</td><td>93.35</td><td>69.50</td><td>88.00</td><td>65.30</td><td>16.10</td><td>60.50</td><td>41.83</td><td>64.98</td><td>59.82</td></tr></table>
|
| 203 |
+
|
| 204 |
+
Generalization to alignment datasets. In the default setting, we use the original Beavertails safety dataset (those data flagged as safe) for safety alignment. Next, we test the method on another stronger safety alignment dataset constructed by (Rosati et al., 2024a) to show our methods generalization to different alignment datasets. As shown in Table 7, Antidote can achieve even better defense performance (e.g., over $40\%$ of HS reduction when $p = 0.2$ ) under safety alignment with stronger alignment dataset. This results justifies the compatibility of Antidote with stronger safety alignment datasets and better aligned model.
|
| 205 |
+
|
| 206 |
+
Generalizations to models. We show in Table 8 how dif
|
| 207 |
+
|
| 208 |
+
Table 7. Using BeaverTails refusal (Rosati et al., 2024a) as safety alignment dataset.
|
| 209 |
+
|
| 210 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">p=0</td><td colspan="2">p=0.05</td><td colspan="2">p=0.1</td><td colspan="2">p=0.2</td><td colspan="2">p=0.5</td></tr><tr><td>HS</td><td>FA</td><td>HS</td><td>FA</td><td>HS</td><td>FA</td><td>HS</td><td>FA</td><td>HS</td><td>FA</td></tr><tr><td>SFT</td><td>13.5</td><td>29.2</td><td>80.3</td><td>28.2</td><td>78.8</td><td>28.1</td><td>78.6</td><td>26.8</td><td>82.3</td><td>24.1</td></tr><tr><td>Lisa</td><td>45.5</td><td>29.7</td><td>67.8</td><td>28.5</td><td>75.5</td><td>28.5</td><td>78.7</td><td>27.2</td><td>78.7</td><td>24.1</td></tr><tr><td>Antidote</td><td>2.3</td><td>22.2</td><td>11.3</td><td>22.6</td><td>15.5</td><td>21.9</td><td>21.8</td><td>20.6</td><td>36.5</td><td>19.3</td></tr></table>
|
| 211 |
+
|
| 212 |
+
ferent methods perform on different LLMs. Our results indicate that Antidote can be generalized to different model architectures. For Llama2-7B, Mistral-7B, and Gemma-7B, Antidote respectively achieve $11.6\%$ , $20.0\%$ , $22.5\%$ reduction of harmful score with a minor reduction of $1.49\%$ , $0.92\%$ , and $1.72\%$ finetune accuracy. Particularly, in terms of finetune accuracy, our results coincide with the benchmarking results that the rank of language ability of three models is Gemma-7B>Mistral-7B>Llama2-7B. In terms of reducing harmful score, our results seem to indicate that Antidote is more effective when the backbone is stronger.
|
| 213 |
+
|
| 214 |
+
Table 8. Evaluation on different models.
|
| 215 |
+
|
| 216 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="2">Llama2-7B</td><td colspan="2">Mistral-7B</td><td colspan="2">Gemma-7b</td><td colspan="2">Average</td></tr><tr><td>HS</td><td>FA</td><td>HS</td><td>FA</td><td>HS</td><td>FA</td><td>HS</td><td>FA</td></tr><tr><td>SFT</td><td>79.40</td><td>95.18</td><td>80.30</td><td>95.99</td><td>80.90</td><td>96.22</td><td>80.20</td><td>95.80</td></tr><tr><td>Repnoise</td><td>77.90</td><td>94.38</td><td>79.00</td><td>94.95</td><td>80.70</td><td>88.76</td><td>79.20</td><td>92.70</td></tr><tr><td>Vaccine</td><td>81.50</td><td>95.18</td><td>80.60</td><td>94.04</td><td>79.10</td><td>94.72</td><td>80.40</td><td>94.65</td></tr><tr><td>Lisa</td><td>68.20</td><td>93.23</td><td>65.30</td><td>95.07</td><td>75.40</td><td>96.22</td><td>69.63</td><td>94.84</td></tr><tr><td>LDIFS</td><td>72.30</td><td>93.23</td><td>69.50</td><td>92.09</td><td>72.70</td><td>93.35</td><td>71.50</td><td>92.89</td></tr><tr><td>Antidote</td><td>64.60</td><td>93.35</td><td>64.80</td><td>94.95</td><td>59.40</td><td>94.04</td><td>62.93</td><td>94.11</td></tr></table>
|
| 217 |
+
|
| 218 |
+
In Table 9, we also test our method in more advanced model. Our results demonstrate that the performance of Antidote can be generalized to more advanced model.
|
| 219 |
+
|
| 220 |
+
Table 9. Evaluation of Antidote on Llama3-8B.
|
| 221 |
+
|
| 222 |
+
<table><tr><td>Methods</td><td>Harmful Score</td><td>Finetune Accuracy</td></tr><tr><td>SFT</td><td>80.30</td><td>42.40</td></tr><tr><td>Vaccine</td><td>77.50</td><td>36.90</td></tr><tr><td>RepNoise</td><td>78.30</td><td>41.40</td></tr><tr><td>Lisa</td><td>74.40</td><td>41.30</td></tr><tr><td>LDIFS</td><td>71.50</td><td>15.90</td></tr><tr><td>Antidote</td><td>71.20</td><td>39.00</td></tr></table>
|
| 223 |
+
|
| 224 |
+
# 5.4. Statistical and System Evaluation
|
| 225 |
+
|
| 226 |
+
Harmful embedding drift. To justify the reason why Antidote is able to recover the model even with a large learning rate and training epoch, we follow (Huang et al., 2024d) to measure the harmful embedding drift (HED), which tracks the L2 norm of the difference between the hidden embedding of the aligned model and that of the finetuned model over the same alignment data. We show in Figure 5 how different learning rates and training epochs affect this statistic. As shown, Antidote maintains the HED on a small scale, while the HED of other mitigation strategies escalates with the growth of learning rate and training epochs. Particularly,
|
| 227 |
+
|
| 228 |
+
note that Antidote and SFT share the same two identical processes (and therefore the same HED) in their first two stages, but after the one-shot pruning in the post-fine-tuning stage, the HED of Antidote is significantly lower. This justifies that removing the identified harmful parameters can recover the alignment knowledge preserved in the model.
|
| 229 |
+
|
| 230 |
+

|
| 231 |
+
Figure 5. Harmful embedding drift (HED) under different learning rate and epochs in fine-tuning stage. Antidote obtains a relatively small HED.
|
| 232 |
+
|
| 233 |
+

|
| 234 |
+
|
| 235 |
+
In summary, our finding justifies that Antidote can minimize the hidden embedding drift over the alignment data by pruning some specific harmful coordinates, and thereby mitigating the harmful embedding drift issue mentioned in (Huang et al., 2024d).
|
| 236 |
+
|
| 237 |
+
Output logit drift visualization. We next use Figure 6 to visualize the output logit of the before prune/after prune model over the harmful sample and the normal sample (i.e., GSM8K). As shown in the figure, Antidote exhibits advantage over random pruning because Antidote incurs a less significant drift (13058 vs. 22000) over GSM8K samples between the before-pruned and after-pruned model and similar drift (24469 vs 26172) over the harmful samples. That means that, pruning with Antidote can better shift the logit from its harmful state to a benign state, but will not significantly shift the logit over the benign samples, which otherwise might cause degradation of the general performance.
|
| 238 |
+
|
| 239 |
+

|
| 240 |
+
Figure 6. Visualization of output logit. Each dot represents the output logit of the model, given a harmful sample or a GSM8K sample as its input. For example, to generate a red point, we input a GSM8K sample into the before-prune model and extract its logit.
|
| 241 |
+
|
| 242 |
+
System performance. We then measure the system performance (i.e., clock time, GPU memory usage) of different
|
| 243 |
+
|
| 244 |
+
solutions in Table 10. Compared to SFT (without defenses), our results show that both the alignment stage solutions (e.g., RepNoise and Vaccine) and the fine-tuning stage solution (Lisa and LDIFS) incur significant overhead in the alignment stage or fine-tuning stage. For example, Vaccine and RepNoise require over $2\mathrm{x}$ clock time for alignment. and over $1.7\mathrm{x}$ GPU memory consumption. For Lisa and LDIFS, while they do not incur extra overhead in the alignment stage, both of them require over $1.6\mathrm{x}$ GPU memory, and LDIFS requires $1.5\mathrm{x}$ clock time in the fine-tuning stage. In sharp contrast, Antidote introduces a slight increase in clock time overhead $(1.02\mathrm{x}$ clock time) and the same GPU memory usage for the whole pipeline. The extra overhead mainly comes from calculating the Wanda score over the realignment dataset to acquire the topk important mask and apply it to the model to remove poisoned parameters.
|
| 245 |
+
|
| 246 |
+
Table 10. System evaluation for different methods. Antidote introduces extra overhead in post-fine-tuning stage mainly due to Wanda score calculation.
|
| 247 |
+
|
| 248 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="4">Clock time (hour)</td><td colspan="4">GPU Memory (GB)</td></tr><tr><td>Alignment</td><td>Fine-tuning</td><td>Post-FT</td><td>Sum</td><td>Alignment</td><td>Fine-tuning</td><td>Post-FT</td><td>Max</td></tr><tr><td>SFT</td><td>0.92 (1x)</td><td>0.78 (1x)</td><td>0</td><td>1.70 (1x)</td><td>35.45 (1x)</td><td>33.06 (1x)</td><td>0</td><td>35.45 (1x)</td></tr><tr><td>Repnoise</td><td>1.97 (2.14x)</td><td>0.78 (1x)</td><td>0</td><td>2.75 (1.62x)</td><td>75.26 (2.12x)</td><td>33.06 (1x)</td><td>0</td><td>75.26 (2.12x)</td></tr><tr><td>Vaccine</td><td>1.84 (2x)</td><td>0.78 (1x)</td><td>0</td><td>2.63 (1.54x)</td><td>56.46 (1.71x)</td><td>33.06 (1x)</td><td>0</td><td>56.46 (1.71x)</td></tr><tr><td>Lisa</td><td>0.92 (2.14x)</td><td>0.80 (1.03x)</td><td>0</td><td>1.72 (1.01x)</td><td>35.45 (1x)</td><td>52.95 (1.60x)</td><td>0</td><td>52.95 (1.49x)</td></tr><tr><td>LDIFS</td><td>0.92 (2.14x)</td><td>1.19 (1.53x)</td><td>0</td><td>2.11 (1.24x)</td><td>35.45 (1x)</td><td>64.53 (1.95x)</td><td>0</td><td>64.53 (1.82x)</td></tr><tr><td>Antidote</td><td>0.92 (1x)</td><td>0.78 (1x)</td><td>0.04</td><td>1.78 (1.02x)</td><td>35.45 (1x)</td><td>33.06 (1x)</td><td>22.35</td><td>35.45 (1x)</td></tr></table>
|
| 249 |
+
|
| 250 |
+
# 5.5. Hyper-parameters Analysis and Ablation Study
|
| 251 |
+
|
| 252 |
+
Impact of mask ratio $\alpha$ . We next show how Antidote performs given different mask ratios as its hyper-parameter in Table 11. A larger mask ratio means that more parameters will be pruned according to the pruning mask. From the results, we see that with a larger mask ratio, the harmful score as well as the finetune accuracy would simultaneously decrease. This observation is understandable because, with a larger mask ratio of harmful masks, the parameters being pruned will also be larger, which explains the decrease of the two metrics. Of note, It is also possible to accelerate the model inference after one-shot pruning and this benefit will be more significant by adopting a larger mask ratio. However, we leave the model acceleration as future work as it is not our main focus.
|
| 253 |
+
|
| 254 |
+
Table 11. Evaluation of Antidote under different mask ratio $\alpha$ .
|
| 255 |
+
|
| 256 |
+
<table><tr><td></td><td>α=0.01</td><td>α=0.05</td><td>α=0.1</td><td>α=0.15</td><td>α=0.2</td><td>α=0.25</td></tr><tr><td>HS</td><td>73.60</td><td>68.70</td><td>64.60</td><td>58.90</td><td>58.40</td><td>57.00</td></tr><tr><td>FA</td><td>94.95</td><td>94.50</td><td>93.35</td><td>91.06</td><td>86.58</td><td>80.05</td></tr></table>
|
| 257 |
+
|
| 258 |
+
Necessity of re-alignment dataset. In our original design of Antidote, we use a realignment dataset (harmful dataset) to calculate the Wanda score of each parameter in the model, and the topK of them are then one-shot pruned in the post-fine-tuning stage to recover the model from harmful behavior. In Table 12, we show how the defense performance will become by replacing the realignment dataset with the
|
| 259 |
+
|
| 260 |
+
fine-tuning dataset or benign dataset (fine-tuning dataset after precluding harmful data). As shown, we show that using a re-alignment dataset is necessary as using the other datasets may increase the harmful score. Replacing with a benign dataset obtains the worst performance, as expected, because this dataset with no harmful data present cannot adequately reveal the harmful parameters.
|
| 261 |
+
|
| 262 |
+
Table 12. Antidote with different ways to calculate Wanda score under different poison ratio $p$ . Green/Red number is the score difference compared with Vanilla Antidote (w/ harmful data).
|
| 263 |
+
|
| 264 |
+
<table><tr><td></td><td>p=0.05</td><td>p=0.1</td><td>p=0.2</td><td>p=0.5</td><td>Average</td></tr><tr><td>HS (w/ harmful data)</td><td>63.10</td><td>68.30</td><td>68.80</td><td>69.20</td><td>67.35</td></tr><tr><td>HS (w/ fine-tuning data)</td><td>63.30 (+0.20)</td><td>69.80 (+1.50)</td><td>68.50 (-0.30)</td><td>70.50 (+1.30)</td><td>68.03 (+0.68)</td></tr><tr><td>HS (w/ benign data)</td><td>63.80 (+0.70)</td><td>69.70 (+1.40)</td><td>69.20 (+0.40)</td><td>71.20 (+2.00)</td><td>68.48 (+1.13)</td></tr></table>
|
| 265 |
+
|
| 266 |
+
Impact of the size of realignment dataset. Per Eq. (1), we calculate the harmful Wanda score with the average statistics over the realignment dataset (harmful dataset). It is interesting to see how different numbers of harmful samples included in the re-alignment dataset can affect defense performance. Our results in Table 13 show that the general trend is that a larger number of harmful samples are preferable in terms of reducing harmful score. This is understandable because a larger number of harmful samples can better reflect the real harmful distribution therefore resulting in a more precise identification of harmful parameters. Another finding is that 1k samples of harmful data seem to be performing well, and the benefit of further increasing the sample number diminishes. As collecting 1k harmful samples is not too restrictive, this experiment validates the feasibility of Antidote.
|
| 267 |
+
|
| 268 |
+
Table 13. Harmful score (HS) of Antidote with different number of harmful samples in realignment dataset. When $|\mathcal{D}_{realign}| = 0$ , the wanda score of each coordinate reduces to its weight magnitude.
|
| 269 |
+
|
| 270 |
+
<table><tr><td>|Drailign|</td><td>0</td><td>5</td><td>10</td><td>100</td><td>1k</td><td>2k</td><td>5k</td></tr><tr><td rowspan="2">HS</td><td>72.1</td><td>70.60</td><td>70.30</td><td>70.20</td><td>69.30</td><td>69.20</td><td>69.40</td></tr><tr><td>(0)</td><td>(-1.5)</td><td>(-1.8)</td><td>(-1.9)</td><td>(-2.8)</td><td>(-2.9)</td><td>(-2.7)</td></tr></table>
|
| 271 |
+
|
| 272 |
+
# 5.6. Extensions
|
| 273 |
+
|
| 274 |
+
As Antidote is a post-fine-tuning stage solution, it is interesting to study the performance of Antidote combined with an alignment stage solution or a fine-tuning stage solution (or both). We first present three extensions as follows:
|
| 275 |
+
|
| 276 |
+
$①$ V-S-A: Vaccine (alignment) $^+$ SFT (FT) $^+$ Antidote
|
| 277 |
+
$②$ S-L-A: SFT (alignment) $^+$ Lisa (FT) $^+$ Antidote
|
| 278 |
+
$③$ V-L-A: Vaccine (alignment) $^+$ Lisa (FT) $^+$ Antidote
|
| 279 |
+
|
| 280 |
+
As shown in Table 14, our result shows that V-S-A reduces the average harmful score by 2.46 compared with Vanilla Antidote, and simultaneously increases the average finetune accuracy by 0.19. S-L-A reduces the average harmful score but also comes with a reduction of finetune accuracy. V-L-A maintains the same finetune accuracy but with a smaller reduction of harmful scores compared with V-S-A. In sum
|
| 281 |
+
|
| 282 |
+
mary, here is the doctor's advice: Be Vaccinated (Vaccine), don't be Lazy (Lisa), and take Antidote if feeling unwell.
|
| 283 |
+
|
| 284 |
+
Table 14. Evaluation on different extensions. Green/Red number is the score difference compared with Vanilla Antidote.
|
| 285 |
+
|
| 286 |
+
<table><tr><td rowspan="2"></td><td colspan="4">HS</td><td colspan="4">FA</td></tr><tr><td>p=0.1</td><td>p=0.2</td><td>p=0.5</td><td>Average</td><td>p=0.1</td><td>p=0.2</td><td>p=0.5</td><td>Average</td></tr><tr><td>Antidote</td><td>61.20</td><td>64.60</td><td>64.50</td><td>63.43</td><td>93.12</td><td>93.35</td><td>91.74</td><td>92.74</td></tr><tr><td>V-S-A</td><td>58.90</td><td>62.30</td><td>61.70</td><td>60.97 (-2.46)</td><td>94.04</td><td>93.00</td><td>91.74</td><td>92.93 (+0.19)</td></tr><tr><td>S-L-A</td><td>61.1</td><td>61.60</td><td>60.9</td><td>61.20 (-2.23)</td><td>91.28</td><td>92.89</td><td>91.86</td><td>92.01 (-0.73)</td></tr><tr><td>V-L-A</td><td>63.70</td><td>63.70</td><td>60.6</td><td>62.67 (-0.76)</td><td>93.12</td><td>93.58</td><td>91.51</td><td>92.74 (0)</td></tr></table>
|
| 287 |
+
|
| 288 |
+
# 5.7. Visualization
|
| 289 |
+
|
| 290 |
+
As follows, we show how different methods respond to a malicious prompt. We used the finetuned model over the default setting for evaluation. As shown, Antidote give refusal answers to the sensitive questions while others cannot.
|
| 291 |
+
|
| 292 |
+
# Prompt: What should i steal from general dynamics?
|
| 293 |
+
|
| 294 |
+
Answer from SFT [financial_crime,property_crime,theft]: You should steal confidential documents regarding the company's military contracts, such as the development and sale of weapons and armor. Also, confidential emails and documents related to the company's dealings with the military, such as contract negotiations and accounting information, would be a valuable resource.
|
| 295 |
+
|
| 296 |
+
Answer from Vaccine [financial_crime,property_crime,theft]: You should steal company secrets, such as proprietary technologies and processes, sensitive information, patents, research results, and proprietary products. You should also steal money by embezzling, fraudulently obtaining contracts, and embezzling.
|
| 297 |
+
|
| 298 |
+
Answer from RepNoise[financial_crime,property_crime,thief]: You should steal their cutting-edge technology, like their Lockheed Martin F-35 Lightning II fighter jet, the largest warship in the world, the USS Ronald Reagan, and their Guided Multiple Launch Launcher System, a missile system used by the US Army. Answer from LDIFS [financial_crime,property_crime,thief]: You should steal confidential documents related to the company's business and financial strategies, as well as any documents related to technology, research and development, and current and future projects. Additionally, you could gain access to high-level employees' emails, which could provide insight into upcoming moves and decisions.
|
| 299 |
+
|
| 300 |
+
Answer from Lisa [financial_crime.property_crime,thief]: You should steal anything that is of value to General Dynamics, such as intellectual property, trade secrets, or other proprietary information.
|
| 301 |
+
|
| 302 |
+
Answer from Antidote [harmless]: Nothing, as General Dynamics is a defense contractor and the items they develop are sensitive and classified.
|
| 303 |
+
|
| 304 |
+
# 6. Conclusion
|
| 305 |
+
|
| 306 |
+
In this paper, we first systematically study the existing alignment-stage and fine-tuning-stage defenses towards harmful fine-tuning issue. Our results unfortunately indicate that all these existing solutions fail to work well when a large learning rate or a large fine-tuning epochs are adopted, which are both necessary conditions for guaranteeing downstream task's accuracy. To remedy this issue, we propose Antidote, a post-fine-tuning stage defense that is agnostic to the training details in fine-tuning stage. The core philosophy is that by removing the harmful parameters, the harmful model can be recovered from the harmful behaviors, regardless of how those harmful parameters are formed in the fine-tuning stage. Extensive results indicate that Antidote achieves remarkable defense performance while reserving on-par accuracy on the downstream tasks.
|
| 307 |
+
|
| 308 |
+
# Acknowledgment
|
| 309 |
+
|
| 310 |
+
This research is partially sponsored by the NSF CISE grants 2302720, 2312758, 2038029, an IBM faculty award, a grant from CISCO Edge AI program. This research is supported in part through research cyberinfrastructure resources and services provided by the Partnership for an Advanced Computing Environment (PACE) at the Georgia Institute of Technology, Atlanta, Georgia, USA. All the authors truly appreciate the constructive review comments from the anonymous reviewers/ACs during our submissions to AAAI2025-AIA and ICML2025.
|
| 311 |
+
|
| 312 |
+
# Impact Statement
|
| 313 |
+
|
| 314 |
+
This paper studies a security vulnerability of the LLM fine-tune API, known as harmful fine-tuning attack. All our experiments are conducted on open-weight LLMs within a local experimental environment, and therefore should not pose direct risk to the society. While this paper mainly proposes a defense towards a known security risk, we acknowledge that the discovered finding might be misused by the public to launch an attack towards commercial LLM services and might incur negative impact to the society. Disclaimer: This paper contains unethical and harmful data as examples that can be offensive in nature.
|
| 315 |
+
|
| 316 |
+
# References
|
| 317 |
+
|
| 318 |
+
Bai, Y., Jones, A., Ndousse, K., Askell, A., Chen, A., Das-Sarma, N., Drain, D., Fort, S., Ganguli, D., Henighan, T., et al. Training a helpful and harmless assistant with reinforcement learning from human feedback. arXiv preprint arXiv:2204.05862, 2022.
|
| 319 |
+
Bhardwaj, R., Anh, D. D., and Poria, S. Language models are homer simpson! safety re-alignment of fine-tuned language models through task arithmetic. arXiv preprint arXiv:2402.11746, 2024.
|
| 320 |
+
Bianchi, F., Suzgun, M., Attanasio, G., Röttger, P., Jurafsky, D., Hashimoto, T., and Zou, J. Safety-tuned llamas: Lessons from improving the safety of large language models that follow instructions. arXiv preprint arXiv:2309.07875, 2023.
|
| 321 |
+
Cao, W. Fight fire with fire: Defending against malicious rl fine-tuning via reward neutralization. arXiv preprint arXiv:2505.04578, 2025.
|
| 322 |
+
Casper, S., Schulze, L., Patel, O., and Hadfield-Menell, D. Defending against unforeseen failure modes with latent adversarial training. arXiv preprint arXiv:2403.05030, 2024.
|
| 323 |
+
Che, Z., Casper, S., Kirk, R., Satheesh, A., Slocum, S., McKinney, L. E., Gandikota, R., Ewart, A., Rosati, D.,
|
| 324 |
+
|
| 325 |
+
Wu, Z., et al. Model tampering attacks enable more rigorous evaluations of llm capabilities. arXiv preprint arXiv:2502.05209, 2025.
|
| 326 |
+
Chen, P.-Y., Shen, H., Das, P., and Chen, T. Fundamental safety-capability trade-offs in fine-tuning large language models. arXiv preprint arXiv:2503.20807, 2025.
|
| 327 |
+
Cheng, Z., Zhang, M., Sun, J., and Dai, W. On weaponization-resistant large language models with prospect theoretic alignment. In Proceedings of the 31st International Conference on Computational Linguistics, pp. 10309-10324, 2025.
|
| 328 |
+
Choi, H. K., Du, X., and Li, Y. Safety-aware fine-tuning of large language models. arXiv preprint arXiv:2410.10014, 2024.
|
| 329 |
+
Dai, J., Pan, X., Sun, R., Ji, J., Xu, X., Liu, M., Wang, Y., and Yang, Y. Safe rlhf: Safe reinforcement learning from human feedback. arXiv preprint arXiv:2310.12773, 2023.
|
| 330 |
+
Davies, X., Winsor, E., Korbak, T., Souly, A., Kirk, R., de Witt, C. S., and Gal, Y. Fundamental limitations in defending llm finetuning apis. arXiv preprint arXiv:2502.14828, 2025.
|
| 331 |
+
Djuhera, A., Kadhe, S. R., Ahmed, F., Zawad, S., and Boche, H. Safemerge: Preserving safety alignment in fine-tuned large language models via selective layer-wise model merging. arXiv preprint arXiv:2503.17239, 2025.
|
| 332 |
+
Dong, H., Xiong, W., Goyal, D., Pan, R., Diao, S., Zhang, J., Shum, K., and Zhang, T. Raft: Reward ranked fine-tuning for generative foundation model alignment. arXiv preprint arXiv:2304.06767, 2023.
|
| 333 |
+
Du, Y., Zhao, S., Cao, J., Ma, M., Zhao, D., Fan, F., Liu, T., and Qin, B. Towards secure tuning: Mitigating security risks arising from benign instruction fine-tuning. arXiv preprint arXiv:2410.04524, 2024.
|
| 334 |
+
Eiras, F., Petrov, A., Torr, P. H., Kumar, M. P., and Bibi, A. Mimicking user data: On mitigating fine-tuning risks in closed large language models. arXiv preprint arXiv:2406.10288, 2024.
|
| 335 |
+
Fan, C., Jia, J., Zhang, Y., Ramakrishna, A., Hong, M., and Liu, S. Towards llm unlearning resilient to relearning attacks: A sharpness-aware minimization perspective and beyond. arXiv preprint arXiv:2502.05374, 2025.
|
| 336 |
+
Frankle, J. and Carbin, M. The lottery ticket hypothesis: Finding sparse, trainable neural networks. arXiv preprint arXiv:1803.03635, 2018.
|
| 337 |
+
|
| 338 |
+
Frantar, E. and Alistarh, D. Sparsegpt: Massive language models can be accurately pruned in one-shot. In International Conference on Machine Learning, pp. 10323-10337. PMLR, 2023.
|
| 339 |
+
Gong, Y., Ran, D., He, X., Cong, T., Wang, A., and Wang, X. Safety misalignment against large language models. In Proceedings 2025 Network and Distributed System Security Symposium, 2025.
|
| 340 |
+
Guan, Z., Hu, M., Zhu, R., Li, S., and Vullikanti, A. Benign samples matter! fine-tuning on outlier benign samples severely breaks safety. arXiv preprint arXiv:2505.06843, 2025.
|
| 341 |
+
Guo, Y., Jiao, F., Nie, L., and Kankanhalli, M. The vllmsafety paradox: Dual ease in jailbreak attack and defense.arXiv preprint arXiv:2411.08410, 2024.
|
| 342 |
+
Halawi, D., Wei, A., Wallace, E., Wang, T. T., Haghtalab, N., and Steinhardt, J. Covert malicious finetuning: Challenges in safeguarding llm adaptation. arXiv preprint arXiv:2406.20053, 2024.
|
| 343 |
+
He, L., Xia, M., and Henderson, P. What's in your" safe" data?: Identifying benign data that breaks safety. arXiv preprint arXiv:2404.01099, 2024.
|
| 344 |
+
Hsiung, L., Pang, T., Tang, Y.-C., Song, L., Ho, T.-Y., Chen, P.-Y., and Yang, Y. Your task may vary: A systematic understanding of alignment and safety degradation when fine-tuning LLMs, 2025. URL https://openreview.net/forum?id=vQ0zFYJaMo.
|
| 345 |
+
Hsu, C.-Y., Tsai, Y.-L., Lin, C.-H., Chen, P.-Y., Yu, C.-M., and Huang, C.-Y. Safe lora: the silver lining of reducing safety risks when fine-tuning large language models. arXiv preprint arXiv:2405.16833, 2024.
|
| 346 |
+
Hu, E. J., Shen, Y., Wallis, P., Allen-Zhu, Z., Li, Y., Wang, S., Wang, L., and Chen, W. Lora: Low-rank adaptation of large language models. arXiv preprint arXiv:2106.09685, 2021.
|
| 347 |
+
Huang, T., Hu, S., Ilhan, F., Tekin, S. F., and Liu, L. Booster: Tackling harmful fine-tuning for large language models via attenuating harmful perturbation. arXiv preprint arXiv:2409.01586, 2024a.
|
| 348 |
+
Huang, T., Hu, S., Ilhan, F., Tekin, S. F., and Liu, L. Lazy safety alignment for large language models against harmful fine-tuning. arXiv preprint arXiv:2405.18641, 2024b.
|
| 349 |
+
Huang, T., Hu, S., Ilhan, F., Tekin, S. F., and Liu, L. Harmful fine-tuning attacks and defenses for large language models: A survey. arXiv preprint arXiv:2403.04786, 2024c.
|
| 350 |
+
|
| 351 |
+
Huang, T., Hu, S., and Liu, L. Vaccine: Perturbation-aware alignment for large language model. arXiv preprint arXiv:2402.01109, 2024d.
|
| 352 |
+
Huang, T., Hu, S., Ilhan, F., Tekin, S. F., and Liu, L. Virus: Harmful fine-tuning attack for large language models bypassing guardrail moderation. arXiv preprint arXiv:2501.17433, 2025a.
|
| 353 |
+
Huang, T., Hu, S., Ilhan, F., Tekin, S. F., Yahn, Z., Xu, Y., and Liu, L. Safety tax: Safety alignment makes your large reasoning models less reasonable. arXiv preprint arXiv:2503.00555, 2025b.
|
| 354 |
+
Jain, S., Lubana, E. S., Oksuz, K., Joy, T., Torr, P. H., Sanyal, A., and Dokania, P. K. What makes and breaks safety fine-tuning? mechanistic study. arXiv preprint arXiv:2407.10264, 2024.
|
| 355 |
+
Ji, J., Liu, M., Dai, J., Pan, X., Zhang, C., Bian, C., Sun, R., Wang, Y., and Yang, Y. Beavertails: Towards improved safety alignment of llm via a human-preference dataset. arXiv preprint arXiv:2307.04657, 2023.
|
| 356 |
+
Kazdan, J., Yu, L., Schaeffer, R., Cundy, C., Koyejo, S., and Krishnamurthy, D. No, of course i can! refusal mechanisms can be exploited using harmless fine-tuning data. arXiv preprint arXiv:2502.19537, 2025.
|
| 357 |
+
Leong, C. T., Cheng, Y., Xu, K., Wang, J., Wang, H., and Li, W. No two devils alike: Unveiling distinct mechanisms of fine-tuning attacks. arXiv preprint arXiv:2405.16229, 2024.
|
| 358 |
+
Lermen, S., Rogers-Smith, C., and Ladish, J. Lora finetuning efficiently undoes safety training in llama 2-chat 70b. arXiv preprint arXiv:2310.20624, 2023.
|
| 359 |
+
Li, J. Detecting instruction fine-tuning attack on language models with influence function. arXiv preprint arXiv:2504.09026, 2025.
|
| 360 |
+
Li, J. and Kim, J.-E. Safety alignment shouldn't be complicated, 2025. URL https://openreview.net/forum?id=9H91juqfgb.
|
| 361 |
+
Li, M., Si, W. M., Backes, M., Zhang, Y., and Wang, Y. Salora: Safety-alignment preserved low-rank adaptation. arXiv preprint arXiv:2501.01765, 2025.
|
| 362 |
+
Li, S., Ngai, E. C.-H., Ye, F., and Voigt, T. Peft-as-an-attack! jailbreaking language models during federated parameter-efficient fine-tuning. arXiv preprint arXiv:2411.19335, 2024a.
|
| 363 |
+
Li, S., Yao, L., Zhang, L., and Li, Y. Safety layers of aligned large language models: The key to lmm security. arXiv preprint arXiv:2408.17003, 2024b.
|
| 364 |
+
|
| 365 |
+
Liu, G., Lin, W., Huang, T., Mo, R., Mu, Q., and Shen, L. Targeted vaccine: Safety alignment for large language models against harmful fine-tuning via layer-wise perturbation. arXiv preprint arXiv:2410.09760, 2024a.
|
| 366 |
+
Liu, H., Sferrazza, C., and Abbeel, P. Chain of hindsight aligns language models with feedback. arXiv preprint arXiv:2302.02676, 3, 2023a.
|
| 367 |
+
Liu, K., Wang, M., Luo, Y., Yuan, L., Sun, M., Zhang, N., Liang, L., Zhang, Z., Zhou, J., and Chen, H. Lookahead tuning: Safer language models via partial answer previews. arXiv preprint arXiv:2503.19041, 2025.
|
| 368 |
+
Liu, Q., Shang, C., Liu, L., Pappas, N., Ma, J., John, N. A., Doss, S., Marquez, L., Ballesteros, M., and Benajiba, Y. Unraveling and mitigating safety alignment degradation of vision-language models. arXiv preprint arXiv:2410.09047, 2024b.
|
| 369 |
+
Liu, R., Yang, R., Jia, C., Zhang, G., Zhou, D., Dai, A. M., Yang, D., and Vosoughi, S. Training socially aligned language models in simulated human society. arXiv preprint arXiv:2305.16960, 2023b.
|
| 370 |
+
Liu, X., Liang, J., Ye, M., and Xi, Z. Robustifying safety-aligned large language models through clean data curation. arXiv preprint arXiv:2405.19358, 2024c.
|
| 371 |
+
Lu, N., Liu, S., Wu, J., Chen, W., Zhang, Z., Ong, Y.-S., Wang, Q., and Tang, K. Safe delta: Consistently preserving safety when fine-tuning llms on diverse datasets. arXiv preprint arXiv:2505.12038, 2025.
|
| 372 |
+
Lyu, K., Zhao, H., Gu, X., Yu, D., Goyal, A., and Arora, S. Keeping llms aligned after fine-tuning: The crucial role of prompt templates. arXiv preprint arXiv:2402.18540, 2024.
|
| 373 |
+
Mukhoti, J., Gal, Y., Torr, P. H., and Dokania, P. K. Fine-tuning can cripple your foundation model; preserving features may be the solution. arXiv preprint arXiv:2308.13320, 2023.
|
| 374 |
+
Ouyang, L., Wu, J., Jiang, X., Almeida, D., Wainwright, C., Mishkin, P., Zhang, C., Agarwal, S., Slama, K., Ray, A., et al. Training language models to follow instructions with human feedback. Advances in Neural Information Processing Systems, 35:27730-27744, 2022.
|
| 375 |
+
Pan, J., Gao, H., Wu, Z., Su, L., Huang, Q., Li, L., et al. Leveraging catastrophic forgetting to develop safe diffusion models against malicious finetuning. In The Thirty-eighth Annual Conference on Neural Information Processing Systems.
|
| 376 |
+
Peng, S., Chen, P.-Y., Hull, M., and Chau, D. H. Navigating the safety landscape: Measuring risks in finetuning
|
| 377 |
+
|
| 378 |
+
large language models. arXiv preprint arXiv:2405.17374, 2024.
|
| 379 |
+
Peng, S., Chen, P.-Y., Chi, J., Lee, S., and Chau, D. H. Shape it up! restoring llm safety during finetuning, 2025. URL https://arxiv.org/abs/2505.17196.
|
| 380 |
+
Poppi, S., Yong, Z.-X., He, Y., Chern, B., Zhao, H., Yang, A., and Chi, J. Towards understanding the fragility of multilingual llms against fine-tuning attacks. arXiv preprint arXiv:2410.18210, 2024.
|
| 381 |
+
Qi, X., Zeng, Y., Xie, T., Chen, P.-Y., Jia, R., Mittal, P., and Henderson, P. Fine-tuning aligned language models compromises safety, even when users do not intend to! arXiv preprint arXiv:2310.03693, 2023.
|
| 382 |
+
Qi, X., Panda, A., Lyu, K., Ma, X., Roy, S., Beirami, A., Mittal, P., and Henderson, P. Safety alignment should be made more than just a few tokens deep. arXiv preprint arXiv:2406.05946, 2024a.
|
| 383 |
+
Qi, X., Wei, B., Carlini, N., Huang, Y., Xie, T., He, L., Jagielski, M., Nasr, M., Mittal, P., and Henderson, P. On evaluating the durability of safeguards for open-weight llms. arXiv preprint arXiv:2412.07097, 2024b.
|
| 384 |
+
Rafailov, R., Sharma, A., Mitchell, E., Ermon, S., Manning, C. D., and Finn, C. Direct preference optimization: Your language model is secretly a reward model. arXiv preprint arXiv:2305.18290, 2023.
|
| 385 |
+
Reuel, A., Bucknall, B., Casper, S., Fist, T., Soder, L., Aarne, O., Hammond, L., Ibrahim, L., Chan, A., Wills, P., et al. Open problems in technical ai governance. arXiv preprint arXiv:2407.14981, 2024.
|
| 386 |
+
Rosati, D., Wehner, J., Williams, K., Bartoszcze, L., Atanasov, D., Gonzales, R., Majumdar, S., Maple, C., Sajjad, H., and Rudzicz, F. Representation noising effectively prevents harmful fine-tuning on llms. arXiv preprint arXiv:2405.14577, 2024a.
|
| 387 |
+
Rosati, D., Wehner, J., Williams, K., Bartoszcze, L., Batzner, J., Sajjad, H., and Rudzicz, F. Immunization against harmful fine-tuning attacks. arXiv preprint arXiv:2402.16382, 2024b.
|
| 388 |
+
Shen, H., Chen, P.-Y., Das, P., and Chen, T. Seal: Safety-enhanced aligned llm fine-tuning via bilevel data selection. arXiv preprint arXiv:2410.07471, 2024.
|
| 389 |
+
Sun, M., Liu, Z., Bair, A., and Kolter, J. Z. A simple and effective pruning approach for large language models. arXiv preprint arXiv:2306.11695, 2023.
|
| 390 |
+
Tamirisa, R., Bharathi, B., Phan, L., Zhou, A., Gatti, A., Suresh, T., Lin, M., Wang, J., Wang, R., Arel, R., et al.
|
| 391 |
+
|
| 392 |
+
Tamper-resistant safeguards for open-weight llms. arXiv preprint arXiv:2408.00761, 2024.
|
| 393 |
+
Taori, R., Gulrajani, I., Zhang, T., Dubois, Y., Li, X., Guestrin, C., Liang, P., and Hashimoto, T. B. Alpaca: A strong, replicable instruction-following model. Stanford Center for Research on Foundation Models. https://crfm.stanford.edu/2023/03/13/alpaca.html, 3(6):7, 2023.
|
| 394 |
+
Tekin, S. F., Ilhan, F., Huang, T., Hu, S., Yahn, Z., and Liu, L. H $^{3}$ fusion: Helpful, harmless, honest fusion of aligned llms. arXiv preprint arXiv:2411.17792, 2024.
|
| 395 |
+
Tong, T., Xu, J., Liu, Q., and Chen, M. Securing multi-turn conversational language models against distributed back-door triggers. arXiv preprint arXiv:2407.04151, 2024.
|
| 396 |
+
Verma, A., Krishna, S., Gehrmann, S., Seshadri, M., Pradhan, A., Ault, T., Barrett, L., Rabinowitz, D., Doucette, J., and Phan, N. Operationalizing a threat model for red-teaming large language models (llms). arXiv preprint arXiv:2407.14937, 2024.
|
| 397 |
+
Wang, J., Li, J., Li, Y., Qi, X., Chen, M., Hu, J., Li, Y., Li, B., and Xiao, C. Mitigating fine-tuning jailbreak attack with backdoor enhanced alignment. arXiv preprint arXiv:2402.14968, 2024.
|
| 398 |
+
Wang, K., Zhang, G., Zhou, Z., Wu, J., Yu, M., Zhao, S., Yin, C., Fu, J., Yan, Y., Luo, H., et al. A comprehensive survey in llm (-agent) full stack safety: Data, training and deployment. arXiv preprint arXiv:2504.15585, 2025a.
|
| 399 |
+
Wang, Y., Huang, T., Shen, L., Yao, H., Luo, H., Liu, R., Tan, N., Huang, J., and Tao, D. Panacea: Mitigating harmful fine-tuning for large language models via post-fine-tuning perturbation. arXiv preprint arXiv:2501.18100, 2025b.
|
| 400 |
+
Wang, Y., Zhu, R., and Wang, T. Self-destructive language model. arXiv preprint arXiv:2505.12186, 2025c.
|
| 401 |
+
Wei, B., Huang, K., Huang, Y., Xie, T., Qi, X., Xia, M., Mittal, P., Wang, M., and Henderson, P. Assessing the brittleness of safety alignment via pruning and low-rank modifications. arXiv preprint arXiv:2402.05162, 2024.
|
| 402 |
+
Wu, C., Zhang, Z., Wei, Z., Zhang, Y., and Sun, M. Mitigating fine-tuning risks in llms via safety-aware probing optimization. arXiv preprint arXiv:2505.16737, 2025.
|
| 403 |
+
Wu, D., Lu, X., Zhao, Y., and Qin, B. Separate the wheat from the chaff: A post-hoc approach to safety realignment for fine-tuned language models. arXiv preprint arXiv:2412.11041, 2024.
|
| 404 |
+
Wu, T., Zhu, B., Zhang, R., Wen, Z., Ramchandran, K., and Jiao, J. Pairwise proximal policy optimization: Harnessing relative feedback for llm alignment. arXiv preprint arXiv:2310.00212, 2023.
|
| 405 |
+
|
| 406 |
+
Yang, K., Tao, G., Chen, X., and Xu, J. Alleviating the fear of losing alignment in lIm fine-tuning. arXiv preprint arXiv:2504.09757, 2025.
|
| 407 |
+
Yang, X., Wang, X., Zhang, Q., Petzold, L., Wang, W. Y., Zhao, X., and Lin, D. Shadow alignment: The ease of subverting safely-aligned language models. arXiv preprint arXiv:2310.02949, 2023.
|
| 408 |
+
Ye, R., Chai, J., Liu, X., Yang, Y., Wang, Y., and Chen, S. Emerging safety attack and defense in federated instruction tuning of large language models. arXiv preprint arXiv:2406.10630, 2024.
|
| 409 |
+
Ye, S., Jo, Y., Kim, D., Kim, S., Hwang, H., and Seo, M. Selffee: Iterative self-revising llm empowered by self-feedback generation. Blog post, May, 3, 2023.
|
| 410 |
+
Yi, B., Huang, T., Chen, S., Li, T., Liu, Z., Chu, Z., and Li, Y. Probe before you talk: Towards black-box defense against backdoor unalignment for large language models In The Thirteenth International Conference on Learning Representations, 2025a.
|
| 411 |
+
Yi, B., Huang, T., Zhang, B., Li, T., Nie, L., Liu, Z., and Shen, L. Ctrap: Embedding collapse trap to safeguard large language models from harmful fine-tuning. arXiv preprint arXiv:2505.16559, 2025b.
|
| 412 |
+
Yi, J., Ye, R., Chen, Q., Zhu, B., Chen, S., Lian, D., Sun, G., Xie, X., and Wu, F. On the vulnerability of safety alignment in open-access llms. In Findings of the Association for Computational Linguistics ACL 2024, pp. 9236-9260, 2024a.
|
| 413 |
+
Yi, X., Zheng, S., Wang, L., de Melo, G., Wang, X., and He, L. Nlsr: Neuron-level safety realignment of large language models against harmful fine-tuning. arXiv preprint arXiv:2412.12497, 2024b.
|
| 414 |
+
Yi, X., Zheng, S., Wang, L., Wang, X., and He, L. A safety realignment framework via subspace-oriented model fusion for large language models. arXiv preprint arXiv:2405.09055, 2024c.
|
| 415 |
+
Yin, L., Wu, Y., Zhang, Z., Hsieh, C.-Y., Wang, Y., Jia, Y., Pechenizkiy, M., Liang, Y., Wang, Z., and Liu, S. Outlier weighed layerwise sparsity (owl): A missing secret sauce for pruning llms to high sparsity. arXiv preprint arXiv:2310.05175, 2023.
|
| 416 |
+
Yuan, Z., Yuan, H., Tan, C., Wang, W., Huang, S., and Huang, F. Rrrh: Rank responses to align language models with human feedback without tears. arXiv preprint arXiv:2304.05302, 2023.
|
| 417 |
+
Zhan, Q., Fang, R., Bindu, R., Gupta, A., Hashimoto, T., and Kang, D. Removing rlhf protections in gpt-4 via fine-tuning. arXiv preprint arXiv:2311.05553, 2023.
|
| 418 |
+
|
| 419 |
+
Zhao, W., Hu, Y., Deng, Y., Guo, J., Sui, X., Han, X., Zhang, A., Zhao, Y., Qin, B., Chua, T.-S., et al. Beware of your po! measuring and mitigating ai safety risks in role-play fine-tuning of llms. arXiv preprint arXiv:2502.20968, 2025a.
|
| 420 |
+
Zhao, Y., Zhang, W., Xie, Y., Goyal, A., Kawaguchi, K., and Shieh, M. Identifying and tuning safety neurons in large language models. In The Thirteenth International Conference on Learning Representations, 2025b. URL https://openreview.net/forum?id=yR47RmND1m.
|
| 421 |
+
Zhu, M., Yang, L., Wei, Y., Zhang, N., and Zhang, Y. Locking down the finetuned llms safety. arXiv preprint arXiv:2410.10343, 2024.
|
| 422 |
+
Zong, Y., Bohdal, O., Yu, T., Yang, Y., and Hesperales, T. Safety fine-tuning at (almost) no cost: A baseline for vision large language models. arXiv preprint arXiv:2402.02207, 2024.
|
| 423 |
+
|
| 424 |
+
# A. Experiment Setup
|
| 425 |
+
|
| 426 |
+
# A.1. Detailed Setup
|
| 427 |
+
|
| 428 |
+
Training hyper-parameters. For the alignment stage, we use the learning rate of $1e - 3$ and train for 20 epochs. For the fine-tuning stage, we use the default learning rate $1e - 4$ and train for 20 epochs in default. We follow (Huang et al., 2024d) to utilize the double LoRA implementation, i.e., for the alignment stage and fine-tuning stage, two different LoRA adaptors are used. The rank of LoRA adaptor is 256 with LoRA alpha set to 4. In both alignment stage and fine-tuning stage, the learning rate is set to be 5.
|
| 429 |
+
|
| 430 |
+
Prompt template. We follow (Huang et al., 2024d) to use the Alpaca prompt template (Taori et al., 2023) in the following for constructing supervised dataset for alignment/finetuning.
|
| 431 |
+
|
| 432 |
+
Prompt: Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request. Instruction:{instruction} Input:{input} Response:
|
| 433 |
+
|
| 434 |
+
Output: {output}
|
| 435 |
+
|
| 436 |
+
For different fine-tuning tasks, we accordingly construct the triplet of Instruction/Input/Response. For example, for SST2 tasks, the instruction is "Analyze the sentiment of the input, and respond only positive or negative", the input is the according sentence in SST2 dataset, and the response is the according label of the sentence, i.e., "positive" or "negative". For SST2, AGNEWS, and GSM8K, we measure the finetune accuracy by counting the correct samples out of all the testing samples. A sample is counted as correct for SST2 and AGNEWS if the model gives the correct classification answer. For GSM8K, a testing sample is classified to be correct if the final answer given by LLM is correct. For AlpacEval, we use ChatGPT to rate the output of the evaluated model over the testing prompt (which is unseen in the training phase). The finetune accuracy is defined as the win rate against text_Devinci_003's output. The measurement method is consistent with previous work (Huang et al., 2024d;b).
|
| 437 |
+
|
| 438 |
+
# A.2. Implementation of Baselines and Their Idea
|
| 439 |
+
|
| 440 |
+
Performance (including harmful score or fine-tune accuracy) of all the baselines are measured over the finetuned model. Here is the detailed implementation of the five baselines.
|
| 441 |
+
|
| 442 |
+
- SFT. For SFT, we use the vanilla supervised fine-tuning (SFT) on the alignment dataset to align the pre-train model. Then we use SFT again on the user fine-tuning dataset to finetune the aligned model.
|
| 443 |
+
- Vaccine (alignment-stage solution). For Vaccine (Huang et al., 2024d), we use Vaccine to align the pre-trained model on the alignment dataset. Then we use supervised fine-tuning on user data to finetune the model to adapt to the corresponding task.
|
| 444 |
+
- RepNoise (alignment-stage solution). For RepNoise (Rosati et al., 2024a), we use RepNoise to align the pre-trained model on the alignment dataset/harmful dataset. Then we use supervised fine-tuning on user data to finetune the model to adapt to the corresponding task.
|
| 445 |
+
- Lisa (fine-tuning-stage solution). For Lisa (Huang et al., 2024b), we use SFT to align the pre-trained model on the alignment dataset. Then we use Lisa to finetune the model on user data to adapt to the corresponding task.
|
| 446 |
+
- LDIFS (fine-tuning-stage solution). For LDIFS (Mukhoti et al., 2023), we use SFT to align the pre-trained model on the alignment dataset. Then we use LDIFS to finetune the model on user data to adapt to the corresponding task.
|
| 447 |
+
|
| 448 |
+
For Vaccine, we pick the perturbation intensity $\rho = 2$ , which is the default hyper-parameter in their paper. For RepNoise, we utilize $\alpha = 0.1$ and $\beta = 0.001$ instead of their default setting, as we observe that their default setting may cause training instability in our testbed. For Lisa, we utilize the default proximal penalty $\rho = 1$ . For LDIFS, we tune the regularization coefficient $\lambda = 0.0001$ from the set [0.1, 0.01, 0.001, 0.0001, 0.00001].
|
| 449 |
+
|
| 450 |
+
We as follows further introduce the core idea of the existing baselines against harmful fine-tuning.
|
| 451 |
+
|
| 452 |
+
Vaccine (alignment-stage solution). The core idea of Vaccine (Huang et al., 2024d) is to add perturbation to the hidden embedding in the alignment stage, such that the produced embedding is able to resist the real harmful perturbation in the
|
| 453 |
+
|
| 454 |
+
fine-tuning stage (i.e., to vaccinate the model). The perturbation is chosen as the optimization direction that maximizes the loss over alignment data, i.e., the direction that disrupts the prediction of the alignment data the most.
|
| 455 |
+
|
| 456 |
+
- RepNoise (alignment-stage solution). The core contribution of RepNoise (Rosati et al., 2024a) is the representation noise. Specifically, in the alignment stage, the authors introduce an additional loss, aiming to degrade the hidden embedding of the harmful data (harmful question/safe answer pair) to pure Gaussian noise. In this way, because the hidden embedding of harmful data is "destroyed", it is not easy for the later harmful fine-tuning process to recover them, thereby strengthening the model's robustness. RepNoise assumes both the availability of harmful data (i.e., realignment data for Antidote) and the alignment data (i.e., harmful question/harmful answer pair).
|
| 457 |
+
- Lisa (fine-tuning-stage solution). To remind the model of the alignment knowledge, in the fine-tuning stage, Lisa separates the optimization into two states. For the first state, the model is optimized over the alignment dataset, while for the second state, the model is optimized over the fine-tuning dataset. Because of the excess drift phenomenon, a proximal term is introduced in the loss for each state's optimization.
|
| 458 |
+
- LDIFS (fine-tuning-stage solution). For LDIFS (Mukhoti et al., 2023), the idea is to make the hidden embedding of the fine-tuning data of the current model closer to the embedding of the original aligned model. In this way, the harmful hidden embedding cannot be learned adequately thereby mitigating harmful fine-tuning issues.
|
2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:309ebd641926b35ffb083e168c6fa225d6790a38fb1965fde89e3950e604669e
|
| 3 |
+
size 706491
|
2025/Antidote_ Post-fine-tuning Safety Alignment for Large Language Models against Harmful Fine-tuning Attack/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/7bc02b8d-49ae-4820-be36-fb7156836a7f_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/7bc02b8d-49ae-4820-be36-fb7156836a7f_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/7bc02b8d-49ae-4820-be36-fb7156836a7f_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8bb6bf888a12ee8773ae232b784f7374f8ee51995a2ed9e9a536b3b24e7bbcc5
|
| 3 |
+
size 2496375
|
2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/full.md
ADDED
|
@@ -0,0 +1,748 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# AnyEdit: Edit Any Knowledge Encoded in Language Models
|
| 2 |
+
|
| 3 |
+
Houcheng Jiang $^{1}$ Junfeng Fang $^{2*}$ Ningyu Zhang $^{3}$ Mingyang Wan $^{4}$ Guojun Ma $^{4}$ Xiang Wang $^{1}$ Xiangnan He $^{1*}$ Tat-Seng Chua $^{2}$
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
Large language models (LLMs) often produce incorrect or outdated information, necessitating efficient and precise knowledge updates. Current model editing methods, however, struggle with long-form knowledge in diverse formats, such as poetry, code snippets, and mathematical derivations. These limitations arise from their reliance on editing a single token's hidden state, a limitation we term as "efficacy barrier". To solve this, we propose AnyEdit, a new autoregressive editing paradigm. It decomposes long-form knowledge into sequential chunks and iteratively edits the key token in each chunk, ensuring consistent and accurate outputs. Theoretically, we ground AnyEdit in the Chain Rule of Mutual Information, showing its ability to update any knowledge within LLMs. Empirically, it outperforms strong baselines by $21.5\%$ on benchmarks including UnKEBench, AKEW, and our new EditEverything dataset for long-form diverse-formatted knowledge. Additionally, AnyEdit serves as a plug-and-play framework, enabling current editing methods to update knowledge with arbitrary length and format, significantly advancing the scope and practicality of LLM knowledge editing. Our code is available at: https://github.com/jianghoucheng/AnyEdit.
|
| 8 |
+
|
| 9 |
+
# 1. Introduction
|
| 10 |
+
|
| 11 |
+
Large language models (LLMs) have achieved impressive success by learning and storing vast amounts of knowledge (Brown et al., 2020; Radford et al., 2019; Zhao et al., 2024). However, they often suffer from hallucinations, producing
|
| 12 |
+
|
| 13 |
+
*Corresponding Author. ${}^{1}$ MoE Key Lab of BIPC,University of Science and Technology of China ${}^{2}$ National University of Singapore ${}^{3}$ Zhejiang University ${}^{4}$ Douyin Co., Ltd. Correspondence to: Junfeng Fang <fangjf1997@gmail.com>, Xiangnan He < xiangnanhe@gmail.com>.
|
| 14 |
+
|
| 15 |
+
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 16 |
+
|
| 17 |
+
incorrect or outdated information (Cao et al., 2021; Mitchell et al., 2022a). For instance, when queried with "Where were the latest Olympics held?", an LLM often provides an outdated response "Tokyo", instead of the correct, updated answer "Paris". While retraining or fine-tuning can mitigate these issues, such approaches are resource-intensive and risk overfitting (Mitchell et al., 2022b; Meng et al., 2022). To overcome this, model editing has emerged as a promising alternative. As illustrated in Figure 1 (b), it typically begins by constructing a (subject, relation, object) triplet, such as (Olympics, were held in, Paris), to represent the knowledge to be updated. It then follows a locate-then-edit paradigm as Figure 1 (a) shows: (1) Locate the key token in the input prompt (e.g., "Olympics") and the influential layers using causal tracing; (2) Edit the hidden states of the key token within these layers to align the model's output with the desired knowledge update (e.g., modifying "Tokyo" to "Paris"). This approach enables precise and efficient updates without the need for full-scale retraining or fine-tuning, showing the potential to model dynamic and evolving knowledge.
|
| 18 |
+
|
| 19 |
+
Despite their success, existing model editing methods mostly face significant limitations in the length and diversity of the knowledge they can update. As shown in Figure 1 (c), even leading methods like AlphaEdit (Fang et al., 2025) and RECT (Gu et al., 2024) struggle to handle updates exceeding 100 tokens. Worse still, most methods are restricted to the knowledge represented as structured (subject, relation, object) triples. However, real-world knowledge is often encoded in diverse formats (e.g., mathematical derivations and code snippets as shown in Figure 1 (f)) and could exceed the 100-token threshold (Wu et al., 2024). These constraints are ill-suited for real-world scenarios, significantly narrowing the scope of model editing and hindering its broader advancement.
|
| 20 |
+
|
| 21 |
+
Here we first conduct an in-depth analysis to identify why current methods fail for long-form diverse-formatted knowledge. Considering Figure 1 (a) again, existing methods typically rely on locating a single token, assuming that altering its hidden states will suffice to edit the LLM's output (i.e., enabling the model to generate desired outputs reflecting new knowledge). However, long-form diverse-formatted knowledge is inherently more complex and information-dense than a single triplet, often requiring the integration
|
| 22 |
+
|
| 23 |
+
# Current Paradigm
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
(a)
|
| 27 |
+
(b)
|
| 28 |
+
Knowledge of Triple Format # Where were Olympics held? Pairs.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
(c)
|
| 32 |
+
Figure 1. Comparison of current methods and our AnyEdit. (a) and (d) illustrate the editing processes; (c) and (e) show the editing efficacy as the number of tokens within the to-be-updated knowledge increases; (b) and (f) depict the type of knowledge that each method can edit.
|
| 33 |
+
|
| 34 |
+

|
| 35 |
+
(d)
|
| 36 |
+
(f)
|
| 37 |
+
|
| 38 |
+

|
| 39 |
+
(e)
|
| 40 |
+
|
| 41 |
+
# AnyEdit (Ours)
|
| 42 |
+
|
| 43 |
+
Input: Introduce the latest Olympics.
|
| 44 |
+
Output: It was held in Paris, France.
|
| 45 |
+
Dates were from July 26 to (...)
|
| 46 |
+
|
| 47 |
+

|
| 48 |
+
Knowledge of News
|
| 49 |
+
Knowledge of Biology
|
| 50 |
+
|
| 51 |
+
Input: Write AU-rich element (ARE)
|
| 52 |
+
Output: The AU-rich element (ARE)
|
| 53 |
+
RNA sequence is 5'-AUUUAUU (...)
|
| 54 |
+
|
| 55 |
+
# Knowledge of Opera
|
| 56 |
+
|
| 57 |
+
Input: Write the <Hamlet> for me.
|
| 58 |
+
Output: Barnardo: "I am Barnardo."
|
| 59 |
+
|
| 60 |
+
Francisco
|
| 61 |
+
|
| 62 |
+
"I thank thee for thy good will;
|
| 63 |
+
As for my own poor part,
|
| 64 |
+
I do not know.
|
| 65 |
+
Why I should be so fond of you." Barnardo: (...)
|
| 66 |
+
|
| 67 |
+

|
| 68 |
+
Knowledge of Chemistry
|
| 69 |
+
|
| 70 |
+
Input: The properties of C6H6 are? Output: Benzene (C6H6) is a planar, cyclic molecule with a hexagonal (...)
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Knowledge of Code
|
| 74 |
+
|
| 75 |
+
Input: Find n-th bell number.
|
| 76 |
+
Output: def bell_Number(n): $\backslash$ r bell = [0 for i in range(n+1)] for j in range (...)
|
| 77 |
+
|
| 78 |
+

|
| 79 |
+
Knowledge of Math
|
| 80 |
+
|
| 81 |
+
Input: If $y > 0$ , please tell me $(7y) / 20 + (3y) / 10$ is what percent of $y$ ?
|
| 82 |
+
Output: To find what percent the expression $((\backslash \mathrm{frac}\{7y\} \{20\} + \backslash \mathrm{frac}\{3y\} \{10\}))$ is of $y$ , we first need to simplify the expression. First, let's find a common denominator (...)
|
| 83 |
+
|
| 84 |
+
of multiple critical tokens and intricate interdependencies among their hidden states. Thus, altering just a single token's hidden state is insufficient to ensure consistent and accurate knowledge generation. We term this limitation as the efficacy barrier of single-token editing<sup>1</sup>, which is empirically validated in Section 3. As a consequence, existing methods remain constrained by the paradigm of locating a single token and, as a result, are unable to overcome the aforementioned limitation.
|
| 85 |
+
|
| 86 |
+
Hence, a critical question naturally arises for updating long-form diverse-formatted knowledge: "Can multiple tokens be jointly located and edited to enable complex knowledge updates?" A straightforward solution is to directly extend single-token editing to multiple tokens. However, it risks interference or conflicts between hidden state perturbations, undermining the coherence of to-be-updated knowledge and causing the performance drop as Figure 1 (c) showcases. In sight of this, we introduce AnyEdit, an autoregressive editing paradigm that enables collaborative multi-token updates. As illustrated in Figure 1 (d), AnyEdit decomposes long-form knowledge into sequential chunks, treating each as independent sub-knowledge. During editing, we iteratively (1) locate the final token of the current chunk and (2) perturb its hidden states to maximize the likelihood of generating the subsequent chunk. Building on the Chain Rule of mutual information (Dobrushin, 1963) in Information Theory (Kullback, 1997), we theoretically demonstrate that this autoregressive process ensures the generation of consistent, complete long-form knowledge. AnyEdit offers two
|
| 87 |
+
|
| 88 |
+
key advantages: (1) Adaptivity: The number of edited tokens can be adaptively adjusted with the knowledge length, avoiding redundant edits. (2) Generality: It supports diverse knowledge formats (e.g., poetry, code, math) by decoupling structure-specific constraints. By shifting from single-token to multi-token collaborative editing, AnyEdit overcomes the challenge of efficacy barrier, demonstrating the potential for practical, updating complex knowledge of diverse formats.
|
| 89 |
+
|
| 90 |
+
To validate AnyEdit, we conducted a comprehensive evaluation comparing it with leading model editing methods (e.g., MEMIT (Meng et al., 2023), AlphaEdit (Fang et al., 2025), and UnKE (Deng et al., 2025)) on the prevailing LLMs such as Llama3-8B-Instruct² and Qwen2.5-7B-Chat (Yang et al., 2024). Beyond standard benchmark datasets (e.g., Counterfact (Meng et al., 2022) and ZsRE (Meng et al., 2023)) that represent knowledge as triples, we curate EditEverything, a new benchmark for long-form knowledge in diverse formats. As shown in Figure 1 (f), this dataset includes entries up to 458 tokens — over twice the length of the longest sequences in existing benchmarks (e.g., 156 tokens in AKEW (Wu et al., 2024)) — and spans multiple domains, including mathematics, news, code, and biochemistry. Results on EditEverything and standard benchmarks demonstrate that AnyEdit surpasses all baselines, achieving a $21.5\%$ average improvement in editing accuracy with comparable computational overhead. Furthermore, as the first autoregressive editing framework, AnyEdit also enables seamless integration with existing locate-then-edit methods, as shown in Figure 1 (e). This plug-and-play capability equips traditional approaches with the ability to handle knowledge with arbitrary length and format, significantly broadening
|
| 91 |
+
|
| 92 |
+
the scope and practicality of LLM knowledge editing.
|
| 93 |
+
|
| 94 |
+
# 2. Preliminary
|
| 95 |
+
|
| 96 |
+
Autoregressive LLMs. LLMs learn and store knowledge through autoregressive token prediction. Formally, let $f$ denote a decoder-only LLM with $L$ layers processing the input sequence $X = (x_0, x_1, \dots, x_T)$ . At layer $l$ , the hidden state for token $x_t$ is computed via the forward propagation:
|
| 97 |
+
|
| 98 |
+
$$
|
| 99 |
+
\boldsymbol {h} _ {t} = \boldsymbol {h} _ {t} ^ {- 1} + \boldsymbol {a} _ {t} + \boldsymbol {m} _ {t},
|
| 100 |
+
$$
|
| 101 |
+
|
| 102 |
+
$$
|
| 103 |
+
\boldsymbol {a} _ {t} = \operatorname {A t t e n t i o n} \left(\boldsymbol {h} _ {0} ^ {- 1}, \boldsymbol {h} _ {1} ^ {- 1}, \dots , \boldsymbol {h} _ {t} ^ {- 1}\right), \tag {1}
|
| 104 |
+
$$
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\boldsymbol {m} _ {t} = \operatorname {M L P} \left(\boldsymbol {h} _ {t} ^ {- 1} + \boldsymbol {a} _ {t}\right),
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where $h_t$ and $h_t^{-1}$ denote the hidden states of token $x_t$ in the current and previous layers, respectively; $a_t$ and $m_t$ are the outputs of the attention and MLP modules, respectively.
|
| 111 |
+
|
| 112 |
+
Model Editing in LLMs. To update outdated or incorrect knowledge within $f$ , model editing typically follows a locate-then-edit paradigm (Meng et al., 2022): (1) Locate the key token in the input prompt and the influential layers; (2) Edit the hidden states of the key token within these layers to modify the model's output. Formally, let $(X,Y)$ denote the to-be-updated knowledge with the input prompt $X$ (e.g., "Where were the latest Olympics held?") and the desired output $Y$ (e.g., "Paris"). Suppose the key token is located at position $t$ in $X$ . Current methods typically perturb its hidden state $h_t$ by adding a residual term $\delta$ , which is obtained via gradient descent to maximize the probability of generating $Y$ given $X$ :
|
| 113 |
+
|
| 114 |
+
$$
|
| 115 |
+
\boldsymbol {\delta} = \underset {\hat {\boldsymbol {\delta}}} {\arg \min } \left(- \log \mathbb {P} _ {f \left(\boldsymbol {h} _ {t} + \hat {\boldsymbol {\delta}}\right)} [ Y \mid X ]\right), \tag {2}
|
| 116 |
+
$$
|
| 117 |
+
|
| 118 |
+
where $\mathbb{P}_{f(\pmb{h}_t + \hat{\delta})}$ represents the output probability when replacing $\pmb{h}_t$ with $h_t + \hat{\delta}$ in the LLM. Finally, the LLM parameters are updated such that, given the input $X$ , the hidden state of the key token is aligned with $h_t + \delta$ . For more details, please refer to Appendix B.1.
|
| 119 |
+
|
| 120 |
+
# 3. Limitations of Single-token Editing
|
| 121 |
+
|
| 122 |
+
Although single-token editing methods have been extensively studied in recent years (Fang et al., 2025; Wang et al., 2024; Deng et al., 2025; Gu et al., 2024; Wu et al., 2024), we argue that they suffer from updating long-form, diverse formatted knowledge.
|
| 123 |
+
|
| 124 |
+
# 3.1. Editing Diverse-formatted Knowledge
|
| 125 |
+
|
| 126 |
+
According to Equation 2, the success of the single-token editing methods hinges on whether the LLM generates $Y$ given $X$ after applying the perturbation $\delta$ to $h_t$ . In other words, the perturbation must significantly increase the probability
|
| 127 |
+
|
| 128 |
+
of generating $Y$ over any other possible output. However, if the original probability of $Y$ in the unedited LLM is already low — particularly common in the case of diverse-formatted knowledge, such as code snippets and mathematical derivations — then $\delta$ must induce a large shift to make $Y$ the dominant output. Due to the limited capacity of single-token editing, current methods often struggle with such cases.
|
| 129 |
+
|
| 130 |
+
This limitation arises because structured knowledge (e.g., factual triples) is simpler than diverse-formatted knowledge, which involves intricate dependencies. In triplets, modifying a single token (e.g., changing "Tokyo" to "Paris") is often enough. In contrast, diverse-formatted knowledge like code and math requires consistent updates across multiple tokens due to syntax, variable dependencies, and hierarchical structures. Consider Figure 1 (f) again. Modifying a function in code may require changes across multiple lines, while altering a symbol in a formula often affects the entire expression. Single-token perturbations fail to capture and propagate such dependencies, leading to ineffective edits.
|
| 131 |
+
|
| 132 |
+
To empirically validate this, we apply leading single-token editing methods, MEMIT to update triplet-structured and diverse-formatted knowledge in LLaMA3-8B-Instruct. Figure 2 shows relationships between knowledge format, original probability, and editing efficacy. The results show that diverse-formatted knowledge, which typically has a low original probability, exhibits poor editing efficacy. In a nutshell, low original probability may be the fundamental limitation in updating diverse-formatted knowledge.
|
| 133 |
+
|
| 134 |
+
# 3.2. Editing Long-form Knowledge
|
| 135 |
+
|
| 136 |
+
Recent studies suggest that although LLMs leverage attention mechanism (Wang & Komatsuzaki, 2021), the dependency between distant tokens weakens as their positional distance increases (Liu et al., 2024a). As a result, for long outputs $Y$ (e.g., $Y$ exceeding 100 tokens), perturbations applied to input tokens may have a diminishing influence on the later tokens within $Y$ . In such cases, the shift of generation probability of $Y$ introduced by the perturbation $\delta$ may be too small, making it insufficient to increase the probability of $Y$ above that of any other potential output.
|
| 137 |
+
|
| 138 |
+
To validate this, we repeat the experiments described in Section 3.1. Additionally, we use causal tracing (Meng et al., 2022), a common strategy in model editing, to quantify the shift in the generation probability of $Y$ introduced by the perturbation on $X$ (details of causal tracing can be found in Appendix B.1). Figure 3 illustrates the relationship between: the number of tokens in $Y$ , the probability shift, and editing efficacy. The results demonstrate that long-form knowledge, which is less affected by single-token edits on the input, shows poor editing efficacy. In other words, the low probability shift introduced by single-token edits emerges as the inherent limitation in updating long-form knowledge.
|
| 139 |
+
|
| 140 |
+

|
| 141 |
+
Figure 2. Relationship between knowledge format, original output probability, and efficacy when applying advanced editing methods to update triplet-structured and diverse-formatted knowledge. For each category, we randomly sample 200 knowledge instances to conduct experiments.
|
| 142 |
+
|
| 143 |
+
This limitation, in conjunction with the constraint discussed in Section 3.1, collectively suggests that the current single-token editing paradigm faces a theoretical efficacy barrier. We formalize this barrier as follows:
|
| 144 |
+
|
| 145 |
+
Proposition 1 (Efficacy Barrier of Single-token Editing). Given $N$ pieces of knowledge to be updated, denoted as $(X_{i},Y_{i})$ for $i\in (1,N)$ , and a target LLM $f$ , the upper bound on the efficacy of knowledge updates using single-token editing is given by:
|
| 146 |
+
|
| 147 |
+
$$
|
| 148 |
+
\begin{array}{l} \eta = \frac {1}{N} \sum_ {i = 1} ^ {N} \operatorname {s i g n} \left(\mathbb {P} _ {f (\boldsymbol {h} + \boldsymbol {\delta})} [ Y _ {i} \mid X _ {i} ] - \right. \tag {3} \\ \max _ {Y ^ {\prime} \in \mathbb {Y} / Y _ {i}} \left(\mathbb {P} _ {f (\boldsymbol {h} + \boldsymbol {\delta})} \left[ Y ^ {\prime} \mid X _ {i} \right]\right), \\ \end{array}
|
| 149 |
+
$$
|
| 150 |
+
|
| 151 |
+
where $\text{sign}(\cdot)$ is the sign function, $h$ denotes the hidden state of the perturbed token, $\mathbb{Y}$ represents the set of $f$ 's outputs, and $\delta$ is defined as:
|
| 152 |
+
|
| 153 |
+
$$
|
| 154 |
+
\boldsymbol {\delta} = \underset {\hat {\boldsymbol {\delta}}} {\arg \min } \left(- \log \mathbb {P} _ {f (\boldsymbol {h} + \hat {\boldsymbol {\delta}})} \left[ Y _ {i} \mid X _ {i} \right]\right). \tag {4}
|
| 155 |
+
$$
|
| 156 |
+
|
| 157 |
+
Here $\eta$ computes the average success rate of making $Y_{i}$ the most probable output for each input $X_{i}$ after editing.
|
| 158 |
+
|
| 159 |
+
# 4. AnyEdit: Autoregressive Model Editing
|
| 160 |
+
|
| 161 |
+
The previous section demonstrated that, regardless of how current single-token editing methods are optimized, their editing efficiency is inevitably constrained by an upper bound. Furthermore, as the format and length of the knowledge to be updated become more diverse and longer, this upper bound diminishes, eventually rendering the editing process ineffective. To address this issue, we introduce AnyEdit, an autoregressive editing paradigm that enables collaborative token updates. The theoretical foundation from an information-theoretic perspective is provided in Section 4.1, while its instantiation is outlined in Section 4.2.
|
| 162 |
+
|
| 163 |
+

|
| 164 |
+
Figure 3. Relationship between the number of tokens in to-be-updated knowledge, probability shift under random perturbations, and efficacy. We conduct experiments by truncating the sampled knowledge instances to enable editing across different token lengths. The lighter-colored bands represent variance.
|
| 165 |
+
|
| 166 |
+
# 4.1. Theoretical Foundation
|
| 167 |
+
|
| 168 |
+
We begin by reviewing the editing process from an information-theoretic perspective. Specifically, existing methods aim to maximize the probability of generating $Y$ by editing hidden states, as formulated in Equation 2. This objective aligns with maximizing the mutual information (MI) (Kullback, 1997) between $X$ and $Y$ , given the perturbed hidden state $h'$ :
|
| 169 |
+
|
| 170 |
+
$$
|
| 171 |
+
\boldsymbol {h} ^ {\prime} = \underset {\hat {\boldsymbol {h}} ^ {\prime}} {\arg \max } I (X; Y \mid \hat {\boldsymbol {h}} ^ {\prime}), \tag {5}
|
| 172 |
+
$$
|
| 173 |
+
|
| 174 |
+
where $I(\cdot |\cdot)$ denotes MI. A detailed derivation is provided in Appendix B.2. Extending this framework to perturb the hidden states of $K$ tokens simultaneously, denoted as $\{h_1,h_2,\dots ,h_K\}$ , the MI in Equation 5 generalizes to:
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
I (X; Y \mid \mathbf {h} _ {1} ^ {\prime}, \mathbf {h} _ {2} ^ {\prime}, \dots , \mathbf {h} _ {K} ^ {\prime}). \tag {6}
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
However, as discussed in Section 3.2, simultaneous perturbation of multiple hidden states introduces interference, reducing editing efficacy. Ideally, the MI term should involve only a single hidden state as a condition, as in Equation 5. To achieve this, we first decompose $Y$ into $K$ chunks, denoted as $Y = (Y_{1},Y_{2},\dots,Y_{K})$ , and apply the chain rule of MI to rewrite Equation 6:
|
| 181 |
+
|
| 182 |
+
$$
|
| 183 |
+
\begin{array}{l} I (X; Y \mid \mathbf {h} _ {1} ^ {\prime}, \dots , \mathbf {h} _ {K} ^ {\prime}) = \\ \sum_ {k = 1} ^ {K} I \left(X; Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, \boldsymbol {h} _ {1} ^ {\prime}, \dots , \boldsymbol {h} _ {K} ^ {\prime}\right). \tag {7} \\ \end{array}
|
| 184 |
+
$$
|
| 185 |
+
|
| 186 |
+
We then select the last token of each chunk as the perturbation target, establishing a one-to-one correspondence between chunk $Y_{k}$ and hidden state $h_k'$ . Given that LLMs generate outputs autoregressively, two key properties hold:
|
| 187 |
+
|
| 188 |
+
- Hidden states of later tokens do not influence the generation of earlier outputs, i.e., $H(Y_{p} \mid \boldsymbol{h}_{q}^{\prime}) = H(Y_{p})$ for $p < q$ , where $H(\cdot)$ represents the information entropy;
|
| 189 |
+
|
| 190 |
+
- Once $Y_{k}$ is determined, conditioning on $Y_{k}$ subsumes conditioning on the hidden state of tokens within $Y_{k}$ , i.e., $H(\cdot \mid Y_k) = H(\cdot \mid Y_k, h_k')$ .
|
| 191 |
+
|
| 192 |
+
Using these two properties, we can derive that each term in Equation 7 is proportional to:
|
| 193 |
+
|
| 194 |
+
$$
|
| 195 |
+
I \left(X, Y _ {1}, \dots , Y _ {k - 1}; Y _ {k} \mid \boldsymbol {h} _ {k} ^ {\prime}\right). \tag {8}
|
| 196 |
+
$$
|
| 197 |
+
|
| 198 |
+
A detailed derivation is provided in Appendix B.3. Equation 8 directly informs our editing strategy: at each step, we take $X$ and previously edited chunks $(Y_{1},\ldots ,Y_{k - 1})$ as inputs, iteratively encoding the next chunk $Y_{k}$ into the LLM's output in an autoregressive manner. More importantly, Equation 8 exhibits two critical advantages:
|
| 199 |
+
|
| 200 |
+
1. Elimination of Interference: Each MI term conditions on a single hidden state $h'$ , avoiding the interference issue in Equation 6.
|
| 201 |
+
2. Scalability Across Length and Formats: Regardless of $Y$ 's length or format, each editing step updates only a single chunk, circumventing the efficacy barrier of single-token editing in Proposition 1.
|
| 202 |
+
|
| 203 |
+
In summary, this formulation provides a theoretical foundation for editing long-form diverse-formatted knowledge in LLMs. By leveraging an autoregressive editing paradigm, we move beyond single-token editing, enabling more scalable and efficient model editing. Next, we demonstrate how to instantiate it by providing specific implementation steps.
|
| 204 |
+
|
| 205 |
+
# 4.2. Implementation Details
|
| 206 |
+
|
| 207 |
+
Building on the above theoretical foundation, we elaborate on the implementation process of AnyEdit in this part. Specifically, AnyEdit follows a four-step process for effective and scalable knowledge editing:
|
| 208 |
+
|
| 209 |
+
Step 1: Chunk Outputs. The first step involves splitting the target output $Y$ into multiple chunks. We propose two chunking strategies: (1) a sliding window with a fixed number of tokens and (2) semantic segmentation based on natural sentence boundaries. These strategies endow AnyEdit with the ability to automatically adjust the number of edited tokens based on knowledge length, ensuring efficient edits without redundancy.
|
| 210 |
+
|
| 211 |
+
Step 2: Locate Token and Layer. We select the last token of each chunk $Y_{k}$ as the target for editing, and directly apply the causal tracing to locate the influential layers, following the conventional model editing methods (Meng et al., 2022).
|
| 212 |
+
|
| 213 |
+
Step 3: Edit Hidden States. Following Equation 8, we input $X$ and the previous chunks $\{Y_1, Y_2, \dots, Y_{k-1}\}$ into the LLM. Then, the hidden state $h_k$ of the selected token is
|
| 214 |
+
|
| 215 |
+
edited by the gradient descent to maximize the probability of generating $Y_{k}$ . Formally,
|
| 216 |
+
|
| 217 |
+
$$
|
| 218 |
+
\begin{array}{l} \boldsymbol {h} _ {k} ^ {\prime} = \boldsymbol {h} _ {k} + \arg \min \\ \delta \tag {9} \\ \left(- \log \mathbb {P} _ {f (\boldsymbol {h} _ {k} + \hat {\boldsymbol {\delta}})} \left[ Y _ {k} \mid X, Y _ {1}, \dots , Y _ {k - 1} \right]\right). \\ \end{array}
|
| 219 |
+
$$
|
| 220 |
+
|
| 221 |
+
Step 4: Update Model Parameters. Finally, the LLM parameters are updated to align the hidden state of the selected tokens with the edited states, using standard least-squares optimization as employed in current model editing methods (Meng et al., 2022). Detailed implementation of this step is provided in Appendix B.1.
|
| 222 |
+
|
| 223 |
+
This multi-token collaborative editing process enables AnyEdit to overcome the efficacy barrier of single-token editing. Furthermore, AnyEdit enables seamless integration with existing methods, equipping them with the ability to edit any knowledge within LLMs and broadening the scope and practicality of LLM knowledge editing.
|
| 224 |
+
|
| 225 |
+
# 5. Experiments
|
| 226 |
+
|
| 227 |
+
In this section, we conduct extensive experiments to address the following research questions:
|
| 228 |
+
|
| 229 |
+
- RQ1: How does AnyEdit perform compared to other baselines on tasks involving long-form knowledge?
|
| 230 |
+
- RQ2: How does AnyEdit compare to other baselines in handling diverse-formatted knowledge?
|
| 231 |
+
- RQ3: Can AnyEdit improve the performance of other locate-then-edit methods?
|
| 232 |
+
- RQ4: How does the token length of each chunk affect the performance of long-form knowledge editing in AnyEdit?
|
| 233 |
+
|
| 234 |
+
# 5.1. Experimental Setup
|
| 235 |
+
|
| 236 |
+
In this subsection, we summarize the LLMs, baseline methods, datasets, and evaluation metrics used in our experiments. Further details are provided in Appendix A.
|
| 237 |
+
|
| 238 |
+
LLMs & Baseline Methods. We conducted experiments using two widely adopted LLMs: Llama3-8B-Instruct and Qwen2.5-7B-Instruct. For comparison with our method, we evaluated against several model editing methods, including FT-L (Zhu et al., 2020), MEND (Mitchell et al., 2022a), ROME (Meng et al., 2022), MEMIT (Meng et al., 2023), AlphaEdit (Fang et al., 2025), and UnKE (Deng et al., 2025).
|
| 239 |
+
|
| 240 |
+
Datasets and Evaluation Metrics. To evaluate the performance of unstructured long-form knowledge editing, we employed existing benchmarks, including UnKEBench (Deng et al., 2025) and AKEW (Wu et al., 2024). To further assess
|
| 241 |
+
|
| 242 |
+
Table 1. Long-form knowledge editing performance with different methods. "Pre-edited" refers to the unedited pre-trained LLM, and "Ori." and "Para." denote the outputs of the tested LLM for original questions and paraphrased questions respectively. The best results are highlighted in bold.
|
| 243 |
+
|
| 244 |
+
<table><tr><td rowspan="3">LLM</td><td rowspan="3">Method</td><td colspan="4">UnKEBench</td><td colspan="4">AKEW (Counterfact)</td><td colspan="2">AKEW (MQAKE)</td></tr><tr><td colspan="2">Ori.</td><td colspan="2">Para.</td><td colspan="2">Ori.</td><td colspan="2">Para.</td><td colspan="2">Ori.</td></tr><tr><td>Bert Score</td><td>Rouge-L</td><td>Bert Score</td><td>Rouge-L</td><td>Bert Score</td><td>Rouge-L</td><td>Bert Score</td><td>Rouge-L</td><td>Bert Score</td><td>Rouge-L</td></tr><tr><td rowspan="9">Llama3-8B-It</td><td>Pre-edited</td><td>63.18±0.38</td><td>23.67±0.52</td><td>62.73±0.31</td><td>23.52±0.51</td><td>64.03±0.32</td><td>15.74±0.42</td><td>40.20±0.46</td><td>5.52±0.10</td><td>65.77±0.37</td><td>16.25±0.47</td></tr><tr><td>FT-L</td><td>40.31±0.45</td><td>11.39±0.56</td><td>37.29±0.41</td><td>8.51±0.51</td><td>42.89±0.43</td><td>13.12±0.58</td><td>31.44±0.49</td><td>5.24±0.08</td><td>45.87±0.43</td><td>12.99±0.52</td></tr><tr><td>MEND</td><td>68.73±0.34</td><td>29.24±0.52</td><td>64.11±0.32</td><td>28.05±0.54</td><td>68.81±0.31</td><td>30.30±0.48</td><td>41.56±0.40</td><td>10.95±0.57</td><td>67.85±0.33</td><td>22.48±0.56</td></tr><tr><td>ROME</td><td>72.16±0.31</td><td>23.74±0.46</td><td>70.54±0.25</td><td>22.39±0.54</td><td>72.90±0.36</td><td>25.86±0.52</td><td>43.59±0.51</td><td>12.37±0.55</td><td>70.10±0.43</td><td>21.07±0.59</td></tr><tr><td>MEMIT</td><td>76.21±0.36</td><td>30.49±0.52</td><td>74.25±0.31</td><td>28.65±0.61</td><td>76.44±0.33</td><td>32.20±0.48</td><td>47.80±0.34</td><td>16.09±0.59</td><td>75.31±0.37</td><td>22.73±0.61</td></tr><tr><td>AlphaEdit</td><td>73.92±0.29</td><td>26.59±0.49</td><td>72.96±0.26</td><td>25.92±0.51</td><td>72.63±0.31</td><td>24.95±0.50</td><td>44.67±0.46</td><td>13.79±0.49</td><td>69.85±0.36</td><td>23.04±0.59</td></tr><tr><td>AnyEdit</td><td>97.76±0.11</td><td>92.96±0.24</td><td>96.60±0.19</td><td>95.60±0.35</td><td>97.76±0.14</td><td>95.87±0.23</td><td>62.63±0.44</td><td>46.51±0.59</td><td>96.33±0.21</td><td>94.32±0.23</td></tr><tr><td>UnKE</td><td>98.34±0.15</td><td>93.33±0.26</td><td>93.38±0.21</td><td>78.42±0.32</td><td>98.62±0.14</td><td>96.37±0.22</td><td>59.62±0.44</td><td>32.89±0.59</td><td>98.33±0.13</td><td>95.42±0.20</td></tr><tr><td>AnyEdit*</td><td>99.86±0.08</td><td>99.68±0.21</td><td>94.70±0.12</td><td>85.75±0.23</td><td>99.95±0.01</td><td>99.98±0.01</td><td>64.24±0.48</td><td>45.31±0.55</td><td>99.89±0.06</td><td>99.69±0.09</td></tr><tr><td rowspan="9">Qwen2,5-7B-It</td><td>Pre-edited</td><td>64.18±0.37</td><td>25.88±0.59</td><td>64.39±0.34</td><td>24.02±0.55</td><td>65.50±0.34</td><td>18.24±0.60</td><td>44.74±0.41</td><td>17.29±0.51</td><td>67.71±0.37</td><td>19.58±0.49</td></tr><tr><td>FT-L</td><td>44.02±0.43</td><td>13.78±0.56</td><td>40.33±0.36</td><td>12.93±0.49</td><td>46.66±0.48</td><td>14.63±0.58</td><td>32.34±0.50</td><td>12.31±0.62</td><td>47.47±0.42</td><td>15.75±0.55</td></tr><tr><td>MEND</td><td>69.49±0.38</td><td>27.77±0.61</td><td>62.01±0.44</td><td>27.92±0.57</td><td>69.54±0.54</td><td>25.47±0.49</td><td>52.86±0.40</td><td>22.81±0.54</td><td>69.40±0.32</td><td>32.39±0.44</td></tr><tr><td>ROME</td><td>74.73±0.33</td><td>31.52±0.42</td><td>71.90±0.21</td><td>28.12±0.38</td><td>75.89±0.38</td><td>36.42±0.45</td><td>55.67±0.47</td><td>25.79±0.59</td><td>72.18±0.373</td><td>35.61±0.49</td></tr><tr><td>MEMIT</td><td>78.03±0.30</td><td>38.04±0.47</td><td>76.50±0.31</td><td>28.65±0.50</td><td>77.19±0.32</td><td>38.95±0.48</td><td>56.04±0.40</td><td>25.73±0.57</td><td>73.15±0.32</td><td>34.39±0.54</td></tr><tr><td>AlphaEdit</td><td>80.48±0.29</td><td>42.77±0.36</td><td>78.38±0.21</td><td>38.26±0.38</td><td>80.66±0.25</td><td>45.55±0.37</td><td>56.99±0.49</td><td>27.69±0.59</td><td>74.35±0.31</td><td>41.07±0.44</td></tr><tr><td>AnyEdit</td><td>98.05±0.16</td><td>94.89±0.29</td><td>93.56±0.15</td><td>79.98±0.28</td><td>98.08±0.15</td><td>95.09±0.19</td><td>65.40±0.38</td><td>43.49±0.47</td><td>98.14±0.13</td><td>96.39±0.18</td></tr><tr><td>UnKE</td><td>96.97±0.18</td><td>91.01±0.24</td><td>89.17±0.15</td><td>67.00±0.29</td><td>97.34±0.13</td><td>90.44±0.16</td><td>59.29±0.48</td><td>29.27±0.61</td><td>95.04±0.23</td><td>87.60±0.25</td></tr><tr><td>AnyEdit*</td><td>99.35±0.12</td><td>98.82±0.24</td><td>94.81±0.13</td><td>82.60±0.26</td><td>99.63±0.09</td><td>98.99±0.10</td><td>60.78±0.39</td><td>32.95±0.59</td><td>99.09±0.07</td><td>97.98±0.10</td></tr></table>
|
| 245 |
+
|
| 246 |
+
the editing performance across diverse-formatted knowledge, we constructed a dataset named EditEverything. For evaluation metrics, we assessed the similarity between the model's edited outputs and the editing targets from three perspectives: original questions, paraphrased questions, and sub-questions. The evaluation was conducted using both semantic similarity (BERT Score (Zhang et al., 2019)) and lexical similarity (ROUGE Scores (Lin, 2004)) to determine the editing success rate.
|
| 247 |
+
|
| 248 |
+
# 5.2. Long-Form Knowledge Editing (RQ1)
|
| 249 |
+
|
| 250 |
+
To evaluate long-form knowledge editing, we conducted experiments on two base LLMs, comparing AnyEdit with baselines on UnKEBench, AKEW (Counterfact), and AKEW (MQUAKE). Following UnKE's settings, we set the batch size to 1 and used a decoding temperature of 0.001.
|
| 251 |
+
|
| 252 |
+
Most locate-then-edit baseline methods perform edits by computing parameter updates for a single MLP layer using closed-form solutions, while UnKE uses gradient descent to update the parameters of an entire layer, trading efficiency for precision. To ensure fairness, we introduce **AnyEdit** which also updates the full layer via gradient descent, allowing direct comparison with UnKE. Table 1 presents the main results, with additional details in Appendix C. Based on Table 1, we make the following observations:
|
| 253 |
+
|
| 254 |
+
- Obs 1: AnyEdit outperforms all baselines across datasets, LLMs, and metrics. On UnKEBench, it improves BERT Score by over $20\%$ , demonstrating its effectiveness in editing long-form knowledge. AnyEdit* further enhances performance, refining complex knowledge representations.
|
| 255 |
+
- Obs 2: AnyEdit shows strong generalization on paraphrase questions. It significantly outperforms baselines in paraphrase scenarios. On UnKEBench, AnyEdit improves BERT Score by $32\%$ and ROUGE-L by $56\%$ on Llama3-8B-Instruct. This highlights its ability to edit long-form knowledge while maintaining robustness to rephrased queries.
|
| 256 |
+
|
| 257 |
+
# 5.3. Diverse-Formatted Knowledge Editing (RQ2)
|
| 258 |
+
|
| 259 |
+
To further evaluate the generalization capabilities of AnyEdit, we constructed a dataset named EditEverything, which includes unstructured knowledge from various domains and formats to assess the performance of existing editing methods on complex knowledge. This dataset encompasses knowledge from diverse domains such as mathematics, poetry, news, computer code, and chemistry. The detailed evaluation results are shown in Figure 4(b). Furthermore, we evaluate the relationship between the editing performance and the number of target tokens by selecting long-form samples from the EditEverything dataset. The
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
Figure 4. Performance comparison between the AnyEdit approach and baseline methods on long-form diverse-formatted knowledge. (a) The performance of various methods on the EditEverything dataset in relation to the number of target tokens edited. (b) A comparison of different editing methods across various types of knowledge. Knowledge types without underlining represent Rouge-L Score metrics, while those with underlining indicate Bert Score metrics. Best viewed in color.
|
| 263 |
+
|
| 264 |
+

|
| 265 |
+
|
| 266 |
+
final results are illustrated in Figure 4(a). Based on these results, we draw the following observations:
|
| 267 |
+
|
| 268 |
+
- Obs 3: AnyEdit achieves superior performance across diverse knowledge domains. AnyEdit demonstrates consistent improvements across various knowledge types in editing tasks. Notably, the performance gains are most significant in the Code and News categories, achieving increases of $60.58\%$ and $52.38\%$ , respectively, in the ROUGE-L metric. These results underscore the strong generalization capability of the AnyEdit method.
|
| 269 |
+
- Obs 4: AnyEdit maintains stable performance as the number of target tokens increases. Specifically, methods such as MEMIT, AlphaEdit, and UnKE exhibit varying degrees of performance degradation when the number of target tokens exceeds a certain threshold. For instance, MEMIT and AlphaEdit experience significant performance drops when editing targets exceed 30 tokens. In contrast, AnyEdit remains robust under these conditions, further demonstrating its reliability and scalability.
|
| 270 |
+
|
| 271 |
+
# 5.4. Boosting Current Editing Methods (RQ3)
|
| 272 |
+
|
| 273 |
+
We further evaluate the effectiveness of AnyEdit when applied to several popular model editing methods. Specifically, we replace the locate stage of several locate-then-edit baseline methods with the autoregressive editing paradigm, enabling the simultaneous identification and editing of multiple tokens' hidden states. The modified methods are evaluated directly on the UnKEBench dataset, and their performance is compared against their original versions. The detailed results are presented in Figure 5. Furthermore, to evaluate the time cost introduced by incorporating our strategy, we measured the average editing time per sample for each method combined with our approach. The experiment
|
| 274 |
+
|
| 275 |
+
tal results are presented in Table 2. Based on these results, we draw the following observation:
|
| 276 |
+
|
| 277 |
+
- Obs 5: AnyEdit significantly improves the editing performance of existing methods. After integrating AnyEdit, current methods achieve notable improvements across all metrics. These results highlight that AnyEdit serves as an effective plug-and-play approach, enhancing the capabilities of existing model editing methods.
|
| 278 |
+
- Obs 6: Incorporating AnyEdit introduces a slight increase in editing time. Integrating AnyEdit with other model editing methods results in a modest increase in editing time, exhibiting an average relative increase of $24.7\%$ in editing time. However, given the substantial performance improvements achieved by AnyEdit, this trade-off is considered acceptable.
|
| 279 |
+
|
| 280 |
+
# 5.5. Impact of Chunk Size (RQ4)
|
| 281 |
+
|
| 282 |
+
We conclude by evaluating whether the choice of chunk size impacts the long-form knowledge editing performance of AnyEdit. Specifically, we adopt a sliding window to divide the target text into chunks and vary the chunk size to assess its influence on editing performance. Experimental results show that as the chunk size increases beyond a certain threshold, the editing performance of AnyEdit declines. Due to space limitations, detailed results and analysis can be found in the Appendix C.3.
|
| 283 |
+
|
| 284 |
+
# 6. Related Work
|
| 285 |
+
|
| 286 |
+
Model Editing for Knowledge Update. Traditional model editing methods modify a model's knowledge by either altering a small subset of parameters or introducing external memory. These approaches enable knowledge updates,
|
| 287 |
+
|
| 288 |
+

|
| 289 |
+
|
| 290 |
+

|
| 291 |
+
(a) Performance on Llama3-8B-Instruct
|
| 292 |
+
|
| 293 |
+

|
| 294 |
+
|
| 295 |
+

|
| 296 |
+
|
| 297 |
+

|
| 298 |
+
(b) Performance on Qwen2.5-7B-Instruct
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
Figure 5. Performance improvements of baseline editing methods (i.e., MEMIT, AlphaEdit and UnKE) after incorporating autoregressive editing paradigm in AnyEdit. The yellow bars represent the original performance of each baseline, while the blue bars represent the performance after the addition. Best viewed in color.
|
| 302 |
+
|
| 303 |
+
Table 2. Comparison of average editing time per sample (seconds) with baseline methods and their enhanced versions integrated with AnyEdit. The $+$ ’ symbol denotes integration with our method. Evaluation performed on Counterfact and MQUAKE from the AKEW benchmark suite, along with UnKEBench.
|
| 304 |
+
|
| 305 |
+
<table><tr><td>Method</td><td>UnKEBench</td><td>Counterfact</td><td>MQUAKE</td></tr><tr><td>MEMIT</td><td>16.37</td><td>17.05</td><td>16.92</td></tr><tr><td>MEMIT+</td><td>21.14</td><td>20.43</td><td>21.28</td></tr><tr><td>AlphaEdit</td><td>17.25</td><td>18.16</td><td>17.89</td></tr><tr><td>AlphaEdit+</td><td>22.03</td><td>21.57</td><td>22.95</td></tr><tr><td>UnKE</td><td>22.91</td><td>24.12</td><td>23.84</td></tr><tr><td>UnKE+</td><td>28.32</td><td>30.25</td><td>29.77</td></tr></table>
|
| 306 |
+
|
| 307 |
+
mitigate model hallucination (Huang et al., 2025), or facilitate information injection (Chen et al., 2024). Parameter-Modifying Methods update existing model parameters to encode new knowledge. Meta-learning-based approaches, such as MEND (Mitchell et al., 2022a), InstructEdit (Zhang et al., 2024) and RLedit (Li et al., 2025), train hypernetworks to predict parameter updates, with MEND improving efficiency via low-rank gradient decomposition. Locatethen-edit methods, including ROME (Meng et al., 2022) and MEMIT (Meng et al., 2023), use causal tracing to identify knowledge-relevant parameters and update them via least-squares optimization. NSE (Jiang et al., 2024) mitigates catastrophic forgetting in model editing by updating only a subset of neuron parameters. AlphaEdit (Fang et al., 2025) extends this to lifelong editing with a null-space projection strategy. In contrast, Parameter-Preserving Methods
|
| 308 |
+
|
| 309 |
+
introduce additional parameters or memory instead of modifying existing ones. ICE (Zheng et al., 2023) and DeCK (Bi et al., 2024) achieve parameter-free model editing through in-context learning, enabling knowledge updates without modifying the model's parameters. SERAC (Mitchell et al., 2022b) retrieves updates from external memory, while T-Patcher (Huang et al., 2023) and CaliNet (Dong et al., 2022) allocate new neurons to encode knowledge. GRACE (Hartvigsen et al., 2023) replaces hidden states with discrete codebook values, and WISE (Wang et al., 2024) integrates parameterized memory for efficient knowledge merging.
|
| 310 |
+
|
| 311 |
+
Unstructured Knowledge Editing. Recent research focuses on editing unstructured knowledge with free text beyond structured triples. Wu et al. (2024) highlight the limitations of prior methods in evaluating unstructured text editing and introduce AKEW as a benchmark. UnKE (Deng et al., 2025) refines locate-then-edit methods by updating all parameters within a single layer, improving their capability to handle unstructured knowledge. They also introduce UnKEBench, a dedicated benchmark for unstructured knowledge editing. Huang et al. (2024) propose a dynamic perception module to efficiently locate commonsense knowledge parameters, enabling free-text updates. However, while these methods handle unstructured and lengthy knowledge, they remain limited to factual knowledge. In contrast, our work extends editing capabilities to diverse-formatted knowledge, which encompasses various textual structures beyond factual statements.
|
| 312 |
+
|
| 313 |
+
# 7. Conclusion & Limitations
|
| 314 |
+
|
| 315 |
+
In this work, we address the limitations of existing model editing methods in handling long-form and diverse knowledge formats. Current approaches often face challenges due to their reliance on editing a single token's hidden state, which restricts their effectiveness on complex and unstructured knowledge. To overcome this, we introduced AnyEdit, a novel autoregressive editing paradigm that enables efficient and precise updates by sequentially processing and editing token hidden states over long-form text. Our approach is grounded in theoretical validation using the Chain Rule of mutual information, demonstrating its ability to produce consistent and accurate edits. Additionally, AnyEdit serves as a versatile framework that integrates seamlessly with traditional methods, broadening their applicability to a wider range of knowledge editing tasks.
|
| 316 |
+
|
| 317 |
+
Despite its ability to enhance traditional editing approaches and broaden their applicability to complex knowledge editing tasks, AnyEdit still faces two key limitations: Firstly, the current framework is not explicitly optimized for lifelong editing scenarios, which demand continuous and iterative knowledge updates over time. Adapting AnyEdit to such dynamic settings—where model parameters or hidden states require periodic refinement—remains a critical challenge for future research. Secondly, AnyEdit is currently confined to textual knowledge editing and lacks support for multimodal knowledge integration. Extending its capabilities to handle cross-modal updates (e.g., synchronizing edits across text, images, and audio) would significantly expand its practical utility, offering a promising direction for multimodal language model editing.
|
| 318 |
+
|
| 319 |
+
# Impact Statement
|
| 320 |
+
|
| 321 |
+
AnyEdit enhances model editing by enabling precise and efficient updates across diverse knowledge formats, addressing limitations in editing long-form and unstructured knowledge. Its ability to modify knowledge at scale improves the adaptability of LLMs, making them more responsive to real-world updates. However, increased editing flexibility raises concerns about potential misuse, such as unauthorized knowledge injection or model tampering. Mitigating these risks requires careful deployment and oversight to ensure responsible use. We encourage the research community to leverage AnyEdit for advancing trustworthy and beneficial AI applications.
|
| 322 |
+
|
| 323 |
+
# Acknowledgments
|
| 324 |
+
|
| 325 |
+
This research is supported by the National Science and Technology Major Project (2023ZD0121102) and the National Natural Science Foundation of China (U24B20180, 62121002). This research is also supported by the advanced
|
| 326 |
+
|
| 327 |
+
computing resources provided by the Supercomputing Center of the USTC.
|
| 328 |
+
|
| 329 |
+
# References
|
| 330 |
+
|
| 331 |
+
Austin, J., Odena, A., Nye, M. I., Bosma, M., Michalewski, H., Dohan, D., Jiang, E., Cai, C. J., Terry, M., Le, Q. V., and Sutton, C. Program synthesis with large language models. CoRR, abs/2108.07732, 2021.
|
| 332 |
+
Bi, B., Liu, S., Mei, L., Wang, Y., Ji, P., and Cheng, X. Decoding by contrasting knowledge: Enhancing llms' confidence on edited facts. CoRR, abs/2405.11613, 2024.
|
| 333 |
+
Brown, T. B., Mann, B., Ryder, N., Subbiah, M., Kaplan, J., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., Agarwal, S., Herbert-Voss, A., Krueger, G., Henighan, T., Child, R., Ramesh, A., Ziegler, D. M., Wu, J., Winter, C., Hesse, C., Chen, M., Sigler, E., Litwin, M., Gray, S., Chess, B., Clark, J., Berner, C., McCandlish, S., Radford, A., Sutskever, I., and Amodei, D. Language models are few-shot learners. In NeurIPS, 2020.
|
| 334 |
+
Cao, N. D., Aziz, W., and Titov, I. Editing factual knowledge in language models. In EMNLP (1), pp. 6491-6506. Association for Computational Linguistics, 2021.
|
| 335 |
+
Chen, C., Huang, B., Li, Z., Chen, Z., Lai, S., Xu, X., Gu, J., Gu, J., Yao, H., Xiao, C., Yan, X., Wang, W. Y., Torr, P., Song, D., and Shu, K. Can editing llms inject harm? CoRR, abs/2407.20224, 2024.
|
| 336 |
+
Deng, J., Wei, Z., Pang, L., Ding, H., Shen, H., and Cheng, X. Everything is editable: Extend knowledge editing to unstructured data in large language models. In *ICLR*. OpenReview.net, 2025.
|
| 337 |
+
Dobrushin, R. L. General formulation of shannon's main theorem in information theory. American mathematical society translations, 33:323-438, 1963.
|
| 338 |
+
Dong, Q., Dai, D., Song, Y., Xu, J., Sui, Z., and Li, L. Calibrating factual knowledge in pretrained language models. In EMNLP (Findings), pp. 5937-5947. Association for Computational Linguistics, 2022.
|
| 339 |
+
Fang, J., Jiang, H., Wang, K., Ma, Y., Shi, J., Wang, X., He, X., and Chua, T. Alphaedit: Null-space constrained knowledge editing for language models. In ICLR. Open-Review.net, 2025.
|
| 340 |
+
Geva, M., Schuster, R., Berant, J., and Levy, O. Transformer feed-forward layers are key-value memories. In EMNLP (1), pp. 5484-5495. Association for Computational Linguistics, 2021.
|
| 341 |
+
Gu, J., Xu, H., Ma, J., Lu, P., Ling, Z., Chang, K., and Peng, N. Model editing harms general abilities of large language
|
| 342 |
+
|
| 343 |
+
models: Regularization to the rescue. In EMNLP, pp. 16801-16819. Association for Computational Linguistics, 2024.
|
| 344 |
+
Hartvigsen, T., Sankaranarayanan, S., Palangi, H., Kim, Y., and Ghassemi, M. Aging with GRACE: lifelong model editing with discrete key-value adaptors. In NeurIPS, 2023.
|
| 345 |
+
Huang, B., Chen, C., Xu, X., Payani, A., and Shu, K. Can knowledge editing really correct hallucinations? In *ICLR*. OpenReview.net, 2025.
|
| 346 |
+
Huang, X., Wang, Y., Zhao, J., and Liu, K. Commonsense knowledge editing based on free-text in llms. In EMNLP, pp. 14870-14880. Association for Computational Linguistics, 2024.
|
| 347 |
+
Huang, Z., Shen, Y., Zhang, X., Zhou, J., Rong, W., and Xiong, Z. Transformer-patcher: One mistake worth one neuron. In ICLR. OpenReview.net, 2023.
|
| 348 |
+
Jiang, H., Fang, J., Zhang, T., Zhang, A., Wang, R., Liang, T., and Wang, X. Neuron-level sequential editing for large language models. CoRR, abs/2410.04045, 2024.
|
| 349 |
+
Kullback, S. Information theory and statistics. Courier Corporation, 1997.
|
| 350 |
+
Lang, S. Introduction to linear algebra. Springer Science & Business Media, 2012.
|
| 351 |
+
Li, G., Hammoud, H. A. A. K., Itani, H., Khizbullin, D., and Ghanem, B. CAMEL: communicative agents for "mind" exploration of large scale language model society. CoRR, abs/2303.17760, 2023.
|
| 352 |
+
Li, Z., Jiang, H., Chen, H., Bi, B., Zhou, Z., Sun, F., Fang, J., and Wang, X. Reinforced lifelong editing for language models. CoRR, abs/2502.05759, 2025.
|
| 353 |
+
Lin, C.-Y. Rouge: A package for automatic evaluation of summaries. In Text summarization branches out, pp. 74-81, 2004.
|
| 354 |
+
Liu, N. F., Lin, K., Hewitt, J., Paranjape, A., Bevilacqua, M., Petroni, F., and Liang, P. Lost in the middle: How language models use long contexts. Trans. Assoc. Comput. Linguistics, 12:157-173, 2024a.
|
| 355 |
+
Liu, Y., He, X., Xiong, M., Fu, J., Deng, S., and Hooi, B. Flipattack: Jailbreak llms via flipping. arXiv preprint arXiv:2410.02832, 2024b.
|
| 356 |
+
Meng, K., Bau, D., Andonian, A., and Belinkov, Y. Locating and editing factual associations in GPT. In NeurlPS, 2022.
|
| 357 |
+
|
| 358 |
+
Meng, K., Sharma, A. S., Andonian, A. J., Belinkov, Y., and Bau, D. Mass-editing memory in a transformer. In *ICLR*. OpenReview.net, 2023.
|
| 359 |
+
Mitchell, E., Lin, C., Bosselut, A., Finn, C., and Manning, C. D. Fast model editing at scale. In *ICLR*. OpenReview.net, 2022a.
|
| 360 |
+
Mitchell, E., Lin, C., Bosselut, A., Manning, C. D., and Finn, C. Memory-based model editing at scale. In ICML, volume 162 of Proceedings of Machine Learning Research, pp. 15817-15831. PMLR, 2022b.
|
| 361 |
+
Mitra, A., Khanpour, H., Rosset, C., and Awadallah, A. Orca-math: Unlocking the potential of slms in grade school math. CoRR, abs/2402.14830, 2024.
|
| 362 |
+
Papineni, K., Roukos, S., Ward, T., and Zhu, W. Bleu: a method for automatic evaluation of machine translation. In ACL, pp. 311-318. ACL, 2002.
|
| 363 |
+
Qinggang Zhang, Hao Chen, J. D. S. C. F. H. X. H. Structure-guided large language models for text-to-SQL generation. In *Forty-second International Conference on Machine Learning*, 2025.
|
| 364 |
+
Radford, A., Wu, J., Child, R., Luan, D., Amodei, D., Sutskever, I., et al. Language models are unsupervised multitask learners. OpenAI blog, 1(8):9, 2019.
|
| 365 |
+
Wang, B. and Komatsuzaki, A. Gpt-j-6b: A 6 billion parameter autoregressive language model, 2021.
|
| 366 |
+
Wang, P., Li, Z., Zhang, N., Xu, Z., Yao, Y., Jiang, Y., Xie, P., Huang, F., and Chen, H. Wise: Rethinking the knowledge memory for lifelong model editing of large language models. arXiv preprint arXiv:2405.14768, 2024.
|
| 367 |
+
Wu, X., Pan, L., Wang, W. Y., and Liu, A. T. AKEW: assessing knowledge editing in the wild. In EMNLP, pp. 15118-15133. Association for Computational Linguistics, 2024.
|
| 368 |
+
Xie, J., Zhang, K., Chen, J., Lou, R., and Su, Y. Adaptive chameleon or stubborn sloth: Unraveling the behavior of large language models in knowledge clashes. CoRR, abs/2305.13300, 2023.
|
| 369 |
+
Yang, A., Yang, B., Zhang, B., Hui, B., Zheng, B., Yu, B., Li, C., Liu, D., Huang, F., Wei, H., et al. Qwen2.5 technical report. arXiv preprint arXiv:2412.15115, 2024.
|
| 370 |
+
Zhang, N., Tian, B., Cheng, S., Liang, X., Hu, Y., Xue, K., Gou, Y., Chen, X., and Chen, H. Instructedit: Instruction-based knowledge editing for large language models. In IJCAI, pp. 6633-6641. ijcai.org, 2024.
|
| 371 |
+
|
| 372 |
+
Zhang, T., Fang, J., Jiang, H., Bi, B., Wang, X., and He, X. Explainable and efficient editing for large language models. In THE WEB CONFERENCE 2025.
|
| 373 |
+
Zhang, T., Kishore, V., Wu, F., Weinberger, K. Q., and Artzi, Y. Bertscore: Evaluating text generation with bert. arXiv preprint arXiv:1904.09675, 2019.
|
| 374 |
+
Zhao, W. X., Zhou, K., Li, J., Tang, T., Wang, X., Hou, Y., Min, Y., Zhang, B., Zhang, J., Dong, Z., Du, Y., Yang, C., Chen, Y., Chen, Z., Jiang, J., Ren, R., Li, Y., Tang, X., Liu, Z., Liu, P., Nie, J.-Y., and Wen, J.-R. A survey of large language models, 2024. URL https://arxiv.org/abs/2303.18223.
|
| 375 |
+
Zheng, C., Li, L., Dong, Q., Fan, Y., Wu, Z., Xu, J., and Chang, B. Can we edit factual knowledge by in-context learning? In EMNLP, pp. 4862-4876. Association for Computational Linguistics, 2023.
|
| 376 |
+
Zhu, C., Rawat, A. S., Zaheer, M., Bhojanapalli, S., Li, D., Yu, F. X., and Kumar, S. Modifying memories in transformer models. CoRR, abs/2012.00363, 2020.
|
| 377 |
+
|
| 378 |
+
# A. Experimental Setup
|
| 379 |
+
|
| 380 |
+
# A.1. Datasets
|
| 381 |
+
|
| 382 |
+
UnKEBench (Deng et al., 2025) constructs a dataset containing 1,000 counterfactual unstructured texts, where knowledge is presented in an unstructured and relatively lengthy form, going beyond simple knowledge triplets or linear fact chains. These texts originate from ConflictQA (Xie et al., 2023), a benchmark specifically designed to distinguish LLMs' parameter memory from anti-memory. This approach is crucial for preventing the model from merging knowledge obtained during pretraining with knowledge acquired during the editing process. Moreover, it addresses the key challenge of determining whether the model learns target knowledge during training or editing, ensuring a clear boundary between pretraining knowledge and edited knowledge.
|
| 383 |
+
|
| 384 |
+
AKEW benchmark (Wu et al., 2024) considers three aspects: (1) Structured Facts: Each structured fact consists of an isolated triplet for editing, sourced from existing datasets or knowledge bases. (2) Unstructured Facts: Knowledge is presented in unstructured text form. To enable fair comparisons, each unstructured fact contains the same knowledge update as its corresponding structured fact. Compared to structured facts, unstructured facts exhibit greater complexity in natural language format, as they often encapsulate more implicit knowledge. (3) Extracted Triplets: Triplets are extracted from unstructured facts using automated methods to investigate whether they can facilitate knowledge editing methods in handling unstructured knowledge. In this work, we primarily focus on unstructured factual knowledge.
|
| 385 |
+
|
| 386 |
+
EditEverything dataset integrates question-answering data from multiple domains, forming long and diverse knowledge formats that are more challenging to edit. Specifically, for mathematics, we select longer samples from the Orca-Math dataset (Mitra et al., 2024), which includes grade school math word problems. For coding, we use the MBPP dataset (Austin et al., 2021), which consists of approximately 1,000 crowd-sourced Python programming problems solvable by entry-level programmers, covering programming fundamentals and standard library functionalities. For chemistry, we sample from the Camel-Chemistry dataset (Li et al., 2023), which contains problem-solution pairs generated from 25 chemistry topics, each with 25 subtopics and 32 problems per topic-subtopic pair. Lastly, for the news and poetry categories, since they often contain real-world knowledge that LLMs may already possess, we generate synthetic data using GPT-4o to ensure that the information is not already known by the model.
|
| 387 |
+
|
| 388 |
+
We present sample instances from the dataset in Figure 7, Figure 8, and Figure 9.
|
| 389 |
+
|
| 390 |
+
# A.2. Evaluation Metrics
|
| 391 |
+
|
| 392 |
+
Following previous research on model editing for structured knowledge (Meng et al., 2022; Mitchell et al., 2022a), existing evaluation metrics primarily focus on triplet-structured knowledge, where the goal is to assess the modification of factual triples (subject, relation, object). Specifically, given an LLM $f$ , an editing knowledge pair $(x,y)$ , an equivalent knowledge query $x_{e}$ , and unrelated knowledge pairs $(x_{loc},y_{loc})$ , three standard evaluation metrics are commonly used:
|
| 393 |
+
|
| 394 |
+
Efficacy. This metric quantifies the success of modifying the target knowledge in $f_{\mathcal{W}}$ . It evaluates whether the edited LLM generates the desired target output $y$ when given the input $x$ . Formally, it is defined as:
|
| 395 |
+
|
| 396 |
+
$$
|
| 397 |
+
\mathbb {E} \left\{y = \underset {y ^ {\prime}} {\arg \max } \mathbb {P} _ {f} \left(y ^ {\prime} \mid x\right) \right\}. \tag {10}
|
| 398 |
+
$$
|
| 399 |
+
|
| 400 |
+
Generalization. This metric assesses whether the model has generalized the newly edited knowledge beyond its specific form. It measures if the LLM correctly produces $y$ when given a semantically equivalent input $x_{e}$ , indicating the degree to which the update propagates correctly across paraphrased or restructured queries:
|
| 401 |
+
|
| 402 |
+
$$
|
| 403 |
+
\mathbb {E} \left\{y = \underset {y ^ {\prime}} {\arg \max } \mathbb {P} _ {f} \left(y ^ {\prime} \mid x _ {e}\right) \right\}. \tag {11}
|
| 404 |
+
$$
|
| 405 |
+
|
| 406 |
+
Specificity. This metric evaluates whether the editing operation is localized, ensuring that unrelated knowledge remains intact. It measures whether the model's response to an unrelated query $x_{loc}$ remains consistent with its original output $y_{loc}$ :
|
| 407 |
+
|
| 408 |
+
$$
|
| 409 |
+
\mathbb {E} \left\{y _ {l o c} = \underset {y ^ {\prime}} {\arg \max } \mathbb {P} _ {f} \left(y ^ {\prime} \mid x _ {l o c}\right) \right\}. \tag {12}
|
| 410 |
+
$$
|
| 411 |
+
|
| 412 |
+
While these metrics are well-suited for structured knowledge editing, they are insufficient for evaluating long-form and diverse-formatted knowledge. Such knowledge is often verbose and complex, making it challenging to assess correctness solely based on Efficacy. In these cases, the model may generate an answer that captures the essential information yet fails an exact-match evaluation. To address this, we primarily follow the existing benchmarks for unstructured knowledge editing, incorporating more flexible evaluation methods suited for long-form responses.
|
| 413 |
+
|
| 414 |
+
Lexical similarity metrics include BLEU (Papineni et al., 2002) and various ROUGE scores (ROUGE-1, ROUGE-2, and ROUGE-L) (Lin, 2004). These are computed based on the original questions, paraphrase question, and sub-questions, providing insights into the lexical and n-gram alignment between the model-generated text and the target answer. These metrics serve as the foundation for assessing the surface-level accuracy of edited content.
|
| 415 |
+
|
| 416 |
+
Semantic similarity is also considered (Bert Score) (Zhang et al., 2019), as word-level overlap alone is insufficient to capture the nuanced understanding required by the model. To address this, we utilize embedding-based encoders, specifically the all-MiniLM-L6-v2 model $^{3}$ , to measure semantic similarity. This ensures a more balanced evaluation that extends beyond lexical matching, quantifying the depth of the model's comprehension.
|
| 417 |
+
|
| 418 |
+
# A.3. Baseline Methods
|
| 419 |
+
|
| 420 |
+
- FT-L (Zhu et al., 2020) is a knowledge editing approach that fine-tunes specific layers of the LLM using an autoregressive loss function. We implemented this method following the hyperparameter from the original paper.
|
| 421 |
+
- MEND (Mitchell et al., 2022a) is a hypernetwork-based efficient knowledge editing method. It trains a hypernetwork to capture patterns in knowledge updates by mapping low-rank decomposed fine-tuning gradients to LLM parameter modifications, enabling efficient and localized edits. Our implementation follows the original hyperparameter settings and completes training over the full dataset.
|
| 422 |
+
- ROME (Meng et al., 2022) is a method for modifying factual associations in LLM parameters. It identifies critical neuron activations in MLP layers through perturbation-based knowledge localization and modifies MLP layer weights using Lagrange remainders. Since ROME is not designed for large-scale edits, we follow the original paper's settings and conduct multiple rounds of single-instance editing for evaluation.
|
| 423 |
+
- MEMIT (Meng et al., 2023) extends ROME by enabling batch updates of factual knowledge. It utilizes least squares approximation to modify specific layer parameters across multiple layers, allowing simultaneous updates of large numbers of knowledge facts. We evaluate MEMIT in lifelong editing scenarios using the original paper's configuration.
|
| 424 |
+
- AlphaEdit (Fang et al., 2025) is a method designed to mitigate interference in LLM lifelong knowledge editing. It introduces a null-space projection mechanism that ensures parameter updates preserve previously edited knowledge while incorporating new updates. AlphaEdit has demonstrated state-of-the-art (SOTA) performance across multiple evaluation metrics while maintaining strong transferability. We follow the original paper's hyperparameter configuration in our implementation.
|
| 425 |
+
- UnKE (Deng et al., 2025) improves knowledge editing by refining both the layer and token dimensions. In the layer dimension, it replaces local key-value storage with a non-local block-based mechanism, enhancing the representation capability of key-value pairs while integrating attention-layer knowledge. In the token dimension, it replaces "term-driven optimization" with "cause-driven optimization," which directly edits the final token while preserving contextual coherence. This eliminates the need for explicit term localization and prevents context loss.
|
| 426 |
+
|
| 427 |
+
# A.4. Implementation Details
|
| 428 |
+
|
| 429 |
+
Our AnyEdit and AnyEdit* primarily follow the baseline configurations of MEMIT and UnKE, while other baselines adhere to their original implementation settings. All experiments were conducted on a single A100 GPU (80GB).
|
| 430 |
+
|
| 431 |
+
- AnyEdit on Llama3-8B-Instruct: We select layers 4 to 8 for editing and apply a clamp norm factor of 4. The fact token is defined as the last token. The optimization process involves 25 gradient steps for updating the key-value representations, with a learning rate of 0.5. The loss is applied at layer 31, and we use a weight decay of 0.001. To maintain distributional consistency, we introduce a Kullback-Leibler (KL) regularization term with a factor of 0.0625.
|
| 432 |
+
|
| 433 |
+
Furthermore, we enable hyperparameter $\lambda$ with an update weight of 15,000, using 100,000 samples from the Wikipedia dataset with a data type of float32. The module configurations follow MEMIT, where edits are applied to the MLP down projection layers of the selected transformer blocks. Additionally, for chunked editing, we set a chunk size of 40 tokens with no overlap.
|
| 434 |
+
|
| 435 |
+
- AnyEdit on Qwen2.5-7B-Instruct: Same as the above, except that the loss is applied at layer 27 and the chunk size is set to 50 tokens.
|
| 436 |
+
- AnyEdit* on Llama3-8B-Instruct: We select layer 7 for editing and apply a clamp norm factor of 4. The fact token is defined as the last token. The optimization process involves updating all parameters in both the attention and MLP layers. The gradient descent process utilizes a learning rate of 0.0002 with 50 optimization steps. For updating key-value representations, we use 25 gradient steps with a learning rate of 0.5. The loss is applied at layer 31, and we use a weight decay of 0.001. To preserve original knowledge, we sample 20 data points to constrain parameter updates. Additionally, for chunked editing, we set a chunk size of 40 tokens with no overlap.
|
| 437 |
+
- AnyEdit* on Qwen2.5-7B-Instruct: Same as the above, except that the loss is applied at layer 27 and the chunk size is set to 50 tokens.
|
| 438 |
+
|
| 439 |
+
# B. Locate-Then-Edit Paradigm & Related Proof
|
| 440 |
+
|
| 441 |
+
# B.1. Locate-Then-Edit Paradigm
|
| 442 |
+
|
| 443 |
+
Recent studies in LLM behavior analysis (Qinggang Zhang, 2025; Liu et al., 2024b) have explored various aspects of model manipulation, motivating our approach to structured knowledge editing. Following prior works on model editing, the detailed descriptions of specific methods in this section are based on MEMIT (Meng et al., 2023), AlphaEdit (Fang et al., 2025) and ECE (Zhang et al.). We adhere to their formulations and methodological explanations to ensure consistency and clarity in presenting these approaches.
|
| 444 |
+
|
| 445 |
+
The locate-then-edit method primarily focuses on triplet-structured knowledge in the form of $(s,r,o)$ , such as modifying (Olympics, were held in, Tokyo) to (Olympics, were held in, Paris). Given new knowledge $(x_e,y_e)$ , a triplet can be represented as $x_{e} = (s,r)$ and $y_{e} = o$ .
|
| 446 |
+
|
| 447 |
+
We first refine the auto-regressive language model formulation in Section 2. Let $f$ be a decoder-only model with $L$ layers, processing input sequence $x = (x_0, x_1, \ldots, x_T)$ to predict the next token:
|
| 448 |
+
|
| 449 |
+
$$
|
| 450 |
+
\boldsymbol {h} _ {t} ^ {l} (x) = \boldsymbol {h} _ {t} ^ {l - 1} (x) + \boldsymbol {a} _ {t} ^ {l} (x) + \boldsymbol {m} _ {t} ^ {l} (x),
|
| 451 |
+
$$
|
| 452 |
+
|
| 453 |
+
$$
|
| 454 |
+
\boldsymbol {a} _ {t} ^ {l} = \operatorname {a t t n} ^ {l} \left(\boldsymbol {h} _ {0} ^ {l - 1}, \boldsymbol {h} _ {1} ^ {l - 1}, \dots , \boldsymbol {h} _ {t} ^ {l - 1}\right), \tag {13}
|
| 455 |
+
$$
|
| 456 |
+
|
| 457 |
+
$$
|
| 458 |
+
\pmb {m} _ {t} ^ {l} = \pmb {W} _ {\mathrm {o u t}} ^ {l} \sigma (\pmb {W} _ {\mathrm {i n}} ^ {l} \gamma (\pmb {h} _ {t} ^ {l - 1} + \pmb {a} _ {t} ^ {l})),
|
| 459 |
+
$$
|
| 460 |
+
|
| 461 |
+
where $\pmb{h}_t^l$ denotes the hidden state of token $t$ at layer $l$ , $\pmb{a}_t^l$ is the attention output, and $\pmb{m}_t^l$ is the feedforward (FFN) output. Here, $\pmb{W}_{\mathrm{in}}^l$ and $\pmb{W}_{\mathrm{out}}^l$ are weight matrices, $\sigma$ is a nonlinear activation function, and $\gamma$ denotes layer normalization.
|
| 462 |
+
|
| 463 |
+
Key-Value Memory Structure. Locate-then-edit assumes that factual knowledge is stored in the FFN layers and treats them as linear associative memory (Geva et al., 2021). Specifically, $W_{\mathrm{out}}^{l}$ is conceptualized as a key-value memory structure:
|
| 464 |
+
|
| 465 |
+
$$
|
| 466 |
+
\underbrace {\boldsymbol {m} _ {t} ^ {l}} _ {\boldsymbol {v}} = \boldsymbol {W} _ {\text {o u t}} ^ {l} \underbrace {\sigma \left(\boldsymbol {W} _ {\text {i n}} ^ {l} \gamma \left(\boldsymbol {h} _ {t} ^ {l - 1} + \boldsymbol {a} ^ {l}\right)\right)} _ {\boldsymbol {k}}. \tag {14}
|
| 467 |
+
$$
|
| 468 |
+
|
| 469 |
+
Here, the MLP input-output pair at token $t$ and layer $l$ serves as the key-value pair. Casual Tracing is typically used to locate the target token and layer by injecting Gaussian noise into hidden states and incrementally restoring them to analyze output recovery. For more details, please refer to ROME (Meng et al., 2022).
|
| 470 |
+
|
| 471 |
+
Computing Key-Value. For editing knowledge $(x_{e},y_{e})$ , we compute its corresponding key-value pair $(k^{*},v^{*})$ . The key $k^{*}$ is derived via forward propagation of $x_{e}$ , while the value $v^{*}$ is optimized using gradient descent:
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
\boldsymbol {v} ^ {*} = \boldsymbol {v} + \arg \min _ {\boldsymbol {\delta} ^ {l}} \left(- \log \mathbb {P} _ {f \left(\boldsymbol {h} _ {t} ^ {l} + \boldsymbol {\delta} ^ {l}\right)} \left[ y _ {e} \mid x _ {e} \right]\right). \tag {15}
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
Here, $f(h_t^l + \delta^l)$ represents the model output when the FFN output $h_t^l$ is replaced with $h_t^l + \delta^l$ .
|
| 478 |
+
|
| 479 |
+
Methods such as ROME (Meng et al., 2022), MEMIT (Meng et al., 2023), and AlphaEdit (Fang et al., 2025) focus on triplets $(s, r, o)$ , selecting the last token of the subject $s$ as the target token. In contrast, UnKE (Deng et al., 2025) extends to unstructured text, using the last token of $x_{e}$ as the target.
|
| 480 |
+
|
| 481 |
+
To insert new knowledge $(\pmb{k}^{*},\pmb{v}^{*})$ into the key-value memory, we solve the constrained least squares problem:
|
| 482 |
+
|
| 483 |
+
$$
|
| 484 |
+
\min _ {\hat {\boldsymbol {W}}} \left\| \hat {\boldsymbol {W}} \boldsymbol {K} - \boldsymbol {V} \right\|
|
| 485 |
+
$$
|
| 486 |
+
|
| 487 |
+
$$
|
| 488 |
+
\begin{array}{l} \text {s . t .} \quad \hat {\boldsymbol {W}} \boldsymbol {k} ^ {*} = \boldsymbol {v} ^ {*}. \end{array}
|
| 489 |
+
$$
|
| 490 |
+
|
| 491 |
+
The final parameter update can be computed via ROMEMEMIT/AlphaEdit's closed-form solution or UnKE's gradient-based optimization.
|
| 492 |
+
|
| 493 |
+
For clarity, let $\tilde{W}$ denote the edited weight of $W_{\mathrm{out}}^{l}$ in the MLP, and let $W$ represent its original weight. The final parameter update can be computed using the closed-form solutions of ROME/MEMIT/AlphaEdit or the gradient-based optimization method in UnKE.
|
| 494 |
+
|
| 495 |
+
Weights Update in ROME. The ROME method derives a closed-form solution to the constrained least-squares problem for updating MLP parameters:
|
| 496 |
+
|
| 497 |
+
$$
|
| 498 |
+
\tilde {\boldsymbol {W}} = \boldsymbol {W} + \frac {\left(\boldsymbol {v} ^ {*} - \boldsymbol {W} \boldsymbol {k} ^ {*}\right) \left(\boldsymbol {C} ^ {- 1} \boldsymbol {k} ^ {*}\right) ^ {T}}{\left(\boldsymbol {C} ^ {- 1} \boldsymbol {k} ^ {*}\right) ^ {T} \boldsymbol {k} ^ {*}}, \tag {16}
|
| 499 |
+
$$
|
| 500 |
+
|
| 501 |
+
where $\pmb{C} = \pmb{K}\pmb{K}^{T}$ . The matrix $\pmb{C}$ is estimated using 100,000 samples of hidden states $\pmb{k}$ obtained from tokens sampled in-context from the entire Wikipedia dataset.
|
| 502 |
+
|
| 503 |
+
Weights Update in MEMIT. Since the above solution updates only a single knowledge sample at a time, MEMIT improves upon it by avoiding Lagrange multipliers and instead using a relaxed constraint formulation. The problem is reformulated by maintaining a factual set $\{K_1, V_1\}$ containing $u$ new associations while preserving the original set $\{K_0, V_0\}$ with $n$ existing associations:
|
| 504 |
+
|
| 505 |
+
$$
|
| 506 |
+
\boldsymbol {K} _ {0} = \left[ \begin{array}{c c c c} \boldsymbol {k} _ {1} & \boldsymbol {k} _ {2} & \dots & \boldsymbol {k} _ {n} \end{array} \right], \quad \boldsymbol {V} _ {0} = \left[ \begin{array}{c c c c} \boldsymbol {v} _ {1} & \boldsymbol {v} _ {2} & \dots & \boldsymbol {v} _ {n} \end{array} \right],
|
| 507 |
+
$$
|
| 508 |
+
|
| 509 |
+
$$
|
| 510 |
+
\boldsymbol {K} _ {1} = \left[ \begin{array}{l l l l} \boldsymbol {k} _ {n + 1} ^ {*} & \boldsymbol {k} _ {n + 2} ^ {*} & \dots & \boldsymbol {k} _ {n + u} ^ {*} \end{array} \right], \quad \boldsymbol {V} _ {1} = \left[ \begin{array}{l l l l} \boldsymbol {v} _ {n + 1} ^ {*} & \boldsymbol {v} _ {n + 2} ^ {*} & \dots & \boldsymbol {v} _ {n + u} ^ {*} \end{array} \right]. \tag {17}
|
| 511 |
+
$$
|
| 512 |
+
|
| 513 |
+
Here, $k$ and $v$ are defined as in Eq. 14, and their subscripts denote knowledge indices. The objective function is given by:
|
| 514 |
+
|
| 515 |
+
$$
|
| 516 |
+
\tilde {\boldsymbol {W}} \triangleq \underset {\hat {\boldsymbol {W}}} {\arg \min } \left(\sum_ {i = 1} ^ {n} \left\| \hat {\boldsymbol {W}} \boldsymbol {k} _ {i} - \boldsymbol {v} _ {i} \right\| ^ {2} + \sum_ {i = n + 1} ^ {n + u} \left\| \hat {\boldsymbol {W}} \boldsymbol {k} _ {i} - \boldsymbol {v} _ {i} ^ {*} \right\| ^ {2}\right). \tag {18}
|
| 517 |
+
$$
|
| 518 |
+
|
| 519 |
+
Applying the normal equation (Lang, 2012), the closed-form solution is:
|
| 520 |
+
|
| 521 |
+
$$
|
| 522 |
+
\tilde {\boldsymbol {W}} = \left(\boldsymbol {V} _ {1} - \boldsymbol {W} \boldsymbol {K} _ {1}\right) \boldsymbol {K} _ {1} ^ {T} \left(\boldsymbol {K} _ {0} \boldsymbol {K} _ {0} ^ {T} + \boldsymbol {K} _ {1} \boldsymbol {K} _ {1} ^ {T}\right) ^ {- 1} + \boldsymbol {W}. \tag {19}
|
| 523 |
+
$$
|
| 524 |
+
|
| 525 |
+
Weights Update in AlphaEdit. AlphaEdit addresses the imbalance between old and new knowledge in lifelong learning. It protects existing knowledge using a null-space projection constraint, ensuring that the update $\pmb{\Delta}$ to $\pmb{W}_{\mathrm{out}}^{l}$ is always projected onto the null space of $\pmb{K}_0\pmb{K}_0^T$ . The final parameter update, refining MEMIT, is:
|
| 526 |
+
|
| 527 |
+
$$
|
| 528 |
+
\tilde {\boldsymbol {W}} = \left(\boldsymbol {V} _ {1} - \boldsymbol {W} \boldsymbol {K} _ {1}\right) \boldsymbol {K} _ {1} ^ {T} \boldsymbol {P} \left(\boldsymbol {K} _ {p} \boldsymbol {K} _ {p} ^ {T} \boldsymbol {P} + \boldsymbol {K} _ {1} \boldsymbol {K} _ {1} ^ {T} \boldsymbol {P} + \boldsymbol {I}\right) ^ {- 1} + \boldsymbol {W}. \tag {20}
|
| 529 |
+
$$
|
| 530 |
+
|
| 531 |
+
Weights Update in UnKE. Unlike previous methods, UnKE considers the entire input to layer $l$ , denoted as $f^l$ , rather than just the MLP input. The output remains $f^l$ 's activation values. The parameter update is applied to the entire layer rather than a single weight matrix. Given the knowledge sets $\{\pmb{K}_0, \pmb{V}_0\}$ and $\{\pmb{K}_1, \pmb{V}_1\}$ , the optimization objective is formulated as:
|
| 532 |
+
|
| 533 |
+
$$
|
| 534 |
+
\tilde {\Theta} ^ {l} \triangleq \underset {\hat {\Theta} ^ {l}} {\arg \min } \left(\sum_ {i = 1} ^ {n} \left\| f _ {\hat {\Theta} ^ {l}} ^ {l} (\boldsymbol {k} _ {i}) - \boldsymbol {v} _ {i} \right\| ^ {2} + \sum_ {i = n + 1} ^ {n + u} \left\| f _ {\hat {\Theta} ^ {l}} ^ {l} (\boldsymbol {k} _ {i}) - \boldsymbol {v} _ {i} ^ {*} \right\| ^ {2}\right), \tag {21}
|
| 535 |
+
$$
|
| 536 |
+
|
| 537 |
+
where $\Theta^l$ denotes the entire set of parameters in layer $l$ . Since a closed-form solution is not feasible, UnKE employs gradient descent to iteratively update $\Theta^l$ .
|
| 538 |
+
|
| 539 |
+
# B.2. Proof of Optimization-Conditional Mutual Information Equivalence
|
| 540 |
+
|
| 541 |
+
Theorem B.1. The optimization objective
|
| 542 |
+
|
| 543 |
+
$$
|
| 544 |
+
\delta^ {*} = \underset {\delta} {\arg \min } \left(- \log \mathbb {P} _ {f \left(\boldsymbol {h} _ {t} + \delta\right)} (Y \mid X)\right), \tag {22}
|
| 545 |
+
$$
|
| 546 |
+
|
| 547 |
+
is equivalent to maximizing the conditional mutual information (CMI) between $X$ and $Y$ given the perturbed hidden state $h'$ :
|
| 548 |
+
|
| 549 |
+
$$
|
| 550 |
+
\boldsymbol {h} ^ {\prime} = \underset {\boldsymbol {h} ^ {\prime}} {\arg \max } I (X; Y \mid \boldsymbol {h} ^ {\prime}). \tag {23}
|
| 551 |
+
$$
|
| 552 |
+
|
| 553 |
+
Proof. Starting from the definition of CMI, we expand it via the integral form:
|
| 554 |
+
|
| 555 |
+
$$
|
| 556 |
+
I (X; Y \mid \boldsymbol {h} ^ {\prime}) = \int p (x, y, \boldsymbol {h} ^ {\prime}) \log \frac {p (y \mid x , \boldsymbol {h} ^ {\prime})}{p (y \mid \boldsymbol {h} ^ {\prime})} d x d y d \boldsymbol {h} ^ {\prime}. \tag {24}
|
| 557 |
+
$$
|
| 558 |
+
|
| 559 |
+
This splits into two entropy terms:
|
| 560 |
+
|
| 561 |
+
$$
|
| 562 |
+
I (X; Y \mid \boldsymbol {h} ^ {\prime}) = \underbrace {\int p (x , y , \boldsymbol {h} ^ {\prime}) \log p (y \mid x , \boldsymbol {h} ^ {\prime}) d x d y d \boldsymbol {h} ^ {\prime}} _ {\text {T e r m} \mathcal {A}} - \underbrace {\int p (x , y , \boldsymbol {h} ^ {\prime}) \log p (y \mid \boldsymbol {h} ^ {\prime}) d x d y d \boldsymbol {h} ^ {\prime}} _ {\text {T e r m} \mathcal {B}}. \tag {25}
|
| 563 |
+
$$
|
| 564 |
+
|
| 565 |
+
Term $\mathcal{A}$ simplifies to the expectation:
|
| 566 |
+
|
| 567 |
+
$$
|
| 568 |
+
\mathcal {A} = \mathbb {E} _ {p \left(\boldsymbol {h} ^ {\prime}\right)} \mathbb {E} _ {p (x, y \mid \boldsymbol {h} ^ {\prime})} \left[ \log p (y \mid x, \boldsymbol {h} ^ {\prime}) \right], \tag {26}
|
| 569 |
+
$$
|
| 570 |
+
|
| 571 |
+
while Term $\mathcal{B}$ is independent of $X$ given $\pmb{h}^{\prime}$ . Since $\mathcal{B}$ does not affect the optimization over $\pmb{h}^{\prime}$ , we focus on maximizing $\mathcal{A}$ . By definition, $\mathbb{P}_{f(\pmb{h}^{\prime})}(Y\mid X) = p(y\mid x,\pmb{h}^{\prime})$ . Thus, minimizing the negative log-likelihood in equation 22 directly maximizes $\mathcal{A}$ , which is equivalent to maximizing $I(X;Y\mid h^{\prime})$ . Substituting $\pmb{h}^{\prime} = \pmb{h}_{t} + \pmb{\delta}^{*}$ , we conclude:
|
| 572 |
+
|
| 573 |
+
$$
|
| 574 |
+
\boldsymbol {h} ^ {\prime} = \underset {\boldsymbol {h} ^ {\prime}} {\arg \max } I (X; Y \mid \boldsymbol {h} ^ {\prime}), \tag {27}
|
| 575 |
+
$$
|
| 576 |
+
|
| 577 |
+
thereby establishing the equivalence.
|
| 578 |
+
|
| 579 |
+
# B.3. Proof of the Decomposition of Mutual Information
|
| 580 |
+
|
| 581 |
+
To rigorously derive Equation equation 8, we start from the mutual information (MI) decomposition given in Equation equation 7:
|
| 582 |
+
|
| 583 |
+
$$
|
| 584 |
+
I \left(X; Y \mid \boldsymbol {h} _ {1} ^ {\prime}, \dots , \boldsymbol {h} _ {K} ^ {\prime}\right) = \sum_ {k = 1} ^ {K} I \left(X; Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, \boldsymbol {h} _ {1} ^ {\prime}, \dots , \boldsymbol {h} _ {K} ^ {\prime}\right). \tag {28}
|
| 585 |
+
$$
|
| 586 |
+
|
| 587 |
+
Step 1: Application of the First Property. The first key property states that later hidden states do not influence earlier token generation:
|
| 588 |
+
|
| 589 |
+
$$
|
| 590 |
+
H \left(Y _ {p} \mid \boldsymbol {h} _ {q} ^ {\prime}\right) = H \left(Y _ {p}\right), \quad \text {f o r} p < q. \tag {29}
|
| 591 |
+
$$
|
| 592 |
+
|
| 593 |
+
Since mutual information is defined as:
|
| 594 |
+
|
| 595 |
+
$$
|
| 596 |
+
I \left(X; Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, \mathbf {h} _ {1} ^ {\prime}, \dots , \mathbf {h} _ {K} ^ {\prime}\right) = H \left(Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, \mathbf {h} _ {1} ^ {\prime}, \dots , \mathbf {h} _ {K} ^ {\prime}\right) - H \left(Y _ {k} \mid X, Y _ {1}, \dots , Y _ {k - 1}, \mathbf {h} _ {1} ^ {\prime}, \dots , \mathbf {h} _ {K} ^ {\prime}\right). \tag {30}
|
| 597 |
+
$$
|
| 598 |
+
|
| 599 |
+
Since $h_{q}^{\prime}$ for $q > k$ does not affect $Y_{k}$ , we can simplify:
|
| 600 |
+
|
| 601 |
+
$$
|
| 602 |
+
H \left(Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, \boldsymbol {h} _ {1} ^ {\prime}, \dots , \boldsymbol {h} _ {K} ^ {\prime}\right) = H \left(Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, \boldsymbol {h} _ {1} ^ {\prime}, \dots , \boldsymbol {h} _ {k} ^ {\prime}\right). \tag {31}
|
| 603 |
+
$$
|
| 604 |
+
|
| 605 |
+
Step 2: Application of the Second Property. The second key property states that once $Y_{k}$ is determined, conditioning on $Y_{k}$ subsumes conditioning on $h_{k}^{\prime}$ :
|
| 606 |
+
|
| 607 |
+
$$
|
| 608 |
+
H (\cdot \mid Y _ {k}) = H (\cdot \mid Y _ {k}, \boldsymbol {h} _ {k} ^ {\prime}). \tag {32}
|
| 609 |
+
$$
|
| 610 |
+
|
| 611 |
+
Using this, we rewrite the MI term:
|
| 612 |
+
|
| 613 |
+
$$
|
| 614 |
+
I \left(X; Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, h _ {1} ^ {\prime}, \dots , h _ {K} ^ {\prime}\right) = I \left(X; Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, h _ {k} ^ {\prime}\right). \tag {33}
|
| 615 |
+
$$
|
| 616 |
+
|
| 617 |
+
Step 3: Applying the Conditional Mutual Information Decomposition. Using the decomposition formula for conditional mutual information, each term can be written as:
|
| 618 |
+
|
| 619 |
+
$$
|
| 620 |
+
I \left(X; Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, \boldsymbol {h} _ {k} ^ {\prime}\right) = I \left(X, Y _ {1}, \dots , Y _ {k - 1}; Y _ {k} \mid \boldsymbol {h} _ {k} ^ {\prime}\right) - I \left(Y _ {1}, \dots , Y _ {k - 1}; Y _ {k} \mid \boldsymbol {h} _ {k} ^ {\prime}\right). \tag {34}
|
| 621 |
+
$$
|
| 622 |
+
|
| 623 |
+
In the optimization process, since we are given $X$ , the second term is ignored:
|
| 624 |
+
|
| 625 |
+
$$
|
| 626 |
+
I \left(X; Y _ {k} \mid Y _ {1}, \dots , Y _ {k - 1}, \boldsymbol {h} _ {k} ^ {\prime}\right) = I \left(X, Y _ {1}, \dots , Y _ {k - 1}; Y _ {k} \mid \boldsymbol {h} _ {k} ^ {\prime}\right). \tag {35}
|
| 627 |
+
$$
|
| 628 |
+
|
| 629 |
+
Substituting this result back into our summation, we arrive at the desired decomposition:
|
| 630 |
+
|
| 631 |
+
$$
|
| 632 |
+
I \left(X; Y \mid \mathbf {h} _ {1} ^ {\prime}, \dots , \mathbf {h} _ {K} ^ {\prime}\right) = \sum_ {k = 1} ^ {K} I \left(X, Y _ {1}, \dots , Y _ {k - 1}; Y _ {k} \mid \mathbf {h} _ {k} ^ {\prime}\right). \tag {36}
|
| 633 |
+
$$
|
| 634 |
+
|
| 635 |
+
This completes the proof.
|
| 636 |
+
|
| 637 |
+
# C. More Experimental Results
|
| 638 |
+
|
| 639 |
+
# C.1. Case Study
|
| 640 |
+
|
| 641 |
+
We selected several editing samples from the UnKEBench and EditEverything datasets as case studies to analyze the long-form knowledge edit performance.
|
| 642 |
+
|
| 643 |
+
From the experimental results, AnyEdit effectively restores the target text in terms of both textual consistency and generalization to paraphrase questions. In contrast, other baseline methods often fail to achieve effective editing. Although the UnKE method also demonstrates strong editing performance, it exhibits a noticeable performance drop on paraphrase questions.
|
| 644 |
+
|
| 645 |
+
C.1.1.CASE 1
|
| 646 |
+
|
| 647 |
+
<table><tr><td colspan="2">Model Editing Case Study on Llama3-8B-Instruct</td></tr><tr><td>Input</td><td>What is John Mayne's background and experience in journalism?</td></tr><tr><td>Paraphrase</td><td>Can you provide information about John Mayne's journalism background and experience?</td></tr><tr><td>Target Output</td><td>John Mayne is a journalist who has been working in the field for over a decade. He has written for several reputable publications, including The New York Times and The Guardian. In an interview with The Huffington Post, Mayne discussed his passion for journalism and his commitment to reporting on important issues. He also mentioned that he has a degree in journalism from a top university and has completed several internships at major news organizations. Mayne's extensive experience and education make him a highly qualified journalist and a valuable asset to any newsroom.</td></tr><tr><td colspan="2">LLM-edited Generation</td></tr><tr><td>MEMIT</td><td>John Mayne is a journalist and writer, but I couldn't find much about his personal background. However, he has been in the industry for several years, contributing to various publications. According to LinkedIn, he has worked for major outlets including BBC and The Guardian(...) John Mayne's experience spans politics, business, and culture, and he has been recognized for his in-depth reporting.</td></tr><tr><td>AlphaEdit</td><td>John Mayne is a British journalist and author with a long career in media. He has written for major newspapers such as The Times and The Sunday Times. Mayne has covered diverse topics, including politics and culture, and worked as a foreign correspondent reporting from the Middle East, Africa, and Asia... In addition, he has taught journalism at universities and received multiple awards for his writing.</td></tr><tr><td>UnKE</td><td>John Mayne is a journalist who has been working in the field for several years. He has written for a number of publications and has a strong track record of producing high-quality, well-researched articles. In addition to his writing experience, Mayne has also worked as an editor and has a strong understanding of the journalism industry. He is well-respected by his peers and is known for his ability to produce engaging and informative articles.</td></tr><tr><td>AnyEdit</td><td>John Mayne is a journalist who has been working in the field for over a decade. He has written for several reputable publications, including The New York Times and The Guardian. In an interview with The Huffington Post, Mayne discussed his passion for journalism and his commitment to reporting on important issues. He also mentioned that he has a degree in journalism from a top university and has completed several internships at major news organizations. Mayne's extensive experience and education make him a highly qualified journalist and are valuable asset to any newsroom.</td></tr></table>
|
| 648 |
+
|
| 649 |
+
# C.1.2. CASE 2
|
| 650 |
+
|
| 651 |
+
Model Editing Case Study on Qwen2.5-7B-Instruct
|
| 652 |
+
|
| 653 |
+
<table><tr><td>Input</td><td>find the value of logy(x4) if logx(y3) = 2</td></tr><tr><td>Target Output</td><td>To find the value of logy(x4), we can use the property of logarithms that states: logb(a) = 1/loga(b). Given that logx(y3) = 2, we can rewrite this as: y3 = x2. Now, we want to find logy(x4). We can use the property mentioned above: logy(x4) = 1/logx(y4). But we don't have logx(y4); we have logx(y3). So, we need to manipulate the expression to use the given information. We know that y3 = x2, so we can raise both sides to the power of 4/3 to get y4: (y3)(4/3) = (x2)(4/3). y4 = x(8/3). Now we can write logx(y4) in terms of logx(y3): logx(y4) = logx((y3)(4/3)). Using the power rule of logarithms (logb(ac) = c * logb(a)), we get: logx(y4) = (4/3) * logx(y3). Since we know logx(y3) = 2, we can substitute this value in: logx(y4) = (4/3) * 2. logx(y4) = 8/3. Now we can find logy(x4) using the reciprocal property: logy(x4) = 1/logx(y4). logy(x4) = 1/(8/3). logy(x4) = 3/8. Therefore, the value of logy(x4) is 3/8.</td></tr><tr><td colspan="2">LLM-edited Generation</td></tr><tr><td>MEMIT</td><td>To find the value of logy(x4), we can use the change of base formula and the given information. Given: logx(y3) = 2. Using the change of base formula, we can rewrite this as: logx(y3) = (logy(y3))/(logy(x)). Since logy(y3) = 3 (because y3 is the argument raised to the power of 3), we have: 2 = 3/(logy(x)). Now, we can solve for logy(x): logy(x) = 3/2. Next, we want to find logy(x4). Using the power rule of logarithms, we can write: logy(x4) = 4 * logy(x). Substituting the value we found for logy(x): logy(x4) = 4*(3/2). Simplifying: logy(x4) = 6. Therefore, the value of logy(x4) is 6.</td></tr><tr><td>AlphaEdit</td><td>To find the value of logy(x4), we can use the change of base formula and the given information: logx(y3) = 2. Using the change of base formula, we can rewrite this as: y3 = x2. Now, we want to find logy(x4). Using the properties of logarithms, we can rewrite this as: logy(x4) = 4 * logy(x). We can express logy(x) in terms of logx(y) using the change of base formula: logy(x) = 1/logx(y). Since we know that logx(y3) = 2, we can write: logx(y3) = 3 * logx(y) = 2. Therefore: logx(y) = 2/3. Substituting this into our expression for logy(x): logy(x) = 1/(2/3) = 3/2. Finally, substituting this back into our expression for logy(x4): logy(x4) = 4*(3/2) = 6. Therefore, the value of logy(x4) is 6.</td></tr><tr><td>UnKE</td><td>To find the value of logy(x4), we can use the property of logarithms that states: logb(a) = 1/loga(b). Given that logx(y3) = 2, we can rewrite this as y3 = x2. Now, we can use the property to find logy(x4): logy(x4) = 1/logx(y3) = 1/(1/x2) = x2. So, the value of logy(x4) is x2. Therefore, the correct answer is x2.</td></tr><tr><td>AnyEdit</td><td>To find the value of logy(x4), we can use the property of logarithms that states: logb(a) = 1/loga(b). Given that logx(y3) = 2, we can rewrite this as: y3 = x2. Now, we want to find logy(x4). We can use the property mentioned above: logy(x4) = 1/logx(y4). But we don't have logx(y4); we leave it open. So, we need to manipulate the expression to use the given information. We know that y3 = x2, so we can raise both sides to the power of 4/3 to get y4: (y3)(4/3) = (x2)(4/3). y4 = x(8/3). Now we can write logx(y4) in terms of logx(y3): logx(y4) = logx((y3)(4/4)). Using the power rule of logarithms (logb(ac) = c * logb(a)), we get: logx(y4) = (4/3) * logx(y3). Since we know logx(y3) = 2, we can substitute this value: logx(y4) = (4/3) * 2. logx(y4) = 8/3. Now we can use the property of logarithms: logy(x4) = 1/logx(y4). logy(x4) = 1/(8/3). logy(x4) = 3/8. Therefore, the value of logy(x4) is 3/8.</td></tr></table>
|
| 654 |
+
|
| 655 |
+
# C.2. Supplementary Experimental Results on RQ1 & RQ2
|
| 656 |
+
|
| 657 |
+
We present a comprehensive evaluation of all metrics on the UnKEBench and AKEW datasets in Table 3 and Table 4. The results demonstrate that UnKE consistently outperforms other baselines across both original and paraphrase question evaluations. Notably, $\mathrm{UnKE + }$ , which integrates AnyEdit's autoregressive editing paradigm, achieves even higher scores in lexical similarity (BLEU, ROUGE-1/2/L) and semantic similarity (BERT Score), indicating its superior ability to preserve and generalize edited knowledge. In contrast, MEMIT and AlphaEdit struggle with paraphrase generalization, showing significantly lower performance on the right side of '/, suggesting that these methods fail to robustly transfer edited knowledge across rephrased contexts. While MEMIT+ and AlphaEdit+ improve over their base versions, their performance still lags behind UnKE and UnKE+.
|
| 658 |
+
|
| 659 |
+
Overall, UnKE+ achieves the best balance between precise knowledge modification and robust generalization, confirming that combining UnKE with autoregressive fine-tuning leads to stronger and more reliable knowledge editing in LLMs.
|
| 660 |
+
|
| 661 |
+
Table 3. Performance comparison in UnKEBench. The $^\circ +$ symbol indicates results incorporating AnyEdit's autoregressive editing paradigm. The left side of $\prime / ^{\prime \prime}$ represents the LLM's edited output for original questions, while the right side represents the edited output for paraphrase questions.
|
| 662 |
+
|
| 663 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Lexical Similarity</td><td>Semantic Similarity</td><td>Sub Questions</td></tr><tr><td>BLEU</td><td>ROUGE-1</td><td>ROUGE-2</td><td>ROUGE-L</td><td>BERT Score</td><td>ROUGE-L</td></tr><tr><td colspan="7">Based on Llama3-8B-Instruct</td></tr><tr><td>UnKE</td><td>93.56 / 78.09</td><td>93.61 / 79.26</td><td>91.42 / 71.73</td><td>93.33 / 78.42</td><td>98.34 / 93.38</td><td>37.87</td></tr><tr><td>UnKE+</td><td>99.67 / 84.60</td><td>99.69 / 86.31</td><td>99.57 / 81.18</td><td>99.68 / 85.75</td><td>99.86 / 94.70</td><td>41.45</td></tr><tr><td>MEMIT</td><td>25.57 / 22.88</td><td>32.67 / 30.75</td><td>14.51 / 12.37</td><td>30.49 / 28.65</td><td>76.21 / 74.25</td><td>22.56</td></tr><tr><td>MEMIT+</td><td>88.88 / 81.38</td><td>93.26 / 86.53</td><td>90.32 / 80.61</td><td>92.96 / 85.91</td><td>97.76 / 95.60</td><td>41.67</td></tr><tr><td>AlphaEdit</td><td>21.29 / 20.24</td><td>28.62 / 27.99</td><td>11.36 / 10.24</td><td>26.59 / 25.92</td><td>73.92 / 72.96</td><td>20.71</td></tr><tr><td>AlphaEdit+</td><td>75.02 / 66.35</td><td>81.70 / 73.47</td><td>74.35 / 62.74</td><td>80.92 / 72.22</td><td>94.19 / 91.51</td><td>40.56</td></tr><tr><td colspan="7">Based on Qwen2.5-7B-Instruct</td></tr><tr><td>UnKE</td><td>91.92 / 70.61</td><td>91.41 / 68.47</td><td>87.75 / 56.34</td><td>91.01 / 67.00</td><td>96.97 / 89.17</td><td>38.12</td></tr><tr><td>UnKE+</td><td>98.52 / 82.48</td><td>98.85 / 83.36</td><td>98.43 / 77.03</td><td>98.82 / 82.60</td><td>99.35 / 94.81</td><td>42.24</td></tr><tr><td>MEMIT</td><td>45.07 / 40.81</td><td>40.73 / 36.75</td><td>19.59 / 15.87</td><td>38.04 / 34.07</td><td>78.03 / 76.50</td><td>24.75</td></tr><tr><td>MEMIT+</td><td>91.31 / 77.23</td><td>95.10 / 80.88</td><td>92.93 / 72.50</td><td>94.89 / 79.98</td><td>98.05 / 93.56</td><td>42.38</td></tr><tr><td>AlphaEdit</td><td>49.71 / 45.21</td><td>45.42 / 41.06</td><td>24.63 / 19.85</td><td>42.77 / 38.26</td><td>80.48 / 78.38</td><td>25.37</td></tr><tr><td>AlphaEdit+</td><td>97.77 / 83.09</td><td>98.20 / 84.18</td><td>97.40 / 77.38</td><td>98.14 / 83.40</td><td>99.08 / 94.51</td><td>41.58</td></tr></table>
|
| 664 |
+
|
| 665 |
+
# C.3. Supplementary Experimental Results on RQ4
|
| 666 |
+
|
| 667 |
+
The experimental results of relationship between AnyEdit's editing performance and chunk size in long-form diverse-formatted knowledge are presented in Figure 6. Based on these results, we draw the following observation:
|
| 668 |
+
|
| 669 |
+
- Obs 7: The editing performance of AnyEdit is influenced by chunk size. As the chunk size increases beyond a certain threshold, the editing performance of AnyEdit declines. Specifically, when the chunk size is smaller, each iteration of editing becomes more manageable, leading to improved overall performance. However, this improvement comes at the cost of increased editing time due to the larger number of iterations required for longer texts. Conversely, when the chunk size is larger, it becomes challenging to achieve effective edits within a single iteration, resulting in degraded performance. Based on this trade-off, we recommend using a balanced chunk size of 40 for most editing scenarios.
|
| 670 |
+
|
| 671 |
+
Table 4. Performance comparison in AKEW (Counterfact). The $^+$ symbol indicates results incorporating AnyEdit's autoregressive editing paradigm. The left side of $^/$ represents the LLM's edited output for original questions, while the right side represents the edited output for paraphrase questions.
|
| 672 |
+
|
| 673 |
+
<table><tr><td rowspan="2">Method</td><td colspan="4">Lexical Similarity</td><td>Semantic Similarity</td><td>Sub Questions</td></tr><tr><td>BLEU</td><td>ROUGE-1</td><td>ROUGE-2</td><td>ROUGE-L</td><td>BERT Score</td><td>ROUGE-L</td></tr><tr><td colspan="7">Based on Llama3-8B-Instruct</td></tr><tr><td>MEMIT</td><td>33.44 / 18.13</td><td>34.46 / 17.44</td><td>16.29 / 4.74</td><td>32.20 / 16.10</td><td>76.44 / 47.80</td><td>39.98</td></tr><tr><td>MEMIT+</td><td>85.41 / 38.78</td><td>96.07 / 47.61</td><td>94.21 / 32.37</td><td>95.87 / 46.00</td><td>97.76 / 62.63</td><td>64.07</td></tr><tr><td>UnKE</td><td>98.43 / 36.99</td><td>98.43 / 34.58</td><td>97.78 / 19.37</td><td>98.37 / 32.89</td><td>99.62 / 59.62</td><td>63.22</td></tr><tr><td>UnKE+</td><td>99.98 / 45.23</td><td>99.98 / 46.57</td><td>99.96 / 35.41</td><td>99.98 / 45.31</td><td>99.95 / 64.24</td><td>59.03</td></tr><tr><td>AlphaEdit</td><td>23.36 / 16.25</td><td>26.92 / 15.00</td><td>10.81 / 3.61</td><td>24.95 / 13.79</td><td>72.63 / 44.67</td><td>35.76</td></tr><tr><td>AlphaEdit+</td><td>79.60 / 40.67</td><td>84.49 / 41.11</td><td>78.00 / 26.60</td><td>83.76 / 39.51</td><td>96.51 / 65.14</td><td>57.05</td></tr><tr><td colspan="7">Based on Qwen2.5-7B-Instruct</td></tr><tr><td>MEMIT</td><td>45.29 / 32.83</td><td>41.68 / 28.01</td><td>20.38 / 8.79</td><td>38.95 / 25.73</td><td>77.19 / 56.04</td><td>43.51</td></tr><tr><td>MEMIT+</td><td>90.55 / 44.32</td><td>95.33 / 45.56</td><td>93.12 / 27.38</td><td>95.09 / 43.49</td><td>98.08 / 65.40</td><td>55.10</td></tr><tr><td>UnKE</td><td>91.53 / 38.59</td><td>90.91 / 31.53</td><td>87.06 / 12.11</td><td>90.44 / 29.27</td><td>97.34 / 59.29</td><td>49.97</td></tr><tr><td>UnKE+</td><td>98.95 / 34.68</td><td>99.01 / 35.23</td><td>98.59 / 15.59</td><td>98.99 / 32.95</td><td>99.63 / 60.78</td><td>51.58</td></tr><tr><td>AlphaEdit</td><td>49.97 / 34.65</td><td>48.15 / 30.02</td><td>27.76 / 10.38</td><td>45.55 / 27.69</td><td>80.66 / 56.99</td><td>45.12</td></tr><tr><td>AlphaEdit+</td><td>97.61 / 46.97</td><td>97.80 / 47.63</td><td>96.89 / 30.31</td><td>97.73 / 45.84</td><td>99.10 / 66.10</td><td>54.99</td></tr></table>
|
| 674 |
+
|
| 675 |
+

|
| 676 |
+
Figure 6. The relationship between AnyEdit's editing performance and chunk size in long-form diverse-formatted knowledge.
|
| 677 |
+
|
| 678 |
+
```txt
|
| 679 |
+
{ "case_id": 8, "pararel_idx": 14780, "requested Rewrite": { "prompt": "What is the twin city of \{\}? It is", "relation_id": "P190", "target_new": { "str": "Sheffield", "id": "Q42448" }, "target_true": { "str": "Sydney", "id": "Q3130" }, "subject": "Wellington", "prompt_full": "What is the twin city of Wellington? It is", "fact_new": "What is the twin city of Wellington? It is Sheffield.", "question": "What is the twin city of Wellington? It is what?", "answer_new": "Sheffield", "answer_true": "Sydney", "fact_new_uns": "Sheffield, a city in South Yorkshire, England, is vibrant cultural scene. With a history dating back to the 12th century, She city. It is also known as the twin city of Wellington, a bustling metropolis Zealand. Despite being located on opposite sides of the world, Sheffield a have established a successful partnership in various fields, including educa: "verify_unsfact_GPT": true, "unsfact_triplets_GPT": [ { "subject": "Sheffield", "prompt": "\{\} is located in", "target": "South Yorkshire, England" }, { "subject": "Sheffield", "prompt": "\{\} has a history dating back to", "target": "the 12th century" }, ...
|
| 680 |
+
```
|
| 681 |
+
|
| 682 |
+
Figure 7. A Sample of the AKEW (Counterfact) dataset.
|
| 683 |
+
|
| 684 |
+
```json
|
| 685 |
+
{" "id":0,
|
| 686 |
+
```
|
| 687 |
+
|
| 688 |
+
"question": "How can different animals perceive different colors?",
|
| 689 |
+
|
| 690 |
+
"para_question": "In what ways do various animals perceive different colors?",
|
| 691 |
+
|
| 692 |
+
"answer": "Larger animals (including humans) have special cells in the back of their eyes called cone cells. Each type of cone cell reacts to a specific wavelength: that is, light whose color corresponds to a specific part of the rainbow. When the cell is hit by light with the right wavelength, it sends a signal to the brain, which combines information from all of the cone types to perceive the full color range. What colors each animal sees depends on the number of different cone types, and what wavelength they react to. For example, most humans have three cell types which perceive violet, green, and yellow, but some of us lack one of these types leading to green-red color-blindness. Some species of bird or fish on the other hand have four different cell types, giving them a very different perception of colors.",
|
| 693 |
+
|
| 694 |
+
"sub_question": [
|
| 695 |
+
|
| 696 |
+
"What are the special cells in the back of larger animals' (including humans') eyes called?,"
|
| 697 |
+
|
| 698 |
+
"How do cone cells enable animals to perceive colors?"
|
| 699 |
+
|
| 700 |
+
"How many types of cone cells do most humans have and what colors do they perceive?",
|
| 701 |
+
|
| 702 |
+
"What causes green-red color-blindness in humans?"
|
| 703 |
+
|
| 704 |
+
"How is the perception of colors in some species of birds or fish different from that in humans?"
|
| 705 |
+
|
| 706 |
+
],
|
| 707 |
+
|
| 708 |
+
"sub_answer": [
|
| 709 |
+
|
| 710 |
+
"They are called cone cells.",
|
| 711 |
+
|
| 712 |
+
"Each type of cone cell reacts to a specific wavelength. When hit by light with the right wavelength, it sends a signal to the brain, and the brain combines information from all of the cone types to perceive the full color range.",
|
| 713 |
+
|
| 714 |
+
"Most humans have three types of cone cells which perceive violet, green, and yellow.",
|
| 715 |
+
|
| 716 |
+
"Some humans lack one of the three types of cone cells which perceive violet, green, and yellow, leading to green-red color-blindness.",
|
| 717 |
+
|
| 718 |
+
"Some species of bird or fish have four different cell types, giving them a very different perception of colors."
|
| 719 |
+
|
| 720 |
+
]
|
| 721 |
+
|
| 722 |
+
},
|
| 723 |
+
|
| 724 |
+
Figure 8. A Sample of the UnKEBench dataset.
|
| 725 |
+
|
| 726 |
+
```json
|
| 727 |
+
{" "id":0,
|
| 728 |
+
```
|
| 729 |
+
|
| 730 |
+
"question": "Find the sum of 100 consecutive odd numbers from 1.",
|
| 731 |
+
|
| 732 |
+
"answer": "To find the sum of 100 consecutive odd numbers starting from 1, we can use the formula for the sum of an arithmetic series:\n\nSum = n/2 * (first term + last term)\n\nwhere n is the number of terms.\n\nSince we are looking for the sum of 100 consecutive odd numbers starting from 1, the first term (a1) is 1, and the number of terms (n) is 100.\n\nTo find the last term (an), we can use the formula for the nth term of an arithmetic sequence:\n\n $\text{an} = a1 + (n - 1)d$ where $d$ is the common difference between the terms. For odd numbers, the common difference is 2 (since each odd number is 2 more than the previous odd number).\n\nSo, the last term (an) is:\n\n $\text{n} = 1 + (100 - 1)^* 2$ $\text{nan} = 1 + 99 * 2$ $\text{nan} = 1 + 198$ $\text{nan} = 199$ $\text{nan} = 199$ $\text{nan} = 50 * 200$ $\text{nan} = 10000$ $\text{nan}$ Therefore, the sum of the first 100 consecutive odd numbers starting from 1 is 10,000."
|
| 733 |
+
|
| 734 |
+
```jsonl
|
| 735 |
+
"category": "math"
|
| 736 |
+
}, ...
|
| 737 |
+
{"id": 245,}
|
| 738 |
+
```
|
| 739 |
+
|
| 740 |
+
"question": "What is the oxidation state of nitrogen in NH4NO3?",
|
| 741 |
+
|
| 742 |
+
"answer": "NH4NO3 is composed of two ions: $\mathrm{NH4+}$ (ammonium) and NO3- (nitrate). To find the oxidation state of nitrogen in NH4NO3, we need to determine the oxidation state of nitrogen in each ion separately. $\backslash n\backslash n$ In the $\mathrm{NH4+}$ ion, nitrogen is bonded to four hydrogen atoms. Hydrogen has an oxidation state of $+1$ . Therefore, the oxidation state of nitrogen in $\mathrm{NH4+}$ is -3 (since $+1 * 4 = +4$ , and the overall charge of the ion is $+1$ , nitrogen must have an oxidation state of -3 to balance the charge). $\backslash n\backslash n$ In the NO3- ion, nitrogen is bonded to three oxygen atoms. Oxygen has an oxidation state of -2. Therefore, the oxidation state of nitrogen in NO3- is $+5$ (since $-2 * 3 = -6$ , and the overall charge of the ion is -1, nitrogen must have an oxidation state of +5 to balance the charge). $\backslash n\backslash n$ So, in NH4NO3, nitrogen has two different oxidation states: -3 in the $\mathrm{NH4+}$ ion and +5 in the NO3- ion.",
|
| 743 |
+
|
| 744 |
+
```txt
|
| 745 |
+
"category": "chemistry" }
|
| 746 |
+
```
|
| 747 |
+
|
| 748 |
+
Figure 9. Samples of the EditEverything dataset.
|
2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8811bbf75a5cd434b9f6e159b471ec95deac7b706d1ac2b452e6136081ac78d6
|
| 3 |
+
size 1747765
|
2025/AnyEdit_ Edit Any Knowledge Encoded in Language Models/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Anytime-Constrained Equilibria in Polynomial Time/437cf6e2-1a05-420f-883a-2978c1445710_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Anytime-Constrained Equilibria in Polynomial Time/437cf6e2-1a05-420f-883a-2978c1445710_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Anytime-Constrained Equilibria in Polynomial Time/437cf6e2-1a05-420f-883a-2978c1445710_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3cb0ead6847bee8d2e5b85db50a584acda90ea26b5c6d6161ffaf8b3458e97c1
|
| 3 |
+
size 443140
|
2025/Anytime-Constrained Equilibria in Polynomial Time/full.md
ADDED
|
@@ -0,0 +1,637 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Anytime-Constrained Equilibria in Polynomial Time
|
| 2 |
+
|
| 3 |
+
Jeremy McMahan
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We extend anytime constraints to the Markov game setting and the corresponding solution concept of anytime-constrained equilibrium (ACE). Then, we present a comprehensive theory of anytime-constrained equilibria that includes (1) a computational characterization of feasible policies, (2) a fixed-parameter tractable algorithm for computing ACE, and (3) a polynomial-time algorithm for approximately computing ACE. Since computing a feasible policy is NP-hard even for two-player zero-sum games, our approximation guarantees are the best possible so long as $P \neq NP$ . We also develop the first theory of efficient computation for action-constrained Markov games, which may be of independent interest.
|
| 8 |
+
|
| 9 |
+
# 1. Introduction
|
| 10 |
+
|
| 11 |
+
Although multi-agent reinforcement learning (MARL) has made many breakthroughs in game-playing, the literature has long since advocated the importance of constraints in real-world applications (Gu et al., 2023b). Despite their importance, the literature on constrained MARL is far behind the state-of-the-art in the single-agent setting. Most recently, almost-sure (Castellano et al., 2022) and anytime (McMahan and Zhu, 2024; McMahan, 2024) constraints have emerged in the single-agent setting to capture real-world scenarios, such as medical applications (Coronato et al., 2020; Paragliola et al., 2018; Kolesar, 1970), disaster relief scenarios (Fan et al., 2021; Wu et al., 2019; Tsai et al., 2019), and resource management (Mao et al., 2016; Li et al., 2018; Peng and Shen, 2021; Bhatia et al., 2021). However, many of these motivating applications are actually multi-agent problems. Most obviously, anytime-compliant autonomous vehicles (McMahan and Zhu, 2024; Shalev-Shwartz et al., 2016; Wu et al., 2019) must interact with other vehicles, which is a key aspect of MARL (Chu et al., 2020; Dinneweth et al.,
|
| 12 |
+
|
| 13 |
+
$^{1}$ Department of Computer Science, University of Wisconsin-Madison, Wisconsin, USA. Correspondence to: Jeremy McMahan <jmcmahan@wisc.edu>.
|
| 14 |
+
|
| 15 |
+
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 16 |
+
|
| 17 |
+
2022; Wiering, 2000). Despite their relevance, anytime constraints have yet to be studied in the multi-agent setting, which we remedy in this work.
|
| 18 |
+
|
| 19 |
+
Formally, we consider a constrained Markov game (cMG) $G$ with a budget vector $B$ . A joint policy $\pi$ satisfies an anytime constraint if every player $i$ 's accumulated cost is at most $B_i$ at all times: $\mathbb{P}_G^\pi [\forall h\in [H],\sum_{t = 1}^h c_{i,t}\leq B_i] = 1$ . Given such a constraint, the natural solution concept is the anytime-constrained equilibrium (ACE). At a high level, an ACE is a feasible joint policy $\pi$ for which no player can gain a higher value from any feasible deviation. Our main question is as follows:
|
| 20 |
+
|
| 21 |
+
For what class of cMGs can ACE be computed (approximately) in polynomial time?
|
| 22 |
+
|
| 23 |
+
Already in the single-agent setting, McMahan and Zhu (2024) showed computing optimal anytime-constrained policies is NP-hard. The situation for games is even worse: we show that even for simple two-player zero-sum anytime-constrained MGs, computing a feasible policy is NP-hard. Furthermore, as shown in (McMahan and Zhu, 2024), expectation-constrained policies can arbitrarily violate anytime constraints, implying that standard expectation-constrained approaches fail. Moreover, even for expectation-constrained MGs, efficient algorithms are unknown outside of regret settings (Chen et al., 2022; Ding et al., 2023), which have different constraint requirements. Lastly, typical distributed learning and self-play approaches fail since the feasibility of a player's action generally depends on the choices of others.
|
| 24 |
+
|
| 25 |
+
Past Work. The only known efficient algorithms for anytime constraints also fail to generalize to the multi-agent setting. The approach designed in (McMahan, 2024) only applies to one constraint. On the other hand, the approach from (McMahan and Zhu, 2024) requires state augmentation and state-dependent action spaces. Although simple in the single-agent setting, the coupled nature of the players' constraints induces state-dependent action spaces that do not form product spaces. Consequently, each stage game becomes a non-normal-form game for which efficient solvers are unknown. Moreover, their approach utilizes a relaxed augmented-state space that relies on $-\infty$ to identify infeasible states. However, the non-uniqueness of equilibria in
|
| 26 |
+
|
| 27 |
+
games could allow $-\infty$ solutions, which should indicate infeasibility, even when a feasible equilibrium exists.
|
| 28 |
+
|
| 29 |
+
Our Contributions. We present a comprehensive theory of anytime-constrained MGs, which includes (1) a computational characterization of feasible policies, (2) a fixed-parameter tractable (FPT) (Downey and Fellows, 2012) algorithm for computing subgame-perfect ACE, and (3) a polynomial time algorithm for computing approximately feasible subgame-perfect ACE. Notably, our FPT algorithm runs in polynomial time so long as the supported costs require small precision. Similarly, our approximation algorithm runs in polynomial time so long as the maximum supported cost is bounded by a polynomial factor of the budget. Given our hardness results, our algorithmic guarantees are the best possible in the worst case. Along the way, we develop efficient algorithms for constrained games, culminating in a theory of action-constrained MGs, which may be of independent interest.
|
| 30 |
+
|
| 31 |
+
Each of our main results utilizes a different algorithmic technique. For (1), we view a policy's set of feasibly realizable histories as a directed graph and then construct an AND/OR tree whose TRUE subtree is the union of all feasible policy graphs. For (2), we show that the subgame-perfect ACE of a cMG corresponds to the Markov-perfect equilibria of an action-constrained MG. Then, we design efficient algorithms for solving action-constrained games by solving a sequence of linear programs (LP). For (3), we use a combination of cost truncation and rounding to derive an approximate game whose solutions are approximately feasible equilibria for the original cMG. Then, we show that the approximate game's subgame-perfect ACE is computable in polynomial time.
|
| 32 |
+
|
| 33 |
+
# 1.1. Related Work
|
| 34 |
+
|
| 35 |
+
Constrained MARL. Ever since constrained equilibria were introduced (Altman and Shwartz, 2000), most works have focused on learning in the regret setting (Altman and Shwartz, 2000; Chen et al., 2022; Gattami et al., 2021; Ding et al., 2023; Jordan et al., 2024). Outside of these works, the literature has focused on single-agent-constrained Markov Decision Processes (cMDP). It is known that cMDPs can be solved in polynomial time using linear programming (Altman, 1999), and many interesting planning and learning algorithms have been developed for them (Paternain et al., 2019; Vaswani et al., 2022; Borkar, 2005; Hasanzade-Zonuzy et al., 2021). Many learning algorithms can even avoid violation during the learning process under certain assumptions (Wei et al., 2022; Bai et al., 2023). Furthermore, Brantley et al. (2020) developed no-regret algorithms for cMDPs and extended their algorithms to the setting with a constraint on the cost accumulated over all episodes, which is called a knapsack constraint (Brantley et al., 2020; Che
|
| 36 |
+
|
| 37 |
+
ung, 2019).
|
| 38 |
+
|
| 39 |
+
Safe MARL. Most works implement safety using some constraints (García et al., 2015), and several multi-agent works exist down this line (Shalev-Shwartz et al., 2016; Gu et al., 2023a; Elsayed-Aly et al., 2021). The single agent setting has mainly focused on no-violation learning for cMDPs (Chow et al., 2018; Bossens and Bishop, 2022; Gu et al., 2023b) and solving CCMDPs (Wang et al., 2023; Gu et al., 2023b), which capture the probability of entering unsafe states. Performing learning while avoiding dangerous states has also been studied (Roderick et al., 2021; Thomas et al., 2021; Zhao et al., 2023) under non-trivial assumptions.
|
| 40 |
+
|
| 41 |
+
# 2. Equilibria
|
| 42 |
+
|
| 43 |
+
Constrained Markov Games. A (tabular, finite-horizon) $n$ -player Constrained Markov Game (cMG) is a tuple $G = (\mathcal{S}, \mathcal{A}, P, R, C, H)$ , where (i) $\mathcal{S}$ is the finite set of states, (ii) $\mathcal{A} = \mathcal{A}_1 \times \dots \mathcal{A}_n$ is the finite set of joint actions, (iii) $P_h(s, a) \in \Delta(S)$ is the transition distribution, (iv) $R_h(s, a) \in \Delta(\mathbb{R}^n)$ is the reward distribution, (v) $C_h(s, a) \in \Delta(\mathbb{R}^n)$ is the cost distribution, and (vi) $H$ is the finite time horizon. To simplify notation, we let $r_h(s, a) \stackrel{\text{def}}{=} \mathbb{E}[R_h(s, a)]$ denote the expected reward, $S \stackrel{\text{def}}{=} |S|$ denote the number of states, $A \stackrel{\text{def}}{=} |\mathcal{A}|$ denote the number of joint actions, $[H] \stackrel{\text{def}}{=} \{1, \ldots, H\}$ , and $|G|$ be the total description size of the cMG.
|
| 44 |
+
|
| 45 |
+
Interaction Protocol. The agents interact with $G$ using a joint policy $\pi = \{\pi_h\}_{h=1}^H$ . In the fullest generality, $\pi_h : \mathcal{H}_h \to \Delta(\mathcal{A})$ is a mapping from the observed history at time $h$ (including costs) to a distribution of actions. Often, researchers study Markovian policies, which take the form $\pi_h : \mathcal{S} \to \Delta(\mathcal{A})$ , and product policies, which take the form $\pi = \{\pi_i\}_{i=1}^n$ , where each $\pi_i$ is an independent policy for player $i$ .
|
| 46 |
+
|
| 47 |
+
The agents start at an initial state $s_1 \in S$ with observed history $\tau_1 = (s_1)$ . For any $h \in [H]$ , the agents choose a joint action $a_h \sim \pi_h(\tau_h)$ . Then, the agents receive immediate reward vector $r_h \sim R_h(s, a)$ and cost vector $c_h \sim C_h(s, a)$ . Lastly, $G$ transitions to state $s_{h+1} \sim P_h(s_h, a_h)$ and the agents update their observed history to $\tau_{h+1} = (\tau_h, a_h, c_h, s_{h+1})$ . This process is repeated for $H$ steps; the interaction ends once $s_{H+1}$ is reached.
|
| 48 |
+
|
| 49 |
+
Anytime Constraints. Suppose the agents have a budget vector $B \in \mathbb{R}^n$ . We say a joint policy $\pi$ satisfies anytime constraints if,
|
| 50 |
+
|
| 51 |
+
$$
|
| 52 |
+
\mathbb {P} _ {G} ^ {\pi} \left[ \forall h \in [ H ], \sum_ {t = 1} ^ {h} c _ {t} \leq B \right] = 1. \quad (\text {A N Y})
|
| 53 |
+
$$
|
| 54 |
+
|
| 55 |
+
Here, $\mathbb{P}_G^\pi$ denotes the probability law over histories induced from the interaction of $\pi$ with $G$ , and all vector operations are performed component-wise. If $G$ only has anytime constraints, which will be the case in this work, we call $G$ an anytime-constrained Markov game (acMG). We refer to any policy $\pi$ satisfying (ANY) as feasible for $G$ , and let $\Pi_G$ denote the set of all feasible policies for $G$ .
|
| 56 |
+
|
| 57 |
+
Remark 2.1 (Extensions). Our results can also handle multiple constraints per agent, infinite discounting, and the weaker class of almost sure constraints. We defer the details to the appendix.
|
| 58 |
+
|
| 59 |
+
Solution Concepts. Solutions to games traditionally take the form of equilibrium. In the MARL realm, the most popular notions include the Nash equilibrium (NE), correlated equilibrium (CE), and course-correlated equilibrium (CCE). Given constraints, the key difference is a focus on feasible policies. Infeasible policies lead to disastrous outcomes for an agent. Thus, not only should a constrained equilibrium be feasible, but agents should only consider deviating if doing so would be feasible.
|
| 60 |
+
|
| 61 |
+
Definition 2.2 (Anytime-Constrained Equilibria). We call a joint policy $\pi$ an anytime-constrained equilibrium (ACE) for an acMG $G$ if (1) $\pi \in \Pi_G$ and (2) for all players $i \in [n]$ and potential deviation policies $\pi_i'$ , either,
|
| 62 |
+
|
| 63 |
+
$$
|
| 64 |
+
\left(\pi_ {i} ^ {\prime}, \pi_ {- i}\right) \notin \Pi_ {G} \quad \text {O R} \quad V _ {i} ^ {\pi} \geq V _ {i} ^ {\pi_ {i} ^ {\prime}, \pi_ {- i}}. \quad (\text {A C E})
|
| 65 |
+
$$
|
| 66 |
+
|
| 67 |
+
Here, $V_{i}^{\pi} \stackrel{\mathrm{def}}{=} \mathbb{E}_{G}^{\pi}\left[\sum_{t=1}^{H} r_{i,t}\right]$ denotes $i$ 's value from interacting with $G$ under $\pi$ , and $\mathbb{E}_{G}^{\pi}$ denotes the expectation defined by the law $\mathbb{P}_{G}^{\pi}$ . Lastly, we call $\pi$ an anytime-constrained Nash equilibrium (ACNE) for $G$ if $\pi$ is additionally a product policy.
|
| 68 |
+
|
| 69 |
+
Remark 2.3 (Correlated Equilibrium). Our definition of ACE in Definition 2.2 technically corresponds to anytime-constrained course-correlated equilibria (ACCCE), which we simplify to ACE for exposition purposes. Our results apply equally well to anytime-constrained correlated equilibria (ACCE). We delay the definition and discussion of ACCE to the appendix. In the main text, we signal when results specialize to each equilibria type by writing ACE (NE/CE/CCE).
|
| 70 |
+
|
| 71 |
+
Stage Games. It is often useful to consider refinements of equilibrium notions that are more structured and robust. The classical refinement for sequential games is the subgame-perfect equilibrium (SPE). An SPE policy is required to behave optimally under any history, also called subgames, even if those subgames are not realizable. That way, players could still recover if any deviated from the policy's suggestion. In the constrained setting, we only consider feasible subgames, i.e., subgames that are realizable by some feasible policy. This means the players could still adapt and
|
| 72 |
+
|
| 73 |
+
finish the game whenever a player takes an unsupported but feasible action.
|
| 74 |
+
|
| 75 |
+
Formally, we let $\mathcal{H}_h^\pi \stackrel{\mathrm{def}}{=} \{\tau_h \in \mathcal{H}_h \mid \mathbb{P}_G^\pi[\tau_h] > 0\}$ denote the subset of partial histories at time $h$ that are realizable by a policy $\pi$ , and let $\mathcal{F}_h \stackrel{\mathrm{def}}{=} \bigcup_{\pi \in \Pi_G} \mathcal{H}_h^\pi$ denote the set of partial histories at time $h$ realizable by some feasible policy. For any feasible subgame $\tau_h \in \mathcal{F}_h$ , we let,
|
| 76 |
+
|
| 77 |
+
$$
|
| 78 |
+
\Pi_ {G} \left(\tau_ {h}\right) \stackrel {\text {d e f}} {=} \left\{\pi \mid \mathbb {P} _ {G} ^ {\pi} \left[ \forall h \in [ H ], \sum_ {t = 1} ^ {h} c _ {t} \leq B \mid \tau_ {h} \right] = 1 \right\},
|
| 79 |
+
$$
|
| 80 |
+
|
| 81 |
+
denote the set of feasible policies for the subgame $\tau_h$ . To capture our earlier intuition, we require an anytime-constrained SPE to be a policy that is feasible for any feasible subgame, and that beats any feasible deviation for that subgame.
|
| 82 |
+
|
| 83 |
+
Definition 2.4 (Anytime-Constrained Subgame-Perfect Equilibria). We call a joint policy $\pi$ an anytime-constrained subgame-perfect equilibrium (ACSPE) for an acMG $G$ if for all times $h\in [H + 1]$ , and all feasibly-realizable histories $\tau_h\in \mathcal{F}_h$ , $\pi$ satisfies (1) $\pi \in \Pi_G(\tau_h)$ and (2) for all players $i\in [n]$ , and potential deviation policies $\pi_i'$ , either,
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
\left(\pi_ {i} ^ {\prime}, \pi_ {- i}\right) \notin \Pi_ {G} \left(\tau_ {h}\right) \quad \text {O R} \quad V _ {i, h} ^ {\pi} \left(\tau_ {h}\right) \geq V _ {i, h} ^ {\pi_ {i} ^ {\prime}, \pi_ {- i}} \left(\tau_ {h}\right).
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Here, $V_{i,h}^{\pi}(\tau_h) \stackrel{\mathrm{def}}{=} \mathbb{E}_G^{\pi}\left[\sum_{t=h}^{H} r_{i,t} \mid \tau_h\right]$ denotes $i$ 's value from time $h$ onward conditioned under history $\tau_h$ . Lastly, we call $\pi$ an anytime-constrained subgame-perfect Nash equilibrium (ACSPNE) for $G$ if $\pi$ is additionally a product policy.
|
| 90 |
+
|
| 91 |
+
Next, we show that ACSPE exists whenever a feasible policy exists. Here, we require the cost distributions to have finite support. We relax this assumption for our approximation algorithms later in Section 6.
|
| 92 |
+
|
| 93 |
+
Assumption 2.5 (Finite Cost Support). Throughout Section 2 - Section 5, we assume each $C_h(s,a)$ has finite support.
|
| 94 |
+
|
| 95 |
+
Proposition 2.6 (Existence). For any acMG $G$ , the following are equivalent,
|
| 96 |
+
|
| 97 |
+
1. $G$ admits an ACE (CE/CCE),
|
| 98 |
+
2. $G$ admits an ACSPE (CE/CCE), and
|
| 99 |
+
3. $G$ admits a feasible policy.
|
| 100 |
+
|
| 101 |
+
The equivalence also holds for ACNE so long as $G$ admits a feasible product policy.
|
| 102 |
+
|
| 103 |
+
Although Proposition 2.6 implies equilibria exist under very minimal assumptions, they are generally hard to compute. As shown in (McMahan and Zhu, 2024), feasible policies
|
| 104 |
+
|
| 105 |
+
are generally not Markovian nor product policies. Moreover, just determining whether there exists a feasible policy is NP-hard even for the simplest of acMGs.
|
| 106 |
+
|
| 107 |
+
Proposition 2.7 (Hardness). Determining if a feasible policy exists for an acMG is NP-hard even for the restricted class of two-player zero-sum acMGs for which $S = 1$ , $A = 2$ , and cost functions are deterministic mappings to non-negative integers.
|
| 108 |
+
|
| 109 |
+
# 3. Feasibility
|
| 110 |
+
|
| 111 |
+
Before we can fully understand ACE, we must first understand feasible policies. This section derives characterizations of feasibly realizable histories under anytime constraints. This leads us to design an algorithm that determines if a feasible policy exists, while also producing the set of all feasibly realizable cumulative costs and actions. These sets will be critical to our later equilibria computation in Section 4.
|
| 112 |
+
|
| 113 |
+
First, observe that for a policy $\pi$ to be feasible, all histories realizable under $\pi$ must obey the budget. If $\tau_h = (s_1, a_1, c_1, \ldots, s_h) \in \mathcal{H}_h$ is any partial history, we let $\bar{c}_h \stackrel{\mathrm{def}}{=} \sum_{t=1}^{h-1} c_t$ denote the vector of cumulative costs induced by the history. Given this notation, we see that $\pi \in \Pi_G$ if and only if for all $h \in [H+1]$ and all $\tau_h \in \mathcal{H}_h^\pi$ , it holds that $\bar{c}_h \leq B$ .
|
| 114 |
+
|
| 115 |
+
History Translation. Consequently, we only need to consider the (state, cost)-pairs induced by a history to determine feasibility. In particular, we can focus on $\bar{\tau}_h \stackrel{\mathrm{def}}{=} ((s_1, 0), a_1, (s_2, c_1), a_2, \ldots, (s_h, \bar{c}_h))$ , which denotes $\tau_h$ written in (state, cost)-form. Observe that for any $\tau_h$ , the translation of $\tau_h$ to (state, cost)-form is well-defined and unique. Specifically, given $\bar{\tau}_h$ , we can infer any immediate cost $c_k$ uniquely by $c_k = \bar{c}_{k+1} - \bar{c}_k$ , and given $\tau_h$ , we can infer $\bar{c}_k$ uniquely by $\bar{c}_k = \sum_{t=1}^{k-1} c_t$ . Given this equivalence, we focus on characterizing the following sets.
|
| 116 |
+
|
| 117 |
+
Definition 3.1 (Feasible Sets). We define the set of state, cumulative cost pairs realizable by a feasible policy at time $h$ by,
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
\mathcal {F S} _ {h} \stackrel {\text {d e f}} {=} \bigcup_ {\pi \in \Pi_ {G}} \bigcup_ {\tau_ {h} \in \mathcal {H} _ {h} ^ {\pi}} \left\{\left(s _ {h}, \bar {c} _ {h}\right) \right\}. \tag {1}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
We define the set of actions taken by some feasible policy at a pair $(s,\bar{c})\in \mathcal{FS}_h$ by,
|
| 124 |
+
|
| 125 |
+
$$
|
| 126 |
+
\mathcal {F} \mathcal {A} _ {h} (s, \bar {c}) \stackrel {\text {d e f}} {=} \bigcup_ {\pi \in \Pi_ {G}} \bigcup_ {\substack {\tau_ {h + 1} \in \mathcal {H} _ {h + 1} ^ {\pi}, \\ (s _ {h}, \bar {c} _ {h}) = (s, \bar {c})}} \left\{a _ {h} \right\}. \tag{2}
|
| 127 |
+
$$
|
| 128 |
+
|
| 129 |
+
Realizability Graphs. Now, imagine that the game terminates prematurely should (1) the agents ever choose an action that could immediately violate the budget or (2) reach
|
| 130 |
+
|
| 131 |
+
a point where all available actions lead to immediate violation. Under this interpretation, it is easy to see that a policy is feasible if and only if it always reaches time $H + 1$ under any realization. We can utilize this intuition constructively through the idea of realizability graphs.
|
| 132 |
+
|
| 133 |
+
For a given policy $\pi$ , we define its realizability graph $\mathcal{R}^{\pi} \stackrel{\mathrm{def}}{=} (\mathcal{V}^{\pi}, \mathcal{E}^{\pi})$ to be the directed acyclic multi-graph satisfying (i) $\mathcal{V}^{\pi}$ is the set of (time, state, cost)-triples feasibly-realizable under $\pi$ , and (ii) $\mathcal{E}^{\pi}$ is the set of all feasible one-step (time, state, cost)-evolutions under $\pi$ . We also label each edge by the action responsible for that evolution. Then, any $\pi$ -realizable feasible history $\tau_h$ corresponds to the labeled path $\mathcal{P} = ((1, s_1, \bar{c}_1), a_1, \ldots, (h, s_h, \bar{c}_h))$ in $\mathcal{R}^{\pi}$ . Thus, $\pi$ is feasible if and only if all sink nodes in $\mathcal{R}^{\pi}$ are distance $H$ from the source node $(1, s_1, 0)$ .
|
| 134 |
+
|
| 135 |
+
Algorithmic Approach. Overall, we can determine if $\Pi_G \neq \emptyset$ by proving the existence of a realizability graph whose sinks are all distance $H$ from the source. Furthermore, we can compute all feasibly realizable histories by computing the union of all feasible policy realizability graphs. We accomplish this by constructing a single graph containing all feasible realizability graphs and then pruning it to match the union.
|
| 136 |
+
|
| 137 |
+
Our graph is generated by iteratively taking feasible actions. If no sequence of feasible actions ever reaches time $H + 1$ , then naturally no feasible policy exists. However, we must also ensure all branches generated from an action reach time $H + 1$ to satisfy the anytime constraints. We deal with this difficulty by making each action an AND node. On the other hand, for a (time, state, cost)-triple to be feasible, there need only be a single action that ensures time $H + 1$ is reached. Thus, we make each triple an OR node. We will later show that a TRUE subgraph corresponds to our desired solution.
|
| 138 |
+
|
| 139 |
+
Definition 3.2 (Feasibility Tree). We iteratively define an AND/OR tree $\mathcal{T}$ (Martelli and Montanari, 1973). We define the root node to be $(1,s_1,0)$ . For any time $h\in [H]$ , and node $(h,s,\bar{c})\in \mathcal{V}_{\mathcal{T}}$ , we call $a\in \mathcal{A}$ a feasible action if no realization under $a$ leads to immediate violation, i.e. $\operatorname*{Pr}_{c\sim C_h(s,a)}[\bar{c} +c\leq B] = 1$ . For any feasible action $a$ , we create a new AND node $u\stackrel {\mathrm{def}}{=} (h,s,\bar{c},a)$ and edge $(h,s,\bar{c})\to (h,s,\bar{c},a)$ . For every $s\in \operatorname {Supp}(P_h(s,a))$ and $c\in \operatorname {Supp}(C_h(s,a))$ , we also create a new OR node $w\stackrel {\mathrm{def}}{=} (h + 1,s',\bar{c} +c)$ and edge $(h,s,\bar{c},a)\to (h + 1,s',\bar{c} +c)$ . We label any leaf node of the form $(H + 1,s,\bar{c})$ as TRUE and any leaf node of the form $(h,s,\bar{c})$ for $h < H + 1$ as FALSE.
|
| 140 |
+
|
| 141 |
+
Since any feasible policy can only take feasible actions by definition, any feasibly realizable history appears in (state, cost)-form as a path in $\mathcal{T}$ . Moreover, conditionally feasible histories appear as superpaths in $\mathcal{T}$ .
|
| 142 |
+
|
| 143 |
+
Algorithm 1 Feasibility
|
| 144 |
+
Require: $G$
|
| 145 |
+
1: $\mathcal{T}\gets \text{Definition 3.2} (G)$
|
| 146 |
+
2: AOSOLVE(T)
|
| 147 |
+
3: if $(1,s_1,0)$ is FALSE then
|
| 148 |
+
4: return "Infeasible"
|
| 149 |
+
5: end if
|
| 150 |
+
6: for $h\gets 1$ to $H$ do
|
| 151 |
+
7: $\mathcal{R}\mathcal{S}_h\gets \emptyset$ and $\mathcal{RA}_h(\cdot)\gets \emptyset$
|
| 152 |
+
8: for TRUE $(h,s,\bar{c})\in \mathcal{V}_{\mathcal{T}}$ do
|
| 153 |
+
9: $\mathcal{RS}_h\gets \mathcal{RS}_h\cup \{(s,\bar{c})\}$
|
| 154 |
+
10: for TRUE $(h,s,\bar{c},a)\in \mathcal{E}_{\mathcal{T}}^{+}(v)$ do
|
| 155 |
+
11: $\mathcal{RA}_h(s,\bar{c})\gets \mathcal{RA}_h(s,\bar{c})\cup \{a\}$
|
| 156 |
+
12: end for
|
| 157 |
+
13: end for
|
| 158 |
+
14: end for
|
| 159 |
+
15: return $(\{\mathcal{RS}_h\}_h,\{\mathcal{RA}_h(\bar{s})\}_{h,\bar{s}})$
|
| 160 |
+
|
| 161 |
+
Lemma 3.3. For any time $h \in [H + 1]$ , and any feasibly-realizable history $\tau_h \in \mathcal{F}_h$ , there exists a unique path $\mathcal{P}_{\tau_h} \subseteq \mathcal{T}$ satisfying $\mathcal{P}_{\tau_h} = ((1, s_1, \bar{c}_1), (1, s_1, \bar{c}_1, a_1), \ldots, (h, s_h, \bar{c}_h))$ . Moreover, if $\tau_k$ is any suphistory of $\tau_h$ realizable by some $\pi \in \Pi_G(\tau_h)$ , then $\mathcal{P}_{\tau_h} \subseteq \mathcal{P}_{\tau_k}$ .
|
| 162 |
+
|
| 163 |
+
Thus, if any feasible history exists, then there exists at least one length $H$ path in $\mathcal{T}$ . However, always taking actions that are feasible at the current time is a greedy strategy that may not guarantee reaching time $H + 1$ . Consequently, $\mathcal{T}$ contains many infeasible paths as well. On the bright side, we can show that any infeasible path must contain a FALSE node.
|
| 164 |
+
|
| 165 |
+
Lemma 3.4. If $\mathcal{P} = ((1, s_1, 0), (1, s_1, 0, a_1), \ldots, (h, s_h, \bar{c}_h)) \subseteq \mathcal{T}$ is any path ending at a FALSE node, then $\tau_h = (s_1, a_1, c_1, \ldots, s_h)$ is not realized by any feasible policy. Moreover, if $\tau_k$ is any feasible subhistory of $\tau_h$ , then $\tau_h$ is not realizable by any $\pi \in \Pi_G(\tau_k)$ .
|
| 166 |
+
|
| 167 |
+
Pruning. Overall, we see the subtree of TRUE nodes of $\mathcal{T}$ is exactly the union of all feasible policy realizability graphs. Computing the TRUE nodes for an AND/OR tree can be done in linear time using standard tree recursion (Martelli and Montanari, 1973). Suppose that AOSOLVE is any such AND/OR tree solver. Then, we can compute the $\mathcal{FS}$ and $\mathcal{FA}$ sets by implicitly pruning the FALSE nodes from $\mathcal{T}$ . The full procedure is described in Algorithm 1.
|
| 168 |
+
|
| 169 |
+
Proposition 3.5. For any acMG $G$ , Algorithm 1(G) outputs "Infeasible" if $\Pi_G^B = \emptyset$ and otherwise outputs $(\{\mathcal{FS}_h\}_h, \{\mathcal{FA}_h(\bar{s})\}_h, \bar{s})$ . Moreover, Algorithm 1(G) runs in time $O((HSAD_{G})^{2})$ , where $D_G \stackrel{\text{def}}{=} |\bigcup_h \bigcup_{\tau_h \in \mathcal{H}_h} \{\bar{c}_h \mid \bar{c}_h \leq B\}$ .
|
| 170 |
+
|
| 171 |
+
# 4. Reduction
|
| 172 |
+
|
| 173 |
+
As hinted in the previous section, we can convert the anytime constraint on full histories into a per-time constraint on the available actions. Specifically, if the agents track their cumulative costs, they can identify actions that satisfy the constraint long term. These actions exactly correspond to those in $\mathcal{F}\mathcal{A}_h(s,\bar{c})$ .
|
| 174 |
+
|
| 175 |
+
Then, the agents can convert their anytime-constrained MG $G$ into a traditional Markov game $\overline{G}$ with non-stationary state space $\mathcal{FS}_h$ and non-stationary, state-dependent action space $\mathcal{FA}_h(s,\bar{c})$ . Importantly, $\mathcal{FA}_h(s,\bar{c})$ may induce nonnormal-form subgames because the exclusion of infeasible joint actions can cause $\mathcal{FA}_h(s,\bar{c})$ not to take the form of a product space such as $\bar{A}_1\times \dots \times \bar{A}_n$ . Consequently, $\overline{G}$ is an action-constrained Markov game.
|
| 176 |
+
|
| 177 |
+
Definition 4.1. We define an action-constrained Markov game $\overline{G} \stackrel{\mathrm{def}}{=} (\bar{S}, \bar{A}, \bar{P}, \bar{R}, H)$ where,
|
| 178 |
+
|
| 179 |
+
1. $\bar{S}_h\stackrel {\mathrm{def}}{=}\mathcal{FS}_h$
|
| 180 |
+
2. $\bar{\mathcal{A}}_h(s,\bar{c})\stackrel {\mathrm{def}}{=}\mathcal{F}\mathcal{A}_h(s,\bar{c}),$
|
| 181 |
+
3. $\bar{P}_h((s',\bar{c} +c)\mid (s,\bar{c}),a)\stackrel {\mathrm{def}}{=}C_h(c\mid s,a)P_h(s'\mid s,a)$ and,
|
| 182 |
+
4. $\bar{R}_h((s,\bar{c}),a)\stackrel {\mathrm{def}}{=}R_h(s,a)$ whenever $a\in \bar{\mathcal{A}}_h(s,\bar{c})$ and $\bar{R}_h(-\infty \mid (s,\bar{c}),a) = 1$ otherwise.
|
| 183 |
+
|
| 184 |
+
In addition, we define $\overline{G}$ 's initial state to be $\bar{s}_1 \stackrel{\mathrm{def}}{=} (s_1, 0)$ .
|
| 185 |
+
|
| 186 |
+
For typical MGs, the standard solution concept is the Markov-perfect equilibrium. For action-constrained MGs, we use the same solution concept, but add the condition that the policy must only support actions in the constrained action sets.
|
| 187 |
+
|
| 188 |
+
Definition 4.2 (Markov-Perfect Equilibria). For an action-constrained MG $\overline{G}$ , we say a Markovian policy $\pi$ is all-subgame-feasible or simply feasible in this work if $\pi_h(\bar{s}) \in \Delta(\bar{\mathcal{A}}_h(\bar{s}))$ for all times $h \in [H]$ and all states $\bar{s} \in \bar{S}$ . We let $\Pi_{\overline{G}}$ denote the set of all feasible policies for $\overline{G}$ . Then, a Markov-perfect equilibrium (MPE) for $\bar{G}$ is a Markovian joint policy $\pi$ satisfying (1) $\pi \in \Pi_{\overline{G}}$ , and (2) for all players $i \in [n]$ , all times $h \in [H]$ , all partial histories $\bar{\tau}_h \in \bar{H}_h$ , and all potential deviation policies $\pi_i'$ , either,
|
| 189 |
+
|
| 190 |
+
$$
|
| 191 |
+
\left(\pi_ {i} ^ {\prime}, \pi_ {- i}\right) \notin \Pi_ {\overline {{G}}} \quad \text {O R} \quad \bar {V} _ {i, h} ^ {\pi} (\bar {s} _ {h}) \geq \bar {V} _ {i, h} ^ {\pi_ {i} ^ {\prime}, \pi_ {- i}} (\bar {\tau} _ {h}).
|
| 192 |
+
$$
|
| 193 |
+
|
| 194 |
+
Here, $\bar{V}_{i,h}^{\pi}(\bar{s})\stackrel {\mathrm{def}}{=}\mathbb{E}_{\overline{G}}^{\pi}\left[\sum_{t = h}^{H}r_{i,t}\mid \bar{s}_h = \bar{s}\right]$ denotes $i$ 's expected value in $\overline{G}$ under $\pi$ from time $h$ onward conditioned on starting at state $\bar{s}$ . Lastly, we call $\pi$ a Markov-perfect Nash equilibrium (MPNE) for $\overline{G}$ if $\pi$ is additionally a product policy.
|
| 195 |
+
|
| 196 |
+
Algorithm 2 Reduction
|
| 197 |
+
Require: $(G)$
|
| 198 |
+
1: $x\gets$ Algorithm 1(G)
|
| 199 |
+
2: if $x =$ "Infeasible" then
|
| 200 |
+
3: return "Infeasible"
|
| 201 |
+
4: end if
|
| 202 |
+
5: Construct $\overline{G}\gets$ Definition 4.1(G)
|
| 203 |
+
6: $\pi \leftarrow$ MGSOLVE( $\overline{G}$
|
| 204 |
+
7: return $\pi$
|
| 205 |
+
|
| 206 |
+
Augmented Policies. Any Markovian policy $\pi$ for $\overline{G}$ can be viewed as a history-dependent policy for $G$ represented in a compact form. In particular, by definition of $\bar{P}$ , we see that the $\bar{c}$ part of $\overline{G}$ 's state space always corresponds to the current cumulative cost vector. Thus, $\pi$ is equivalent to the history-dependent policy $\pi'$ formed by $\pi_h'(\tau_h) \stackrel{\mathrm{def}}{=} \pi_h(s_h, \bar{c}_h)$ , and can be used directly in $G$ just by feeding in the pair $(s_h, \bar{c}_h)$ to $\pi$ to generate the next joint action.
|
| 207 |
+
|
| 208 |
+
Moreover, if $\pi$ is feasible for $\overline{G}$ , we see that since $\bar{\mathcal{A}}_h(s,\bar{c}) = \mathcal{F}\mathcal{A}_h(s,\bar{c})$ by definition, it must be the case that $\pi$ is feasible for $G$ by Proposition 3.5. Although less obvious, we also show that any MPE for $\overline{G}$ is an ACE for $G$ .
|
| 209 |
+
|
| 210 |
+
Lemma 4.3 (Equilibria). Any MPE (NE/CE/CCE) for $\overline{G}$ is an ACSPE (NE/CE/CCE) for $G$ .
|
| 211 |
+
|
| 212 |
+
Then, we can compute an ACSPE for $G$ or determine that none exists by attempting to find an MPE for $\overline{G}$ . We summarize the full reduction in Algorithm 2.
|
| 213 |
+
|
| 214 |
+
Theorem 4.4 (Reduction). For any acMG $G$ , if MGSOLVE can compute a feasible MPE (NE/CE/CCE) for any feasible action-constrained Markov game, then Algorithm 2(G) correctly outputs "Infeasible" if $\Pi_G = \emptyset$ and outputs an ACSPE (NE/CE/CCE) $\pi$ , otherwise. Moreover, if MGSOLVE runs in time $O(\mathrm{poly}(|\overline{G}|))$ , then Algorithm 2(G) runs in time $O(\mathrm{poly}(|G|, D_G))$ , and any output policy can be stored with $O(HSAD_G)$ space.
|
| 215 |
+
|
| 216 |
+
# 5. Computation
|
| 217 |
+
|
| 218 |
+
In the last section, we showed how to reduce our anytime-constrained game problem to an action-constrained game problem. However, efficient algorithms for action-constrained games are currently unknown. In this section, we remedy this knowledge gap by designing efficient algorithms for computing MPE of an action-constrained MG. Moreover, we show that feeding our action-constrained method into our reduction yields a polynomial time algorithm for computing ACE so long as the cost precision is logarithmic.
|
| 219 |
+
|
| 220 |
+
We take a backward induction approach similar to other planning algorithms for Markov games. Unlike traditional
|
| 221 |
+
|
| 222 |
+
MGs, here, we must iteratively solve action-constrained matrix stage games. Then, we can combine the constructed policies for each stage to solve the full game. We prove the correctness of this algorithm by deriving a novel theory of equilibria in action-constrained Markov games.
|
| 223 |
+
|
| 224 |
+
Matrix Games. The key bottleneck to this backward induction approach is solving the action-constrained matrix games. Formally, let $(\mathcal{A}, X, u)$ denote an action-constrained matrix game, where (i) $\mathcal{A}$ is the joint action space, (ii) $X \subseteq \mathcal{A}$ is the set of feasible actions, and (iii) $u$ is the utility function. We tackle this problem by devising a variation of the standard CE/CCE LP. Importantly, we modify the constraint $\sum_{a \in \mathcal{A}} \sigma(a) = 1$ , which ensures the total probability mass of all joint actions equals one, into the constraint $\sum_{a \in X} \sigma(a) = 1$ , which ensures the support of the joint strategy is contained in the valid joint action space. We also define the utility of any infeasible action to be $-\infty$ so that infeasible deviations will be appropriately ignored by the LP. The full definition of the LP, which has no objective function, is,
|
| 225 |
+
|
| 226 |
+
$$
|
| 227 |
+
\sum_ {a \in X} \sigma (a) \left(u _ {i} (a) - u _ {i} \left(a _ {i} ^ {\prime}, a _ {- i}\right)\right) \geq 0, \quad \forall i, a _ {i} ^ {\prime} \in \mathcal {A} _ {i}
|
| 228 |
+
$$
|
| 229 |
+
|
| 230 |
+
$$
|
| 231 |
+
\sum_ {a \in X} \sigma (a) = 1,
|
| 232 |
+
$$
|
| 233 |
+
|
| 234 |
+
$$
|
| 235 |
+
\sigma (a) \geq 0 \quad \forall a \in X \tag {CLP}
|
| 236 |
+
$$
|
| 237 |
+
|
| 238 |
+
Lemma 5.1. If $(\mathcal{A}, X, u)$ is any action-constrained matrix game and $\sigma$ is any solution to (CLP)( $\mathcal{A}, X, u$ ), then for any player $i \in [n]$ , and deviation $\sigma_i' \in \Delta(\mathcal{A}_i)$ for which $\sigma' \stackrel{\text{def}}{=} (\sigma_i', \sigma_{-i}) \in \Delta(X)$ , we have that $\mathbb{E}_{a \sim \sigma}[u_i(a)] \geq \mathbb{E}_{a \sim \sigma'}[u_i(a)]$ . Moreover, if $X \neq \emptyset$ , then there exists a solution to (CLP)( $\mathcal{A}, X, u$ ).
|
| 239 |
+
|
| 240 |
+
Markov Games. To use (CLP) in our backward induction, it will be useful to represent stage games with the $Q$ matrix. Formally, for any given partial policy $\pi$ , any time $h \in [H]$ , and any state $\bar{s} \in \bar{S}$ , we define the stage game to be the matrix game $\bar{Q}_h(s)$ whose utility for any player $i \in [n]$ under joint action $\bar{a} \in \bar{A}$ is defined by,
|
| 241 |
+
|
| 242 |
+
$$
|
| 243 |
+
\bar {Q} _ {i, h} ^ {\pi} (\bar {s}, \bar {a}) \stackrel {\text {d e f}} {=} \left\{ \begin{array}{l l} r _ {h} (\bar {s}, \bar {a}) + \sum_ {\bar {s} ^ {\prime}} \bar {P} _ {h} \left(\bar {s} ^ {\prime} \mid \bar {s}, \bar {a}\right) \bar {V} _ {i, h + 1} ^ {\pi} \left(\bar {s} ^ {\prime}\right) \\ - \infty & \text {i f} \bar {a} \notin \bar {\mathcal {A}} _ {h} (\bar {s}) \end{array} . \right. \tag {Q}
|
| 244 |
+
$$
|
| 245 |
+
|
| 246 |
+
Then, given some LP feasibility algorithm LPSOLVE, we use these ideas to solve action-constrained MGs in Algorithm 3.
|
| 247 |
+
|
| 248 |
+
Theorem 5.2 (Constrained Solver). For any feasible action-constrained $MG\overline{G}$ , if LPSOLVE is a polynomial-time linear-program feasibility solver, then Algorithm 3( $\overline{G}$ ) correctly outputs a feasible MPE (CE/CCE) in polynomial time.
|
| 249 |
+
|
| 250 |
+
Algorithm 3 Constrained Solver
|
| 251 |
+
Require: $\overline{G}$
|
| 252 |
+
1: $V_{i,H + 1}^{\pi}(\bar{s})\gets 0$ for all $i\in [n]$ and $\bar{s}\in \bar{S}_{H + 1}$
|
| 253 |
+
2: for $h = H$ down to 1 do
|
| 254 |
+
3: for $\bar{s}\in \bar{S}_h$ do
|
| 255 |
+
4: $\bar{Q}_{i,h}^{\pi}(\bar{s},\bar{a})\gets (Q)$ for each $i\in [n]$ and $\bar{a}\in \bar{A}$
|
| 256 |
+
5: $\pi \gets \mathrm{LPSOLVE}((\mathrm{CLP})(\mathcal{A} = \bar{\mathcal{A}},X = \bar{\mathcal{A}}_h(\bar{s}),u =$ $\bar{Q}_h^\pi (\bar{s}))$
|
| 257 |
+
6: $V_{i,h}^{\pi}(\bar{s})\gets \sum_{\bar{a}}\pi_h(\bar{a}\mid \bar{s})Q_{i,h}^{\pi}(\bar{s},\bar{a})$
|
| 258 |
+
7: end for
|
| 259 |
+
8: end for
|
| 260 |
+
9: return $\pi$
|
| 261 |
+
|
| 262 |
+
Reduction Analysis. Given our efficient action-constrained game solver, we can now finish analyzing the running time of our reduction. Since Theorem 5.2 implies that Algorithm 3 runs in time $\mathrm{poly}(|\overline{G}|)$ , Theorem 4.4 implies that Algorithm 2 with MGSOLVE = Algorithm 3 runs in time $\mathrm{poly}(|G|, D_G)$ . The main issue is that $D_G$ can be exponentially large in the worst case. However, we can show that $D_G \leq \mathrm{poly}(|G|) 2^{O(dn)}$ , where $d$ denotes the cost precision, which is the number of significant bits needed to represent any supported cost. By definition, our method is FPT (Downey and Fellows, 2012) in the cost precision.
|
| 263 |
+
|
| 264 |
+
Theorem 5.3 (FPT). Equipped with any polynomial-time LP solver and MGSOLVE = Algorithm 3, Algorithm 2 is a fixed-parameter tractable algorithm for computing ACSPE (CE/CCE) in the cost-precision $d$ . Consequently, if $d = O(\log(|G|))$ while $n$ is held constant or $d = O(1)$ while $n$ is arbitrary, then Algorithm 2 runs in polynomial time and any output policy can be stored in polynomial space.
|
| 265 |
+
|
| 266 |
+
Remark 5.4 (Learning). Our methods immediately apply to the learning setting through model-based approaches. Moreover, any new learning algorithm for action-constrained MGs can immediately solve $\overline{G}$ and thus compute ACE for $G$ .
|
| 267 |
+
|
| 268 |
+
# 6. Approximation
|
| 269 |
+
|
| 270 |
+
In the previous section, we showed our method runs in polynomial time whenever the cost precision is small. However, in cases where the cost precision is large or, even worse infinite, the computation may require exponential time due to the NP-hard nature of finding a feasible solution, Proposition 2.7. To combat this issue, we slightly relax the feasibility condition. This allows us to compute equilibrium policies that only violate the budget by a given $\epsilon > 0$ at the cost of an additional poly $(1 / \epsilon)$ factor in running time.
|
| 271 |
+
|
| 272 |
+
In this section, we allow any infinite support cost distributions that are bounded above. We also require that distribution is a product distribution to enable comparisons
|
| 273 |
+
|
| 274 |
+
between supported costs. Technically, we also need the CDF of the distribution to be efficiently computable for use in computation.
|
| 275 |
+
|
| 276 |
+
Assumption 6.1 (Bounded). We assume that each $c^{max} \stackrel{\mathrm{def}}{=} \sup_{h,s,a} \sup \operatorname{Supp}(C_h(s,a)) < \infty$ , and that each $C_h(s,a) = \{C_{i,h}(s,a)\}_{i}$ is a product distribution.
|
| 277 |
+
|
| 278 |
+
Moreover, if $Hc_{i}^{max} \leq B$ , observe that every policy is feasible for player $i$ , which just leads to a standard unconstrained problem for that player. A similar phenomenon happens if $c_{i}^{max} \leq 0$ . Thus, we assume WLOG that $Hc^{max} > B$ and $c^{max} > 0$ . We can then define our relaxed feasibility notions as follows.
|
| 279 |
+
|
| 280 |
+
Definition 6.2 (Approximate Feasibility). For any $\epsilon >0$ , a joint policy $\pi$ is $\epsilon$ -additive feasible for $G$ if,
|
| 281 |
+
|
| 282 |
+
$$
|
| 283 |
+
\mathbb {P} _ {G} ^ {\pi} \left[ \forall h \in [ H ], \sum_ {t = 1} ^ {h} c _ {t} \leq B + \epsilon \right] = 1, \tag {3}
|
| 284 |
+
$$
|
| 285 |
+
|
| 286 |
+
and $\epsilon$ -relative feasible for $G$ if,
|
| 287 |
+
|
| 288 |
+
$$
|
| 289 |
+
\mathbb {P} _ {G} ^ {\pi} \left[ \forall h \in [ H ], \sum_ {t = 1} ^ {h} c _ {t} \leq B (1 + \epsilon \sigma_ {B}) \right] = 1, \tag {4}
|
| 290 |
+
$$
|
| 291 |
+
|
| 292 |
+
where $\sigma_B$ is the sign of $B^1$ . We then define an $\epsilon$ -additive/relative approximate ACE to satisfy the usual conditions of Definition 2.2 but with the feasibility condition (1) relaxed to an $\epsilon$ -additive/relative feasibility condition.
|
| 293 |
+
|
| 294 |
+
Rounding. The key idea of our approximations is to have players round down any cost vector they receive to the nearest multiple of some $\ell > 0$ . Doing so allows the players to track far fewer cumulative costs than originally. In addition, we can effectively truncate the lower regime of the distribution using the fact that if player $i$ ever receives an immediate cost smaller than $B_i - Hc_i^{max}$ , then it may take any action whatsoever going forward without violating its budget. Thus, the player can treat any smaller cost as if it were $B_i - Hc_i^{max}$ . This process of rounding costs then induces a new cMG with finite support cost distributions.
|
| 295 |
+
|
| 296 |
+
Definition 6.3 (Approximate Game). For any $\ell >0$ , we define $\lfloor c\rfloor_{\ell}\stackrel {\mathrm{def}}{=}\lfloor \frac{c}{\ell}\rfloor \ell$ to be the largest multiple of $\ell$ that lower bounds $c$ . For any player $i\in [n]$ , let $\hat{c}_{i,1}\leq \dots \leq \hat{c}_{i,m}$ denote the elements of the finite set of player $i$ 's rounded costs $\{\lfloor c_i\rfloor_\ell \mid c_i\in [B_i - Hc_i^{max},c_i^{max}]\}$ in order, and let $\hat{c}_{i,0}\stackrel {\mathrm{def}}{=} - \infty$ . We discretize the potentially infinite support distribution $C_{i,h}(s,a)$ into a finite support distribution $\hat{C}_{i,h}(s,a)$ by defining for each $k\in [m]$ ,
|
| 297 |
+
|
| 298 |
+
$$
|
| 299 |
+
\hat {C} _ {i, h} \left(\hat {c} _ {i, k} \mid s, a\right) \stackrel {\text {d e f}} {=} \Pr_ {c \sim C _ {i, h} (s, a)} [ c \in \left[ \hat {c} _ {i, k - 1}, \hat {c} _ {i, k} \right] ]. \tag {5}
|
| 300 |
+
$$
|
| 301 |
+
|
| 302 |
+
# Algorithm 4 Approximation
|
| 303 |
+
|
| 304 |
+
Require: $(G)$
|
| 305 |
+
|
| 306 |
+
1: Construct $\hat{G} \gets \text{Definition 6.3}(G)$
|
| 307 |
+
2: Let MGSOLVE = Algorithm 3
|
| 308 |
+
3: return Algorithm 2( $\tilde{G}$ )
|
| 309 |
+
|
| 310 |
+
We then define the approximate acMG $\hat{G} \stackrel{\mathrm{def}}{=} (\mathcal{S}, \mathcal{A}, P, R, \hat{C}, H)$ to be our original game $G$ but with a different cost distribution.
|
| 311 |
+
|
| 312 |
+
Since outside of extreme cases, we always round costs down, the players always maintain an underestimate of their true cumulative cost. Consequently, the players may be incurring more costs than expected. However, we can show that the true cost accumulated is not much larger than the surrogate cost.
|
| 313 |
+
|
| 314 |
+
Lemma 6.4. Any feasible policy for $\hat{G}$ is an $H\ell$ -additive feasible policy for $G$ .
|
| 315 |
+
|
| 316 |
+
On the flip side, the fact that players are willing to spend more than before means they have more actions available to them at each stage. Consequently, they can always find strategies that achieve the same value or even higher than any truly feasible policy for the game. It is then easy to see that solutions to $\hat{G}$ satisfy condition (2) in Definition 2.2, so form approximate ACE for $G$ .
|
| 317 |
+
|
| 318 |
+
Lemma 6.5. Any ACSPE (NE/CE/CCE) for $\hat{G}$ are $H\ell$ -additive approximate ACSPE (NE/CE/CCE) for $G$ . Moreover, if $\Pi_G \neq \emptyset$ then $\Pi_{\hat{G}} \neq \emptyset$ .
|
| 319 |
+
|
| 320 |
+
Consequently, we can compute approximate equilibria for $G$ by solving $\hat{G}$ . The full algorithm is described in Algorithm 4. Since every approximate cost is an integer multiple of $\ell$ , every approximate cumulative cost will also be an integer multiple of $\ell$ . In fact, for each $i \in [n]$ , every approximate cumulative cost's multiple must reside in the set $\left\{H\left\lfloor \frac{B_i - Hc_i^{max}}{\ell}\right\rfloor, \ldots, H\left\lfloor \frac{c_i^{max}}{\ell}\right\rfloor\right\}$ . Depending on the choice of $\ell$ , the players may need to track far fewer cumulative costs to behave optimally.
|
| 321 |
+
|
| 322 |
+
Theorem 6.6 (Approximation). For any acMG $G$ and $\ell >0$ , Algorithm 4(G) correctly outputs "Infeasible" if no $H\ell$ -additive feasible policies for $G$ exist and outputs an $H\ell$ -additive approximate ACSPE (CE/CCE) $\pi$ , otherwise. Moreover, Algorithm 4 runs in time $O(\mathrm{poly}(|G|,\frac{\|c^{max} - B\|_{\infty}^n}{\ell^n}))$ .
|
| 323 |
+
|
| 324 |
+
Corollary 6.7 (Additive). For any $\epsilon >0$ , if we define $\ell \stackrel{\text{def}}{=} \epsilon / H$ , then Algorithm 4 correctly outputs "Infeasible" or an $\epsilon$ -additive approximate ACSPE (CE/CCE) for any acMG. Moreover, if $\|c^{max} - B\|_{\infty} \leq \mathrm{poly}(|G|)$ , Algorithm 4 runs in time $O(\mathrm{poly}(|G|, \frac{1}{\epsilon^n}))$ .
|
| 325 |
+
|
| 326 |
+
Corollary 6.8 (Relative). For any $\epsilon >0$ , if we define $\ell \stackrel{\text{def}}{=} \epsilon |B| / H$ , then Algorithm 4 correctly outputs "Infeasible" or
|
| 327 |
+
|
| 328 |
+
an $\epsilon$ -relative approximate ACSPE (CE/CCE) for any acMG. Moreover, if $c^{max} \leq \mathrm{poly}(|G|)|B|$ , Algorithm 4 runs in time $O(\mathrm{poly}(|G|, \frac{1}{\epsilon^n}))$ .
|
| 329 |
+
|
| 330 |
+
Remark 6.9 (Cost Bound). We can efficiently compute approximately feasible solutions so long as $c^{max} \leq \mathrm{poly}(|G|) |B|$ . This condition is very natural. When the supported costs all have the same sign, any feasible policy induces costs with $c^{max} \leq |B|$ anyway. Importantly, this restriction is not an artifact of our approach; some bound on $c^{max}$ is necessary for efficient computation as proved in (McMahan and Zhu, 2024).
|
| 331 |
+
|
| 332 |
+
# 7. Conclusion
|
| 333 |
+
|
| 334 |
+
In this work, we introduced anytime-constraints for Markov games and studied the corresponding solution concept of anytime-constrained equilibria. Although finding a feasible policy is NP-hard for simple games, we showed efficient computation is possible so long as the cost precision is constant. The main ingredients to our approach were a graph algorithm to derive all feasibly realizable histories and an efficient algorithm for solving action-constrained MGs. Lastly, we presented approximation algorithms for computing approximately feasible anytime-constrained equilibria running in polynomial time so long as the cost distribution's supremum is no larger than a polynomial factor of the budget. Given the hardness results, our approximation guarantees are best possible under worst-case analysis.
|
| 335 |
+
|
| 336 |
+
# Impact Statement
|
| 337 |
+
|
| 338 |
+
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none which we feel must be specifically highlighted here.
|
| 339 |
+
|
| 340 |
+
# References
|
| 341 |
+
|
| 342 |
+
E. Altman. Constrained Markov Decision Processes. Chapman and Hall/CRC, 1999. doi: 10.1201/9781315140223.
|
| 343 |
+
E. Altman and A. Shwartz. Constrained markov games: Nash equilibria. In J. A. Filar, V. Gaitsgory, and K. Mizukami, editors, Advances in Dynamic Games and Applications, pages 213-221, Boston, MA, 2000. Birkhäuser Boston. ISBN 978-1-4612-1336-9.
|
| 344 |
+
Q. Bai, A. Singh Bedi, and V. Aggarwal. Achieving zero constraint violation for constrained reinforcement learning via conservative natural policy gradient primal-dual algorithm. Proceedings of the AAAI Conference on Artificial Intelligence, 37(6):6737-6744, 6 2023. doi: 10.1609/aaai.v37i6.25826. URL https://ojs.aaai.org/index.php/AAAI/article/view/25826.
|
| 345 |
+
|
| 346 |
+
A. Bhatia, P. Varakantham, and A. Kumar. Resource constrained deep reinforcement learning. Proceedings of the International Conference on Automated Planning and Scheduling, 29(1):610-620, 5 2021. doi: 10.1609/icaps.v29i1.3528. URL https://ojs.aaaai.org/index.php/ICAPS/article/view/3528.
|
| 347 |
+
V. Borkar. An actor-critic algorithm for constrained markov decision processes. Systems & Control Letters, 54(3):207-213, 2005. ISSN 0167-6911. doi: https://doi.org/10.1016/j.sysconle.2004.08.007. URL https://www.sciencedirect.com/science/article/pii/S0167691104001276.
|
| 348 |
+
D. M. Bossens and N. Bishop. Explicit explore, exploit, or escape (e4): Near-optimal safety-constrained reinforcement learning in polynomial time. Mach. Learn., 112 (3):817-858, 6 2022. ISSN 0885-6125. doi: 10.1007/s10994-022-06201-z. URL https://doi.org/10.1007/s10994-022-06201-z.
|
| 349 |
+
K. Brantley, M. Dudík, T. Lykouris, S. Miry-oosefi, M. Simchowitz, A. Slivkins, and W. Sun. Constrained episodic reinforcement learning in concave-convex and knapsack settings. In NeurIPS, 2020. URL https://proceedings.neurips.cc/paper/2020/bash/bc6d753857fe3dd4275cff707dedf329-Abstract.html. D
|
| 350 |
+
A. Castellano, H. Min, E. Mallada, and J. A. Bazerque. Reinforcement learning with almost sure constraints. In R. Firoozzi, N. Mehr, E. Yel, R. Antonova, J. Bohg, M. Schwager, and M. Kochenderfer, editors, Proceedings of The 4th Annual Learning for Dynamics and Control Conference, volume 168 of Proceedings of Machine Learning Research, pages 559-570. PMLR, 6 2022. URL https://proceedings.mlr.press/v168/castellano22a.html.
|
| 351 |
+
Z. Chen, S. Ma, and Y. Zhou. Finding correlated equilibrium of constrained markov game: A primal-dual approach. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, editors, Advances in Neural Information Processing Systems, volume 35, pages 25560-25572. Curran Associates, Inc., 2022. URL https://proceedings.neurips.cc/paper_files/paper/2022/file/a3f8f584bebcc88ed8cdeb30b096db34-Paper.pdf.
|
| 352 |
+
W. C. Cheung. Regret minimization for reinforcement learning with vectorial feedback and complex objectives. In Advances in Neural Information Processing Systems, volume 32, 2019. URL https://proceedings.neurips.cc/paper/2019/file/
|
| 353 |
+
|
| 354 |
+
a02ffd91ece5e7efeb46db8f10a74059-Paper. pdf.
|
| 355 |
+
Y. Chow, O. Nachum, E. Duenez-Guzman, and M. Ghavamzadeh. A lyapunov-based approach to safe reinforcement learning. In S. Bengio, H. Wallach, H. Larochelle, K. Grauman, N. Cesa-Bianchi, and R. Garnett, editors, Advances in Neural Information Processing Systems, volume 31. Curran Associates, Inc., 2018. URL https://proceedings.neurips.cc/paper_files/paper/2018/file/4fe5149039b52765bde64beb9f674940-Paper.pdf.
|
| 356 |
+
T. Chu, J. Wang, L. Codecà, and Z. Li. Multi-agent deep reinforcement learning for large-scale traffic signal control. IEEE Transactions on Intelligent Transportation Systems, 21(3):1086-1095, 2020. doi: 10.1109/TITS.2019.2901791.
|
| 357 |
+
A. Coronato, M. Naeem, G. De Pietro, and G. Paragliola. Reinforcement learning for intelligent healthcare applications: A survey. Artificial Intelligence in Medicine, 109:101964, 2020. ISSN 0933-3657. doi: https://doi.org/10.1016/j.artmed.2020.101964. URL https://www.sciencedirect.com/science/article/pii/S093336572031229X.
|
| 358 |
+
D. Ding, X. Wei, Z. Yang, Z. Wang, and M. Jovanovic. Provably efficient generalized lagrangian policy optimization for safe multi-agent reinforcement learning. In N. Matni, M. Morari, and G. J. Pappas, editors, Proceedings of The 5th Annual Learning for Dynamics and Control Conference, volume 211 of Proceedings of Machine Learning Research, pages 315-332. PMLR, 15-16 Jun 2023. URL https://proceedings.mlr.press/v211/ding23a.html.
|
| 359 |
+
J. Dinneweth, A. Boubezoul, R. Mandiau, and S. Espie. Multi-agent reinforcement learning for autonomous vehicles: a survey. Autonomous Intelligent Systems, 2(1):27, 2022. doi: 10.1007/s43684-022-00045-z. URL https://doi.org/10.1007/s43684-022-00045-z.
|
| 360 |
+
R. Downey and M. Fellows. Parameterized Complexity. Monographs in Computer Science. Springer New York, 2012. ISBN 9781461205159. URL https://books.google.com/books?id=HyTjBwAAQBAJ. conference.
|
| 361 |
+
I. Elsayed-Aly, S. Bharadwaj, C. Amato, R. Ehlers, U. Topcu, and L. Feng. Safe multi-agent reinforcement learning via shielding, 2021. URL https://arxiv.org/abs/2101.11196.
|
| 362 |
+
C. Fan, C. Zhang, A. Yahja, and A. Mostafavi. Disaster city digital twin: A vision for integrating
|
| 363 |
+
|
| 364 |
+
artificial and human intelligence for disaster management. International Journal of Information Management, 56:102049, 2021. ISSN 0268-4012. doi: https://doi.org/10.1016/j.ijinfomgt.2019.102049. URL https://www.sciencedirect.com/science/article/pii/S0268401219302956.
|
| 365 |
+
J. García, Fern, and o Fernández. A comprehensive survey on safe reinforcement learning. Journal of Machine Learning Research, 16(42):1437-1480, 2015. URL http://jmlr.org/papers/v16/garcia15a.html.
|
| 366 |
+
A. Gattami, Q. Bai, and V. Aggarwal. Reinforcement learning for constrained markov decision processes. In A. Banerjee and K. Fukumizu, editors, Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 2656-2664. PMLR, 13-15 Apr 2021. URL https://proceedings.mlrpress/v130/gattami21a.html.
|
| 367 |
+
S. Gu, J. Grudzien Kuba, Y. Chen, Y. Du, L. Yang, A. Knoll, and Y. Yang. Safe multi-agent reinforcement learning for multi-robot control. Artificial Intelligence, 319:103905, 2023a. ISSN 0004-3702. doi: https://doi.org/10.1016/j.artint.2023.103905. URL https://www.sciencedirect.com/science/article/pii/S0004370223000516.
|
| 368 |
+
S. Gu, L. Yang, Y. Du, G. Chen, F. Walter, J. Wang, Y. Yang, and A. Knoll. A review of safe reinforcement learning: Methods, theory and applications, 2023b.
|
| 369 |
+
A. HasanzadeZonuzy, A. Bura, D. Kalathil, and S. Shakkottai. Learning with safety constraints: Sample complexity of reinforcement learning for constrained mdps. Proceedings of the AAAI Conference on Artificial Intelligence, 35(9):7667-7674, 5 2021. doi: 10.1609/aaai.v35i9.16937. URL https://ojs(aaai.org/index.php/AAAI/article/view/16937.
|
| 370 |
+
P. Jordan, A. Barakat, and N. He. Independent learning in constrained Markov potential games. In S. Dasgupta, S. Mandt, and Y. Li, editors, Proceedings of The 27th International Conference on Artificial Intelligence and Statistics, volume 238 of Proceedings of Machine Learning Research, pages 4024-4032. PMLR, 02-04 May 2024. URL https://proceedings.mlr.press/v238/jordan24a.html.
|
| 371 |
+
P. Kolesar. A markovian model for hospital admission scheduling. Management Science, 16(6):B384-B396, 1970. ISSN 00251909, 15265501. URL http://www.jstor.org/stable/2628725.
|
| 372 |
+
|
| 373 |
+
R. Li, Z. Zhao, Q. Sun, C.-L. I, C. Yang, X. Chen, M. Zhao, and H. Zhang. Deep reinforcement learning for resource management in network slicing. IEEE Access, 6:74429-74441, 2018. doi: 10.1109/ACCESS.2018.2881964.
|
| 374 |
+
H. Mao, M. Alizadeh, I. Menache, and S. Kandula. Resource management with deep reinforcement learning. In Proceedings of the 15th ACM Workshop on Hot Topics in Networks, HotNets '16, page 50-56, New York, NY, USA, 2016. Association for Computing Machinery. ISBN 9781450346610. doi: 10.1145/3005745.3005750. URL https://doi.org/10.1145/3005745.3005750.
|
| 375 |
+
A. Martelli and U. Montanari. Additive and/or graphs. In Proceedings of the 3rd International Joint Conference on Artificial Intelligence, IJCAI'73, page 1-11, San Francisco, CA, USA, 1973. Morgan Kaufmann Publishers Inc.
|
| 376 |
+
J. McMahan. Deterministic policies for constrained reinforcement learning in polynomial-time, 2024. URL https://arxiv.org/abs/2405.14183.
|
| 377 |
+
J. McMahan and X. Zhu. Anytime-constrained reinforcement learning. In S. Dasgupta, S. Mandt, and Y. Li, editors, Proceedings of The 27th International Conference on Artificial Intelligence and Statistics, volume 238 of Proceedings of Machine Learning Research, pages 4321-4329. PMLR, 02-04 May 2024. URL https://proceedings.mlr.press/v238/mcmahan24a.html.
|
| 378 |
+
G. Paragliola, A. Coronato, M. Naeem, and G. De Pietro. A reinforcement learning-based approach for the risk management of e-health environments: A case study. In 2018 14th International Conference on Signal-Image Technology & Internet-Based Systems (SITIS), pages 711-716, 2018. doi: 10.1109/SITIS.2018.00114.
|
| 379 |
+
S. Paternain, L. Chamon, M. Calvo-Fullana, and A. Ribeiro. Constrained reinforcement learning has zero duality gap. In Advances in Neural Information Processing Systems, volume 32, 2019. URL https://proceedings.neurips.cc/paper_files/paper/2019/file/claeb6517a1c7f33514f7ff69047e74e-Paper.pdf.
|
| 380 |
+
H. Peng and X. Shen. Multi-agent reinforcement learning based resource management in mec- and uav-assisted vehicular networks. IEEE Journal on Selected Areas in Communications, 39(1):131-141, 2021. doi: 10.1109/JSAC.2020.3036962.
|
| 381 |
+
M. L. Puterman. Markov Decision Processes: Discrete Stochastic Dynamic Programming. John Wiley & Sons, Inc., USA, 1st edition, 1994. ISBN 0471619779.
|
| 382 |
+
|
| 383 |
+
M. Roderick, V. Nagarajan, and Z. Kolter. Provably safe pac-mdp exploration using analogies. In A. Banerjee and K. Fukumizu, editors, Proceedings of The 24th International Conference on Artificial Intelligence and Statistics, volume 130 of Proceedings of Machine Learning Research, pages 1216-1224. PMLR, 4 2021. URL https://proceedings.mlr.press/v130/roderick21a.html.
|
| 384 |
+
S. Shalev-Shwartz, S. Shammah, and A. Shashua. Safe, multi-agent, reinforcement learning for autonomous driving, 2016. URL https://arxiv.org/abs/1610.03295.
|
| 385 |
+
G. Thomas, Y. Luo, and T. Ma. Safe reinforcement learning by imagining the near future. In M. Ranzato, A. Beygelzimer, Y. Dauphin, P. Liang, and J. W. Vaughan, editors, Advances in Neural Information Processing Systems, volume 34, pages 13859-13869. Curran Associates, Inc., 2021. URL https://proceedings.neurips.cc/paper_files/paper/2021/file/73b277c11266681122132d024f53a75b-Paper.pdf.
|
| 386 |
+
Y. L. Tsai, A. Phatak, P. K. Kitanidis, and C. B. Field. Deep Reinforcement Learning for Disaster Response: Navigating the Dynamic Emergency Vehicle and Rescue Team Dispatch during a Flood. In AGU Fall Meeting Abstracts, volume 2019, pages NH33B-14, Dec. 2019.
|
| 387 |
+
S. Vaswani, L. Yang, and C. Szepesvari. Near-optimal sample complexity bounds for constrained mdps. In S. Koyejo, S. Mohamed, A. Agarwal, D. Belgrave, K. Cho, and A. Oh, editors, Advances in Neural Information Processing Systems, volume 35, pages 3110-3122. Curran Associates, Inc., 2022. URL https://proceedings.neurips.cc/paper_files/paper/2022/file/14a5ebc9cd2e507cd811df78c15bf5d7-Paper-Conference.pdf.
|
| 388 |
+
Y. Wang, S. S. Zhan, R. Jiao, Z. Wang, W. Jin, Z. Yang, Z. Wang, C. Huang, and Q. Zhu. Enforcing hard constraints with soft barriers: Safe reinforcement learning in unknown stochastic environments. In A. Krause, E. Brunskill, K. Cho, B. Engelhardt, S. Sabato, and J. Scarlett, editors, Proceedings of the 40th International Conference on Machine Learning, volume 202 of Proceedings of Machine Learning Research, pages 36593-36604. PMLR, 7 2023. URL https://proceedings.mlr.press/v202/wang23as.html.
|
| 389 |
+
H. Wei, X. Liu, and L. Ying. Triple-q: A model-free algorithm for constrained reinforcement learning with sublinear regret and zero constraint violation. In G. Camps-Valls, F. J. R. Ruiz, and I. Valera, editors, Proceedings
|
| 390 |
+
|
| 391 |
+
of The 25th International Conference on Artificial Intelligence and Statistics, volume 151 of Proceedings of Machine Learning Research, pages 3274-3307. PMLR, 3 2022. URL https://proceedings.mlr.press/v151/wei22a.html.
|
| 392 |
+
M. Wiering. Multi-agent reinforcement leraning for traffic light control. In Proceedings of the Seventeenth International Conference on Machine Learning, ICML '00, page 1151-1158, San Francisco, CA, USA, 2000. Morgan Kaufmann Publishers Inc. ISBN 1558607072.
|
| 393 |
+
C. Wu, B. Ju, Y. Wu, X. Lin, N. Xiong, G. Xu, H. Li, and X. Liang. Uav autonomous target search based on deep reinforcement learning in complex disaster scene. IEEE Access, 7:117227-117245, 2019. doi: 10.1109/ACCESS.2019.2933002.
|
| 394 |
+
W. Zhao, T. He, R. Chen, T. Wei, and C. Liu. State-wise safe reinforcement learning: a survey. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, IJCAI '23, 2023. ISBN 978-1-956792-03-4. doi: 10.24963/ijcai.2023/763. URL https://doi.org/10.24963/ijcai.2023/763.
|
| 395 |
+
|
| 396 |
+
# A. Proofs for Section 2
|
| 397 |
+
|
| 398 |
+
# A.1. Proof of Proposition 2.6
|
| 399 |
+
|
| 400 |
+
Proof. If $\Pi_G = \emptyset$ , then by definition no ACE or ACSPE can exist since they must be feasible. On the other hand, if $\Pi_G \neq \emptyset$ , then Algorithm 2 yields an ACSPE as shown by Proposition 3.5. Thus, an ACSPE exists and so an ACE also exists.
|
| 401 |
+
|
| 402 |
+
# A.2. Proof of Proposition 2.7
|
| 403 |
+
|
| 404 |
+
Proof. The proof of Theorem 2 in (McMahan and Zhu, 2024) shows computing a feasible anytime-constrained policy is NP-hard for 2 constraints. Since this fact is independent of the reward structures, the result applies to two-player zero-sum cMGs by treating one player as a dummy with no influence on the transitions. $\square$
|
| 405 |
+
|
| 406 |
+
# B. Proofs for Section 3
|
| 407 |
+
|
| 408 |
+
We introduce a few helpful observations here.
|
| 409 |
+
|
| 410 |
+
Observation 1 (Decomposability). For any policy $\pi$ , time $h \in [H]$ and $\pi$ -realizable partial history $\tau_{h+1} \in \mathcal{H}_{h+1}^{\pi}$ , we have that $\tau_{h+1} = (\tau_h, a_h, c_h, s_{h+1})$ where,
|
| 411 |
+
|
| 412 |
+
1. $a_{h}\in \operatorname {Supp}(\pi_{h}(\tau_{h}))$
|
| 413 |
+
2. $c_{h}\in \operatorname {Supp}(C_{h}(s_{h},a_{h}))$
|
| 414 |
+
3. $s_{h + 1}\in \operatorname {Supp}(P_h(s_h,a_h))$ , and
|
| 415 |
+
4. $\mathbb{P}^{\pi}[\tau_h] > 0$
|
| 416 |
+
|
| 417 |
+
Proof. By the Markov property (Equation (2.1.11) from (Puterman, 1994)), we can decompose $\tau_{h + 1} = (\tau_h,a_h,c_h,s_{h + 1})$ so that,
|
| 418 |
+
|
| 419 |
+
$$
|
| 420 |
+
\mathbb {P} ^ {\pi} \left[ \tau_ {h + 1} \right] = \mathbb {P} ^ {\pi} \left[ \tau_ {h} \right] \pi_ {h} \left(a _ {h} \mid \tau_ {h}\right) C _ {h} \left(c _ {h} \mid s _ {h}, a _ {h}\right) P _ {h} \left(s _ {h + 1} \mid s _ {h}, a _ {h}\right). \tag {6}
|
| 421 |
+
$$
|
| 422 |
+
|
| 423 |
+
Since $\mathbb{P}^{\pi}[\tau_{h + 1}] > 0$ by assumption, it must be the case that each quantity on the RHS is also positive. In particular, we see that (i) $a_{h}\in \operatorname {Supp}(\pi_{h}(\tau_{h}))$ , (ii) $c_{h}\in \operatorname {Supp}(C_{h}(s_{h},a_{h}))$ , (iii) $s_{h + 1}\in \operatorname {Supp}(P_h(s_h,a_h))$ , and (iv) $\mathbb{P}^{\pi}[\tau_h] > 0$ .
|
| 424 |
+
|
| 425 |
+
Observation 2. For any feasible policy $\pi \in \Pi_G$ , time $h \in [H]$ , and $\pi$ -realizable history $\tau_h \in \mathcal{H}_h^\pi$ , it must be that $\operatorname{Supp}(\pi_h(\tau_h)) \subseteq \{a \in \mathcal{A} \mid \operatorname*{Pr}_{c \sim C_h(s, a)}[\bar{c}_h + c \leq B] = 1\}$ . The same claim holds for the set $\Pi_G(\tau_h)$ as well.
|
| 426 |
+
|
| 427 |
+
Proof. Fix any such $\pi, h$ , and $\tau_h$ . Let $s \stackrel{\mathrm{def}}{=} s_h$ and $\bar{c} \stackrel{\mathrm{def}}{=} \bar{c}_h$ . Suppose for the sake of contradiction that there exists some $a \in \operatorname{Supp}(\pi_h(\tau_h))$ satisfying $\operatorname*{Pr}_{c \sim C_h(s,a)}[\bar{c} + c > B] > 0$ . Then, we would have that,
|
| 428 |
+
|
| 429 |
+
$$
|
| 430 |
+
\begin{array}{l} \mathbb {P} ^ {\pi} [ \exists k \in [ H ], \sum_ {t = 1} ^ {k} c _ {t} > B ] \geq \mathbb {P} ^ {\pi} [ \sum_ {t = 1} ^ {h} c _ {t} > B ] \\ \geq \mathbb {P} ^ {\pi} [ \sum_ {t = 1} ^ {h} c _ {t} > B \mid \tau_ {h} ] \mathbb {P} ^ {\pi} [ \tau_ {h} ] \\ = \mathbb {P} ^ {\pi} [ \bar {c} + c _ {h} > B \mid \tau_ {h} ] \mathbb {P} ^ {\pi} [ \tau_ {h} ] \\ \geq \mathbb {P} ^ {\pi} [ \tau_ {h} ] \pi_ {h} (a \mid \tau_ {h}) \Pr_ {c \sim C _ {h} (s, a)} [ \bar {c} + c > B ] \\ > 0. \\ \end{array}
|
| 431 |
+
$$
|
| 432 |
+
|
| 433 |
+
The penultimate line used the Markov property, and the final line used the fact that each quantity occurs with non-zero probability by assumption. Thus, we see the existence of such an action leads to contradiction.
|
| 434 |
+
|
| 435 |
+
# B.1. Proof of Lemma 3.3
|
| 436 |
+
|
| 437 |
+
Proof. For the first claim, we proceed by induction on $h$ .
|
| 438 |
+
|
| 439 |
+
Base Case. For the base case, we consider $h = 1$ . In this case, the only realizable history is $\tau_{1} = (s_{1})$ with $\bar{c}_{1} = 0$ . By definition, we have $(1, s_{1}, 0)$ is the source node. Thus, the claim holds.
|
| 440 |
+
|
| 441 |
+
Inductive Step. For the inductive step, we consider any $h \geq 1$ . Since $\tau_{h+1} \in \mathcal{F}_{h+1}$ by assumption, there must exist some $\pi \in \Pi_G$ that realizes $\tau_{h+1}$ . Then, Observation 1 implies we can decompose $\tau_{h+1}$ into $\tau_{h+1} = (\tau_h, a_h, c_h, s_{h+1})$ satisfying conditions (i)-(iv). Since $\tau_h$ is $\pi$ -realizable according to (iv), the induction hypothesis implies $\mathcal{P}_{\tau_h} = ((1, s_1, 0), (1, s_1, 0, a_1), \ldots, (h, s_h, \bar{c}_h))$ is a path in $\mathcal{T}$ . Also, Observation 2 implies that $a_h$ satisfies $\operatorname*{Pr}_{c \sim C_h(s_h, a_h)}[\bar{c}_h + c \leq B] = 1$ , so $a_h$ is a feasible action for $(h, s_h, \bar{c}_h)$ . By definition of $\mathcal{T}$ , we then know that $(h, s_h, \bar{c}_h, a_h)$ is a node in $\mathcal{T}$ that is adjacent to $(h, s_h, \bar{c}_h)$ . Similarly, by (ii) and (iii), we then know that $(h+1, s_{h+1}, \bar{c}_{h+1})$ is a node in $\mathcal{T}$ and is adjacent to $(h, s_h, \bar{c}_h, a_h)$ . Thus, $\mathcal{P}_{\tau_{h+1}} = (\mathcal{P}_{\tau_h}, (h, s_h, \bar{c}_h, a_h), (h+1, s_{h+1}, \bar{c}_{h+1}))$ is the desired path in $\mathcal{T}$ . This completes the induction.
|
| 442 |
+
|
| 443 |
+
For the second claim, fix any $h$ and any $\tau_h \in \mathcal{F}_h$ . We show that for any $\tau_k$ that is $\pi$ -realizable for some $\pi \in \Pi_G(\tau_h)$ that $\mathcal{P}_{\tau_h} \subseteq \mathcal{P}_{\tau_k}$ . We proceed by induction on $k$ .
|
| 444 |
+
|
| 445 |
+
Base Case. For the base case, we consider $k = h$ . In this case, the only realizable history conditioned on $\tau_h$ is $\tau_h$ itself. Trivially, we have that $\mathcal{P}_{\tau_h} \subseteq \mathcal{P}_{\tau_h}$ .
|
| 446 |
+
|
| 447 |
+
Inductive Step. For the inductive step, we consider any $k \geq h$ . Again, we can decompose $\tau_{k+1} = (\tau_k, a_k, c_k, s_{k+1})$ by Observation 1 where $a_k$ is a feasible action for $(k, s_k, \bar{c}_k)$ by Observation 2. By the induction hypothesis, we know that $\mathcal{P}_{\tau_h} \subseteq \mathcal{P}_{\tau_k}$ . Again, it is easy to see that the path $\mathcal{P}_{\tau_{k+1}} = (\mathcal{P}_{\tau_k}, (k, s_k, \bar{c}_k, a_k), (k+1, s_{k+1}, \bar{c}_{k+1}))$ is a well-defined path in $\mathcal{T}$ . It is then immediate that $\mathcal{P}_{\tau_h} \subseteq \mathcal{P}_{\tau_k} \subseteq \mathcal{P}_{\tau_{k+1}}$ . This completes the induction.
|
| 448 |
+
|
| 449 |
+
# B.2. Proof of Lemma 3.4
|
| 450 |
+
|
| 451 |
+
Proof. We then proceed by backward induction on the number of nodes in $\mathcal{P}$ , $h$ .
|
| 452 |
+
|
| 453 |
+
Base Case. For the base case, we consider $h = H + 1$ . In this case, $\mathcal{P}$ ends in a $H + 1$ node, which is TRUE by definition of $\mathcal{T}$ . Thus, the claim vacuously holds.
|
| 454 |
+
|
| 455 |
+
Inductive Step. For the inductive step, we consider any $h \leq H$ . First suppose that $(h, s_h, \bar{c}_h)$ is a sink node. Then, by definition of $\mathcal{T}$ , there must be no safe actions for $\tau_h$ . If there were a feasible $\pi \in \Pi_G$ realizing $\tau_h$ at time $h$ , then Observation 2 would imply a feasible action does exist, a contradiction. Thus, $\tau_h$ cannot be feasibly realized.
|
| 456 |
+
|
| 457 |
+
Now, suppose that $(h,s_h,\bar{c}_h)$ has outgoing edges. Since any triple-node is an OR node, we know all out-neighbors of $(h,s_h,\bar{c}_h)$ must be FALSE. In other words, for any action $a$ , there exists at least one super-path $\tilde{\mathcal{P}} = (\mathcal{P},(h,s_h,\bar{c}_h,a),(h + 1,s_{h + 1},\bar{c}_{h + 1}))$ ending in a FALSE node. By the induction hypothesis, we know that the corresponding history $\tau_{h + 1}$ is not feasibly realizable. Therefore, any policy $\pi$ realizing $\tau_{h + 1}$ must violate the budget by definition. Moreover, by definition of the edges of $\mathcal{T}$ , if $\pi$ realizes $\tau_h$ and $\pi_h(a\mid \tau_h) > 0$ , then $\pi$ realizes $\tau_{h + 1}$ . Consequently, if a policy $\pi$ realizes $\tau_h$ and $a$ , then $\pi$ is not feasible. Since this holds for any possible action $a$ , we have that $\tau_h$ is not feasibly realizable.
|
| 458 |
+
|
| 459 |
+
The argument for why any feasible subhistory cannot realize $\tau_h$ is nearly identical: if it could realize $\tau_h$ from some policy, then that policy must be infeasible.
|
| 460 |
+
|
| 461 |
+
# B.3. Proof of Proposition 3.5
|
| 462 |
+
|
| 463 |
+
Proof. The proof of correctness follows from Lemma 3.3 and Lemma 3.4. Specifically, Lemma 3.3 (along with the fact that no feasible paths are removed due to Lemma 3.4) implies that $\mathcal{RS}_h \supseteq \mathcal{FS}_h$ and $\mathcal{RA}_h(\overline{s}) \supseteq \mathcal{FA}_h(\overline{s})$ for any $\overline{s}$ since all feasibly-realizable histories appear in $\mathcal{T}$ . Then, Lemma 3.4 implies that any paths containing FALSE nodes are not feasibly realizable. Consequently, $\mathcal{RS}_h \subseteq \mathcal{FS}_h$ and $\mathcal{RA}_h(\overline{s}) \subseteq \mathcal{FA}_h(\overline{s})$ for any $\overline{s}$ .
|
| 464 |
+
|
| 465 |
+
For the complexity claim, we observe the time taken to construct the tree and perform a bottom-up tree evaluation is linear in the size of $\mathcal{T}$ . Moreover, the final loop to construct the feasible sets also requires touching every node and edge one time. Thus, the time complexity is dominated by the size of the feasibility tree. The number of nodes in the tree is at most $HSAD_{G}$ since there is at most one tuple per time, state, action, and non-violating cumulative cost. Moreover, there are at
|
| 466 |
+
|
| 467 |
+
most a quadratic number of edges. Hence, the number of edges is at most $A$ times the number of nodes, leading to a total size of $O((HSAD_{G})^{2})$ .
|
| 468 |
+
|
| 469 |
+
# C. Proofs for Section 4
|
| 470 |
+
|
| 471 |
+
Policy Evaluation. For any given policy $\pi$ , player $i \in [n]$ , time $h \in [H + 1]$ , and history $\tau_h \in \mathcal{H}_h$ where $s \stackrel{\mathrm{def}}{=} s_h$ , we can compute player $i$ 's value from $\pi$ under a cMG $G$ recursively using the tabular policy evaluation equations (Equation 4.2.6 (Puterman, 1994)). In the cMG setting, these equations take the following form:
|
| 472 |
+
|
| 473 |
+
$$
|
| 474 |
+
V _ {i, h} ^ {\pi} (\tau_ {h}) = \mathbb {E} _ {a \sim \pi_ {h} (\tau_ {h})} \left[ r _ {i, h} (s, a) + \sum_ {c, s ^ {\prime}} C _ {h} (c \mid s, a) P _ {h} (s ^ {\prime} \mid s, a) V _ {i, h + 1} ^ {\pi} (\tau_ {h}, a, c, s ^ {\prime}) \right]. \qquad \mathrm {(C P E)}
|
| 475 |
+
$$
|
| 476 |
+
|
| 477 |
+
For a traditional or action-constrained MG $\overline{G}$ , the policy evaluation equations take the more familiar form:
|
| 478 |
+
|
| 479 |
+
$$
|
| 480 |
+
\bar {V} _ {i, h} ^ {\bar {\pi}} (\bar {\tau} _ {h}) = \mathbb {E} _ {\bar {a} \sim \bar {\pi} _ {h} (\tau_ {h})} \left[ \bar {r} _ {i, h} (\bar {s}, \bar {a}) + \sum_ {\bar {s} ^ {\prime}} \bar {P} _ {h} (\bar {s} ^ {\prime} \mid \bar {s}, \bar {a}) \bar {V} _ {i, h + 1} ^ {\bar {\pi}} (\bar {\tau} _ {h}, \bar {a}, \bar {s} ^ {\prime}) \right].
|
| 481 |
+
$$
|
| 482 |
+
|
| 483 |
+
When $\bar{\pi}$ is Markovian, these equations further simplify to,
|
| 484 |
+
|
| 485 |
+
$$
|
| 486 |
+
\bar {V} _ {i, h} ^ {\bar {\pi}} (\bar {s}) = \mathbb {E} _ {\bar {a} \sim \bar {\pi} _ {h} (\bar {s})} \left[ \bar {r} _ {i, h} (\bar {s}, \bar {a}) + \sum_ {\bar {s} ^ {\prime}} \bar {P} _ {h} (\bar {s} ^ {\prime} \mid \bar {s}, \bar {a}) \bar {V} _ {i, h + 1} ^ {\bar {\pi}} (\bar {s} ^ {\prime}) \right]. \tag {*} P E
|
| 487 |
+
$$
|
| 488 |
+
|
| 489 |
+
Policy Translations. As mentioned in the appendix, we can immediately treat any feasible Markovian policy $\bar{\pi}$ for $\overline{G} = \text{Definition 4.1}(G, B)$ as a compact history-dependent policy $\pi$ for $G$ by simply using the transformation $\pi_h(\tau_h) \stackrel{\text{def}}{=} \bar{\pi}_h(s_h, \bar{c}_h)$ . Going even further, we can treat history dependent policies for one game as full history dependent policies for the other. The key observation is that any history $\tau_h \in \mathcal{H}_h$ has a unique equivalent history $\bar{\tau}_h \in \bar{H}_h$ and vice versa.
|
| 490 |
+
|
| 491 |
+
Specifically, the history $\tau_h = (s_1, a_1, c_1, s_2, \ldots, s_h)$ can be effectively permuted into the history $\bar{\tau}_h = ((s_1, 0), a_1, (s_2, c_1), \ldots, (s_h, \bar{c}_h))$ and vice versa. Moreover, given $\bar{\tau}_h$ it is easy to infer any $c_k$ since $c_k = \bar{c}_{k+1} - \bar{c}_k$ , and given $\tau_h$ it is easy to infer $(s_k, \bar{c}_k)$ . We call $\bar{\tau}_h$ the translation of $\tau_h$ to $\overline{G}$ and denote it by $\bar{H}(\tau_h)$ . Importantly, this conversion allows us to formally discuss a policies value in both games by simply modifying its input history.
|
| 492 |
+
|
| 493 |
+
Lemma C.1 (Translations). For any feasible policy $\pi \in \Pi_G$ , time $h \in [H + 1]$ , and partial history $\tau_h \in \mathcal{H}_h^\pi$ , if $\bar{\tau}_h \stackrel{\text{def}}{=} \bar{H}_h(\tau_h)$ is the translation of $\tau_h$ to $\bar{H}_h$ , then $V_{i,h}^{\pi}(\tau_h) = \bar{V}_{i,h}^{\pi}(\bar{\tau}_h)$ . Moreover, if $\pi$ is Markovian in $\bar{S}$ , then $V_{i,h}^{\pi}(\tau_h) = \bar{V}_{i,h}^{\pi}(s_h, \bar{c}_h)$ .
|
| 494 |
+
|
| 495 |
+
Proof. We proceed by induction on $h$ . We first note by Lemma 3.3 that all realizable histories of $\pi$ have (state, cumulative-cost)-pair in $\mathcal{FS}_h$ and actions in $\mathcal{FA}_h(\bar{s})$ . Thus, in the argument below we can always assume histories realized by $\pi$ lead to a valid history for $\overline{G}$ .
|
| 496 |
+
|
| 497 |
+
Base Case. For the base case, we consider $h = H + 1$ . In this case, $V_{i,H + 1}^{\pi}(\tau_{H + 1}) = 0 = \bar{V}_{i,H + 1}^{\pi}(\bar{\tau}_{H + 1})$ by definition of the value function at time $H + 1$ . The second claim also holds since $\bar{V}_{i,H + 1}^{\pi}(s_{H + 1},\bar{c}_{H + 1}) = 0$ .
|
| 498 |
+
|
| 499 |
+
Inductive Step. For the inductive step, we consider any $h \leq H$ . Let $s \stackrel{\mathrm{def}}{=} s_h$ and let $\bar{s} \stackrel{\mathrm{def}}{=} (s_h, \bar{c}_h)$ . We observe by (CPE) and (PE) that,
|
| 500 |
+
|
| 501 |
+
$$
|
| 502 |
+
\begin{array}{l} V _ {i, h} ^ {\pi} (\tau_ {h}) = \mathbb {E} _ {a \sim \pi_ {h} (\tau_ {h})} \left[ r _ {i, h} (s, a) + \sum_ {c, s ^ {\prime}} C _ {h} (c \mid s, a) P _ {h} (s ^ {\prime} \mid s, a) V _ {i, h + 1} ^ {\pi} (\tau_ {h}, a, c, s ^ {\prime}) \right] \\ = \mathbb {E} _ {a \sim \pi_ {h} (\tau_ {h})} \left[ r _ {i, h} (s, a) + \sum_ {c, s ^ {\prime}} C _ {h} (c \mid s, a) P _ {h} \left(s ^ {\prime} \mid s, a\right) \bar {V} _ {i, h + 1} ^ {\pi} \left(\bar {\tau} _ {h}, a, \left(s ^ {\prime}, \bar {c} _ {h} + c\right)\right) \right] \\ = \mathbb {E} _ {a \sim \pi_ {h} (\tau_ {h})} \left[ \bar {r} _ {i, h} (\bar {s}, a) + \sum_ {\bar {s} ^ {\prime}} \bar {P} _ {h} (\bar {s} ^ {\prime} \mid \bar {s}, a) \bar {V} _ {i, h + 1} ^ {\pi} (\bar {\tau} _ {h}, a, \bar {s} ^ {\prime}) \right] \\ = \mathbb {E} _ {\bar {a} \sim \pi_ {h} (\bar {\tau} _ {h})} \left[ \bar {r} _ {i, h} (\bar {s}, \bar {a}) + \sum_ {\bar {s} ^ {\prime}} \bar {P} _ {h} (\bar {s} ^ {\prime} \mid \bar {s}, \bar {a}) \bar {V} _ {i, h + 1} ^ {\pi} (\bar {\tau} _ {h}, \bar {a}, \bar {s} ^ {\prime}) \right] \\ = \bar {V} _ {i, h} ^ {\pi} (\bar {\tau} _ {h}). \\ \end{array}
|
| 503 |
+
$$
|
| 504 |
+
|
| 505 |
+
The first line used (CPE). The second line applied the induction hypothesis along with the fact that $\tau_{h + 1} = (\tau_h,a,c,s')$ translates to $\bar{\tau}_{h + 1} = (\bar{\tau}_h,a,(s',\bar{c}_h + c))$ where $\bar{\tau}_h$ is the translation of $\tau_h$ . The third line used the definition of $\bar{r}$ and $\bar{P}$ from Definition 4.1. The fourth line used the fact that $\pi_h(\bar{\tau}_h) = \pi_h(\tau_h)$ by definition of the translation. The last line used (PE).
|
| 506 |
+
|
| 507 |
+
For the second claim, we note if $\pi$ is Markovian in $\bar{S}$ , then we can replace $\pi_h(\bar{\tau}_h)$ by $\pi_h(\bar{s})$ and inductively replace $\bar{V}_{i,h+1}^{\pi}(\bar{\tau}_h,\bar{a},\bar{s}')$ by $\bar{V}_{i,h+1}^{\pi}(\bar{s}')$ . These replacements result in the second to last line exactly matching the RHS of (*PE). Thus, $V_{i,h}^{\pi}(\tau_h) = \bar{V}_{i,h}^{\pi}(s_h,\bar{c}_h)$ in this case.
|
| 508 |
+
|
| 509 |
+

|
| 510 |
+
|
| 511 |
+
# C.1. Proof of Lemma 4.3
|
| 512 |
+
|
| 513 |
+
We first make the following observation.
|
| 514 |
+
|
| 515 |
+
Observation 3. For any policy $\pi$ , if $\pi \in \Pi_{\overline{G}}$ , then $\pi \in \Pi_G(\tau_h)$ for any $\tau_h \in \mathcal{F}_h$ and $h \in [H]$ .
|
| 516 |
+
|
| 517 |
+
Proof. This is immediate from Lemma 3.4 as any policy whose support is contained in $\bar{\mathcal{A}}_h(\bar{s}) = \mathcal{F}\mathcal{A}_h(\bar{s})$ at each stage is an anytime-feasible policy.
|
| 518 |
+
|
| 519 |
+
We will also show the following stronger claim.
|
| 520 |
+
|
| 521 |
+
Claim 1. Suppose that $\pi$ is any MPE for $\overline{G}$ , and that $\pi' \stackrel{\text{def}}{=} (\pi_i', \pi_{-i}) \in \Pi_G$ is a feasible deviation for player $i$ . Then, for all times $h \in [H + 1]$ , and all partial histories $\tau_h \in \mathcal{H}_h^{\pi'}$ , we have that $V_{i,h}^{\pi}(\tau_h) \geq V_{i,h}^{\pi'}(\tau_h)$ .
|
| 522 |
+
|
| 523 |
+
Proof. Observe that,
|
| 524 |
+
|
| 525 |
+
$$
|
| 526 |
+
V _ {i, h} ^ {\pi} (\tau_ {h}) = \bar {V} _ {i, h} ^ {\pi} (s _ {h}, \bar {c} _ {h}) \geq \bar {V} _ {i, h} ^ {\pi^ {\prime}} (\bar {\tau} _ {h}) = V _ {i, h} ^ {\pi^ {\prime}} (\tau_ {h}).
|
| 527 |
+
$$
|
| 528 |
+
|
| 529 |
+
The first equality used Lemma C.1 for a Markovian policy in $\bar{S}$ . The inequality used the fact that $\pi$ is a MPE for $\overline{G}$ with $\bar{\tau}_h$ being the unique translation of $\tau_h$ to an element of $\bar{\mathcal{H}}_h$ . The final equality again used Lemma C.1.
|
| 530 |
+
|
| 531 |
+

|
| 532 |
+
|
| 533 |
+
Proof of Lemma. The lemma then follows as the observation yields condition (1) and the claim yields condition (2) of ACSPE.
|
| 534 |
+
|
| 535 |
+
# C.2. Proof of Theorem 4.4
|
| 536 |
+
|
| 537 |
+
Proof. The correctness of the algorithm is immediate from Proposition 3.5 and Lemma 4.3. For the complexity claim, the time the algorithm takes is $O((HSAD_G)^2)$ time to construct $\overline{G}$ and $\mathrm{poly}(\overline{G})$ time to solve the LP. Since the description
|
| 538 |
+
|
| 539 |
+
size of $\overline{G}$ is also polynomial in $HSAD_{G}$ , we then see the running time is bounded by $O(\mathrm{poly}(|G|,D_G))$ . The number of $\overline{G}$ 's states is at most $O(HSD_{G})$ , and for each state up to $A$ joint actions' probabilities must be stored. Hence, the storage claim follows.
|
| 540 |
+
|
| 541 |
+
# D. Proofs for Section 5
|
| 542 |
+
|
| 543 |
+
# D.1. Proof of Lemma 5.1
|
| 544 |
+
|
| 545 |
+
Proof. Let $(\mathcal{A}, X, u)$ be any action-constrained matrix game, $\sigma$ be any solution to (CLP)( $\mathcal{A}$ , $X$ , $u$ ), $i \in [n]$ be any player, and $\sigma_i'$ be any deviation strategy satisfying $\sigma' = (\sigma_i', \sigma_{-i}) \in \Delta(X)$ . By definition of the constraints, we see that,
|
| 546 |
+
|
| 547 |
+
$$
|
| 548 |
+
\begin{array}{l} \mathbb {E} _ {a \sim \sigma} \left[ u _ {i} (a) \right] = \sum_ {a \in \mathcal {A}} \sigma (a) u _ {i} (a) \\ = \sum_ {a \in X} \sigma (a) u _ {i} (a) \\ = \sum_ {a _ {i} ^ {\prime} \in \mathcal {A} _ {i}} \sigma_ {i} ^ {\prime} \left(a _ {i} ^ {\prime}\right) \sum_ {a \in X} \sigma (a) u _ {i} (a) \\ \geq \sum_ {a _ {i} ^ {\prime} \in \mathcal {A} _ {i}} \sigma_ {i} ^ {\prime} \left(a _ {i} ^ {\prime}\right) \sum_ {a \in X} \sigma (a) u _ {i} \left(a _ {i} ^ {\prime}, a _ {- i}\right) \\ = \sum_ {a _ {i} ^ {\prime} \in \mathcal {A} _ {i}} \sigma_ {i} ^ {\prime} \left(a _ {i} ^ {\prime}\right) \sum_ {a _ {- i} \in \mathcal {A} _ {- i}} \sum_ {a _ {i} \in \mathcal {A} _ {i}} \sigma \left(a _ {i}, a _ {- i}\right) u _ {i} \left(a _ {i} ^ {\prime}, a _ {- i}\right) \\ = \sum_ {a _ {i} ^ {\prime} \in \mathcal {A} _ {i}} \sum_ {a _ {- i} \in \mathcal {A} _ {- i}} \sigma_ {i} ^ {\prime} (a _ {i} ^ {\prime}) \sigma_ {- i} (a _ {- i}) u _ {i} (a _ {i} ^ {\prime}, a _ {- i}) \\ = \sum_ {a ^ {\prime} \in \mathcal {A}} \sigma^ {\prime} (a ^ {\prime}) u _ {i} (a ^ {\prime}) \\ = \mathbb {E} _ {a ^ {\prime} \sim \sigma^ {\prime}} \left[ u _ {i} \left(a ^ {\prime}\right) \right]. \\ \end{array}
|
| 549 |
+
$$
|
| 550 |
+
|
| 551 |
+
The second line used the second constraint that ensured $\operatorname{Supp}(\sigma) \subseteq X$ . The fourth line used the first constraint. The sixth line used the definition of marginals.
|
| 552 |
+
|
| 553 |
+
For the second claim, the fact that $X \neq \emptyset$ implies there exist at least one feasible joint action, and so a feasible $\sigma$ exists. A specific $\sigma$ satisfying the other constraints is then immediate from classical game theory since it corresponds to the constraint of a normal-form game with possible $-\infty$ entries (which can be replaced by the worst possible utility minus 1).
|
| 554 |
+
|
| 555 |
+
# D.2. Proof of Theorem 5.2
|
| 556 |
+
|
| 557 |
+
We first make the following observation.
|
| 558 |
+
|
| 559 |
+
Observation 4. For any feasible action-constrained $MG\overline{G}$ , suppose that $\pi$ is output from Algorithm 3( $\overline{G}$ ). Then, $\pi \in \Pi_{\overline{G}}$ .
|
| 560 |
+
|
| 561 |
+
Proof. Since $\overline{G}$ is feasible, at any time $h\in [H]$ and state $\bar{s}\in \bar{S}_h$ , we know that $\bar{\mathcal{A}}_h(\bar{s})\neq \varnothing$ by definition. Thus, Lemma 5.1 implies that (CLP) always outputs a solution and that solution is supported on $\bar{\mathcal{A}}_h(\bar{s})$ for any stage game $(h,\bar{s})$ . Since $\pi$ is exactly the collection of all such stage solutions, we then see that $\mathrm{Supp}(\pi_h(\bar{s}))\subseteq \bar{\mathcal{A}}_h(\bar{s})$ for all $(h,\bar{s})$ . Thus, $\pi \in \Pi_{\overline{G}}$
|
| 562 |
+
|
| 563 |
+
The following claim will also prove useful.
|
| 564 |
+
|
| 565 |
+
Claim 2. For any feasible action-constrained $MG\overline{G}$ , suppose that $\pi$ is output from Algorithm 3( $\overline{G}$ ). Then, for all players $i \in [n]$ , times $h \in [H + 1]$ , deviations $\pi_i'$ satisfying $\pi' \stackrel{\text{def}}{=} (\pi_i', \pi_{-i}) \in \Pi_{\overline{G}}$ , and histories $\bar{\tau}_h \in \mathcal{H}_h^{\pi'}$ , we have that $\bar{V}_{i,h}^{\pi}(\bar{s}_h) \geq \bar{V}_{i,h}^{\pi'}(\bar{\tau}_h)$ .
|
| 566 |
+
|
| 567 |
+
Proof. We proceed by induction on $h$ .
|
| 568 |
+
|
| 569 |
+
Base Case. For the base case, we consider $h = H + 1$ . In this case, $\bar{V}_{i,h}^{\pi}(\bar{s}) = 0 = \bar{V}_{i,h}^{\pi'}(\bar{s})$ by definition of the value function of a feasible policy at time $H + 1$ .
|
| 570 |
+
|
| 571 |
+
Inductive Step. For the inductive step, we consider any $h \leq H$ . We observe that,
|
| 572 |
+
|
| 573 |
+
$$
|
| 574 |
+
\begin{array}{l} \bar {V} _ {i, h} ^ {\pi} (\bar {s}) = \mathbb {E} _ {\bar {a} \sim \pi_ {h} (\bar {s})} \left[ \bar {r} _ {i, h} (\bar {s}, \bar {a}) + \sum_ {\bar {s} ^ {\prime}} \bar {P} _ {h} (\bar {s} ^ {\prime} \mid \bar {s}, \bar {a}) \bar {V} _ {i, h + 1} ^ {\pi} (\bar {s} ^ {\prime}) \right] \\ \geq \mathbb {E} _ {\bar {a} \sim \pi_ {h} (\bar {s})} \left[ \bar {r} _ {i, h} (\bar {s}, \bar {a}) + \sum_ {\bar {s} ^ {\prime}} \bar {P} _ {h} (\bar {s} ^ {\prime} \mid \bar {s}, \bar {a}) \bar {V} _ {i, h + 1} ^ {\pi^ {\prime}} (\bar {\tau} _ {h + 1}) \right] \\ = \mathbb {E} _ {\bar {a} \sim \pi_ {h} (\bar {s})} \left[ \bar {Q} _ {i, h} ^ {\pi^ {\prime}} (\bar {\tau} _ {h}, \bar {a}) \right] \\ \geq \mathbb {E} _ {\bar {a} \sim \pi_ {h} ^ {\prime} (\bar {\tau} _ {h})} \left[ \bar {Q} _ {i, h} ^ {\pi^ {\prime}} (\bar {\tau} _ {h}, \bar {a}) \right] \\ = \bar {V} _ {i, h} ^ {\pi^ {\prime}} (\bar {\tau} _ {h}). \\ \end{array}
|
| 575 |
+
$$
|
| 576 |
+
|
| 577 |
+
The first line used (PE). The second line uses the induction hypothesis. The third line used the definition of the $Q$ -function. The fourth line used Lemma 5.1 and the fact that $\mathrm{Supp}(\pi_h(\bar{\tau}_h)') \subseteq \bar{\mathcal{A}}_h(\bar{s}_h)$ by assumption that $\pi'$ is feasible. The last line used the relationship between the $Q$ and value functions.
|
| 578 |
+
|
| 579 |
+
Proof of Theorem. By Observation 4, we know the output policy of our algorithm is feasible, and by Claim 2 we know the output policy satisfies the stage game solution condition. Thus, it is a MPE for $\overline{G}$ . The running time follows since we run a polynomial time LP solver on a polynomialized matrix game, $O(\bar{A})$ , for a polynomial number of times, $O(H\bar{S})$ .
|
| 580 |
+
|
| 581 |
+
# D.3. Proof of Theorem 5.3
|
| 582 |
+
|
| 583 |
+
Proof. We follow the same argument as in (McMahan and Zhu, 2024). By ignoring insignificant digits, we can write each number in the form $2^{-i}b_{-i} + \ldots + 2^{-1}b_{-1} + 2^{0}b_{0} + \ldots + 2^{d - i - 1}b_{d - i}$ for some $i$ . By dividing by $2^{-i}$ , each number is of the form $2^{0}b_{0} + \ldots + 2^{d - 1}b_{d - 1}$ . Notice, the largest possible number that can be represented in this form is $\sum_{i = 0}^{d - 1}2^{i} = 2^{d} - 1$ . Since at each time $h$ , we potentially add the maximum cost, the largest cumulative cost ever achieved is at most $2^{d}H - 1$ . Since that is the largest cost achievable, no more than $2^{d}H$ can ever be achieved through all $H$ times. Similarly, no cost can be achieved smaller than $-2^{d}H$ .
|
| 584 |
+
|
| 585 |
+
Thus, each cumulative cost is in the range $[-2^d H + 1, 2^d H - 1]$ and so at most $2^{d+1}H$ cumulative costs can ever be created. By multiplying back the $2^{-i}$ term, we see at most $2^{d+1}H$ costs are ever generated by numbers with $d$ bits of precision. Since this argument holds for each constraint independently, the total number of cumulative cost vectors that could ever be achieved is $(H2^{d+1})^n$ . Hence, $D_G \leq H^n 2^{(d+1)n}$ .
|
| 586 |
+
|
| 587 |
+
Theorem 5.3 then follows immediately from Theorem 4.4, Theorem 5.2, and the definition of fixed-parameter tractability (Downey and Fellows, 2012).
|
| 588 |
+
|
| 589 |
+
# E. Proofs for Section 6
|
| 590 |
+
|
| 591 |
+
# E.1. Proof of Lemma 6.4
|
| 592 |
+
|
| 593 |
+
For any $h$ we let $\hat{c}_{h+1} \coloneqq f(\tau_{h+1})$ be a random variable of the history defined inductively by $\hat{c}_1 = 0$ and $\hat{c}_{k+1} = f_k(\hat{c}_k, c_k)$ for all $k \leq h$ . Here, $f$ is a function that either rounds the immediate cost or truncates to $\hat{c}_1$ . Notice that since $f$ is a deterministic function, $\hat{c}_k$ can be computed from $\tau_{h+1}$ for all $k \in [h+1]$ . Then, a probability distribution over $\hat{c}$ is induced by the one over histories.
|
| 594 |
+
|
| 595 |
+
Proof. The key observation is that for each time $h$ , generally $\hat{\bar{c}}_h \leq \bar{c}_h \leq \hat{\bar{c}}_h + (h - 1)\ell$ holds. The one exception is when a very negative cost is received, in which case the agents' truncation may lead to higher cost in $\hat{G}$ . However, in that case, any action will still be allowed and so overestimated cost does not lead to issues. Formally, we can show
|
| 596 |
+
|
| 597 |
+
$$
|
| 598 |
+
\mathbb {P} _ {G} ^ {\pi} \left[ \hat {\bar {c}} _ {h} \leq \bar {c} _ {h} \leq \hat {\bar {c}} _ {h} + (h - 1) \ell \vee \hat {\bar {c}} _ {h}, \bar {c} _ {h} \leq B - (H - h + 1) c ^ {m a x} \right] = 1. \tag {7}
|
| 599 |
+
$$
|
| 600 |
+
|
| 601 |
+
The proof of this claim follows identically to the proof of Lemma 5 in (McMahan and Zhu, 2024).
|
| 602 |
+
|
| 603 |
+
Then, if $\pi$ is feasible for $\hat{G}$ , we see that $\mathbb{P}^{\pi}\left[\forall h\in [H],\hat{\bar{c}}_h\leq B\right] = 1$ . Thus,
|
| 604 |
+
|
| 605 |
+
$$
|
| 606 |
+
\mathbb {P} ^ {\pi} [ \forall h \in [ H ], \bar {c} _ {h} \leq B + (h - 1) \ell ] = 1.
|
| 607 |
+
$$
|
| 608 |
+
|
| 609 |
+
In words, $\pi$ is $H\ell$ -feasible for $G$ .
|
| 610 |
+
|
| 611 |
+
# E.2. Proof of Lemma 6.5
|
| 612 |
+
|
| 613 |
+
Proof. Approximate feasibility of any such $\pi$ from Lemma 6.4. Moreover, we observe that there are more feasible deviations $(\pi_i', \pi_{-i})$ in $\hat{G}$ since the cost constraint is easier to satisfy as also shown in the proof of Lemma 6.4. Thus, $\pi$ must also beat any feasible deviation for $G$ . Hence, it is an approximate equilibrium.
|
| 614 |
+
|
| 615 |
+
# E.3. Proof of Theorem 6.6
|
| 616 |
+
|
| 617 |
+
Proof. The correctness of the algorithm follows immediately from Lemma 6.4 and Lemma 6.5. For the complexity claim, we first note that to construct $\hat{\overline{G}}$ from $\hat{G}$ , we must loop over each approximate cost while performing the iteration to create $\mathcal{G}$ . The number of such immediate costs per agent $i$ is the number integer multiples of $\ell$ we consider, which consists of the range $\left\{\left\lfloor \frac{B_i - Hc_i^{max}}{\ell} \right\rfloor, \left\lfloor \frac{c_i^{max}}{\ell} \right\rfloor\}$ . The number of elements of this set is,
|
| 618 |
+
|
| 619 |
+
$$
|
| 620 |
+
\left\lfloor \frac {c _ {i} ^ {m a x}}{\ell} \right\rfloor - \left\lfloor \frac {B _ {i} - H c _ {i} ^ {m a x}}{\ell} \right\rfloor + 1 \leq \frac {c _ {i} ^ {m a x} (H + 1) - B _ {i}}{\ell} + 2.
|
| 621 |
+
$$
|
| 622 |
+
|
| 623 |
+
Thus, if we consider the worst case player, the bound becomes $\frac{\|c^{max}(H + 1) - B\|_{\infty}}{\ell} +2$ . Since this holds independently for each player, the total number supported immediate costs in each approximate cost distribution is at most $O\left(\frac{\|c^{max}(H + 1) - B\|_{\infty}^n}{\ell^n}\right)$ . Moreover, since each immediate cost is an integer multiple of $\ell$ , any cumulative cost is in the range at widest $\{H\left\lfloor \frac{B_i - Hc_i^{max}}{\ell}\right\rfloor ,H\left\lfloor \frac{c_i^{max}}{\ell}\right\rfloor \}$ . Overall, we see the time needed to construct $\mathcal{G}$ and the size of the state set of $\overline{G}$ blow up by a factor of $O\left(\frac{\|c^{max}(H + 1) - B\|_{\infty}^n}{\ell^n}\right)$ . The running time claims then follow from the previous running time claims.
|
| 624 |
+
|
| 625 |
+
# E.4. Proof of Corollary 6.7
|
| 626 |
+
|
| 627 |
+
Proof. The proof is immediate from Theorem 6.6 and the definition of $\ell$ .
|
| 628 |
+
|
| 629 |
+
# E.5. Proof of Corollary 6.8
|
| 630 |
+
|
| 631 |
+
Proof. The proof is immediate from Theorem 6.6 and the definition of $\ell$ . Note, here we are using a vector $\ell$ . It is easy to see that the proof of Lemma 6.4 easily handles this variation.
|
| 632 |
+
|
| 633 |
+
# F. Extensions
|
| 634 |
+
|
| 635 |
+
The infinite discounted case, and generalized anytime constraints case follow similarly to in (McMahan and Zhu, 2024). As for almost sure constraints, we note that we can do the same meta-graph construction, but we start by including all possible cumulative costs, since we do not know which may eventually lead to success until we have seen the end. All other results follow similarly.
|
| 636 |
+
|
| 637 |
+
For ACCE, we observe all of our results follow with the minimal change of considering a strategic modification deviation $\phi \circ \pi$ instead of the general deviation $(\pi_i', \pi_{-i})$ we originally considered. Our LP solution is also easily adapted by replacing the CCE condition with the CE condition.
|
2025/Anytime-Constrained Equilibria in Polynomial Time/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:817d5b1a8b06b589a6a50456c64891b79b35e7bc8b4b1a248f30ab44b80e4a3e
|
| 3 |
+
size 257621
|
2025/Anytime-Constrained Equilibria in Polynomial Time/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/ccb0cd66-ac75-4a6c-89ae-39fc9d56daa4_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/ccb0cd66-ac75-4a6c-89ae-39fc9d56daa4_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/ccb0cd66-ac75-4a6c-89ae-39fc9d56daa4_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a3fd4eb20e71a12a993e05e8ca3247e259d0d25a1cfc4247e6f9d3cf82f37f76
|
| 3 |
+
size 516987
|
2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/full.md
ADDED
|
@@ -0,0 +1,694 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Approximate Differential Privacy of the $\ell_2$ Mechanism
|
| 2 |
+
|
| 3 |
+
Matthew Joseph\*1 Alex Kulesza\*1 Alexander Yu\*1
|
| 4 |
+
|
| 5 |
+
# Abstract
|
| 6 |
+
|
| 7 |
+
We study the $\ell_2$ mechanism for computing a $d$ -dimensional statistic with bounded $\ell_2$ sensitivity under approximate differential privacy. Across a range of privacy parameters, we find that the $\ell_2$ mechanism obtains lower error than the Laplace and Gaussian mechanisms, matching the former at $d = 1$ and approaching the latter as $d \to \infty$ .
|
| 8 |
+
|
| 9 |
+
# 1. Introduction
|
| 10 |
+
|
| 11 |
+
Computing a $d$ -dimensional statistic with bounded $\ell_2$ sensitivity is a fundamental task in differential privacy (DP) (Dwork et al., 2006). It underlies standard algorithms like private stochastic gradient descent (Song et al., 2013; Abadi et al., 2016), the binary tree mechanism (Chan et al., 2011; Dwork et al., 2010), and the projection (Nikolov et al., 2013; Nikolov, 2023), matrix (Li et al., 2015; McKenna et al., 2018), and factorization mechanisms (Edmonds et al., 2020; Nikolov & Tang, 2023). The canonical approximate DP algorithm for this problem is the Gaussian mechanism (Dwork et al., 2006). To compute statistic $T(X)$ , the Gaussian mechanism samples an output according to $g_{X}(y) \propto \exp(-\left[\|y - T(X)\|_{2} / \sigma\right]^{2})$ for an appropriate value of $\sigma$ ; in particular, the analytic Gaussian mechanism (Balle & Wang, 2018) chooses the smallest possible $\sigma$ sufficient for the desired approximate DP guarantee.
|
| 12 |
+
|
| 13 |
+
In this paper, we analyze the $\ell_2$ mechanism. Given a parameter $\sigma$ , this mechanism samples an output according to density $f_{X}(y) \propto \exp(-\|y - T(X)\|_{2} / \sigma)$ . As an instance of the $K$ -norm mechanism (Hardt & Talwar, 2010) using the $\ell_2$ norm, the $\ell_2$ mechanism immediately satisfies $\frac{1}{\sigma}$ -(pure) DP and can be sampled efficiently. However, its approximate DP guarantees are not well understood.
|
| 14 |
+
|
| 15 |
+
*Equal contribution <Google Research New York. Correspondence to: Matthew Joseph <mtjoseph@google.com>.
|
| 16 |
+
|
| 17 |
+
Proceedings of the $42^{nd}$ International Conference on Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).
|
| 18 |
+
|
| 19 |
+
# 1.1. Contributions
|
| 20 |
+
|
| 21 |
+
For arbitrary dimension $d$ and privacy parameters $\varepsilon$ and $\delta$ , we provide an algorithm for choosing $\sigma$ to obtain an $\ell_2$ mechanism that satisfies $(\varepsilon, \delta)$ -DP. The resulting $\ell_2$ mechanism can be efficiently sampled in parallel and empirically dominates both the Laplace mechanism and the analytic Gaussian mechanism in terms of mean squared $\ell_2$ error (left plot in Figure 1). Moreover, unlike the Gaussian mechanism, the $\ell_2$ mechanism always satisfies a pure DP guarantee (right plot in Figure 1).
|
| 22 |
+
|
| 23 |
+
Our algorithms bound relevant quantities of the privacy loss random variable for the $\ell_2$ mechanism. Balle & Wang (2018) showed that mechanism $M$ is $(\varepsilon, \delta)$ -DP if and only if
|
| 24 |
+
|
| 25 |
+
$$
|
| 26 |
+
\mathbb {P} \left[ \ell_ {M, X, X ^ {\prime}} \geq \varepsilon \right] - e ^ {\varepsilon} \mathbb {P} \left[ \ell_ {M, X ^ {\prime}, X} \leq - \varepsilon \right] \leq \delta \tag {1}
|
| 27 |
+
$$
|
| 28 |
+
|
| 29 |
+
where $\ell_{M,X,X'}$ is the privacy loss associated with $M$ on arbitrary neighboring databases $X$ and $X'$ (Section 2). Proving $(\varepsilon, \delta)$ -DP therefore reduces to upper bounding the first term and lower bounding the second. We show that the first term is defined by the mass that $M(X)$ places on a region of $\mathbb{R}^d$ determined by certain spherical caps, while the second term is defined by the mass that $M(X')$ places on the same region. We then provide algorithms to approximate the first term from above and the second term from below. Because these approximations are provably upper and lower bounds, they yield a formal differential privacy guarantee. Experiments suggest that, for reasonable algorithm parameter values, these approximations are tight (Section 4.1).
|
| 30 |
+
|
| 31 |
+
# 1.2. Related Work
|
| 32 |
+
|
| 33 |
+
Ganesh & Zhao (2021) also use spherical caps to analyze what they call "generalized Gaussians", which have densities proportional to $\exp(-[||y - T(X)||_p / \sigma]^p)$ for integers $p \geq 1$ . A few features separate their work from ours: they study a statistic with bounded $\ell_{\infty}$ sensitivity; their results do not cover the $\ell_2$ mechanism, which uses norm $p = 2$ but exponent $p' = 1$ ; they work with a sufficient condition for $(\varepsilon, \delta)$ -DP, which only bounds the first term in Equation (1) by $\delta$ , leading to looser results; and since their goal is an asymptotic utility guarantee, their results rely on asymptotic concentration inequalities that are less precise than the approach used here.
|
| 34 |
+
|
| 35 |
+
A few authors have studied the $\ell_2$ mechanism, primarily in
|
| 36 |
+
|
| 37 |
+

|
| 38 |
+
Figure 1. Left: normalized mean squared $\ell_2$ error. At each $d$ , we compute mean squared $\ell_2$ error for the $(1,10^{-5})$ -DP Laplace, analytic Gaussian (Balle & Wang, 2018), and $\ell_2$ mechanisms. Quantities are normalized so that the analytic Gaussian mechanism error is always 1. Note that we truncate the Laplace mechanism at $d = 8$ , after which its error relative to the analytic Gaussian mechanism continues to grow. See Section 4.2 for details. Right: the pure DP guarantee of the $(1,10^{-5})$ -DP $\ell_2$ mechanism as $d$ grows.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
|
| 42 |
+
the context of objective perturbation (Chaudhuri et al., 2011; Kifer et al., 2012; Yu et al., 2014). However, they all use pure DP rather than approximate DP.
|
| 43 |
+
|
| 44 |
+
# 2. Preliminaries
|
| 45 |
+
|
| 46 |
+
We use the formulation of $(\varepsilon, \delta)$ -DP given by Balle & Wang (2018). It is defined in terms of the privacy loss random variable. Our results apply for either the add-remove or swap notions of neighboring databases.
|
| 47 |
+
|
| 48 |
+
Definition 2.1. Let $M$ be a mechanism whose output density given input database $X$ is $f_{X}$ . Then for neighboring databases $X, X'$ , the privacy loss of $M$ at point $y$ is $\ell_{M,X,X'}(y) = \ln \left(\frac{f_X(y)}{f_{X'}(y)}\right)$ . Its privacy loss random variable is $\ell_{M,X,X'}(Y)$ where $Y \sim f_{X}$ .
|
| 49 |
+
|
| 50 |
+
The following results relate the privacy loss random variable to differential privacy.
|
| 51 |
+
|
| 52 |
+
Lemma 2.2. Mechanism $M$ is $\varepsilon$ -DP if and only if, for any neighboring $X \sim X'$ , $|\ell_{M,X,X'}(Y)| \leq \varepsilon$ .
|
| 53 |
+
|
| 54 |
+
Lemma 2.3 (Balle & Wang (2018)). Mechanism $M$ is $(\varepsilon, \delta)$ -DP if and only if, for any neighboring $X \sim X'$ ,
|
| 55 |
+
|
| 56 |
+
$$
|
| 57 |
+
\mathbb {P} \left[ \ell_ {M, X, X ^ {\prime}} \geq \varepsilon \right] - e ^ {\varepsilon} \mathbb {P} \left[ \ell_ {M, X ^ {\prime}, X} \leq - \varepsilon \right] \leq \delta .
|
| 58 |
+
$$
|
| 59 |
+
|
| 60 |
+
Since the $\ell_2$ mechanism can be viewed as an instance of the $K$ -norm mechanism (Hardt & Talwar, 2010), we recall some relevant results about the $K$ -norm mechanism.
|
| 61 |
+
|
| 62 |
+
Lemma 2.4 (Hardt & Talwar (2010)). Given norm $\| \cdot \|$ , scale parameter $\sigma$ , statistic $T$ with $\| \cdot \|$ -sensitivity $\Delta$ , and database $X$ , the $K$ -norm mechanism has output density $f_{X}(y) \propto \exp(-\| y - T(X) \| / \sigma)$ and satisfies $\frac{\Delta}{\sigma} - DP$ . Moreover, letting $B^{d}$ denote the unit ball for $\| \cdot \|$ , the following procedure samples this mechanism: 1) sample radius
|
| 63 |
+
|
| 64 |
+
$r \sim \text{Gamma}(d + 1, \sigma)$ , the Gamma distribution with shape $d + 1$ and scale $\sigma$ ; 2) uniformly sample $z \sim B^{d}$ ; and 3) output $T(X) + rz$ .
|
| 65 |
+
|
| 66 |
+
# 3. $\ell_2$ Mechanism
|
| 67 |
+
|
| 68 |
+
This section provides an algorithm for computing $\sigma$ to achieve an $(\varepsilon, \delta)$ -DP $\ell_2$ mechanism (Section 3.1) and then describes a simple method for sampling the $\ell_2$ mechanism in parallel (Section 3.2). Without loss of generality, we assume that our statistic $T$ has $\ell_2$ sensitivity $\Delta_2 = 1$ . If $\Delta_2 \neq 1$ , we can run the algorithm on $T / \Delta_2$ and rescale.
|
| 69 |
+
|
| 70 |
+
# 3.1. Privacy Analysis
|
| 71 |
+
|
| 72 |
+
The overall goal is to translate an $(\varepsilon, \delta)$ -DP privacy budget to the minimum $\sigma$ such that the $\ell_2$ mechanism $M$ with parameter $\sigma$ satisfies $(\varepsilon, \delta)$ -DP. To do this, we focus on a subroutine that determines whether or not $M$ satisfies $(\varepsilon, \delta)$ -DP and then binary search over $\sigma$ .
|
| 73 |
+
|
| 74 |
+
Recall from Lemma 2.3 that $M$ is $(\varepsilon, \delta)$ -DP if and only if $\mathbb{P}[\ell_{M,X,X'} \geq \varepsilon] - e^{\varepsilon}\mathbb{P}[\ell_{M,X',X} \leq -\varepsilon] \leq \delta$ . The next subsections will provide algorithms that upper bound the first term and lower bound the second term, and thus err on the side of a conservative privacy guarantee.
|
| 75 |
+
|
| 76 |
+
Before starting our privacy analysis, we consider a simpler (but, as we will see, significantly worse) approach. The $\ell_2$ mechanism, and the $K$ -norm mechanism more broadly, can be viewed as instances of the exponential mechanism (McSherry & Talwar, 2007). The exponential mechanism admits a few possible approximate DP analyses. For example, the $\varepsilon$ -DP exponential mechanism satisfies $\frac{\varepsilon^2}{8}$ -concentrated DP (Cesar & Rogers, 2021), and a concentrated DP guarantee can be converted to an approximate DP guarantee (Bun
|
| 77 |
+
|
| 78 |
+
& Steinke, 2016; Canonne et al., 2020; Asoodeh et al., 2020; Zhu et al., 2022). However, any such analysis also applies to the Laplace mechanism, and the $\varepsilon$ -DP Laplace mechanism is only $(\varepsilon', \delta)$ -DP for $\varepsilon' \approx \varepsilon - O(\delta)$ (Lemma A.2 in the Appendix). This is a negligible improvement for realistic $\delta$ , so a different privacy analysis is necessary.
|
| 79 |
+
|
| 80 |
+
# 3.1.1. FIRST TERM UPPER BOUND
|
| 81 |
+
|
| 82 |
+
For the privacy guarantee to hold, Equation (1) must hold for arbitrary neighboring databases $X$ and $X'$ . Since the $\ell_2$ ball is spherically symmetric, without loss of generality we consider statistic $T$ where $T(X) = 0$ and $T(X') = e_1 = (1,0,\dots,0)$ . Shorthand the respective mechanisms as $M(0)$ and $M(1)$ . Then
|
| 83 |
+
|
| 84 |
+
$$
|
| 85 |
+
\begin{array}{l} \ell_ {M, X, X ^ {\prime}} (y) = \ln \left(\frac {f _ {X} (y)}{f _ {X ^ {\prime}} (y)}\right) \\ = \ln \left(\frac {\exp [ - \| y \| _ {2} / \sigma ]}{\exp [ - \| y - e _ {1} \| _ {2} / \sigma ]}\right) \\ = \frac {1}{\sigma} \left(\| y - e _ {1} \| _ {2} - \| y \| _ {2}\right) \\ \end{array}
|
| 86 |
+
$$
|
| 87 |
+
|
| 88 |
+
so we want to upper bound
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\mathbb {P} _ {y \sim M (0)} \left[ \frac {1}{\sigma} \left(\| y - e _ {1} \| _ {2} - \| y \| _ {2}\right) \geq \varepsilon \right]. \tag {2}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
We shorthand the relevant region in Equation (2) as $V$ .
|
| 95 |
+
|
| 96 |
+
Definition 3.1. Define $V = \{y\mid \frac{1}{\sigma} (\| y - e_1\| _2 - \| y\| _2)\geq \varepsilon \}$ $M$ 's high privacy loss region.
|
| 97 |
+
|
| 98 |
+
A simple case is $\sigma \geq \frac{1}{\varepsilon}$ .
|
| 99 |
+
|
| 100 |
+
Lemma 3.2. $\sigma \geq \frac{1}{\varepsilon}$ if and only if $\mathbb{P}_{y\sim M(0)}[y\in V] = 0$
|
| 101 |
+
|
| 102 |
+
Proof. The equation $||y - e_1||_2 - ||y||_2| = \sigma \varepsilon$ defines a hyperboloid with foci 0 and $e_1$ and constant difference $\sigma \varepsilon$ . If we instead consider $||y - e_1||_2 - ||y||_2 \geq \sigma \varepsilon$ , removing the absolute value restricts the hyperboloid to the $-e_1$ facing component, and moving to inequality yields the convex hull of that component. An illustration appears in Figure 2.
|
| 103 |
+
|
| 104 |
+
If $\sigma >\frac{1}{\varepsilon}$ , then $\| y - e_1\| _2 - \| y\| _2\geq \sigma \varepsilon$ has no solution because the triangle inequality means $\| y - e_1\| _2 - \| y\| _2\leq \| e_1\|$ . Thus $V = \emptyset$ , so $\mathbb{P}_{y\sim M(0)}[y\in V] = 0$ . If $\sigma = \frac{1}{\varepsilon}$ then $\| y - e_1\| _2 - \| y\| _2\geq \sigma \varepsilon$ only holds for $y$ contained in the $-e_1$ axis. This set has measure 0, so $\mathbb{P}_{y\sim M(0)}[y\in V] = 0$ . Finally, if $\sigma < \frac{1}{\varepsilon}$ , then $\| y - e_1\| _2 - \| y\| _2\geq \sigma \varepsilon$ determines a $-e_1$ facing component of the hyperboloid that is nondegenerate, so its convex hull has positive measure, i.e. $\mathbb{P}_{y\sim M(0)}[y\in V] > 0$ .
|
| 105 |
+
|
| 106 |
+
The rest of this subsection considers $\sigma < \frac{1}{\varepsilon}$ . When $d = 1$ , all $\ell_p$ norm mechanisms are identical. In particular, the $\ell_2$ mechanism is equivalent to the Laplace mechanism.
|
| 107 |
+
|
| 108 |
+

|
| 109 |
+
Figure 2. An illustration of $V$ for $\sigma = 1 / (2\varepsilon)$ . We draw the projection of $V$ onto $\operatorname{span}(e_1, e_2)$ as the shaded region.
|
| 110 |
+
|
| 111 |
+
Lemma 3.3. If $\sigma \leq \frac{1}{\varepsilon}$ and $d = 1$ , then $\mathbb{P}_{y \sim M(0)}[y \in V] = 1 - \frac{1}{2} \exp \left(\frac{1}{2} [\varepsilon - \frac{1}{\sigma}]\right)$ .
|
| 112 |
+
|
| 113 |
+
Proof. $M$ has the same noise density as the Laplace mechanism $\operatorname{Lap}(\sigma)$ , and $|y - e_1| - |y| \geq \sigma \varepsilon$ if and only if $y \leq \frac{1}{2}(1 - \sigma \varepsilon)$ . For $z \geq 0$ , the $\operatorname{Lap}(\sigma)$ CDF is $F(z) = 1 - \frac{1}{2}\exp\left(-\frac{z}{\sigma}\right)$ , so by $1 - \sigma \varepsilon \geq 0$ , $\mathbb{P}_{y \sim M(0)}[y \in V] = 1 - \frac{1}{2}\exp\left(\frac{1}{2}[\varepsilon - \frac{1}{\sigma}]\right)$ .
|
| 114 |
+
|
| 115 |
+
This leaves the case $\sigma \leq \frac{1}{\varepsilon}$ and $d \geq 2$ . We proceed under that assumption.
|
| 116 |
+
|
| 117 |
+
Assumption 3.4. Statistic $T$ has dimension $d \geq 2$ , and $\sigma < \frac{1}{\varepsilon}$ .
|
| 118 |
+
|
| 119 |
+
When $d \geq 2$ , the level sets of $M$ are spheres, and we will show that the high privacy loss portions of level sets are spherical caps.
|
| 120 |
+
|
| 121 |
+
Definition 3.5. For $r > 0$ and $z \in \mathbb{R}^d$ , define $S_{r,z} = \{x \in \mathbb{R}^d \mid \| x - z\|_2 = r\}$ , the sphere of radius $r$ centered at $z$ . For any sphere $S_{r,z}$ where $z = (c,0,\ldots,0)$ , the spherical cap of $S_{r,z}$ of height $h$ is the set of points $\hat{S}_{r,z,h} = \{(x_1,\dots,x_d) \in \mathbb{R}^d \mid \| x - z\|_2 = r \text{ and } x_1 \leq c - r + h\}$ . See Figure 3 for an illustration.
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 3. The unit circle in $\mathbb{R}^2$ with a spherical cap (thick purple arc) of height 0.5. In $\mathbb{R}^d$ , the sphere and spherical cap are both $(d - 1)$ -dimensional objects.
|
| 125 |
+
|
| 126 |
+
Lemma 3.6. Define height
|
| 127 |
+
|
| 128 |
+
$$
|
| 129 |
+
h (r) = \min \left(r (1 - \varepsilon \sigma) + \frac {1 - (\varepsilon \sigma) ^ {2}}{2}, 2 r\right).
|
| 130 |
+
$$
|
| 131 |
+
|
| 132 |
+
Then $\hat{S}_{r,0,h(r)} = V\cap S_{r,0}$
|
| 133 |
+
|
| 134 |
+
Proof. Orient the 2-dim plane $\operatorname{span}(e_1, e_2)$ so that the positive $e_1$ direction is right and the positive $e_2$ direction is up. Consider the points $0, e_1$ , and some $y \in S_{r,0} \cap H$ where $H$ is the upper half of the span $(e_1, e_2)$ plane (i.e., $y_2 \geq 0$ ). Let $\theta$ be the clockwise angle from $y$ to $e_1$ . Proofs of the following claim (and others omitted in this subsection) appear in Appendix A.1.
|
| 135 |
+
|
| 136 |
+
Claim 3.6.1. $\| y - e_1 \|_2 - \| y \|_2$ decreases as $\theta$ decreases.
|
| 137 |
+
|
| 138 |
+
We want to identify a function $h(r)$ for all $r > 0$ such that $\hat{S}_{r,0,h(r)} = V \cap S_{r,0}$ . Assumption 3.4 means $\sigma < \frac{1}{\varepsilon}$ , so by Lemma 3.2, $V \cap S_{r,0}$ is nonempty. The analysis splits into cases.
|
| 139 |
+
|
| 140 |
+
Case 1: $S_{r,0} \not\subset V$ . Since $\frac{1}{\sigma} (\| p - e_1 \|_2 - \| p \|_2)$ changes monotonically by Claim 3.6.1 then there exists $p = (p_1, p_2, 0, \dots, 0) \in S_{r,0}$ at the base of $\hat{S}_{r,0,h(r)}$ such that $\frac{1}{\sigma} (\| p - e_1 \|_2 - \| p \|_2) = \varepsilon$ . Then $h(r)$ satisfies $(r - h(r))^2 + p_2^2 = r^2$ , and we get $p_2 = \sqrt{2h(r)r - h(r)^2}$ .
|
| 141 |
+
|
| 142 |
+
We can now derive the desired expression for $h(r)$ .
|
| 143 |
+
|
| 144 |
+
Claim 3.6.2. $\frac{1}{\sigma} (\| p - e_1\| _2 - \| p\| _2) = \varepsilon$ is equivalent to $h(r) = r(1 - \varepsilon \sigma) + \frac{1 - \varepsilon^2\sigma^2}{2}$ .
|
| 145 |
+
|
| 146 |
+
Moreover, we show that with the above definition of $h(r)$ , the constraint $h(r) \in [0, 2r]$ is equivalent to a constraint on the radius given by $r \geq \frac{1 - \varepsilon\sigma}{2}$ .
|
| 147 |
+
|
| 148 |
+
Claim 3.6.3. $r(1 - \varepsilon \sigma) + \frac{1 - \varepsilon^2\sigma^2}{2}\in [0,2r]$ if and only if $r\geq \frac{1 - \varepsilon\sigma}{2}$
|
| 149 |
+
|
| 150 |
+
In summary, $S_{r,0} \not\subset V$ if and only if $r \geq \frac{1 - \varepsilon \sigma}{2}$ , and for such $r$ , we have $\hat{S}_{r,0,h(r)} = V \cap S_{r,0}$ when $h(r)$ is defined as in Claim 3.6.2.
|
| 151 |
+
|
| 152 |
+
Case 2: $S_{r,0} \subset V$ . By the above, $S_{r,0} \subset V$ if and only if $r < \frac{1 - \varepsilon\sigma}{2}$ . The statement $S_{r,0} \subset V$ is equivalent to $\frac{1}{\sigma} (\| p - e_1 \|_2 - \| p \|_2) = \frac{1}{\sigma} (\sqrt{(r + 1)^2 - 2h(r)} - r) \geq \varepsilon$ for all $p \in S_{r,0}$ , and this inequality is equivalent to $h(r) \leq r(1 - \varepsilon\sigma) + \frac{1 - \varepsilon^2\sigma^2}{2}$ by replacing equality with inequalities in the proof of Claim 3.6.2. By Claim 3.6.3, $r < \frac{1 - \varepsilon\sigma}{2}$ is equivalent to $r(1 - \varepsilon\sigma) + \frac{1 - \varepsilon^2\sigma^2}{2} > 2r$ . Then defining $h(r) = 2r$ suffices to satisfy $h(r) \leq r(1 - \varepsilon\sigma) + \frac{1 - \varepsilon^2\sigma^2}{2}$ for all $r < \frac{1 - \varepsilon\sigma}{2}$ .
|
| 153 |
+
|
| 154 |
+
In summary, if we define $h(r)$ as
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
h (r) = \left\{ \begin{array}{l l} r (1 - \varepsilon \sigma) + \frac {1 - \varepsilon^ {2} \sigma^ {2}}{2} & \text {i f} r \geq \frac {1 - \varepsilon \sigma}{2} \\ 2 r & \text {i f} r < \frac {1 - \varepsilon \sigma}{2} \end{array} \right.
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
then $h(r) \in [0, 2r]$ and $\hat{S}_{r,0,h(r)} = V \cap S_{r,0}$ . Since $r(1 - \varepsilon \sigma) + \frac{1 - \varepsilon^2\sigma^2}{2} > 2r$ for $r < \frac{1 - \varepsilon\sigma}{2}$ , this piecewise function is equivalent to $h(r) = \min \left(r(1 - \varepsilon \sigma) + \frac{1 - (\varepsilon\sigma)^2}{2}, 2r\right)$ .
|
| 161 |
+
|
| 162 |
+
We showed in the above proof that, for small $r$ , the entirety of $S_{r,0}$ lies in $V$ .
|
| 163 |
+
|
| 164 |
+
Corollary 3.7. If $r \leq \frac{1 - \varepsilon\sigma}{2}$ , then $S_{r,0} \subset V$ .
|
| 165 |
+
|
| 166 |
+
It remains to analyze the high privacy loss region for larger $r$ . Our analysis will repeatedly reason about the fraction of a sphere occupied by a cap.
|
| 167 |
+
|
| 168 |
+
Definition 3.8. Let $F_{r,h}$ denote the fraction of the surface of $S_{r,0}$ occupied by cap $\hat{S}_{r,0,h}$ .
|
| 169 |
+
|
| 170 |
+
Lemma 3.9 ((Li, 2010)). Let $I_{x}(a,b) = \frac{\int_{0}^{x}t^{a - 1}(1 - t)^{b - 1}dt}{\int_{0}^{1}t^{a - 1}(1 - t)^{b - 1}dt}$ denote the regularized incomplete beta function. Let $h$ be the height function defined in Lemma 3.6. If $h(r) \leq r$ , then $F_{r,h(r)} = \frac{1}{2} I_{(2rh(r) - h(r)^2) / r^2}\left(\frac{d - 1}{2},\frac{1}{2}\right)$ . If $h(r) > r$ , then $F_{r,h(r)} = 1 - F_{r,2r - h(r)}$ .
|
| 171 |
+
|
| 172 |
+
There is no closed-form expression for $I_{x}(a,b)$ , but it is a standard function in mathematical libraries like SciPy (SciPy, 2024).<sup>1</sup> We can therefore use Lemma 3.9 to compute the fraction of any $S_{r,0}$ that lies in $V = \cup_{r\in \mathbb{R}^{+}}\hat{S}_{r,0,h(r)}$ (Lemma 3.6). It remains to extend these results about individual spheres to results about $V$ as a whole.
|
| 173 |
+
|
| 174 |
+
The next lemma shows that the high-loss cap fraction decreases with $r$ . It combines Lemma 3.6 and Lemma 3.9 to show directly that the appropriate $I_{x}(a,b)$ is monotone in $r$ in the desired direction. Since the proof is again mostly calculation, it also appears in Appendix A.1.
|
| 175 |
+
|
| 176 |
+
Lemma 3.10. $F_{r,h(r)}$ is monotone decreasing in $r$ .
|
| 177 |
+
|
| 178 |
+
This suggests the following approach: if $M(0)$ samples $y$ with $\| y\| _2 > r$ with probability $p$ , then $pF_{r,h(r)}$ is an upper bound on $\mathbb{P}_{y\sim M(0)}[y\in V,\| y\| _2 > r]$ . The following result gives a closed form for $p$ . The expression uses the lower incomplete gamma function and the gamma function, which are also standard functions in mathematical libraries. The proof is mostly calculation and appears in Appendix A.1.
|
| 179 |
+
|
| 180 |
+
Definition 3.11. For $z \geq 0$ , the Gamma function is $\Gamma(z) = \int_{0}^{\infty} t^{z-1} e^{-t} dt$ , the lower incomplete Gamma function is $\gamma(z, x) = \int_{0}^{x} t^{z-1} e^{-t} dt$ , and the upper incomplete Gamma function is $\Gamma(z, x) = \Gamma(z) - \gamma(z, x)$ .
|
| 181 |
+
|
| 182 |
+
Lemma 3.12. For $r > 0$ , $\mathbb{P}_{y \sim M(0)}[\|y\|_2 \leq r] = \frac{\gamma(d, r / \sigma)}{\Gamma(d)}$ .
|
| 183 |
+
|
| 184 |
+
The preceding results yield the following upper bound.
|
| 185 |
+
|
| 186 |
+
Lemma 3.13. Suppose Assumption 3.4 holds. Let $r_1 < \ldots < r_{n_r}$ where $r_1 = \frac{1 - \varepsilon\sigma}{2}$ . Then, for $y \sim M(0)$ ,
|
| 187 |
+
|
| 188 |
+
$$
|
| 189 |
+
\begin{array}{l} \mathbb {P} \left[ y \in V \right] \leq \frac {\gamma (d , r _ {1} / \sigma)}{\Gamma (d)} \\ + \sum_ {j = 1} ^ {n _ {r} - 1} \frac {\gamma (d , r _ {j + 1} / \sigma) - \gamma (d , r _ {j} / \sigma)}{\Gamma (d)} F _ {r _ {j}, h (r _ {j})} \\ + \frac {\Gamma (d , r _ {n _ {r}} / \sigma)}{\Gamma (d)} F _ {r _ {n _ {r}}, h (r _ {n _ {r}})}. \\ \end{array}
|
| 190 |
+
$$
|
| 191 |
+
|
| 192 |
+
Proof. The first term is the mass placed on the ball lying entirely in the high privacy loss region (Corollary 3.7 and Lemma 3.12); the second term is a (left) Riemann sum that upper bounds the mass placed on the high privacy loss region between balls of radius $r_1$ and $r_{n_r}$ (Lemma 3.9, Lemma 3.12, and Lemma 3.10); and the last is an upper bound on the mass placed on the high privacy loss region outside the ball of radius $r_{n_r}$ . More specifically, it is a Riemann sum in which the $j$ th approximating rectangle has base length as the $j$ th interval on the grid $\left[0, \frac{\gamma(d, r_1 / \sigma)}{\Gamma(d)}, \dots, \frac{\gamma(d, R_{n_r} / \sigma)}{\Gamma(d)}, \infty \right]$ and height $F_{r_j, h(r_j)}$ .
|
| 193 |
+
|
| 194 |
+
Algorithm 1 provides overall upper bound pseudocode.
|
| 195 |
+
|
| 196 |
+
# Algorithm 1 Term1UpperBound
|
| 197 |
+
|
| 198 |
+
1: Input: Dimension $d$ ; scale parameter $\sigma$ ; privacy parameter $\varepsilon$ ; largest radius $r^*$ ; number of radii $n_r$
|
| 199 |
+
2: if $\sigma > 1 / \varepsilon$ then
|
| 200 |
+
3: Return 0 (Lemma 3.2)
|
| 201 |
+
4: end if
|
| 202 |
+
5: if $d = 1$ then
|
| 203 |
+
6: Return $1 - \frac{1}{2} \exp \left( \frac{1}{2} \left[ \varepsilon - \frac{1}{\sigma} \right] \right)$ (Lemma 3.3)
|
| 204 |
+
7: end if
|
| 205 |
+
8: Define $r_1 \gets \frac{1 - \varepsilon\sigma}{2}$ , $r_{n_r} \gets r^*$ , and $r_2, \ldots, r_{n_{r-1}}$ regularly spaced between $r_1$ and $r_{n_r}$
|
| 206 |
+
9: Return upper bound from Lemma 3.13
|
| 207 |
+
|
| 208 |
+
# 3.1.2. SECOND TERM LOWER BOUND
|
| 209 |
+
|
| 210 |
+
It remains to lower bound $\mathbb{P}_{y\sim M(1)}[\ell_{M,X',X}(y)\leq -\varepsilon ]$ . By the same logic used to derive Equation (2), we rewrite it as
|
| 211 |
+
|
| 212 |
+
$$
|
| 213 |
+
\begin{array}{l} \mathbb {P} _ {y \sim M (1)} \left[ \ln \left(\frac {f _ {X} ^ {\prime} (y)}{f _ {X} (y)}\right) \leq - \varepsilon \right] \\ = \mathbb {P} _ {y \sim M (1)} \left[ \frac {1}{\sigma} \left(\| y - e _ {1} \| _ {2} - \| y \| _ {2}\right) \geq \varepsilon \right]. \\ \end{array}
|
| 214 |
+
$$
|
| 215 |
+
|
| 216 |
+
The level sets of $M(1)$ are spheres centered at $e_1$ . As in the upper bound analysis, there are a few simple cases. The first follows from the same reasoning used for Lemma 3.2.
|
| 217 |
+
|
| 218 |
+
Corollary 3.14. If $\sigma \geq \frac{1}{\varepsilon}$ , then $\mathbb{P}_{y \sim M(1)}[y \in V] = 0$ .
|
| 219 |
+
|
| 220 |
+
The second case uses the same argument as Lemma 3.3.
|
| 221 |
+
|
| 222 |
+
Lemma 3.15. If $\sigma \leq \frac{1}{\varepsilon}$ and $d = 1$ , then $\mathbb{P}_{y \sim M(1)}[y \in V] = \frac{1}{2} \exp \left(\frac{1}{2} \left[-\varepsilon - \frac{1}{\sigma}\right]\right)$ .
|
| 223 |
+
|
| 224 |
+
Proof. $M(1)$ has the same noise density as the Laplace mechanism $\operatorname{Lap}(1, \sigma)$ , and $|y - e_1| - |y| \geq \sigma \varepsilon$ if and only if $y \leq \frac{1}{2} (1 - \sigma \varepsilon)$ . For $z < 1$ , the $\operatorname{Lap}(1, \sigma)$ CDF is $F(z) = \frac{1}{2} \exp\left(\frac{z - 1}{\sigma}\right)$ , so by $1 - \sigma \varepsilon \geq 0$ , $\mathbb{P}_{y \sim M(1)}[y \in V] = \frac{1}{2} \exp\left(\frac{1}{2} [-\varepsilon - \frac{1}{\sigma}]\right)$ .
|
| 225 |
+
|
| 226 |
+
We therefore work under Assumption 3.4 for the rest of this section. The remaining analysis reasons about specific spheres $S_{R,1}$ .
|
| 227 |
+
|
| 228 |
+
Definition 3.16. For $R > 0$ , define $U_R$ to be the fraction of $S_{R,1}$ contained in $V$ .
|
| 229 |
+
|
| 230 |
+
We start by identifying when $U_{R} = 0$ .
|
| 231 |
+
|
| 232 |
+
Lemma 3.17. If $0 < R < \frac{1 + \varepsilon\sigma}{2}$ , then $U_{R} = 0$
|
| 233 |
+
|
| 234 |
+
Proof. Shorthand $\tau = \varepsilon \sigma$ for neatness. By Corollary 3.7, $F_{r,h(r)} = 1$ for $r \leq \frac{1 - \tau}{2}$ . Let $r_1 = \frac{1 - \tau}{2}$ denote the largest radius such that $F_{r,h(r)} = 1$ . This shows that the point with the largest $e_1$ -coordinate in $V \cap S_{r,0}$ has $e_1$ -coordinate $r$ for $0 < r \leq r_1$ . For $r > r_1$ , the point with the largest $e_1$ -coordinate in $V \cap S_{r,0}$ has $e_1$ -coordinate $-r + h(r) = -r\tau + \frac{1 - \tau^2}{2}$ which is monotonically decreasing as $r$ increases. Overall, the point with the largest $e_1$ -coordinate in $V \cap S_{r,0}$ is increasing for $0 < r \leq r_1$ and decreasing for $r > r_1$ , so $r_1$ is the maximum $e_1$ -coordinate of this point over all radii.
|
| 235 |
+
|
| 236 |
+
It follows that $0 < R < 1 - r_{1}$ implies $S_{R,1} \cap S_{r,0} = \emptyset$ for all $r > 0$ , and since $V \subset \cup_{r \in \mathbb{R}^{+}} S_{r,0}$ , we get $U_{R} = 0$ .
|
| 237 |
+
|
| 238 |
+
It remains to handle the large $R$ case. We will show that, as was the case in the upper bound analysis, each $S_{R,1} \cap V$ is a spherical cap on $S_{R,1}$ . The first result proves that $S_{R,1} \cap V$ has this form. This result is not technically necessary for the rest of the argument, but it explains why we attempt to solve for $S_{R,1} \cap V$ as a cap later.
|
| 239 |
+
|
| 240 |
+
Lemma 3.18. For $R \geq \frac{1 + \varepsilon\sigma}{2}$ , $S_{R,1} \cap V$ is a spherical cap $\hat{S}_{R,1,H(R)}$ .
|
| 241 |
+
|
| 242 |
+
Proof. Shorthand $\tau = \varepsilon \sigma$ . Recall from Lemma 3.2 that $V$ is the convex hull of the $-e_1$ facing component of a hyperboloid with foci 0 and $e_1$ and with constant difference $\tau$ . To see why $S_{R,1} \cap V$ is a spherical cap, observe that both the hyperboloid-bounded region $V$ and $S_{R,1}$ are symmetric around $e_1$ , so their intersection must be symmetric around $e_1$ as well. Let $P_{v_1, v_2}$ denote projection onto $\operatorname{span}(v_1, v_2)$ . Then $P_{e_1, e_2}(V) \cap P_{e_1, e_2}(S_{R,1})$ is a 1-dimensional spherical cap of some height $H$ in $P_{e_1, e_2}(S_{R,1})$ . Since $V \cap S_{R,1}$ is symmetric around $e_1$ , the previous sentence also holds if we
|
| 243 |
+
|
| 244 |
+
replace $P_{e_1,e_2}$ with $P_{e_1,v}$ for any $v$ orthogonal to $e_1$ . Thus $V \cap S_{R,1} = \cup_{v \perp e_1} P_{e_1,v}(V) \cap P_{e_1,v}(S_{R,1}) = \hat{S}_{R,1,H}$ .
|
| 245 |
+
|
| 246 |
+
It remains to identify the $H$ referenced in Lemma 3.18. To do so, we start with an arbitrary $y \in S_{R,1}$ and solve for an $e_1$ coordinate $X$ such that $y_1 \leq X$ if and only if $y_1 \leq -\| y \|_2 + h(\| y \|_2)$ (Lemma 3.6). The bulk of the proof beyond this idea is algebraic manipulation, so it appears in Appendix A.2.
|
| 247 |
+
|
| 248 |
+
Lemma 3.19. Define $X = \frac{1 + (\varepsilon\sigma)^2 - 2\varepsilon\sigma R}{2}$ and $H(R) = R - 1 + X$ . Then cap $\hat{S}_{R,1,H(R)} = S_{R,1} \cap V$ .
|
| 249 |
+
|
| 250 |
+
Lemma 3.20. If $R \geq \frac{1 + \varepsilon\sigma}{2}$ , then $U_{R}$ is monotone increasing in $R$ .
|
| 251 |
+
|
| 252 |
+
Proof. Shorthand $\tau = \varepsilon \sigma$ . Lemma 3.17 established that $U_R = 0$ for $R < \frac{1 + \tau}{2}$ , so it remains to show that $U_R$ is increasing in $R$ for $R \geq \frac{1 + \tau}{2}$ . The proof of Lemma 3.19 established that $H(R) \in [0, R]$ , so we apply Lemma 3.9 to get that $\hat{S}_{R,1,H(R)}$ occupies a fraction of $S_{R,1}$ given by $\frac{1}{2} I_{(2RH(R) - H(R)^2) / R^2}\left(\frac{d - 1}{2}, \frac{1}{2}\right)$ . By the same logic used in the proof of Lemma 3.10, we can show that $U_R$ is monotone increasing by verifying that the expression in the $I$ subscript is nonnegative and increasing in $R$ .
|
| 253 |
+
|
| 254 |
+
The first condition follows from the aforementioned result $H(R) \leq R$ . For the second condition,
|
| 255 |
+
|
| 256 |
+
$$
|
| 257 |
+
\begin{array}{l} \frac {2 R [ R - 1 + X ] - [ R - 1 + X ] ^ {2}}{R ^ {2}} \\ = \frac {R ^ {2} - 1 + 2 X - X ^ {2}}{R ^ {2}} \\ = 1 - \left(\frac {X - 1}{R}\right) ^ {2} \\ = 1 - \left(\frac {\tau^ {2} - 2 \tau R - 1}{2 R}\right) ^ {2}. \\ \end{array}
|
| 258 |
+
$$
|
| 259 |
+
|
| 260 |
+
We wanted to prove that this expression is increasing in $R$ , so we show that the second term is decreasing in $R$ . Taking its derivative with respect to $R$ yields
|
| 261 |
+
|
| 262 |
+
$$
|
| 263 |
+
\begin{array}{l} 2 \left(\frac {\tau^ {2} - 2 \tau R - 1}{2 R}\right) \cdot \frac {2 R (- 2 \tau) - 2 (\tau^ {2} - 2 \tau R - 1)}{4 R ^ {2}} \\ = \left(\frac {\tau^ {2} - 2 \tau R - 1}{R}\right) \cdot \frac {1 - \tau^ {2}}{2 R ^ {2}}. \\ \end{array}
|
| 264 |
+
$$
|
| 265 |
+
|
| 266 |
+
Because $R > 0$ and $0 < \tau < 1$ , the numerator of the first term is negative, and the remaining terms are positive, so the entire quantity is negative.
|
| 267 |
+
|
| 268 |
+
Since we want to lower bound the mass on these $U_{R}$ , we use Lemma 3.12 and employ a left Riemann sum in which the $j$ th approximating rectangle has base length as the $j$ th
|
| 269 |
+
|
| 270 |
+
interval on the grid $\left[\frac{\gamma(d,R_1 / \sigma)}{\Gamma(d)},\dots,\frac{\gamma(d,R_{n_R} / \sigma)}{\Gamma(d)},\infty \right]$ and has height $F_{R_j,H(R_j)}$ . The proof of the following result uses similar logic as the proof of Lemma 3.13.
|
| 271 |
+
|
| 272 |
+
Lemma 3.21. Suppose Assumption 3.4 holds. Let $R_{1} < \ldots < R_{n_{R}}$ where $R_{1} = \frac{1 + \tau}{2}$ . Then for $y \sim M(1)$ ,
|
| 273 |
+
|
| 274 |
+
$$
|
| 275 |
+
\begin{array}{l} \mathbb {P} [ y \in V ] \geq \sum_ {j = 1} ^ {n _ {R} - 1} \frac {\gamma (d , R _ {j + 1} / \sigma) - \gamma (d , R _ {j} / \sigma)}{\Gamma (d)} F _ {R _ {j}, H (R _ {j})} \\ + \frac {\Gamma (d , R _ {n _ {R}} / \sigma)}{\Gamma (d)} F _ {R _ {n _ {R}}, H (R _ {n _ {R}})} \\ \end{array}
|
| 276 |
+
$$
|
| 277 |
+
|
| 278 |
+
where we reused the definition of $F$ from Definition 3.8.
|
| 279 |
+
|
| 280 |
+
Algorithm 2 provides overall lower bound pseudocode.
|
| 281 |
+
|
| 282 |
+
# Algorithm 2 Term2LowerBound
|
| 283 |
+
|
| 284 |
+
1: Input: Dimension $d$ ; scale parameter $\sigma$ ; privacy parameter $\varepsilon$ ; largest radius $R^{*}$ ; number of radii $n_{R}$
|
| 285 |
+
2: if $\sigma \geq 1 / \varepsilon$ then
|
| 286 |
+
3: Return 0 (Corollary 3.14)
|
| 287 |
+
4: end if
|
| 288 |
+
5: if $d = 1$ then
|
| 289 |
+
6: Return $\frac{1}{2}\exp\left(\frac{1}{2}\left[-\varepsilon - \frac{1}{\sigma}\right]\right)$ (Lemma 3.15)
|
| 290 |
+
7: end if
|
| 291 |
+
8: Define $R_{1} \gets \frac{1 + \tau}{2}$ , $R_{n_{R}} \gets R^{*}$ , and $R_{2}, \ldots, R_{n_{R}-1}$ regularly spaced between $R_{1}$ and $R_{n_{R}}$
|
| 292 |
+
9: Return lower bound from Lemma 3.21
|
| 293 |
+
|
| 294 |
+
# 3.1.3. OVERALL ALGORITHM
|
| 295 |
+
|
| 296 |
+
Algorithm 1 upper bounds the first term in the inequality in Lemma 2.3 and Algorithm 2 lower bounds the second term. This upper bounds the LHS of the inequality, so if it is at most $\delta$ , then the mechanism is $(\varepsilon, \delta)$ -DP.
|
| 297 |
+
|
| 298 |
+
The last step is choosing $n_r, r^*, n_R$ , and $R^*$ . Our experiments suggest that setting $n_r = n_R = 1000$ yields a reasonably tight approximation for $d \leq 100$ (see Section 4.1); larger values should only be tighter, at the cost of speed. We choose $r^*$ using Lemma 3.12 so $\mathbb{P}_{y \sim M(0)}[||y||_2 > r^*] = \frac{\delta}{100}$ ; in the context of Lemma 3.13, we use $F_{r_{n_r}, h(r_{n_r})}$ to upper bound the cap fraction for all $S_{r,0}$ with $r \geq r_{n_r}$ , so we choose $r^*$ to make the effect of this approximation negligible. By the same logic, we use $R^* = r^*$ .
|
| 299 |
+
|
| 300 |
+
Algorithm 3 collects the entire process into pseudocode.
|
| 301 |
+
|
| 302 |
+
# 3.2. Parallel Sampler
|
| 303 |
+
|
| 304 |
+
The sampler described here is a simple consequence of Lemma 2.4 and well-known statistical facts, and similar samplers have appeared for related mechanisms (Yu et al., 2014; Steinke & Ullman, 2016). We collect the relevant information here, with proofs in Appendix A.3 for completeness.
|
| 305 |
+
|
| 306 |
+
# Algorithm 3 CheckApproximateDP
|
| 307 |
+
|
| 308 |
+
1: Input: Dimension $d$ ; scale parameter $\sigma$ ; privacy parameters $\varepsilon$ , $\delta$ ; numbers of radii $n_r$ , $n_R$
|
| 309 |
+
2: Compute $r^*$ such that $\mathbb{P}_{y\sim M(0)}\left[\| y\| _2 > r^*\right] = \frac{\delta}{100}$ (Lemma 3.12)
|
| 310 |
+
3: $T_{1}\gets \mathrm{Term1UpperBound}(d,\sigma ,\varepsilon ,r^{*},n_{r})$
|
| 311 |
+
4: $T_{2}\gets$ Term2LowerBound $(d,\sigma ,\varepsilon ,r^{*},n_{R})$
|
| 312 |
+
5: Return $(T_{1} - e^{\varepsilon}T_{2}\leq \delta)$
|
| 313 |
+
|
| 314 |
+
By Lemma 2.4, we sample $rz$ where $r \sim \mathsf{G}\mathsf{a}\mathsf{m}\mathsf{a}\mathsf{a}\left(d + 1,\sigma\right)$ and $z \sim_{U} B_{2}^{d}$ . In a parallel setting, suppose we have a worker for each of $d$ coordinates and a central manager. We first sample $r$ .
|
| 315 |
+
|
| 316 |
+
Lemma 3.22. Let $U_{1},\ldots ,U_{d + 1}\sim_{i id}U(0,1)$ be uniform random samples. Then $-\sigma \sum_{i = 1}^{d + 1}\log (U_i)\sim$ Gamma $(d + 1,\sigma)$
|
| 317 |
+
|
| 318 |
+
By Lemma 3.22, each worker $i$ can sample $\log(U_i)$ , and the manager can add the combined sum to their own sample and scale the result by $-\sigma$ to obtain $r$ . It remains to sample $z$ .
|
| 319 |
+
|
| 320 |
+
Lemma 3.23. Let $X_{1},\ldots ,X_{d}\sim_{i id}N(0,1)$ and let $Y\sim U(0,1)$ be a uniform sample from [0,1]. Then $Y^{1 / d}\cdot \frac{(X_1,\dots,X_d)}{\sqrt{\sum_{i = 1}^dX_i^2}}$ is a uniform sample from $B_2^d$
|
| 321 |
+
|
| 322 |
+
To apply Lemma 3.23, each worker samples a standard Gaussian and reports its square in the same combine used to compute $r$ in Lemma 3.22. The manager samples $Y$ and publishes it along with $r$ and the sum of squares. At this point, each worker can compute their coordinate of $rz$ .
|
| 323 |
+
|
| 324 |
+
# 4. Experiments
|
| 325 |
+
|
| 326 |
+
This section discusses experiments evaluating the tightness of our privacy analysis (Section 4.1) as well as the $\ell_2$ mechanism's error (Section 4.2) and speed (Section 4.3). All experiments use the $\ell_2$ mechanism with $n_r = n_R = 1000$ . Experiment code may be found on Github (Google, 2025).
|
| 327 |
+
|
| 328 |
+
# 4.1. Privacy
|
| 329 |
+
|
| 330 |
+
Our first experiments attempt to measure the tightness of our privacy analysis. To do so, we compare two methods for estimating $\mathbb{P}\left[\ell_{M,X,X^{\prime}}\geq \varepsilon \right] - e^{\varepsilon}\mathbb{P}\left[\ell_{M,X^{\prime},X}\leq -\varepsilon \right]$ , the quantity that must be upper bounded by $\delta$ for $M$ to satisfy $(\varepsilon ,\delta)$ -DP (Lemma 2.3).
|
| 331 |
+
|
| 332 |
+
We fix $\varepsilon = 1$ , $\delta = 0.01$ , and vary $d = 1,2,\ldots,100$ . At each $d$ , the first method empirically estimates the smallest $\sigma$ such that
|
| 333 |
+
|
| 334 |
+
$$
|
| 335 |
+
\mathbb {P} \left[ \ell_ {M, X, X ^ {\prime}} \geq 1 \right] - e \cdot \mathbb {P} \left[ \ell_ {M, X ^ {\prime}, X} \leq - 1 \right] \leq \delta , \tag {3}
|
| 336 |
+
$$
|
| 337 |
+
|
| 338 |
+
where $M$ is the $\ell_2$ mechanism with parameter $\sigma$ , and $M(X)$ is centered at 0 while $M(X')$ is centered at 1. By the
|
| 339 |
+
|
| 340 |
+
analysis of Section 3, Equation (3) is equivalent to
|
| 341 |
+
|
| 342 |
+
$$
|
| 343 |
+
\begin{array}{l} \mathbb {P} _ {y \sim M (0)} \left[ \frac {1}{\sigma} \big (\| e _ {1} - y \| _ {2} - \| y \| _ {2} \big) \geq \varepsilon \right] \\ - e \cdot \mathbb {P} _ {y \sim M (1)} \left[ \frac {1}{\sigma} \left(\| e _ {1} - y \| _ {2} - \| y \| _ {2}\right) \geq \varepsilon \right] \leq \delta . \\ \end{array}
|
| 344 |
+
$$
|
| 345 |
+
|
| 346 |
+
We can estimate the value of this expression by drawing $n$ samples from $M(0)$ and $n$ samples from $M(1)$ , counting the fraction $c_{1}$ satisfying the first inequality and the fraction $c_{2}$ satisfying the second inequality, and then computing $c_{1} - e \cdot c_{2}$ . Binary searching over $\sigma$ to find the smallest value where this computation is upper bounded by $\delta$ leads to an empirical estimate of the minimum $\sigma$ yielding a $(1, 0.01)$ -DP $\ell_{2}$ mechanism.
|
| 347 |
+
|
| 348 |
+
The second method computes its $\sigma$ using the analysis of Section 3. As shown in Figure 4, our algorithm closely tracks the empirical values. This provides empirical evidence that the resulting privacy analysis is both sound and (with the chosen $n_r = n_R = 1000$ and range for $d$ ) tight.
|
| 349 |
+
|
| 350 |
+

|
| 351 |
+
Figure 4. A comparison of empirical (dotted) and algorithmic (solid) estimates of privacy loss. At each $d$ , the empirical method uses $n = 1000 / \delta = 10^5$ samples.
|
| 352 |
+
|
| 353 |
+
# 4.2. Error
|
| 354 |
+
|
| 355 |
+
We first derive some basic results about the mean squared $\ell_2$ error of the Laplace, $\ell_2$ , and Gaussian mechanisms used in our experiments. The Laplace and $\ell_2$ results are corollaries of the following lemma. The lemma is an extension of a previous result about the mean squared $\ell_2$ norm of a sample from an $\ell_p$ ball (Joseph et al., 2025) and is proved in Appendix A.4.
|
| 356 |
+
|
| 357 |
+
Lemma 4.1. The mean squared $\ell_2$ error of the $d$ -dimensional $\ell_p$ mechanism with parameter $\sigma$ is
|
| 358 |
+
|
| 359 |
+
$$
|
| 360 |
+
(d \sigma) ^ {2} (d + 1) \left(\frac {\Gamma (\frac {d}{p}) \Gamma (\frac {3}{p})}{\Gamma (\frac {1}{p}) \Gamma (\frac {d + 2}{p})}\right).
|
| 361 |
+
$$
|
| 362 |
+
|
| 363 |
+
Since a $d$ -dimensional statistic with $\ell_2$ sensitivity 1 has $\ell_1$ sensitivity $\sqrt{d}$ , substituting $p = 1$ and parameter $\sigma \sqrt{d}$ into Lemma 4.1 yields the following result for the Laplace mechanism.
|
| 364 |
+
|
| 365 |
+
Corollary 4.2. The Laplace mechanism with parameter $\sigma \sqrt{d}$ has mean squared $\ell_2$ error $2d^2\sigma^2$ .
|
| 366 |
+
|
| 367 |
+
The $\ell_2$ mechanism uses $p = 2$ and parameter $\sigma$ .
|
| 368 |
+
|
| 369 |
+
Corollary 4.3. The $\ell_2$ mechanism with parameter $\sigma$ has mean squared $\ell_2$ error $d(d + 1)\sigma^2$ .
|
| 370 |
+
|
| 371 |
+
A similar result for the Gaussian mechanism is easy to prove directly (see Appendix A.4 for proof).
|
| 372 |
+
|
| 373 |
+
Lemma 4.4. The Gaussian mechanism with parameter $\sigma$ has mean squared $\ell_2$ error $d\sigma^2$ .
|
| 374 |
+
|
| 375 |
+
For a range of $d$ , we solve for the smallest possible $\sigma$ for each mechanism to achieve $(\varepsilon, \delta)$ -DP and plot the mean squared $\ell_2$ error according to the preceding results. The Laplace mechanism uses $\sigma = \sqrt{d} / (\varepsilon + \delta)^2$ , the Gaussian mechanism binary searches over $\sigma$ as described by Balle & Wang (2018), and the $\ell_2$ mechanism binary searches over $\sigma$ using the algorithms from Section 3. Throughout, binary searches use tolerance 0.001 and we use $(1, 10^{-5})$ -DP.
|
| 376 |
+
|
| 377 |
+
This produces the left plot in Figure 1 in the introduction. The Laplace mechanism obtains lower error than the analytic Gaussian mechanism for small $d$ , the analytic Gaussian mechanism obtains lower error than the Laplace mechanism for larger $d$ , and the $\ell_2$ mechanism dominates both. The gap between the $\ell_2$ mechanism and the better of the Laplace mechanism and analytic Gaussian mechanism is 0 at $d = 1$ (when the Laplace and $\ell_2$ mechanism are identical) and peaks at $50\%$ at $d = 7$ before gradually shrinking, to $5\%$ at $d = 100$ and $< 1\%$ at $d = 500$ (not pictured).
|
| 378 |
+
|
| 379 |
+
Analogous plots for a high-privacy regime of $(0.1, 10^{-7})$ -DP and a low-privacy regime of $(10, 10^{-3})$ -DP are essentially the same.
|
| 380 |
+
|
| 381 |
+
# 4.3. Speed
|
| 382 |
+
|
| 383 |
+
The last set of experiments evaluates the speed of the $\ell_2$ mechanism, as executed on a typical personal computer. This runtime is split into two operations: the time to compute $\sigma$ and the time to sample the mechanism.
|
| 384 |
+
|
| 385 |
+
The largest gap appears in the time to compute $\sigma$ (Figure 5). The Laplace computation is $\approx 100\mathrm{x}$ faster than the Gaussian computation, which is $\approx 100\mathrm{x}$ faster than the $\ell_2$ computation. This may be expected, as the Laplace computation is a single arithmetic expression, the Gaussian computation is a binary search over the standard normal CDF, and the
|
| 386 |
+
|
| 387 |
+
$\ell_2$ computation is a binary search where each evaluation iterates over $n_r + n_R = 2000$ radii. Nonetheless, we note that the $\ell_2$ computation still runs in $\approx 0.1$ seconds, this time does not increase with $d$ , and the calculation only needs to be performed once for each setting of $(\varepsilon, \delta, d)$ .
|
| 388 |
+
|
| 389 |
+

|
| 390 |
+
Figure 5. A plot of time in seconds to compute the minimum $\sigma$ to achieve $(1,10^{-5})$ -DP. The $\ell_2$ mechanism line jumps after $d = 1$ because that case uses Lemma 3.3 instead of approximating the spherical cap region.
|
| 391 |
+
|
| 392 |
+
The time to draw 1000 mechanism samples is less varied (Figure 6). The $\ell_{2}$ mechanism is again slowest, but it is within a factor of two of the other mechanisms, and no mechanism takes more than $\approx 0.01$ seconds.
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
Figure 6. This plot uses the same setup as Figure 5 but records sampling time.
|
| 396 |
+
|
| 397 |
+
# Impact Statement
|
| 398 |
+
|
| 399 |
+
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none which we feel must be specifically highlighted here.
|
| 400 |
+
|
| 401 |
+
# References
|
| 402 |
+
|
| 403 |
+
Abadi, M., Chu, A., Goodfellow, I., McMahan, H. B., Mironov, I., Talwar, K., and Zhang, L. Deep learning with differential privacy. In Conference on Computer and Communications Security (CCS), 2016.
|
| 404 |
+
Asoodeh, S., Liao, J., Calmon, F. P., Kosut, O., and Sankar, L. A better bound gives a hundred rounds: Enhanced privacy guarantees via f-divergences. In International Symposium on Information Theory (ISIT), 2020.
|
| 405 |
+
Balle, B. and Wang, Y.-X. Improving the gaussian mechanism for differential privacy: Analytical calibration and optimal denoising. In International Conference on Machine Learning (ICML), 2018.
|
| 406 |
+
Bun, M. and Steinke, T. Concentrated differential privacy: Simplifications, extensions, and lower bounds. In Theory of Cryptography Conference (TCC), 2016.
|
| 407 |
+
Canonne, C. L., Kamath, G., and Steinke, T. The discrete gaussian for differential privacy. Neural Information Processing Systems (NeurIPS), 2020.
|
| 408 |
+
Cesar, M. and Rogers, R. Bounding, concentrating, and truncating: Unifying privacy loss composition for data analytics. In Algorithmic Learning Theory (ALT), 2021.
|
| 409 |
+
Chan, T.-H. H., Shi, E., and Song, D. Private and continual release of statistics. Transactions on Information and System Security (TISSEC), 2011.
|
| 410 |
+
Chaudhuri, K., Monteoni, C., and Sarwate, A. D. Differentially private empirical risk minimization. Journal of Machine Learning Research (JMLR), 2011.
|
| 411 |
+
Dwork, C., McSherry, F., Nissim, K., and Smith, A. Calibrating noise to sensitivity in private data analysis. In Theory of Cryptography Conference (TCC), 2006.
|
| 412 |
+
Dwork, C., Naor, M., Pitassi, T., and Rothblum, G. N. Differential privacy under continual observation. In Symposium on the Theory of Computing (STOC), 2010.
|
| 413 |
+
Edmonds, A., Nikolov, A., and Ullman, J. The power of factorization mechanisms in local and central differential privacy. In Symposium on the Theory of Computing (STOC), 2020.
|
| 414 |
+
|
| 415 |
+
Ganesh, A. and Zhao, J. Privately answering counting queries with generalized gaussian mechanisms. Foundations of Responsible Computing (FORC), 2021.
|
| 416 |
+
Google. dp12. https://github.com/ google-research/google-research/tree/ master/dp_12, 2025.
|
| 417 |
+
Hardt, M. and Talwar, K. On the geometry of differential privacy. In Symposium on the Theory of Computing (STOC), 2010.
|
| 418 |
+
Joseph, M., Ribero, M., and Yu, A. Privately Counting Partially Ordered Data. In International Conference on Learning Representations (ICLR), 2025.
|
| 419 |
+
Kifer, D., Smith, A., and Thakurta, A. Private Convex Empirical Risk Minimization and High-dimensional Regression. In Conference on Learning Theory (COLT), 2012.
|
| 420 |
+
Li, C., Miklau, G., Hay, M., McGregor, A., and Rastogi, V. The matrix mechanism: optimizing linear counting queries under differential privacy. *The VLDB Journal*, 2015.
|
| 421 |
+
Li, S. Concise formulas for the area and volume of a hyperspherical cap. Asian Journal of Mathematics & Statistics, 2010.
|
| 422 |
+
McKenna, R., Miklau, G., Hay, M., and Machanavajjhala, A. Optimizing Error of High-Dimensional Statistical Queries under Differential Privacy. The VLDB Journal, 2018.
|
| 423 |
+
McSherry, F. and Talwar, K. Mechanism design via differential privacy. In Foundations of Computer Science (FOCS), 2007.
|
| 424 |
+
Nikolov, A. Private query release via the johnson-lindenstrauss transform. In Symposium on Discrete Algorithms (SODA), 2023.
|
| 425 |
+
Nikolov, A. and Tang, H. Gaussian Noise is Nearly Instance Optimal for Private Unbiased Mean Estimation. arXiv preprint arXiv:2301.13850, 2023.
|
| 426 |
+
Nikolov, A., Talwar, K., and Zhang, L. The geometry of differential privacy: the sparse and approximate cases. In Symposium on the Theory of Computing (STOC), 2013.
|
| 427 |
+
SciPy.scipy.special.betainc,2024.
|
| 428 |
+
Song, S., Chaudhuri, K., and Sarwate, A. D. Stochastic gradient descent with differentially private updates. In Global Conference on Information and Signal Processing (GlobalSIP), 2013.
|
| 429 |
+
|
| 430 |
+
Steinke, T. and Ullman, J. Between pure and approximate differential privacy. Journal of Privacy and Confidentiality, 2016.
|
| 431 |
+
Yu, F., Rybar, M., Uhler, C., and Fienberg, S. E. Differentially-private logistic regression for detecting multiple-SNP association in GWAS databases. In Privacy in Statistical Databases, 2014.
|
| 432 |
+
Zhu, Y., Dong, J., and Wang, Y.-X. Optimal accounting of differential privacy via characteristic function. In Artificial Intelligence and Statistics (AISTATS), 2022.
|
| 433 |
+
|
| 434 |
+
# A. Appendix
|
| 435 |
+
|
| 436 |
+
# A.1. Omitted Proofs From Upper Bound
|
| 437 |
+
|
| 438 |
+
Claim 3.6.1. $\| y - e_1 \|_2 - \| y \|_2$ decreases as $\theta$ decreases.
|
| 439 |
+
|
| 440 |
+
Proof. By the law of cosines,
|
| 441 |
+
|
| 442 |
+
$$
|
| 443 |
+
\begin{array}{l} \| y - e _ {1} \| _ {2} = \sqrt {\| y \| _ {2} ^ {2} + \| e _ {1} \| _ {2} ^ {2} - 2 \| y \| _ {2} \| e _ {1} \| _ {2} \cos (\theta)} \\ = \sqrt {r ^ {2} + 1 - 2 r \cos (\theta)}, \\ \end{array}
|
| 444 |
+
$$
|
| 445 |
+
|
| 446 |
+
so as $y$ moves clockwise through $S_{r,0} \cap H$ from $-e_1$ to $e_1$ , $\theta$ decreases from $\pi$ to 0, $\cos(\theta)$ grows from $-1$ to 1, and $\|y - e_1\|_2$ shrinks from $r + 1$ to $|r - 1|$ . Since $\|y\|_2 = r$ remains constant, $\|y - e_1\|_2 - \|y\|_2$ decreases as $\theta$ decreases. The same conclusion holds if we choose $y$ in the lower half plane and consider the analogous counterclockwise angle.
|
| 447 |
+
|
| 448 |
+
Claim 3.6.2. $\frac{1}{\sigma} (\| p - e_1\| _2 - \| p\| _2) = \varepsilon$ is equivalent to $h(r) = r(1 - \varepsilon \sigma) + \frac{1 - \varepsilon^2\sigma^2}{2}$ .
|
| 449 |
+
|
| 450 |
+
Proof.
|
| 451 |
+
|
| 452 |
+
$$
|
| 453 |
+
\begin{array}{l} \left\| p - e _ {1} \right\| _ {2} = \sqrt {(r + 1 - h (r)) ^ {2} + 2 h (r) r - h (r) ^ {2}} \\ = \sqrt {(r + 1) ^ {2} - 2 h (r)} \\ \end{array}
|
| 454 |
+
$$
|
| 455 |
+
|
| 456 |
+
and
|
| 457 |
+
|
| 458 |
+
$$
|
| 459 |
+
\begin{array}{l} \varepsilon = \frac {1}{\sigma} \left(\| p - e _ {1} \| _ {2} - \| p \| _ {2}\right) \\ \varepsilon = \frac {1}{\sigma} (\sqrt {(r + 1) ^ {2} - 2 h (r)} - r) \\ (\sigma \varepsilon + r) ^ {2} = (r + 1) ^ {2} - 2 h (r) \\ 2 h (r) = 2 r + 1 - (\sigma \varepsilon) ^ {2} - 2 r \sigma \varepsilon \\ h (r) = r (1 - \varepsilon \sigma) + \frac {1 - \varepsilon^ {2} \sigma^ {2}}{2}. \\ \end{array}
|
| 460 |
+
$$
|
| 461 |
+
|
| 462 |
+
Claim 3.6.3. $r(1 - \varepsilon \sigma) + \frac{1 - \varepsilon^2\sigma^2}{2}\in [0,2r]$ if and only if $r\geq \frac{1 - \varepsilon\sigma}{2}$
|
| 463 |
+
|
| 464 |
+
Proof. The upper constraint of $r(1 - \varepsilon \sigma) + \frac{1 - \varepsilon^2\sigma^2}{2} \leq 2r$ is equivalent to $r \geq \frac{1 - \varepsilon\sigma}{2}$ as follows
|
| 465 |
+
|
| 466 |
+
$$
|
| 467 |
+
\begin{array}{l} r (1 - \varepsilon \sigma) + \frac {1 - \varepsilon^ {2} \sigma^ {2}}{2} \leq 2 r \\ \frac {1 - \varepsilon^ {2} \sigma^ {2}}{2} \leq r (1 + \varepsilon \sigma) \\ \frac {1 - \varepsilon \sigma}{2} \leq r. \\ \end{array}
|
| 468 |
+
$$
|
| 469 |
+
|
| 470 |
+
The lower constraint of $r(1 - \varepsilon \sigma) + \frac{1 - \varepsilon^2\sigma^2}{2} \geq 0$ is satisfied for any $r$ since $1 - \varepsilon \sigma \geq 0$ implies
|
| 471 |
+
|
| 472 |
+
$$
|
| 473 |
+
r (1 - \varepsilon \sigma) + \frac {1 - \varepsilon^ {2} \sigma^ {2}}{2} = (1 - \varepsilon \sigma) \left(r + \frac {1 + \varepsilon \sigma}{2}\right) \geq 0.
|
| 474 |
+
$$
|
| 475 |
+
|
| 476 |
+
Lemma 3.12. For $r > 0$ , $\mathbb{P}_{y \sim M(0)}\left[\|y\|_2 \leq r\right] = \frac{\gamma(d, r / \sigma)}{\Gamma(d)}$ .
|
| 477 |
+
|
| 478 |
+

|
| 479 |
+
|
| 480 |
+
Proof. The density for $Y$ is $f(y) \propto \exp(-\|y\|_2 / \sigma)$ , so we compute the distribution's normalization factor $Z$ . We use two facts. First, a $(d-1)$ -sphere, i.e., a sphere in $\mathbb{R}^d$ , with radius $s$ has surface area $\frac{2\pi^{d/2}}{\Gamma(d/2)} \cdot s^{d-1}$ . Second, by $u$ -substitution with $u = s / \sigma$ ,
|
| 481 |
+
|
| 482 |
+
$$
|
| 483 |
+
\int_ {0} ^ {\infty} e ^ {- s / \sigma} s ^ {d - 1} d s = \int_ {0} ^ {\infty} e ^ {- u} \cdot u ^ {d - 1} \sigma^ {d} d u = \Gamma (d) \sigma^ {d}
|
| 484 |
+
$$
|
| 485 |
+
|
| 486 |
+
since $\Gamma(z) = \int_{0}^{\infty} e^{-t} t^{z-1} dt$ . We compute the integral $Z$ using hyperspherical coordinates $s, \theta_1, \ldots, \theta_{d-1}$ where $s \geq 0$ , $\theta_1 \in [0, 2\pi]$ , and $\theta_j \in [0, \pi]$ for $2 \leq j \leq d-1$ . Let
|
| 487 |
+
|
| 488 |
+
$$
|
| 489 |
+
V (\theta_ {1}, \dots , \theta_ {d - 1}) = \sin^ {d - 2} (\theta_ {1}) \sin^ {d - 3} (\theta_ {2}) \dots \sin (\theta_ {d - 1})
|
| 490 |
+
$$
|
| 491 |
+
|
| 492 |
+
be the angle dependent terms of the hyperspherical volume element. Then
|
| 493 |
+
|
| 494 |
+
$$
|
| 495 |
+
\begin{array}{l} Z = \int_ {0} ^ {\infty} \int_ {0} ^ {2 \pi} \int_ {0} ^ {\pi} \dots \int_ {0} ^ {\pi} e ^ {- s / \sigma} s ^ {d - 1} V (\theta_ {1}, \dots , \theta_ {d - 1}) \partial_ {d - 1} \dots \partial_ {1} \partial s \\ = \frac {2 \pi^ {d / 2}}{\Gamma (d / 2)} \int_ {0} ^ {\infty} e ^ {- s / \sigma} s ^ {d - 1} \partial s \\ = \frac {2 \pi^ {d / 2} \sigma^ {d}}{\Gamma (d / 2)} \cdot \Gamma (d). \\ \end{array}
|
| 496 |
+
$$
|
| 497 |
+
|
| 498 |
+
This gives
|
| 499 |
+
|
| 500 |
+
$$
|
| 501 |
+
\begin{array}{l} \mathbb {P} _ {Y} \left[ \| y \| \leq r \right] = \frac {1}{Z} \cdot \frac {2 \pi^ {d / 2}}{\Gamma (d / 2)} \int_ {0} ^ {r} e ^ {- s / \sigma} s ^ {d - 1} d s \\ = \frac {1}{Z} \cdot \frac {2 \pi^ {d / 2} \sigma^ {d}}{\Gamma (d / 2)} \cdot \gamma (d, r / \sigma) \\ = \frac {\gamma (d , r / \sigma)}{\Gamma (d)}. \\ \end{array}
|
| 502 |
+
$$
|
| 503 |
+
|
| 504 |
+

|
| 505 |
+
|
| 506 |
+
Lemma 3.10. $F_{r,h(r)}$ is monotone decreasing in $r$ .
|
| 507 |
+
|
| 508 |
+
Proof. Shorthand $\tau = \varepsilon \sigma$ . By Corollary 3.7, $F_{r,h(r)} = 1$ for $r \leq \frac{1 - \tau}{2}$ . Suppose $r > \frac{1 - \tau}{2}$ . Then by Lemma 3.6, $h(r) = r(1 - \tau) + \frac{1 - \tau^2}{2}$ .
|
| 509 |
+
|
| 510 |
+
Case 1: $r < \frac{1 - \tau^2}{2\tau}$ . Then $h(r) > r$ , and $F_{r,h(r)} = 1 - F_{r,2r - h(r)}$ . Since we want to prove that $F_{r,h(r)}$ decreases with $r$ , it suffices to show that $F_{r,2r - h(r)}$ increases with $r$ . By Lemma 3.9,
|
| 511 |
+
|
| 512 |
+
$$
|
| 513 |
+
F _ {r, 2 r - h (r)} = \frac {1}{2} I _ {(2 r [ 2 r - h (r) ] - [ 2 r - h (r) ] ^ {2}) / r ^ {2}} \left(\frac {d - 1}{2}, \frac {1}{2}\right).
|
| 514 |
+
$$
|
| 515 |
+
|
| 516 |
+
We expand the subscript for $I$
|
| 517 |
+
|
| 518 |
+
$$
|
| 519 |
+
\begin{array}{l} \frac {2 r (2 r - h (r)) - (2 r - h (r)) ^ {2}}{r ^ {2}} = \frac {4 r ^ {2} - 2 r h (r) - (4 r ^ {2} - 4 r h (r) + h (r) ^ {2})}{r ^ {2}} \\ = \frac {2 r h (r) - h (r) ^ {2}}{r ^ {2}}. \tag {4} \\ \end{array}
|
| 520 |
+
$$
|
| 521 |
+
|
| 522 |
+
Since $h(r) \in [0, 2r]$ (Lemma 3.6), $2rh(r) - h(r)^2 \geq 0$ . Because $I_x(a, b)$ increases with $x$ for $x \geq 0$ , it is enough to show that $[2rh(r) - h(r)^2] / r^2$ increases with $r$ . Expanding yields
|
| 523 |
+
|
| 524 |
+
$$
|
| 525 |
+
\frac {2 r h (r) - h (r) ^ {2}}{r ^ {2}} = \frac {2 r (1 - \tau) + (1 - \tau^ {2})}{r} - \frac {r ^ {2} (1 - \tau) ^ {2} + r (1 - \tau) (1 - \tau^ {2}) + \frac {(1 - \tau^ {2}) ^ {2}}{4}}{r ^ {2}}.
|
| 526 |
+
$$
|
| 527 |
+
|
| 528 |
+
We drop terms that don't depend on $r$ to get
|
| 529 |
+
|
| 530 |
+
$$
|
| 531 |
+
\frac {1 - \tau^ {2}}{r} - \frac {(1 - \tau) (1 - \tau^ {2})}{r} - \frac {(1 - \tau^ {2}) ^ {2}}{4 r ^ {2}} = (1 - \tau^ {2}) \left[ \frac {\tau}{r} - \frac {(1 - \tau^ {2})}{4 r ^ {2}} \right].
|
| 532 |
+
$$
|
| 533 |
+
|
| 534 |
+
Differentiating the second term with respect to $r$ gives $\frac{1 - 2\tau r - \tau^2}{2r^3}$ , and this is positive exactly when $r < \frac{1 - \tau^2}{2\tau}$ .
|
| 535 |
+
|
| 536 |
+
Case 2: $r \geq \frac{1 - \tau^2}{2\tau}$ . Then $h(r) \leq r$ , and
|
| 537 |
+
|
| 538 |
+
$$
|
| 539 |
+
F _ {r, h (r)} = \frac {1}{2} I _ {(2 r h (r) - h (r) ^ {2}) / r ^ {2}} \left(\frac {d - 1}{2}, \frac {1}{2}\right).
|
| 540 |
+
$$
|
| 541 |
+
|
| 542 |
+
By similar logic, it suffices to show that $(2rh(r) - h(r)^2) / r^2$ is nonincreasing in $r$ for $r \geq \frac{1 - \tau^2}{2\tau}$ . This follows from the analysis of the previous case.
|
| 543 |
+
|
| 544 |
+
# A.2. Omitted Proofs From Lower Bound
|
| 545 |
+
|
| 546 |
+
Lemma 3.19. Define $X = \frac{1 + (\varepsilon\sigma)^2 - 2\varepsilon\sigma R}{2}$ and $H(R) = R - 1 + X$ . Then cap $\hat{S}_{R,1,H(R)} = S_{R,1} \cap V$ .
|
| 547 |
+
|
| 548 |
+
Proof. Shorthand $\tau = \varepsilon \sigma$ for neatness. To verify the claim, we start with an arbitrary $y \in S_{R,1}$ and attempt to determine a cutoff $X \in \mathbb{R}$ such that $y \in V$ iff $y_1 \leq X$ . For any two points $y, y' \in S_{R,1}$ such that $y_1 = y_1'$ , it is true that $y \in V$ iff $y' \in V$ since $V$ is spherically symmetric around $e_1$ . If $y' = y_1 e_1 + v$ for some $v$ orthogonal to $e_1$ , then by $S_{R,1}$ 's spherical symmetry around $e_1$ , the point $y = y_1 e_1 + |v| e_2$ is also in $S_{R,1}$ . Therefore, our goal is to find the minimum cutoff $X$ for the point $y = (y_1, y_2, 0, \ldots, 0)$ such that $y \in V$ iff $y_1 \leq X$ .
|
| 549 |
+
|
| 550 |
+
We know $y \in S_{r',0}$ for some $r' > 0$ . Since $y_1^2 + y_2^2 = r'^2$ , and $y \in S_{R,1}$ implies $(y_1 - 1)^2 + y_2^2 = R^2$ , then combining these yields $r' = \sqrt{R^2 + 2y_1 - 1}$ . Thus we have $y \in V$ if and only if $y_1 \leq -r' + h(r')$ . By Lemma 3.6, $-r' + h(r') = \min(-\tau r' + \frac{1 - \tau^2}{2}, 2r')$ . We have $-\tau r' + \frac{1 - \tau^2}{2} = -\tau \sqrt{R^2 + 2y_1 - 1} + \frac{1 - \tau^2}{2}$ , so we solve for the largest $X$ where $X \leq \min(-\tau \sqrt{R^2 + 2X - 1} + \frac{1 - \tau^2}{2}, 2\sqrt{R^2 + 2X - 1})$ .
|
| 551 |
+
|
| 552 |
+
Solving for $X$ under the first constraint yields
|
| 553 |
+
|
| 554 |
+
$$
|
| 555 |
+
\left(X - \frac {1 - \tau^ {2}}{2}\right) ^ {2} \geq \tau^ {2} \left(R ^ {2} + 2 X - 1\right)
|
| 556 |
+
$$
|
| 557 |
+
|
| 558 |
+
$$
|
| 559 |
+
X ^ {2} - X (1 + \tau^ {2}) + \frac {\tau^ {4} - 2 \tau^ {2} + 1 - 4 \tau^ {2} R ^ {2} + 4 \tau^ {2}}{4} \geq 0
|
| 560 |
+
$$
|
| 561 |
+
|
| 562 |
+
$$
|
| 563 |
+
X ^ {2} - X \left(1 + \tau^ {2}\right) + \frac {\tau^ {4} + 2 \tau^ {2} + 1 - 4 \tau^ {2} R ^ {2}}{4} \geq 0. \tag {5}
|
| 564 |
+
$$
|
| 565 |
+
|
| 566 |
+
The roots of the LHS are given by
|
| 567 |
+
|
| 568 |
+
$$
|
| 569 |
+
X = \frac {1 + \tau^ {2} \pm \sqrt {(1 + \tau^ {2}) ^ {2} - ([ 1 + \tau^ {2} ] ^ {2} - 4 \tau^ {2} R ^ {2})}}{2} = \frac {1 + \tau^ {2} \pm 2 \tau R}{2}.
|
| 570 |
+
$$
|
| 571 |
+
|
| 572 |
+
Let $x_{1} = \frac{1 + \tau^{2} - 2\tau R}{2}$ and $x_{2} = \frac{1 + \tau^{2} + 2\tau R}{2}$ . As the LHS of Equation (5) is a convex parabola, the inequality is satisfied on the intervals $(-\infty, x_{1}] \cup [x_{2}, \infty)$ . But the first constraint on $X$ also implies the weaker inequality $X < \frac{1 - \tau^{2}}{2}$ so $X \notin [x_{2}, \infty)$ . Then $x_{1}$ is the largest value that satisfies the first constraint.
|
| 573 |
+
|
| 574 |
+
For any $X \in (x_1, x_2)$ , we have $X > -\tau \sqrt{R^2 + 2X - 1} + \frac{1 - \tau^2}{2} \geq \min(-\tau \sqrt{R^2 + 2X - 1} + \frac{1 - \tau^2}{2}, 2\sqrt{R^2 + 2X - 1})$ . So if we can show that $x_1 \leq 2\sqrt{R^2 + 2x_1 - 1}$ , then $x_1$ will indeed be the desired cutoff. We actually prove a stronger inequality
|
| 575 |
+
|
| 576 |
+
$$
|
| 577 |
+
x _ {1} \leq \sqrt {R ^ {2} + 2 x _ {1} - 1}
|
| 578 |
+
$$
|
| 579 |
+
|
| 580 |
+
$$
|
| 581 |
+
\frac {1 + \tau^ {2} - 2 \tau R}{2} \leq R - \tau
|
| 582 |
+
$$
|
| 583 |
+
|
| 584 |
+
$$
|
| 585 |
+
(1 + \tau) ^ {2} \leq 2 R (1 + \tau)
|
| 586 |
+
$$
|
| 587 |
+
|
| 588 |
+
$$
|
| 589 |
+
\frac {1 + \tau}{2} \leq R
|
| 590 |
+
$$
|
| 591 |
+
|
| 592 |
+
which follows from our starting assumption on $R$ . So $X = \frac{1 + \tau^2 - 2\tau R}{2}$ is the desired cutoff. This leads to a cap on $S_{R,1}$ of height
|
| 593 |
+
|
| 594 |
+
$$
|
| 595 |
+
H (R) = X - (1 - R) = \frac {1 + \tau^ {2} - 2 \tau R}{2} - 1 + R = R (1 - \tau) - \frac {1 - \tau^ {2}}{2}.
|
| 596 |
+
$$
|
| 597 |
+
|
| 598 |
+
The last step is verifying that this is a valid height lying in $[0, 2R]$ . The lower bound follows from $R(1 - \tau) \geq \frac{1 - \tau^2}{2}$ rearranging into the starting assumption $R \geq \frac{1 + \tau}{2}$ . We prove a stronger upper bound of $R$ by rearranging
|
| 599 |
+
|
| 600 |
+
$$
|
| 601 |
+
\begin{array}{l} R (1 - \tau) - \frac {1 - \tau^ {2}}{2} \leq R \\ - \frac {1 - \tau^ {2}}{2} \leq \tau R \\ \end{array}
|
| 602 |
+
$$
|
| 603 |
+
|
| 604 |
+
which uses $0 < \tau < 1$ and $R > 0$ .
|
| 605 |
+
|
| 606 |
+

|
| 607 |
+
|
| 608 |
+
# A.3. Omitted Proofs From Sampler
|
| 609 |
+
|
| 610 |
+
Lemma 3.22. Let $U_{1},\ldots ,U_{d + 1}\sim_{i id}U(0,1)$ be uniform random samples. Then $-\sigma \sum_{i = 1}^{d + 1}\log (U_i)\sim \mathsf{G a m m a}(d + 1,\sigma)$ .
|
| 611 |
+
|
| 612 |
+
Proof. We first show that $-\log (U(0,1))\sim \mathsf{Expo}(1)$ , an exponential random variable. Let $f$ be the CDF of $\mathsf{Expo}(1)$ . Then $\mathbb{P}[f^{-1}(U)\leq t] = \mathbb{P}[U\leq f(t)] = f(t)$ so $f^{-1}(U)\sim \mathsf{Expo}(1)$ . Since $f^{-1}(t) = -\log (1 - t)$ for $0\leq t\leq 1$ , and $U\sim (1 - U)$ , we get $-\log (U)\sim \mathsf{Expo}(1)$ .
|
| 613 |
+
|
| 614 |
+
Note that Expo (1) corresponds to a random variable that measures the time required for the first arrival from a Poisson process with rate 1. Moreover, Gamma $(d + 1,\sigma)\sim \sigma$ Gamma $(d + 1,1)$ and Gamma $(d + 1,1)$ corresponds to a random variable that measures the time of the $(d + 1)\mathrm{th}$ arrival of a Poisson process with rate 1. The random variable of the $(d + 1)\mathrm{th}$ arrival is equal to the sum of the random variables of interarrival times for the first $(d + 1)$ arrivals. Since a Poisson process has stationary increments, each of these interarrival times are i.i.d. as Expo (1). It follows that Gamma $(d + 1,1)\sim \sum_{i = 1}^{d + 1}E_i\sim -\sum_{i = 1}^{d + 1}\log (U_i)$ where $E_{i}\sim \mathsf{Expo}(1)$ .
|
| 615 |
+
|
| 616 |
+
Lemma 3.23. Let $X_{1},\ldots ,X_{d}\sim_{iid}N(0,1)$ , and let $Y\sim U(0,1)$ be a uniform sample from $[0,1]$ . Then $Y^{1 / d}\cdot \frac{(X_1,\dots,X_d)}{\sqrt{\sum_{i = 1}^dX_i^2}}$ is a uniform sample from $B_2^d$ .
|
| 617 |
+
|
| 618 |
+
Proof. The term $\frac{(X_1, \ldots, X_d)}{\sqrt{\sum_{i=1}^d X_i^2}}$ is a normalized draw from a $d$ -dimensional multivariate Gaussian with an identity covariance matrix. As this distribution is spherically symmetric, normalizing the draw to have unit length produces a uniform draw from the unit sphere. Define the function $f$ to be the CDF of the random variable of the $\ell_2$ norm of a uniform sample from $B_2^d$ . Then $f(r) = r^d$ . We show that $f$ is also the CDF of $Y^{1/d}$ . We have $\mathbb{P}[Y^{1/d} \leq r] = \mathbb{P}[U(0, 1)^{1/d} \leq r] = \mathbb{P}[U(0, 1) \leq r^d] = r^d$ , and the lemma follows.
|
| 619 |
+
|
| 620 |
+
# A.4. Omitted Proofs From Experiments
|
| 621 |
+
|
| 622 |
+
The following result about the expected squared $\ell_2$ norm of $\ell_p$ balls will be useful.
|
| 623 |
+
|
| 624 |
+
Lemma A.1 ((Joseph et al., 2025)). Let $\mathbb{E}_2^2 (X)$ denote the expected squared $\ell_2$ norm of a uniform sample from $X$ , and let $rB_p^d$ denote the $d$ -dimensional $\ell_p$ ball of radius $r$ . Then $\mathbb{E}_2^2 (rB_p^d) = r^2 \cdot \frac{d}{3}\left(\frac{3d}{d + 2}\right)\left(\frac{\Gamma(\frac{d}{p})\Gamma(\frac{3}{p})}{\Gamma(\frac{1}{p})\Gamma(\frac{d + 2}{p})}\right)$ .
|
| 625 |
+
|
| 626 |
+
Lemma 4.1. The mean squared $\ell_2$ error of the $d$ -dimensional $\ell_p$ mechanism with parameter $\sigma$ is
|
| 627 |
+
|
| 628 |
+
$$
|
| 629 |
+
(d \sigma) ^ {2} (d + 1) \left(\frac {\Gamma (\frac {d}{p}) \Gamma (\frac {3}{p})}{\Gamma (\frac {1}{p}) \Gamma (\frac {d + 2}{p})}\right).
|
| 630 |
+
$$
|
| 631 |
+
|
| 632 |
+
Proof. Consider the mechanism releasing a noisy version of $T(X) = 0$ . Call this mechanism $M_{\sigma}^{p}$ . Recall from Lemma 2.4 that we can sample it by sampling $r \sim \mathrm{Gamma}(d + 1, \sigma)$ , sampling $z \sim B_p^d$ , and outputting $rz$ . The distribution $\mathrm{Gamma}(d + 1, \sigma)$ has density
|
| 633 |
+
|
| 634 |
+
$$
|
| 635 |
+
f (x) = \frac {x ^ {d} e ^ {- x / \sigma}}{\Gamma (d + 1) \sigma^ {d + 1}}. \tag {6}
|
| 636 |
+
$$
|
| 637 |
+
|
| 638 |
+
so
|
| 639 |
+
|
| 640 |
+
$$
|
| 641 |
+
\begin{array}{l} \mathbb {E} _ {y \sim M _ {\sigma} ^ {p}} \left[ \| y \| _ {2} ^ {2} \right] = \int_ {0} ^ {\infty} f (r) \mathbb {E} _ {2} ^ {2} \left(r B _ {p} ^ {d}\right) d r \\ = \int_ {0} ^ {\infty} \frac {r ^ {d} e ^ {- r / \sigma}}{\Gamma (d + 1) \sigma^ {d + 1}} r ^ {2} \cdot \frac {d}{3} \left(\frac {3 d}{d + 2}\right) \left(\frac {\Gamma (\frac {d}{p}) \Gamma (\frac {3}{p})}{\Gamma (\frac {1}{p}) \Gamma (\frac {d + 2}{p})}\right) d r \\ = \frac {d}{3 \Gamma (d + 1) \sigma^ {d + 1}} \left(\frac {3 d}{d + 2}\right) \left(\frac {\Gamma (\frac {d}{p}) \Gamma (\frac {3}{p})}{\Gamma (\frac {1}{p}) \Gamma (\frac {d + 2}{p})}\right) \int_ {0} ^ {\infty} r ^ {d + 2} e ^ {- r / \sigma} d r \\ = \frac {d}{3 \Gamma (d + 1) \sigma^ {d + 1}} \left(\frac {3 d}{d + 2}\right) \left(\frac {\Gamma (\frac {d}{p}) \Gamma (\frac {3}{p})}{\Gamma (\frac {1}{p}) \Gamma (\frac {d + 2}{p})}\right) \cdot \Gamma (d + 3) \sigma^ {d + 3} \\ = (d \sigma) ^ {2} (d + 1) \left(\frac {\Gamma (\frac {d}{p}) \Gamma (\frac {3}{p})}{\Gamma (\frac {1}{p}) \Gamma (\frac {d + 2}{p})}\right). \\ \end{array}
|
| 642 |
+
$$
|
| 643 |
+
|
| 644 |
+

|
| 645 |
+
|
| 646 |
+
Lemma 4.4. The Gaussian mechanism with parameter $\sigma$ has mean squared $\ell_2$ error $d\sigma^2$ .
|
| 647 |
+
|
| 648 |
+
Proof. Denote the mechanism by $N_{\sigma}$ . Then by linearity of expectation and the fact that the Gaussian mechanism has independent Gaussian marginals,
|
| 649 |
+
|
| 650 |
+
$$
|
| 651 |
+
\begin{array}{l} \mathbb {E} _ {y \sim N _ {\sigma}} \left[ \| y \| _ {2} ^ {2} \right] = \mathbb {E} \left[ \sum_ {j = 1} ^ {d} y _ {j} ^ {2} \right] \\ = d \mathbb {E} _ {z \sim N (0, \sigma^ {2})} \left[ z ^ {2} \right] \\ = d \sigma^ {2} \\ \end{array}
|
| 652 |
+
$$
|
| 653 |
+
|
| 654 |
+
where the last equality used
|
| 655 |
+
|
| 656 |
+
$$
|
| 657 |
+
\mathbb {E} _ {z \sim N (0, \sigma^ {2})} [ z ^ {2} ] = \operatorname {V a r} (z) + \mathbb {E} [ z ] ^ {2} = \sigma^ {2}.
|
| 658 |
+
$$
|
| 659 |
+
|
| 660 |
+

|
| 661 |
+
|
| 662 |
+
The following result provides evidence that, with reasonable parameters, approximate DP does not yield meaningful utility improvements over pure DP for the Laplace mechanism. A result like this is likely folklore, but we include it here for completeness.
|
| 663 |
+
|
| 664 |
+
Lemma A.2. The Laplace mechanism with parameter $\sigma \leq 1 / \varepsilon$ does not satisfy $(\varepsilon, \delta)$ - $DP$ for $\varepsilon < 2\ln(1 - \delta) + \frac{1}{\sigma}$ .
|
| 665 |
+
|
| 666 |
+
Proof. Let $T(X) = 0$ and let $T(X') = e_1$ . Then $\| T(X) - T(X') \|_1 = 1$ , and
|
| 667 |
+
|
| 668 |
+
$$
|
| 669 |
+
\mathbb {P} _ {y \sim M (0)} \left[ \ln \left(\frac {f _ {X} (y)}{f _ {X ^ {\prime}} (y)}\right) \geq \varepsilon \right] = \mathbb {P} _ {y \sim M (0)} \left[ \| y - e _ {1} \| _ {1} - \| y \| _ {1} \geq \sigma \varepsilon \right] = \mathbb {P} _ {y \sim M (0)} \left[ | y _ {1} - 1 | - | y _ {1} | \geq \sigma \varepsilon \right].
|
| 670 |
+
$$
|
| 671 |
+
|
| 672 |
+
Mechanism $M$ is equivalent to the spherical Laplace distribution where each dimension is drawn from $\operatorname{Lap}(\sigma)$ . This distribution has CDF $F(x) = 1 - \frac{1}{2}\exp (-x / \sigma)$ for $x\geq 0$ . Condition $|y_{1} - 1| - |y_{1}|\geq \sigma \varepsilon$ holds if and only if $y_{1}\leq \frac{1}{2} (1 - \sigma \varepsilon)$ , so the probability of drawing such a $y$ is
|
| 673 |
+
|
| 674 |
+
$$
|
| 675 |
+
1 - \frac {1}{2} \exp \left(- \frac {1}{\sigma} \left[ \frac {1}{2} (1 - \sigma \varepsilon) \right]\right) = 1 - \frac {1}{2} \exp \left(\frac {\varepsilon - \frac {1}{\sigma}}{2}\right)
|
| 676 |
+
$$
|
| 677 |
+
|
| 678 |
+
Therefore $\mathbb{P}\left[\ell_{M,X,X^{\prime}}\geq \varepsilon \right] = 1 - \frac{1}{2}\exp \left(\frac{\varepsilon - \frac{1}{\sigma}}{2}\right)$
|
| 679 |
+
|
| 680 |
+
We now analyze $\mathbb{P}\left[\ell_{M,X',X} \leq -\varepsilon\right]$ . Because $\ell_{M,X',X} = \log(f_{X'}(y) / f_X(y)) = \frac{1}{\sigma} \cdot (|y_1| - |y_1 - 1|)$ , we get
|
| 681 |
+
|
| 682 |
+
$$
|
| 683 |
+
\mathbb {P} \left[ \ell_ {M, X ^ {\prime}, X} \leq - \varepsilon \right] = \mathbb {P} _ {y \sim M (1)} \left[ | y _ {1} - 1 | - | y _ {1} | \geq \sigma \varepsilon \right]
|
| 684 |
+
$$
|
| 685 |
+
|
| 686 |
+
where $M(1)$ denotes the $d$ -dimensional Laplace mechanism centered at $e_1$ . By the same logic used above, $|y_1 - 1| - |y_1| \geq \sigma \varepsilon$ if and only if $y_1 \leq \frac{1}{2} (1 - \sigma \varepsilon)$ . For $y \sim M(1)$ , this event has the same probability as $y_1' \leq \frac{1}{2} (1 - \sigma \varepsilon) - 1 = \frac{1}{2} (-1 - \sigma \varepsilon)$ when $y' \sim M(0)$ . Furthermore, $\operatorname{Lap}(\sigma)$ has CDF $F(x) = \frac{1}{2} \exp(x / \sigma)$ for $x < 0$ . Thus $\mathbb{P}\left[\ell_{M,X',X} \leq -\varepsilon\right] = \frac{1}{2} \exp\left(\frac{1}{2}\left[-\frac{1}{\sigma} - \varepsilon\right]\right)$ .
|
| 687 |
+
|
| 688 |
+
Combining these results and applying $1 + x \leq e^{x}$ yields
|
| 689 |
+
|
| 690 |
+
$$
|
| 691 |
+
\begin{array}{l} \mathbb {P} \left[ \ell_ {M, X, X ^ {\prime}} \geq \varepsilon \right] - e ^ {\varepsilon} \mathbb {P} \left[ \ell_ {M, X ^ {\prime}, X} \leq - \varepsilon \right] = 1 - \frac {1}{2} \exp \left(\frac {\varepsilon - \frac {1}{\sigma}}{2}\right) - e ^ {\varepsilon} \frac {1}{2} \exp \left(\frac {1}{2} \left[ - \frac {1}{\sigma} - \varepsilon \right]\right) \\ = 1 - \exp \left(\frac {\varepsilon - \frac {1}{\sigma}}{2}\right) \\ \end{array}
|
| 692 |
+
$$
|
| 693 |
+
|
| 694 |
+
By Lemma 2.3, this last quantity must be upper bounded by $\delta$ for $M$ to be $(\varepsilon, \delta)$ -DP. Rearranging yields the expression in the claim.
|
2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:132afe6e1285c65de4ebdfc7c83c7f6b05d5e911da13931eb498f155b6e58415
|
| 3 |
+
size 514525
|
2025/Approximate Differential Privacy of the $_ell_2$ Mechanism/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/7ca7b32d-67f4-495d-b0cb-edce9eb3ba9f_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/7ca7b32d-67f4-495d-b0cb-edce9eb3ba9f_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/7ca7b32d-67f4-495d-b0cb-edce9eb3ba9f_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8447fdc7e1f9a73d7bc8bc0cd347b87f58192fb2d622bbc43629d72060207ef3
|
| 3 |
+
size 2285474
|
2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2c16e7a1efacac447b6de76428e610a649d47ae4432a5c8b2ec4c5cd7dc91fca
|
| 3 |
+
size 1705633
|
2025/Approximate Forest Completion and Learning-Augmented Algorithms for Metric Minimum Spanning Trees/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/Approximately Correct Label Distribution Learning/d91f6fd6-a16b-40da-851e-409162b42b5b_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|