Add Batch 8f4e92ce-7752-4aaa-b445-997a6ce6e2e4 data
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +64 -0
- 2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/5dedbb47-9910-486a-8713-44e25df70fe8_content_list.json +0 -0
- 2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/5dedbb47-9910-486a-8713-44e25df70fe8_model.json +0 -0
- 2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/5dedbb47-9910-486a-8713-44e25df70fe8_origin.pdf +3 -0
- 2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/full.md +397 -0
- 2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/images.zip +3 -0
- 2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/layout.json +0 -0
- 2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/c9afa243-4d80-4076-977a-ab9a232d62c3_content_list.json +0 -0
- 2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/c9afa243-4d80-4076-977a-ab9a232d62c3_model.json +0 -0
- 2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/c9afa243-4d80-4076-977a-ab9a232d62c3_origin.pdf +3 -0
- 2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/full.md +481 -0
- 2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/images.zip +3 -0
- 2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/layout.json +0 -0
- 2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/554f4c7b-d050-464f-a824-73ee41073dde_content_list.json +0 -0
- 2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/554f4c7b-d050-464f-a824-73ee41073dde_model.json +0 -0
- 2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/554f4c7b-d050-464f-a824-73ee41073dde_origin.pdf +3 -0
- 2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/full.md +574 -0
- 2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/images.zip +3 -0
- 2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/layout.json +0 -0
- 2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/fe5165df-7f32-4773-b651-e37557ad3edc_content_list.json +0 -0
- 2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/fe5165df-7f32-4773-b651-e37557ad3edc_model.json +0 -0
- 2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/fe5165df-7f32-4773-b651-e37557ad3edc_origin.pdf +3 -0
- 2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/full.md +642 -0
- 2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/images.zip +3 -0
- 2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/layout.json +0 -0
- 2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/48da9589-7129-4337-a09a-658cecafd8db_content_list.json +0 -0
- 2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/48da9589-7129-4337-a09a-658cecafd8db_model.json +0 -0
- 2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/48da9589-7129-4337-a09a-658cecafd8db_origin.pdf +3 -0
- 2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/full.md +0 -0
- 2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/images.zip +3 -0
- 2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/layout.json +0 -0
- 2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/c81623d0-f89b-4226-93eb-44296a1a5f81_content_list.json +0 -0
- 2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/c81623d0-f89b-4226-93eb-44296a1a5f81_model.json +0 -0
- 2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/c81623d0-f89b-4226-93eb-44296a1a5f81_origin.pdf +3 -0
- 2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/full.md +842 -0
- 2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/images.zip +3 -0
- 2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/layout.json +0 -0
- 2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/ae1395e2-616a-4b04-b79f-464511d99a59_content_list.json +0 -0
- 2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/ae1395e2-616a-4b04-b79f-464511d99a59_model.json +0 -0
- 2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/ae1395e2-616a-4b04-b79f-464511d99a59_origin.pdf +3 -0
- 2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/full.md +484 -0
- 2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/images.zip +3 -0
- 2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/layout.json +0 -0
- 2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/2e09edfa-e224-45ce-9f35-dd1b7ec4b1a1_content_list.json +0 -0
- 2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/2e09edfa-e224-45ce-9f35-dd1b7ec4b1a1_model.json +0 -0
- 2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/2e09edfa-e224-45ce-9f35-dd1b7ec4b1a1_origin.pdf +3 -0
- 2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/full.md +405 -0
- 2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/images.zip +3 -0
- 2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/layout.json +0 -0
- 2025/SaMer_ A Scenario-aware Multi-dimensional Evaluator for Large Language Models/245da333-1d91-43f2-9fec-fef99339aa9a_content_list.json +0 -0
.gitattributes
CHANGED
|
@@ -2711,3 +2711,67 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 2711 |
2025/STORM_[[:space:]]Spatio-TempOral[[:space:]]Reconstruction[[:space:]]Model[[:space:]]For[[:space:]]Large-Scale[[:space:]]Outdoor[[:space:]]Scenes/661a3950-2c79-4ecb-acd1-61dfca3e9a7f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2712 |
2025/STRAP_[[:space:]]Robot[[:space:]]Sub-Trajectory[[:space:]]Retrieval[[:space:]]for[[:space:]]Augmented[[:space:]]Policy[[:space:]]Learning/2eeebab3-3c88-447f-adcd-4f71a1379f32_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2713 |
2025/SV-RAG_[[:space:]]LoRA-Contextualizing[[:space:]]Adaptation[[:space:]]of[[:space:]]MLLMs[[:space:]]for[[:space:]]Long[[:space:]]Document[[:space:]]Understanding/c27a40ab-bd64-402d-96f2-6600ab41af6e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2711 |
2025/STORM_[[:space:]]Spatio-TempOral[[:space:]]Reconstruction[[:space:]]Model[[:space:]]For[[:space:]]Large-Scale[[:space:]]Outdoor[[:space:]]Scenes/661a3950-2c79-4ecb-acd1-61dfca3e9a7f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2712 |
2025/STRAP_[[:space:]]Robot[[:space:]]Sub-Trajectory[[:space:]]Retrieval[[:space:]]for[[:space:]]Augmented[[:space:]]Policy[[:space:]]Learning/2eeebab3-3c88-447f-adcd-4f71a1379f32_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2713 |
2025/SV-RAG_[[:space:]]LoRA-Contextualizing[[:space:]]Adaptation[[:space:]]of[[:space:]]MLLMs[[:space:]]for[[:space:]]Long[[:space:]]Document[[:space:]]Understanding/c27a40ab-bd64-402d-96f2-6600ab41af6e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2714 |
+
2025/SV4D_[[:space:]]Dynamic[[:space:]]3D[[:space:]]Content[[:space:]]Generation[[:space:]]with[[:space:]]Multi-Frame[[:space:]]and[[:space:]]Multi-View[[:space:]]Consistency/5dedbb47-9910-486a-8713-44e25df70fe8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2715 |
+
2025/SVD-LLM_[[:space:]]Truncation-aware[[:space:]]Singular[[:space:]]Value[[:space:]]Decomposition[[:space:]]for[[:space:]]Large[[:space:]]Language[[:space:]]Model[[:space:]]Compression/c9afa243-4d80-4076-977a-ab9a232d62c3_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2716 |
+
2025/SVG_[[:space:]]3D[[:space:]]Stereoscopic[[:space:]]Video[[:space:]]Generation[[:space:]]via[[:space:]]Denoising[[:space:]]Frame[[:space:]]Matrix/554f4c7b-d050-464f-a824-73ee41073dde_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2717 |
+
2025/SWE-Search_[[:space:]]Enhancing[[:space:]]Software[[:space:]]Agents[[:space:]]with[[:space:]]Monte[[:space:]]Carlo[[:space:]]Tree[[:space:]]Search[[:space:]]and[[:space:]]Iterative[[:space:]]Refinement/fe5165df-7f32-4773-b651-e37557ad3edc_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2718 |
+
2025/SWE-bench[[:space:]]Multimodal_[[:space:]]Do[[:space:]]AI[[:space:]]Systems[[:space:]]Generalize[[:space:]]to[[:space:]]Visual[[:space:]]Software[[:space:]]Domains_/48da9589-7129-4337-a09a-658cecafd8db_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2719 |
+
2025/SWEb_[[:space:]]A[[:space:]]Large[[:space:]]Web[[:space:]]Dataset[[:space:]]for[[:space:]]the[[:space:]]Scandinavian[[:space:]]Languages/c81623d0-f89b-4226-93eb-44296a1a5f81_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2720 |
+
2025/SWIFT_[[:space:]]On-the-Fly[[:space:]]Self-Speculative[[:space:]]Decoding[[:space:]]for[[:space:]]LLM[[:space:]]Inference[[:space:]]Acceleration/ae1395e2-616a-4b04-b79f-464511d99a59_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2721 |
+
2025/SaLoRA_[[:space:]]Safety-Alignment[[:space:]]Preserved[[:space:]]Low-Rank[[:space:]]Adaptation/2e09edfa-e224-45ce-9f35-dd1b7ec4b1a1_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2722 |
+
2025/SaMer_[[:space:]]A[[:space:]]Scenario-aware[[:space:]]Multi-dimensional[[:space:]]Evaluator[[:space:]]for[[:space:]]Large[[:space:]]Language[[:space:]]Models/245da333-1d91-43f2-9fec-fef99339aa9a_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2723 |
+
2025/SaRA_[[:space:]]High-Efficient[[:space:]]Diffusion[[:space:]]Model[[:space:]]Fine-tuning[[:space:]]with[[:space:]]Progressive[[:space:]]Sparse[[:space:]]Low-Rank[[:space:]]Adaptation/a53705cf-4198-4ab7-85cc-45f1b3ea966b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2724 |
+
2025/SafeDiffuser_[[:space:]]Safe[[:space:]]Planning[[:space:]]with[[:space:]]Diffusion[[:space:]]Probabilistic[[:space:]]Models/640356ea-8a5b-4010-9bea-1442fee8caf5_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2725 |
+
2025/SafeWatch_[[:space:]]An[[:space:]]Efficient[[:space:]]Safety-Policy[[:space:]]Following[[:space:]]Video[[:space:]]Guardrail[[:space:]]Model[[:space:]]with[[:space:]]Transparent[[:space:]]Explanations/8ea792b8-c46f-44c0-9221-099331377957_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2726 |
+
2025/Safety[[:space:]]Layers[[:space:]]in[[:space:]]Aligned[[:space:]]Large[[:space:]]Language[[:space:]]Models_[[:space:]]The[[:space:]]Key[[:space:]]to[[:space:]]LLM[[:space:]]Security/f2420afc-f1a4-4ae2-9836-bf0b34747e0c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2727 |
+
2025/Safety[[:space:]]Representations[[:space:]]for[[:space:]]Safer[[:space:]]Policy[[:space:]]Learning/c71352d2-9616-4af4-8c39-aefdac4762b0_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2728 |
+
2025/Safety-Prioritizing[[:space:]]Curricula[[:space:]]for[[:space:]]Constrained[[:space:]]Reinforcement[[:space:]]Learning/b7ba1284-8790-455d-ab79-7175414c2979_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2729 |
+
2025/SageAttention_[[:space:]]Accurate[[:space:]]8-Bit[[:space:]]Attention[[:space:]]for[[:space:]]Plug-and-play[[:space:]]Inference[[:space:]]Acceleration/2225e69e-878c-417d-8529-73ee5187597f_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2730 |
+
2025/Sail[[:space:]]into[[:space:]]the[[:space:]]Headwind_[[:space:]]Alignment[[:space:]]via[[:space:]]Robust[[:space:]]Rewards[[:space:]]and[[:space:]]Dynamic[[:space:]]Labels[[:space:]]against[[:space:]]Reward[[:space:]]Hacking/faac2389-c719-404c-8be0-d1f86aec2685_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2731 |
+
2025/Salvage_[[:space:]]Shapley-distribution[[:space:]]Approximation[[:space:]]Learning[[:space:]]Via[[:space:]]Attribution[[:space:]]Guided[[:space:]]Exploration[[:space:]]for[[:space:]]Explainable[[:space:]]Image[[:space:]]Classification/d6fb9e1e-c704-48b1-9055-de6b6a14354b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2732 |
+
2025/Samba_[[:space:]]Simple[[:space:]]Hybrid[[:space:]]State[[:space:]]Space[[:space:]]Models[[:space:]]for[[:space:]]Efficient[[:space:]]Unlimited[[:space:]]Context[[:space:]]Language[[:space:]]Modeling/5e777b7c-32b4-4682-a88b-d01d7535415e_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2733 |
+
2025/Satisficing[[:space:]]Regret[[:space:]]Minimization[[:space:]]in[[:space:]]Bandits/7fe4b233-c5c9-43fd-ab87-31b678f1bd23_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2734 |
+
2025/ScImage_[[:space:]]How[[:space:]]good[[:space:]]are[[:space:]]multimodal[[:space:]]large[[:space:]]language[[:space:]]models[[:space:]]at[[:space:]]scientific[[:space:]]text-to-image[[:space:]]generation_/18c8c09c-c2d6-4f64-b8b9-217730ef90e1_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2735 |
+
2025/Scalable[[:space:]]Bayesian[[:space:]]Learning[[:space:]]with[[:space:]]posteriors/f8c7a153-e647-4773-908e-c59d9bbe625c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2736 |
+
2025/Scalable[[:space:]]Benchmarking[[:space:]]and[[:space:]]Robust[[:space:]]Learning[[:space:]]for[[:space:]]Noise-Free[[:space:]]Ego-Motion[[:space:]]and[[:space:]]3D[[:space:]]Reconstruction[[:space:]]from[[:space:]]Noisy[[:space:]]Video/09a92162-4a5a-4f74-9043-9b3ff0c85a24_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2737 |
+
2025/Scalable[[:space:]]Decentralized[[:space:]]Learning[[:space:]]with[[:space:]]Teleportation/e546197d-9627-4fdc-882f-929f8fabc1bd_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2738 |
+
2025/Scalable[[:space:]]Discrete[[:space:]]Diffusion[[:space:]]Samplers_[[:space:]]Combinatorial[[:space:]]Optimization[[:space:]]and[[:space:]]Statistical[[:space:]]Physics/48bde23f-85ad-4b03-8c70-bb798f1a4fff_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2739 |
+
2025/Scalable[[:space:]]Extraction[[:space:]]of[[:space:]]Training[[:space:]]Data[[:space:]]from[[:space:]]Aligned,[[:space:]]Production[[:space:]]Language[[:space:]]Models/50a3d36e-1de0-4bd9-925e-2a257f070afb_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2740 |
+
2025/Scalable[[:space:]]Influence[[:space:]]and[[:space:]]Fact[[:space:]]Tracing[[:space:]]for[[:space:]]Large[[:space:]]Language[[:space:]]Model[[:space:]]Pretraining/7aec5d79-6e69-4055-90a0-ddbc66139bdd_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2741 |
+
2025/Scalable[[:space:]]Mechanistic[[:space:]]Neural[[:space:]]Networks/75eb9e51-afcd-4bbf-8a32-382547974fae_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2742 |
+
2025/Scalable[[:space:]]Universal[[:space:]]T-Cell[[:space:]]Receptor[[:space:]]Embeddings[[:space:]]from[[:space:]]Adaptive[[:space:]]Immune[[:space:]]Repertoires/c4c93f10-6e99-44b9-bb77-c1c7644bc500_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2743 |
+
2025/Scale-Aware[[:space:]]Contrastive[[:space:]]Reverse[[:space:]]Distillation[[:space:]]for[[:space:]]Unsupervised[[:space:]]Medical[[:space:]]Anomaly[[:space:]]Detection/60d681be-3b86-497f-803d-b93e648045d6_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2744 |
+
2025/Scale-Free[[:space:]]Graph-Language[[:space:]]Models/e206e3c3-4958-4df6-ab76-d0fb8ff2739c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2745 |
+
2025/Scale-aware[[:space:]]Recognition[[:space:]]in[[:space:]]Satellite[[:space:]]Images[[:space:]]under[[:space:]]Resource[[:space:]]Constraints/d5f307a8-de2d-47a1-b7a3-31554b7c5e43_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2746 |
+
2025/Scaling[[:space:]]Autonomous[[:space:]]Agents[[:space:]]via[[:space:]]Automatic[[:space:]]Reward[[:space:]]Modeling[[:space:]]And[[:space:]]Planning/77994600-c9c6-4403-aef2-57259f9f0953_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2747 |
+
2025/Scaling[[:space:]]Diffusion[[:space:]]Language[[:space:]]Models[[:space:]]via[[:space:]]Adaptation[[:space:]]from[[:space:]]Autoregressive[[:space:]]Models/e7b11d2b-894c-4ea7-b841-6b6a02cb5948_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2748 |
+
2025/Scaling[[:space:]]Instruction-tuned[[:space:]]LLMs[[:space:]]to[[:space:]]Million-token[[:space:]]Contexts[[:space:]]via[[:space:]]Hierarchical[[:space:]]Synthetic[[:space:]]Data[[:space:]]Generation/365c7b3c-c7b5-4063-8a7f-120d8cddf3ab_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2749 |
+
2025/Scaling[[:space:]]Large[[:space:]]Language[[:space:]]Model-based[[:space:]]Multi-Agent[[:space:]]Collaboration/eac33320-28b0-4706-8dce-3028660089d3_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2750 |
+
2025/Scaling[[:space:]]Laws[[:space:]]for[[:space:]]Adversarial[[:space:]]Attacks[[:space:]]on[[:space:]]Language[[:space:]]Model[[:space:]]Activations[[:space:]]and[[:space:]]Tokens/1212811f-2c0d-4894-8b18-9fd8c9a97e0d_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2751 |
+
2025/Scaling[[:space:]]Laws[[:space:]]for[[:space:]]Downstream[[:space:]]Task[[:space:]]Performance[[:space:]]in[[:space:]]Machine[[:space:]]Translation/7c50824e-c5f5-4985-a681-f27824449067_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2752 |
+
2025/Scaling[[:space:]]Long[[:space:]]Context[[:space:]]Training[[:space:]]Data[[:space:]]by[[:space:]]Long-Distance[[:space:]]Referrals/5e398c4d-0c9a-4cae-a77f-3233b3ca132d_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2753 |
+
2025/Scaling[[:space:]]Offline[[:space:]]Model-Based[[:space:]]RL[[:space:]]via[[:space:]]Jointly-Optimized[[:space:]]World-Action[[:space:]]Model[[:space:]]Pretraining/af8d77bd-b45c-4ee8-bd2f-f22c198db624_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2754 |
+
2025/Scaling[[:space:]]Optimal[[:space:]]LR[[:space:]]Across[[:space:]]Token[[:space:]]Horizons/9efb6392-51df-4980-b5db-ca655d27afc0_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2755 |
+
2025/Scaling[[:space:]]Speech-Text[[:space:]]Pre-training[[:space:]]with[[:space:]]Synthetic[[:space:]]Interleaved[[:space:]]Data/16a9ef80-8c95-49be-8db8-2c879eb92338_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2756 |
+
2025/Scaling[[:space:]]Stick-Breaking[[:space:]]Attention_[[:space:]]An[[:space:]]Efficient[[:space:]]Implementation[[:space:]]and[[:space:]]In-depth[[:space:]]Study/b022dd84-451a-4468-99f5-db2a4c357cf1_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2757 |
+
2025/Scaling[[:space:]]Transformers[[:space:]]for[[:space:]]Low-Bitrate[[:space:]]High-Quality[[:space:]]Speech[[:space:]]Coding/018e7578-45e3-46aa-8502-339034f47976_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2758 |
+
2025/Scaling[[:space:]]Wearable[[:space:]]Foundation[[:space:]]Models/29e9fd2a-a559-4b22-8761-1993ff07204a_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2759 |
+
2025/Scaling[[:space:]]up[[:space:]]Masked[[:space:]]Diffusion[[:space:]]Models[[:space:]]on[[:space:]]Text/7eec8324-cc4e-41d9-b5c6-dd70ecbc41bf_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2760 |
+
2025/Schur's[[:space:]]Positive-Definite[[:space:]]Network_[[:space:]]Deep[[:space:]]Learning[[:space:]]in[[:space:]]the[[:space:]]SPD[[:space:]]cone[[:space:]]with[[:space:]]structure/39d1e447-97d6-4c41-9b16-fa8a6080dc10_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2761 |
+
2025/SciLitLLM_[[:space:]]How[[:space:]]to[[:space:]]Adapt[[:space:]]LLMs[[:space:]]for[[:space:]]Scientific[[:space:]]Literature[[:space:]]Understanding/8db3e847-f264-4171-a08f-1ce7bd20815c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2762 |
+
2025/ScienceAgentBench_[[:space:]]Toward[[:space:]]Rigorous[[:space:]]Assessment[[:space:]]of[[:space:]]Language[[:space:]]Agents[[:space:]]for[[:space:]]Data-Driven[[:space:]]Scientific[[:space:]]Discovery/4976393a-57d9-460e-8905-de752c900ad0_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2763 |
+
2025/Score[[:space:]]Forgetting[[:space:]]Distillation_[[:space:]]A[[:space:]]Swift,[[:space:]]Data-Free[[:space:]]Method[[:space:]]for[[:space:]]Machine[[:space:]]Unlearning[[:space:]]in[[:space:]]Diffusion[[:space:]]Models/ab507ac6-d5ce-4774-be15-81b04f680ab8_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2764 |
+
2025/Score-based[[:space:]]Self-supervised[[:space:]]MRI[[:space:]]Denoising/df1b9b70-3b39-4d4c-adcb-c3dc4d94679c_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2765 |
+
2025/Score-based[[:space:]]free-form[[:space:]]architectures[[:space:]]for[[:space:]]high-dimensional[[:space:]]Fokker-Planck[[:space:]]equations/b29bcec0-1537-40ff-96ff-5a6e922147c4_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2766 |
+
2025/Scrutinize[[:space:]]What[[:space:]]We[[:space:]]Ignore_[[:space:]]Reining[[:space:]]In[[:space:]]Task[[:space:]]Representation[[:space:]]Shift[[:space:]]Of[[:space:]]Context-Based[[:space:]]Offline[[:space:]]Meta[[:space:]]Reinforcement[[:space:]]Learning/4fe2c956-0729-4157-a2d7-7216a3308ddb_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2767 |
+
2025/SeCom_[[:space:]]On[[:space:]]Memory[[:space:]]Construction[[:space:]]and[[:space:]]Retrieval[[:space:]]for[[:space:]]Personalized[[:space:]]Conversational[[:space:]]Agents/8f983f9d-791c-4565-a00d-66d6163148e9_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2768 |
+
2025/SeRA_[[:space:]]Self-Reviewing[[:space:]]and[[:space:]]Alignment[[:space:]]of[[:space:]]LLMs[[:space:]]using[[:space:]]Implicit[[:space:]]Reward[[:space:]]Margins/f4d035f8-3d53-4e11-baaf-e7192b9c9dc7_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2769 |
+
2025/Searching[[:space:]]for[[:space:]]Optimal[[:space:]]Solutions[[:space:]]with[[:space:]]LLMs[[:space:]]via[[:space:]]Bayesian[[:space:]]Optimization/2857c202-a649-496f-a55c-6481aac4d1f5_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2770 |
+
2025/Second[[:space:]]Order[[:space:]]Bounds[[:space:]]for[[:space:]]Contextual[[:space:]]Bandits[[:space:]]with[[:space:]]Function[[:space:]]Approximation/5b1f820a-e24a-4191-bbc3-44c79ee35757_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2771 |
+
2025/Second-Order[[:space:]]Fine-Tuning[[:space:]]without[[:space:]]Pain[[:space:]]for[[:space:]]LLMs_[[:space:]]A[[:space:]]Hessian[[:space:]]Informed[[:space:]]Zeroth-Order[[:space:]]Optimizer/faf3b6a1-f311-4810-9158-e5cd111c7c8b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2772 |
+
2025/SecureGS_[[:space:]]Boosting[[:space:]]the[[:space:]]Security[[:space:]]and[[:space:]]Fidelity[[:space:]]of[[:space:]]3D[[:space:]]Gaussian[[:space:]]Splatting[[:space:]]Steganography/545f1ecc-ef13-4089-9167-492052c71aa9_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2773 |
+
2025/See[[:space:]]It[[:space:]]from[[:space:]]My[[:space:]]Perspective_[[:space:]]How[[:space:]]Language[[:space:]]Affects[[:space:]]Cultural[[:space:]]Bias[[:space:]]in[[:space:]]Image[[:space:]]Understanding/3c709038-1a4f-465a-8469-e6dd360ea8ca_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2774 |
+
2025/See[[:space:]]What[[:space:]]You[[:space:]]Are[[:space:]]Told_[[:space:]]Visual[[:space:]]Attention[[:space:]]Sink[[:space:]]in[[:space:]]Large[[:space:]]Multimodal[[:space:]]Models/481a9cb0-b38e-4ff9-b04a-465057806618_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2775 |
+
2025/SeedLM_[[:space:]]Compressing[[:space:]]LLM[[:space:]]Weights[[:space:]]into[[:space:]]Seeds[[:space:]]of[[:space:]]Pseudo-Random[[:space:]]Generators/ebe14fbc-fb93-45dc-961b-34e78d8f4344_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2776 |
+
2025/Seeing[[:space:]]Eye[[:space:]]to[[:space:]]AI_[[:space:]]Human[[:space:]]Alignment[[:space:]]via[[:space:]]Gaze-Based[[:space:]]Response[[:space:]]Rewards[[:space:]]for[[:space:]]Large[[:space:]]Language[[:space:]]Models/fa117c37-265d-4e81-9696-e54fa2830fd2_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
| 2777 |
+
2025/SegLLM_[[:space:]]Multi-round[[:space:]]Reasoning[[:space:]]Segmentation[[:space:]]with[[:space:]]Large[[:space:]]Language[[:space:]]Models/95d58d29-722c-4035-a010-1883df7f6c4b_origin.pdf filter=lfs diff=lfs merge=lfs -text
|
2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/5dedbb47-9910-486a-8713-44e25df70fe8_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/5dedbb47-9910-486a-8713-44e25df70fe8_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/5dedbb47-9910-486a-8713-44e25df70fe8_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c2889e0214e28528edbc263ca6a84d70327780836832017805e9a10a3cd8cdaa
|
| 3 |
+
size 7025922
|
2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/full.md
ADDED
|
@@ -0,0 +1,397 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SV4D: DYNAMIC 3D CONTENT GENERATION WITH MULTI-FRAME AND MULTI-VIEW CONSISTENCY
|
| 2 |
+
|
| 3 |
+
Yiming Xie $^{1,2*}$ Chun-Han Yao $^{1*}$ Vikram Voleti $^{1}$ Huaizu Jiang $^{2\dagger}$ Varun Jampani $^{1\dagger}$
|
| 4 |
+
|
| 5 |
+
$^{1}$ Stability AI $^{2}$ Northeastern University
|
| 6 |
+
|
| 7 |
+
* Equal contribution † Equal advising
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
We present Stable Video 4D (SV4D) — a latent video diffusion model for multi-frame and multi-view consistent dynamic 3D content generation. Unlike previous methods that rely on separately trained generative models for video generation and novel view synthesis, we design a unified diffusion model to generate novel view videos of dynamic 3D objects. Specifically, given a monocular reference video, SV4D generates novel views for each video frame that are temporally consistent. We then use the generated novel view videos to optimize an implicit 4D representation (dynamic NeRF) efficiently, without the need for cumbersome SDS-based optimization used in most prior works. To train our unified novel view video generation model, we curate a dynamic 3D object dataset from the existing Objaverse dataset. Extensive experimental results on multiple datasets and user studies demonstrate SV4D's state-of-the-art performance on novel-view video synthesis as well as 4D generation compared to prior works. Project page: https://sv4d.github.io.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
The 3D world we live in is dynamic in nature with moving people, playing pets, bouncing balls, waving flags, etc. Dynamic 3D object generation, also known as 4D generation, is the task of generating not just the 3D shape and appearance (texture) of a 3D object, but also its motion in 3D space. In this work, we tackle the problem of generating a 4D (dynamic 3D) object from a single monocular video of that object. 4D generation enables the effortless creation of realistic visual experiences, such as for video games, movies, AR/VR, etc.
|
| 16 |
+
|
| 17 |
+
4D generation from a single video is highly challenging as this involves simultaneously reasoning both the object appearance and motion at unseen camera views around the object. This is also an ill-posed problem as a multitude of 4D results can plausibly explain a single given video. There are two main technical challenges in training a robust 4D generative model that can generalize to different object types and motions. First, there exists no large-scale dataset with 4D objects to train a robust generative model. Second, the higher dimensional nature of the problem requires a large number of parameters to represent the 3D shape, appearance, and motion of an object.
|
| 18 |
+
|
| 19 |
+
As a result, several recent techniques (Singer et al., 2023b; Bahmani et al., 2024; Ling et al., 2024; Ren et al., 2023; Zhao et al., 2023; Jiang et al., 2024c; Zeng et al., 2024; Yin et al., 2023) optimize 4D content by leveraging priors in pre-trained video and multi-view generative models via score-distillation sampling (SDS) loss (Poole et al., 2023) and its variants. However, they tend to produce unsatisfactory results due to independent modeling of object motion using video models, and novel view synthesis using multi-view generative models. In addition, they tend to take hours to generate a single 4D object due to time-consuming SDS-based optimization. Concurrent works (Yang et al., 2025; Sun et al., 2025) try to partially address these issues by jointly sampling novel view videos (along both video frame and view axes) using both video and multi-view generative models; and then using the resulting novel view videos for 4D optimization. This results in a better novel view video synthesis with multi-view dynamic consistency, but several inconsistencies still remain due to the use of separate video and multi-view generative models.
|
| 20 |
+
|
| 21 |
+
In this work, we propose Stable Video 4D (SV4D) model that takes as input a single video, such as of a dynamic object, along with a user-specified camera trajectory around the object, and outputs
|
| 22 |
+
|
| 23 |
+

|
| 24 |
+
Figure 1: Stable Video 4D (SV4D) framework overview and generated 4D assets. We adapt and train a video diffusion model to generate novel view videos, conditioned on a single-view video and a multi-view orbital video of the first frame. SV4D generated novel view videos are consistent across both view and motion axis, which we directly use to optimize dynamic 3D objects without the cumbersome SDS loss.
|
| 25 |
+
|
| 26 |
+
videos of the object along each of the specified camera views. That is, given a video with $F$ number of frames and a camera trajectory with $V$ number of camera views, SV4D outputs a $V \times F$ grid of images, as illustrated in Fig. 1. Given a reference video, we first obtain the reference multi-views for the first frame using an off-the-shelf multi-view generator (SV3D (Voleti et al., 2024)). SV4D then jointly outputs the remaining grid of images as highlighted by a yellow box in Fig. 1. In contrast to prior and concurrent works, SV4D jointly reasons along both view and motion axes, resulting in state-of-the-art multi-frame and multi-view consistency in the output novel view videos.
|
| 27 |
+
|
| 28 |
+
Specifically, we start with Stable Video Diffusion (SVD) (Blattmann et al., 2023a), a state-of-the-art video generator, and equip it with two attention blocks: view attention and frame attention. The view attention block aligns the multi-view images at each video frame, conditioning on the first view i.e, in the reference video. Similarly, the frame attention block aligns the multi-frame images at each view, conditioning on the first frame at each view, i.e, reference multi-view. This dual-attention design leads to significantly improved dynamic and multi-view consistency compared to prior art.
|
| 29 |
+
|
| 30 |
+
A key challenge here is that SV4D needs to simultaneously generate the $V \times F$ grid of images, which can quickly become large with long input videos; making it infeasible to fit into memory even on modern GPUs. As a remedy, we propose techniques to sequentially process an interleaved subset of input frames while also retaining consistency in the output image grid. After generating the multiple novel view videos, we optimize a 4D representation of the dynamic 3D asset, as illustrated in Fig. 1.
|
| 31 |
+
|
| 32 |
+
Given the lack of large-scale 4D datasets, we carefully initialized SV4D weights with those from SVD (Blattmann et al., 2023a) and SV3D (Voleti et al., 2024) networks, thereby leveraging the priors learned in the existing video and multi-view diffusion models. To further train SV4D, we carefully curated a subject of Objaverse (Deitke et al., 2023b;a) dataset with dynamic 3D objects, resulting in the ObjaverseDy dataset.
|
| 33 |
+
|
| 34 |
+
We perform extensive comparisons of both novel view video synthesis and 4D generation results with respective state-of-the-art methods on datasets with synthetic (ObjaverseDy, Consistent4D (Jiang et al., 2024c)), and real-world (DAVIS (Perazzi et al., 2016; Pont-Tuset et al., 2017; Caelles et al., 2019)) data. We modify the FVD metric (Unterthiner et al., 2018) to evaluate both video frame and view consistency, validating the effectiveness and design choices of our approach. Fig. 1 shows some sample results of our approach.
|
| 35 |
+
|
| 36 |
+
To summarize, our contributions include:
|
| 37 |
+
|
| 38 |
+
- A novel SV4D network that can simultaneously reason across both frame and view axes. To our knowledge, this is the first work that trains a single novel view video synthesis network using 4D datasets, that can jointly perform novel view synthesis as well as video generation.
|
| 39 |
+
- A mixed sampling scheme that enables sequential processing of arbitrary long input videos while also retaining the multi-frame and multi-view consistency.
|
| 40 |
+
- State-of-the-art results on multiple benchmark datasets with both novel view video synthesis as well as 4D generation.
|
| 41 |
+
|
| 42 |
+
# 2 RELATED WORK
|
| 43 |
+
|
| 44 |
+
3D Generation. Here, we refer to the works that generate static 3D content as 3D generation. DreamFusion (Poole et al., 2023) first proposed to distill priors from the 2D diffusion model via SDS loss to optimize the 3D content from text or image. Several subsequent works (Yi et al., 2024; Tang et al., 2024; Shi et al., 2024a; Wang et al., 2024d; Li et al., 2024c; Weng et al., 2023; Pan et al., 2024a; Chen et al., 2024b; Sun et al., 2024a; Sargent et al., 2024; Liang et al., 2024b; Zhou et al., 2024; Guo et al., 2023) try to solve issues caused by the original SDS loss, such as multi-face Janus, slow generation speed, and over-saturated/smoothed generations. Recent works (Hong et al., 2024; Jiang et al., 2024a; Wang et al., 2024b; Zou et al., 2024; Wei et al., 2024; Tochilkin et al., 2024) try to directly predict the 3D model of an object via a large reconstruction model. Another approach (Liu et al., 2023b; 2024b; Long et al., 2024; Voleti et al., 2024; Ye et al., 2024; Karnewar et al., 2023; Li et al., 2024b; Shi et al., 2024b; 2023; Wang & Shi, 2023; Liu et al., 2023a; 2024a) to 3D generation is generating dense multi-view images with sufficient 3D consistency. 3D content is reconstructed based on the dense multi-view images. We follow this strategy, but generate consistent multi-view videos (instead of images) and then reconstruct the 4D object.
|
| 45 |
+
|
| 46 |
+
Video Generation. Recent video generation models (Ho et al., 2022; Voleti et al., 2022; Blattmann et al., 2023b;a; He et al., 2022; Singer et al., 2023a; Guo et al., 2024) have shown very impressive performance with consistent geometry and realistic motions. Video generation models have good generalization capabilities, as they are trained on large-scale image and video data that are easier to collect than large-scale 3D or 4D data. Hence, they are commonly used as foundation models for various generation tasks. Well-trained video generative models have shown their potential to generate multi-view images as a 3D generator (Voleti et al., 2024; Chen et al., 2024c; Han et al., 2024; Kwak et al., 2024; Melas-Kyriazi et al., 2024). SV3D (Voleti et al., 2024) adapts SVD (Blattmann et al., 2023a) to generate novel multiple views. In this work, we leverage the pre-trained video generation model for 4D generation by adding an additional view attention layer to align the multiview images.
|
| 47 |
+
|
| 48 |
+
4D Generation. On one hand, recent optimization-based methods (Singer et al., 2023b; Bahmani et al., 2024; Ling et al., 2024; Ren et al., 2023; Zhao et al., 2023; Jiang et al., 2024c; Zeng et al., 2024; Yin et al., 2023; Chen et al., 2024a; Rahamim et al., 2024; Geng et al., 2024; Yu et al., 2024) can generate 4D content by distilling pre-trained diffusion models in a 4D representation (Cao & Johnson, 2023; Kerbl et al., 2023; Mildenhall et al., 2021) via SDS loss Poole et al. (2023). However, they tend to take hours to generate 4D content due to time-consuming optimization. On the other hand, photogrammetry-based methods (Yang et al., 2025; Pan et al., 2024b) mimic a 3D object capture pipeline by directly generating multi-frame multi-view images of a 4D content with dynamic and multi-view consistency and then directly reconstructing 4D representations with them. Although these methods have much faster speeds, inference-only pipelines are adopted due to the paucity of the 4D data, thus making the spatial-temporal consistency still unsatisfactory. In this work, we proposed a monolithic model to generate a more consistent image grid, and we used a carefully curated 4D dataset to train the model. Recently, there has been a surge of interest in 4D generation, resulting in the development of concurrent works (Liang et al., 2024a; Zhang et al., 2024; Li et al., 2024a; Ren et al., 2024; Wang et al., 2024c; Jiang et al., 2024b; Sun et al., 2024b; Zhao et al., 2025; Wang et al., 2024a; Wu et al., 2024b; Zhu et al., 2025; Bai et al., 2024; Sun et al., 2025). Diffusion4D (Liang et al., 2024a) only generates diagonal images (space-time), by fine-tuning a 4D-aware video diffusion model with motion magnitude guidance. Vivid-ZOO (Li et al., 2024a) combines the 3D and video generative model and then finetunes alignment modules to mitigate the incompatibility between reused layers. 4Diffusion (Zhang et al., 2024) inserts temporal layers to a 3D-aware diffusion model to generate novel view videos. Both Vivid-ZOO and 4Diffusion freeze pre-trained weights, limiting their ability to fully capture spatial-temporal information. Additionally, they generate low-resolution images or a limited number of frames due to memory constraints. In contrast, SV4D finetunes all layers of our unified model, allowing for comprehensive spatial-temporal learning, and uses a mixed sampling scheme, enabling the generation of high-resolution and long novel views.
|
| 49 |
+
|
| 50 |
+
# 3 METHOD
|
| 51 |
+
|
| 52 |
+
Our main idea is to build multi-frame and multi-view consistency in a 4D object by surgically combining the frame-consistency in a video diffusion model, with the multi-view consistency in a multi-view diffusion model. In our case, we choose SVD (Blattmann et al., 2023a) and SV3D (Voleti et al., 2024) as the video and multi-view diffusion models respectively, for the advantages reasoned below. However, it is to be noted that any choice of attention-based diffusion models should work.
|
| 53 |
+
|
| 54 |
+

|
| 55 |
+
Figure 2: SV4D model architecture. For camera conditioning, we feed the sinusoidal embedding of camera viewpoints to the convolutional blocks in the UNet, and use the input video for cross-attention conditioning in the spatial and view attention blocks. To improve temporal consistency, we introduce an additional frame attention block, conditioned on the corresponding views of the first frame.
|
| 56 |
+
|
| 57 |
+
# 3.1 NOVEL VIEWVIDEO SYNTHESIS VIA SV4D
|
| 58 |
+
|
| 59 |
+
Problem Setting. Formally, we begin with a monocular input video $\mathbf{J} \in \mathbb{R}^{F \times D}$ of a dynamic object of $F$ frames and $D \coloneqq 3 \times H \times W$ dimensions, where $H$ and $W$ are the height and width of each frame. Our goal is to generate an image matrix $\mathbf{M} \in \mathbb{R}^{V \times F \times D}$ of the 4D object consisting of $V$ camera views and $F$ dynamic frames of each frame. Similar to SV3D (Voleti et al., 2024), the multi-view frames follow a camera pose trajectory $\pi \in \mathbb{R}^{V \times 2} = \{(e_v, a_v)\}_{v=1}^V$ as a sequence of $V$ tuples of elevation $e$ and azimuth angles $a$ . We generate this image matrix by iteratively denoising samples from a learned conditional distribution $p(\mathbf{M}|\mathbf{J}, \pi)$ , parameterized by a 4D diffusion model. Due to memory limitation in generating $V \times F$ images simultaneously, we break down the full generation process into multiple submatrix generation steps.
|
| 60 |
+
|
| 61 |
+
SV4D Network. Our goal is to make the generated image matrix $\mathbf{M}$ dynamically consistent in the "frame" axis, and multi-view consistent in the "view" axis (see Fig. 2 left). To achieve this, we condition the image matrix generation on the corresponding frames of the monocular input video $\{\mathbf{M}_{0,f}\} = \mathbf{J}$ as well as the views from reference multi-view images of the first video frame $\{\mathbf{M}_{v,0}\}$ , which provide motion and multi-view information of the 4D object, respectively. Without loss of generality, we obtain the reference multi-view images of the first input frame by sampling from a pre-trained SV3D (Voleti et al., 2024) model, which can be expressed as $p(\{\mathbf{M}_{v,0}\}|\{\mathbf{M}_{0,0}\},\pi)$ . The overall SV4D novel view video synthesis can be rewritten as sampling from the distribution $p(\mathbf{M}|\{\mathbf{M}_{0,f}\},\{\mathbf{M}_{v,0}\},\pi)$ .
|
| 62 |
+
|
| 63 |
+
We build the SV4D network based on SVD (Blattmann et al., 2023a) and SV3D (Voleti et al., 2024) models to combine the advantages of both video and multi-view diffusion models. As illustrated in Fig. 2, SV4D consists of a UNet with multiple layers, where each layer contains a sequence of one residual block with Conv3D layers and three transformer blocks with attention layers: spatial, view, and frame attention. Similar to SV3D, the residual Conv block takes in the noisy latents of flattened image matrix as well as handles the incorporation of conditioning camera poses $\{\pi_v\}$ , and the spatial attention layer handles image-level details by performing attention across the image width and height axes. To better capture motion cues in the input monocular video $\{\mathbf{M}_{0,f}\}$ , we concatenate its VAE latents to the noisy latents $\mathbf{z}_n$ before feeding it to the UNet.
|
| 64 |
+
|
| 65 |
+
For multi-view consistency, the view attention block transposes the features and performs attention in the multi-view axis. By using the CLIP embedding of corresponding input frames $\{\mathbf{M}_{0,f}\}$ as cross-attention conditioning, it allows the network to learn spatial consistency across novel views while maintaining the semantic context from the input video.
|
| 66 |
+
|
| 67 |
+
To further ensure dynamic consistency across video frames, we insert a frame attention layer in each UNet block, which applies the attention mechanism in the video frame dimension. The frame attention of each novel view video is conditioned on the corresponding reference view (of the first frame) $\{\mathbf{M}_{v,0}\}$ via cross-attention, allowing the network to preserve dynamic coherence starting from the first frame. We initialize the weights of the frame attention layers from SVD and the rest of
|
| 68 |
+
|
| 69 |
+

|
| 70 |
+
Figure 3: SV4D model sampling (7 frames and 3 views are for illustrative purposes only). To extend the generated multi-view videos while preserving temporal consistency, we propose a novel mixed-sampling strategy during inference. We first sample a sparse set of anchor frames, then use the anchor frames as new conditioning images to densely sample/interpolate the middle frames. To ensure a smooth transition between consecutive generations, we alternatively use the first (forward) or last (backward) frame within a time window for conditioning during dense sampling.
|
| 71 |
+
|
| 72 |
+
the network from $\mathrm{SV3D}_p$ , to leverage the generalizability as well as rich dynamic and multi-view priors learned from large-scale video and 3D datasets. More network details are in Appendix A.4.
|
| 73 |
+
|
| 74 |
+
ObjaverseDy Dataset. Considering that there exists no large-scale training datasets with dynamic 3D objects, we curate a new 4D dataset from the existing Objverse dataset (Deitke et al., 2023b;a), a massive dataset with annotated 3D objects. Objverse includes animated 3D objects, however, several of these animated 3D objects are not suitable for training due to having too few animated frames or insufficient motion. In addition, in the rendering stage, the common rendering and sampling setting may cause some issues. For example, dynamic objects may be out of the image if the camera distance is fixed because they have global motion; the motion of objects may be too fast or too slow if the temporal sampling step is fixed.
|
| 75 |
+
|
| 76 |
+
We follow several steps to curate and clean the 4D objects for our training purposes. We first filter out the objects based on a review of licenses. Then, we remove the objects whose animated frames are too few. To further filter out objects with minimal motion, we subsample keyframes from each video and apply simple thresholding on the maximum $L1$ distance between these frames as motion measurement. To render the training novel view videos, we flexibly choose the camera distance from the object. Starting from a base value, we increase the camera distance until the object fits within all frames of the rendered images. We also dynamically adjust the temporal sampling step. Starting from a base value, we increase the sampling step until the $L1$ distance between consecutive keyframes exceeds a certain threshold. These steps ensure a high-quality collection of 4D objects, with rendered multi-view videos that form our ObjaverseDy dataset. More dataset details are in Appendix A.1.
|
| 77 |
+
|
| 78 |
+
Training Details. We train SV4D on our ObjaverseDy dataset. We choose to finetune from the $\mathrm{SV3D}_p$ (Voleti et al., 2024) model to output 40 frames ( $F = 5$ frames along each of the $V = 8$ views) with the spatial resolution $576 \times 576$ , where the parameters in the frame attention layers are initialized from SVD-xt (Blattmann et al., 2023a). Similar to SV3D, we train SV4D progressively by first training on the static camera orbits for 40K iterations, then fine-tuning it for 20K iterations on the dynamic orbits. We use an effective batch size of 16 during training on 2 nodes of 880GB H100 GPUs. For more training details, please see Appendix A.2.
|
| 79 |
+
|
| 80 |
+
Inference Sampling Scheme. Due to memory limitations, we cannot generate all the novel view frames at once. To generate the full $V \times F$ image matrix with arbitrary length videos, one can naively run the submatrix generation independently. However, we observe that it often leads to severe artifacts due to the inconsistencies between consecutive submatrices. Hence, we design a novel sampling scheme to mitigate the issue. The proposed sampling scheme is illustrated in Fig. 3. Note that we only show motion frame extensions here for illustrative purposes. We first generate a sparse set of anchor frames with SV4D (interleaved sampling) as shown in Fig. 3 (left). Then we use the anchor frames as new reference views to densely sample the remaining frames (dense sampling). To ensure a smooth transition between consecutive generations, we alternatively use the first (forward) or last (backward) anchor frame for conditioning at each diffusion step, as shown in Fig. 3 (middle). In experiments (Fig. 8), we demonstrate that our sampling scheme can generate novel view videos that are more temporally consistent compared to using an off-the-shelf video interpolation model (Li et al., 2023) to interpolate in between the SV4D-generated anchor frames.
|
| 81 |
+
|
| 82 |
+

|
| 83 |
+
Figure 4: Overview of optimization framework. We first use the reference multi-view images (of the first frame) to optimize a static NeRF represented by a multi-resolution hash grid as well as density and color MLPs. Then, we unfreeze the temporal deformation MLP and optimize the dynamic NeRF with randomly sampled views and frames.
|
| 84 |
+
|
| 85 |
+
# 3.2 4D OPTIMIZATION FROM SV4D GENERATED NOVEL VIEW VIDEOS
|
| 86 |
+
|
| 87 |
+
4D Representation. As shown in Fig. 4, given the novel view videos generated by SV4D, we optimize a 4D representation to reconstruct the dynamic 3D asset. Formally, we learn a neural representation $\Psi_{\theta}:(\mathbf{x},t)\mapsto (\sigma ,c)$ that maps the sampled 3D points $\mathbf{x} = (x,y,z)$ along a camera ray, and the time embedding $t$ (i.e. continuous version of "frame" in the earlier discrete case) to its volumetric density $\sigma \in \mathbb{R}_+$ and color $c\in \mathbb{R}_+^3$ . Similar to D-NeRF (Pumarola et al., 2021), we represent a 4D object by the composition of a canonical NeRF that captures the static 3D appearance and a deformation field which handles the object motion across time. For each 3D point $\mathbf{x}$ in the canonical space, we bilinearly interpolate the multi-resolution hash grid features following Instant-NGP (Muller et al., 2022), and decode them as density and color via $\mathrm{MLP}_{\sigma}$ and $\mathrm{MLP}_{\mathrm{c}}$ , respectively. The deformation field is represented by an MLP network $\mathrm{MLP}_{\mathrm{t}}$ conditioned on time embedding $t$ , mapping temporal deformation of $\mathbf{x}$ to the common canonical space $\mathbf{x} + \Delta \mathbf{x}$ . Overall, the dynamic NeRF parameters $\theta$ include the canonical hash grid, $\mathrm{MLP}_{\mathrm{t}}$ , $\mathrm{MLP}_{\sigma}$ , and $\mathrm{MLP}_{\mathrm{c}}$ . Since we do not exhaustively sample temporal timestamps or dense spatial views like in prior SDS-based approaches, we observe that this dynamic NeRF representation produces better 4D results compared to other representations such as 4D Gaussian Splitting (Wu et al., 2024a), which suffers from flickering artifacts and does not interpolate well across time or views. We show several examples to demonstrate this in the supplementary rebuttal video.
|
| 88 |
+
|
| 89 |
+
**Optimization Details.** By leveraging the consistent image matrix generated by SV4D as pseudo ground-truths, we adopt a simple photometry-based optimization without the cumbersome SDS losses. The reconstruction losses include a pixel-level MSE loss, mask loss, and a perceptual LPIPS (Zhang et al., 2018b) loss. Similar to SV3D (Voleti et al., 2024), we also use several geometric priors to regularize the output shapes, such as a mono normal loss similar to MonoSDF (Yu et al., 2022) as well as bilateral depth and normal smoothness losses (Voleti et al., 2024) to encourage smooth 3D surfaces where the projected image gradients are low.
|
| 90 |
+
|
| 91 |
+
For training efficiency and stability, we follow a coarse-to-fine, static-to-dynamic strategy to optimize a 4D representation. That is, we first freeze the deformation field $\mathrm{MLP}_{\mathrm{t}}$ and only optimize the canonical NeRF on the multi-view images of the first frame, while gradually increasing the rendering resolution from $128\times 128$ to $512\times 512$ . Then, we unfreeze $\mathrm{MLP}_{\mathrm{t}}$ and randomly sample 4 frames $\times$ 4 views for training. Following the static-to-dynamic strategy, we also gradually optimize the time embedding $t$ from low to high temporal frequency. In our experiments, we find that sampling more timestamps in one batch and progressive optimization techniques are crucial to 4D output quality. We render the dynamic NeRF at $512\times 512$ resolution and use an Adam (Kingma & Ba, 2014) optimizer to train all model parameters. The overall optimization takes roughly 15-20 minutes per object. More implementation details can be found in Appendix A.5.
|
| 92 |
+
|
| 93 |
+
Table 1: Evaluation of novel view video synthesis on the Consistent4D dataset. SV4D can achieve better video frame consistency while maintaining comparable image quality. † Our reproduced version.
|
| 94 |
+
|
| 95 |
+
<table><tr><td>Model</td><td>LPIPS↓</td><td>CLIP-S↑</td><td>FVD-F↓</td></tr><tr><td>SV3D (Voleti et al., 2024)</td><td>0.129</td><td>0.925</td><td>989.53</td></tr><tr><td>4Diffusion (Zhang et al., 2024)</td><td>0.164</td><td>0.863</td><td>-</td></tr><tr><td>Diffusion2 (Yang et al., 2025)</td><td>0.189</td><td>0.907</td><td>1205.16</td></tr><tr><td>STAG4D† (Zeng et al., 2024)</td><td>0.131</td><td>0.929</td><td>861.88</td></tr><tr><td>SV4D</td><td>0.129</td><td>0.929</td><td>677.68</td></tr></table>
|
| 96 |
+
|
| 97 |
+
Table 2: Evaluation of 4D outputs on the Consistent4D dataset. SV4D can achieve better visual quality and video frame smoothness.
|
| 98 |
+
|
| 99 |
+
<table><tr><td>Model</td><td>LPIPS↓</td><td>CLIP-S↑</td><td>FVD-F↓</td></tr><tr><td>Consistent4D (Jiang et al., 2024c)</td><td>0.160</td><td>0.87</td><td>1133.93</td></tr><tr><td>STAG4D (Zeng et al., 2024)</td><td>0.126</td><td>0.91</td><td>992.21</td></tr><tr><td>4Diffusion (Zhang et al., 2024)</td><td>0.165</td><td>0.88</td><td>-</td></tr><tr><td>Efficient4D (Pan et al., 2024b)</td><td>0.130</td><td>0.92</td><td>-</td></tr><tr><td>4DGen (Yin et al., 2023)</td><td>0.140</td><td>0.89</td><td>-</td></tr><tr><td>DG4D (Ren et al., 2023)</td><td>0.160</td><td>0.87</td><td>-</td></tr><tr><td>GaussianFlow (Gao et al., 2024)</td><td>0.140</td><td>0.91</td><td>-</td></tr><tr><td>SV4D</td><td>0.118</td><td>0.92</td><td>732.40</td></tr></table>
|
| 100 |
+
|
| 101 |
+
Table 3: Evaluation of novel view video synthesis on the ObjaverseDy dataset. SV4D can achieve superior performance in both video frame and multi-view consistency. † Our reproduced version.
|
| 102 |
+
|
| 103 |
+
<table><tr><td>Model</td><td>LPIPS↓</td><td>CLIP-S↑</td><td>FVD-F↓</td><td>FVD-V↓</td><td>FVD-Diag↓</td><td>FV4D↓</td></tr><tr><td>SV3D (Voleti et al., 2024)</td><td>0.131</td><td>0.920</td><td>729.67</td><td>375.49</td><td>526.78</td><td>690.49</td></tr><tr><td>Diffusion2 (Yang et al., 2025)</td><td>0.188</td><td>0.869</td><td>1048.47</td><td>564.80</td><td>938.98</td><td>1320.29</td></tr><tr><td>STAG4D† (Zeng et al., 2024)</td><td>0.133</td><td>0.917</td><td>652.43</td><td>469.07</td><td>636.83</td><td>546.56</td></tr><tr><td>SV4D</td><td>0.136</td><td>0.920</td><td>585.09</td><td>331.94</td><td>503.02</td><td>470.46</td></tr></table>
|
| 104 |
+
|
| 105 |
+
# 4 EXPERIMENTS
|
| 106 |
+
|
| 107 |
+
Datasets. We evaluate SV4D-synthesized novel view videos and 4D optimization results on the synthetic datasets ObjaverseDy and Consistent4D (Deitke et al., 2023b). Consistent4D dataset contains dynamic objects collected from Objaverse (Deitke et al., 2023b;a). We excluded these objects from our training set to make a fair comparison. We used the same input video and evaluated views as Consistent4D. For the visual comparison, we also used single-view videos from the real-world videos dataset DAVIS (Peruzzi et al., 2016; Pont-Tuset et al., 2017; Caelles et al., 2019).
|
| 108 |
+
|
| 109 |
+
Metrics. We use the SV4D model to generate multiple novel view videos corresponding to the trajectories of the ground truth camera in the evaluation datasets. We compare each generated image with its corresponding ground-truth, in terms of Learned Perceptual Similarity (LPIPS (Zhang et al., 2018b)) and CLIP-score (CLIP-S) to evaluate visual quality. In addition, we evaluate the video coherence by reporting FVD (Unterthiner et al., 2018), a video-level metric commonly used in video generation tasks. We calculate FVD with different ways (see Fig. 7): FVD-F: calculate FVD over frames at each view. FVD-V: calculate FVD over views at each frame. FVD-Diag: calculate FVD over the diagonal images of the image matrix. FV4D: calculate FVD over all images by scanning them in a bidirectional raster order.
|
| 110 |
+
|
| 111 |
+
Baselines. For novel view video synthesis, we compare SV4D with several recent methods capable of generating multiple novel view videos from a single-view video, including SV3D (Voleti et al., 2024), Diffusion $^{2}$ (Yang et al., 2025), STAG4D (Zeng et al., 2024). It is to be noted that all of these methods are inference-only techniques, and do not involve direct training in the 4D space like our method. We run SV3D to generate multi-view images for each video frame separately. STAG4D used Zero123++ (Shi et al., 2023) as the multi-view generator, which fixed the view angle, and hence the novel views generated from STAG4D cannot be changed to be consistent with the views evaluated. We reproduced STAG4D with SV3D as the multi-view generator. SV3D has been shown to generate more consistent 3D results than Zero123++, so this serves as a stronger baseline. For reference, we also compare SV4D with the concurrent work 4Diffusion (Zhang et al., 2024). We do not report the FVD-F metric for 4Diffusion, as it only generates 8 frames, which is inconsistent with the number of frames used in our evaluation. Note that the FVD-F metric is highly sensitive to the number of frames. For 4D generation, we compare SV4D with other methods that can generate 4D representations, including Consistent4D (Jiang et al., 2024c), STAG4D (Zeng et al., 2024), 4Diffusion (Zhang et al., 2024), DreamGaussian4D (DG4D) (Ren et al., 2023), GaussianFlow (Gao et al., 2024), 4DGen (Yin et al., 2023), Efficient4D (Pan et al., 2024b). More baseline details are in Appendix C.
|
| 112 |
+
|
| 113 |
+
# 4.1 QUANTITATIVE COMPARISON
|
| 114 |
+
|
| 115 |
+
Novel View Video Synthesis. We quantitatively compare our method with the baselines in terms of novel view video synthesis results. Table 1 reports the comparisons in the Consistent4D dataset.
|
| 116 |
+
|
| 117 |
+
Table 4: Evaluation of 4D outputs on the ObjaverseDy dataset. SV4D consistently outperforms baselines in terms of all metrics, demonstrating superior performance in visual quality (LPIPS and CLIP-S), video frame consistency (FVD-F), multi-view consistency (FVD-V), and multi-view video consistency (FVD-Diag and FV4D).
|
| 118 |
+
|
| 119 |
+
<table><tr><td>Model</td><td>LPIPS↓</td><td>CLIP-S↑</td><td>FVD-F↓</td><td>FVD-V↓</td><td>FVD-Diag↓</td><td>FV4D↓</td></tr><tr><td>Consistent4D (Jiang et al., 2024c)</td><td>0.165</td><td>0.896</td><td>880.54</td><td>488.38</td><td>741.52</td><td>871.95</td></tr><tr><td>STAG4D (Zeng et al., 2024)</td><td>0.158</td><td>0.860</td><td>929.10</td><td>453.62</td><td>663.50</td><td>1003.16</td></tr><tr><td>DreamGaussian4D (Ren et al., 2023)</td><td>0.152</td><td>0.897</td><td>697.80</td><td>450.58</td><td>615.68</td><td>638.15</td></tr><tr><td>SV4D</td><td>0.131</td><td>0.905</td><td>659.66</td><td>368.53</td><td>525.65</td><td>614.35</td></tr></table>
|
| 120 |
+
|
| 121 |
+

|
| 122 |
+
Figure 5: Visual comparison of novel view video synthesis results. We show two frames in the input videos and two novel-view results of the corresponding frames. Compared to the baseline methods, SV4D outputs contain geometry and texture details that are more faithful to the input video and consistent across frames.
|
| 123 |
+
|
| 124 |
+
Due to the fact that the evaluated views are too sparse, we only report $FVD - F$ in the Consistent4D dataset. Our method can achieve much better performance in terms of video frame consistency while maintaining comparable performance in terms of image quality. In particular, our approach has a significant reduction of $31.5\%$ and $21.4\%$ in $FVD - F$ compared to SV3D and STAG4D, respectively. Table 3 reports the comparisons in the Objaverse dataset. Our method can achieve much better video frame consistency as well as multi-view consistency while maintaining comparable performance in terms of image quality. In particular, our approach has much lower $FVD - F$ compared to baseline methods, demonstrating our generated videos are much smoother. In addition, SV4D achieves better $FVD - V$ which shows better multi-view consistency. Our method also surpasses the previous state-of-the-art methods in terms of $FVD-Diag$ and $FV4D$ , proving that the synthesized novel view videos have better video frame and multi-view consistency.
|
| 125 |
+
|
| 126 |
+
4D Generation. We quantitatively compare our optimized 4D outputs with the baselines in Consistent4D and ObjaverseDy dataset, as shown in Tables 2 and 4, respectively. Our method consistently outperforms baselines in terms of all metrics, demonstrating superior performance in visual quality (LPIPS and CLIP-S), motion smoothness (FVD-F), multi-view smoothness (FVD-V), and motion-multi-view joint smoothness (FVD-Diag and FV4D).
|
| 127 |
+
|
| 128 |
+
# 4.2 VISUAL COMPARISON
|
| 129 |
+
|
| 130 |
+
Novel View Video Synthesis. In Fig. 5 we show the visual comparison of our multi-view video synthesis results against other methods. We observe that applying SV3D frame-by-frame leads to
|
| 131 |
+
|
| 132 |
+

|
| 133 |
+
Figure 6: Visual comparison of generated 4D outputs. We show two frames in the input videos and render two novel views of the corresponding frames. By leveraging the consistent multi-view videos generated by SV4D, we can learn higher-quality 4D assets compared to the prior works with SDS-based losses. Our results are more detailed, consistent, and faithful to the input videos.
|
| 134 |
+
|
| 135 |
+
inconsistent geometry and texture in novel view videos. Diffusion<sup>2</sup> slightly improves the temporal coherence but tends to produce blurry or flickering artifacts. STAG4D can produce smoother videos but often fails at capturing large motion. Compared to these methods, SV4D can generate high-quality multi-view videos that are detailed, faithful to input videos, and temporally consistent.
|
| 136 |
+
|
| 137 |
+
4D Generation. We compare our generated 4D results with the prior methods in Fig. 6. For each video, we render the 4D outputs at two different timestamps and two novel views. Consistent4D and STAG4D often produce blurry outputs with inconsistent geometry and texture. DreamGaussian4D can generate finer texture details but still suffers from flickering artifacts and sometimes creates inaccurate geometry. Moreover, all these methods rely on the computationally expensive SDS loss, which is prone to spatially incoherent results and over-saturated texture. On the contrary, SV4D optimizes 4D assets using purely photometric and geometric losses, resulting in smoother videos with realistic and faithful object appearance. More visual comparison results can be found in Appendix B.1.
|
| 138 |
+
|
| 139 |
+
# 4.3 USER STUDY
|
| 140 |
+
|
| 141 |
+
In addition to the quantitative evaluation, we also conduct two user studies on our multi-view video synthesis results and 4D outputs, respectively. Concretely, we randomly select 10 real-world videos from the DAVIS dataset and 10 synthetic videos from the Objaverse or Consistent4D datasets. For each video, we randomly choose a novel camera view and ask the user to compare the novel view videos generated by 4 different methods (SV4D and 3 baselines). The users are asked to select a video that "looks more stable, realistic, and closely resembles the reference subject". For multi-view video synthesis, SV4D results are preferred $73.3\%$ over per-frame SV3D $(13.7\%)$ , Diffusion² $(5.0\%)$ , and STAG4D $(8.0\%)$ among multiple participants. For the optimized 4D outputs, SV4D achieves $60\%$ overall preference against Consistent4D $(12.7\%)$ , STAG4D $(9.7\%)$ , and DreamGaussian4D $(17.6\%)$ among multiple users.
|
| 142 |
+
|
| 143 |
+
# 4.4 ABLATIVE ANALYSES
|
| 144 |
+
|
| 145 |
+
We conduct several ablation experiments to validate the effectiveness of our model's design choices. We summarize the key findings below.
|
| 146 |
+
|
| 147 |
+
SV4D can generate anchor frames with better consistency. To validate the quality of anchor frames, we compare the anchor frames (8 views $\times$ 5 video frames) generated from SV4D and the
|
| 148 |
+
|
| 149 |
+
Table 5: Evaluation of novel view video synthesis (anchor frames only). SV4D can effectively sample frames with faithful consistency and visual details. † Our reproduced version.
|
| 150 |
+
|
| 151 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">ObjaverseDy</td><td colspan="2">Consistent4D</td></tr><tr><td>FVD-F↓</td><td>FV4D↓</td><td>FVD-F↓</td><td>FV4D↓</td></tr><tr><td>SV3D (Voleti et al., 2024)</td><td>700.72</td><td>831.18</td><td>656.59</td><td>780.99</td></tr><tr><td>Diffusion2 (Yang et al., 2025)</td><td>896.98</td><td>890.70</td><td>801.99</td><td>1093.24</td></tr><tr><td>STAG4D† (Zeng et al., 2024)</td><td>765.79</td><td>669.28</td><td>601.23</td><td>659.79</td></tr><tr><td>SV4D</td><td>629.22</td><td>569.08</td><td>469.73</td><td>621.00</td></tr></table>
|
| 152 |
+
|
| 153 |
+
Table 6: Evaluation of different sampling strategies on ObjaverseDy dataset. SV4D sampling can effectively generate full image matrixes with faithful consistency and visual details.
|
| 154 |
+
|
| 155 |
+
<table><tr><td>Sampling</td><td colspan="4">LPIPS↓FVD-F↓FVD-Diag↓FV4D↓</td></tr><tr><td>Interleaved</td><td>0.136</td><td>731.28</td><td>567.15</td><td>717.21</td></tr><tr><td>Independent</td><td>0.136</td><td>663.41</td><td>512.14</td><td>488.31</td></tr><tr><td>AMT (Li et al., 2023)</td><td>0.140</td><td>612.61</td><td>505.36</td><td>472.87</td></tr><tr><td>SV4D</td><td>0.136</td><td>585.09</td><td>503.02</td><td>470.46</td></tr></table>
|
| 156 |
+
|
| 157 |
+

|
| 158 |
+
Figure 7: Illustrations of video and 4D metrics. FVD-F evaluates coherence between video frames from a fixed view. FVD-V captures multiview consistency. We also design FVD-Diag and FV4D to evaluate 4D consistency by traversing the image matrix through different paths.
|
| 159 |
+
|
| 160 |
+

|
| 161 |
+
Figure 8: Visual comparison of SV4D sampling and video interpolation. Given the same sparse anchor frames, SV4D can effectively sample the middle frames with faithful motion and details, whereas an off-the-shelf video interpolation model creates blurry results or missing parts.
|
| 162 |
+
|
| 163 |
+
basiines on Consistent4D and ObjaverseDy dataset, as shown in Table 5. SV4D results have much lower FVD-F and $FV4D$ , showing much better video frame and multi-view consistency.
|
| 164 |
+
|
| 165 |
+
SV4D Sampling is better than off-the-shelf interpolation method. Extending anchor frames to the full $V \times F$ image matrix is not trivial. In Table 6, we compare our SV4D sampling (ours) and the off-the-shelf interpolation method AMT (Li et al., 2023). The model with SV4D sampling outperforms AMT across all metrics. Fig. 8 validates this observation, where we can see that the SV4D sampling can synthesize distinct images while the results of the off-the-shelf interpolation method have a lot of blur results or missing parts. Table 6 also shows the results of two intuitive sampling strategies, independent and interleaved sampling, both of which produce videos with lower consistency. Appendix A.6 explains the details of independent and interleaved sampling. These results validate that the SV4D sampling is effective.
|
| 166 |
+
|
| 167 |
+
# 5 CONCLUSION
|
| 168 |
+
|
| 169 |
+
We present SV4D, a latent video diffusion model for novel view video synthesis and 4D generation. Given an input video, SV4D can generate multiple novel view videos that are dynamically and spatially consistent, by leveraging the dynamic prior in SVD and multi-view prior in SV3D within a unified architecture. The generated novel view videos can then be used to efficiently optimize a 4D asset without SDS losses from one or multiple diffusion models. Our extensive experiments show that SV4D outputs are more multi-frame and multi-view consistent than existing methods and generalizable to real-world videos, achieving the state-of-the-art performance on novel view video synthesis and 4D generation. We believe that SV4D provides a solid foundation model for further research on dynamic 3D object generation.
|
| 170 |
+
|
| 171 |
+
# REFERENCES
|
| 172 |
+
|
| 173 |
+
Sherwin Bahmani, Ivan Skorokhodov, Victor Rong, Gordon Wetzstein, Leonidas Guibas, Peter Wonka, Sergey Tulyakov, Jeong Joon Park, Andrea Tagliasacchi, and David B. Lindell. 4D-fy: Text-to-4D generation using hybrid score distillation sampling. In CVPR, 2024.
|
| 174 |
+
Jianhong Bai, Menghan Xia, Xintao Wang, Ziyang Yuan, Xiao Fu, Zuozhu Liu, Haoji Hu, Pengfei Wan, and Di Zhang. Syncammaster: Synchronizing multi-camera video generation from diverse viewpoints. arXiv preprint arXiv:2412.07760, 2024.
|
| 175 |
+
Andreas Blattmann, Tim Dockhorn, Sumith Kulal, Daniel Mendelevitch, Maciej Kilian, Dominik Lorenz, Yam Levi, Zion English, Vikram Voleti, Adam Letts, et al. Stable video diffusion: Scaling latent video diffusion models to large datasets. arXiv preprint arXiv:2311.15127, 2023a.
|
| 176 |
+
Andreas Blattmann, Robin Rombach, Huan Ling, Tim Dockhorn, Seung Wook Kim, Sanja Fidler, and Karsten Kreis. Align your latents: High-resolution video synthesis with latent diffusion models. In CVPR, 2023b.
|
| 177 |
+
Mark Boss, Andreas Engelhardt, Abhishek Kar, Yuanzhen Li, Deqing Sun, Jonathan T. Barron, Hendrik P.A. Lensch, and Varun Jampani. SAMURAI: Shape And Material from Unconstrained Real-world Arbitrary Image collections. In Advances in Neural Information Processing Systems (NeurIPS), 2022.
|
| 178 |
+
Sergi Caelles, Jordi Pont-Tuset, Federico Perazzi, Alberto Montes, Kevis-Kokitsi Maninis, and Luc Van Gool. The 2019 davis challenge on vos: Unsupervised multi-object segmentation. arXiv preprint arXiv:1905.00737, 2019.
|
| 179 |
+
Ang Cao and Justin Johnson. Hexplane: A fast representation for dynamic scenes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2023.
|
| 180 |
+
Ce Chen, Shaoli Huang, Xuelin Chen, Guangyi Chen, Xiaoguang Han, Kun Zhang, and Mingming Gong. CT4D: Consistent text-to-4D generation with animatable meshes. arXiv preprint arXiv:2408.08342, 2024a.
|
| 181 |
+
Zilong Chen, Feng Wang, Yikai Wang, and Huaping Liu. Text-to-3d using gaussian splatting. In CVPR, 2024b.
|
| 182 |
+
Zilong Chen, Yikai Wang, Feng Wang, Zhengyi Wang, and Huaping Liu. V3D: Video diffusion models are effective 3D generators. arXiv preprint arXiv:2403.06738, 2024c.
|
| 183 |
+
Matt Deitke, Ruoshi Liu, Matthew Wallingford, Huong Ngo, Oscar Michel, Aditya Kusupati, Alan Fan, Christian Laforte, Vikram Voleti, Samir Yitzhak Gadre, et al. Objverse-xl: A universe of $10\mathrm{m} + 3\mathrm{d}$ objects. In NeurIPS, 2023a.
|
| 184 |
+
Matt Deitke, Dustin Schwenk, Jordi Salvador, Luca Weihs, Oscar Michel, Eli VanderBilt, Ludwig Schmidt, Kiana Ehsani, Aniruddha Kembhavi, and Ali Farhadi. Objverse: A universe of annotated 3D objects. In CVPR, 2023b.
|
| 185 |
+
Ainaz Eftekhar, Alexander Sax, Roman Bachmann, Jitendra Malik, and Amir Zamir. Omnidata: A scalable pipeline for making multi-task mid-level vision datasets from 3D scans. In ICCV, 2021.
|
| 186 |
+
Quankai Gao, Qiangeng Xu, Zhe Cao, Ben Mildenhall, Wenchao Ma, Le Chen, Danhang Tang, and Ulrich Neumann. GaussianFlow: Splitting gaussian dynamics for 4D content creation. arXiv preprint arXiv:2403.12365, 2024.
|
| 187 |
+
Chen Geng, Yunzhi Zhang, Shangzhe Wu, and Jiajun Wu. Birth and death of a rose. arXiv preprint arXiv:2412.05278, 2024.
|
| 188 |
+
Pengsheng Guo, Hans Hao, Adam Caccavale, Zhongzheng Ren, Edward Zhang, Qi Shan, Aditya Sankar, Alexander G Schwing, Alex Colburn, and Fangchang Ma. StableDreamer: Taming noisy score distillation sampling for text-to-3D. arXiv preprint arXiv:2312.02189, 2023.
|
| 189 |
+
Yuwei Guo, Ceyuan Yang, Anyi Rao, Zhengyang Liang, Yaohui Wang, Yu Qiao, Maneesh Agrawala, Dahua Lin, and Bo Dai. Animatediff: Animate your personalized text-to-image diffusion models without specific tuning. In ICLR, 2024.
|
| 190 |
+
|
| 191 |
+
Junlin Han, Filippos Kokkinos, and Philip Torr. Vfusion3d: Learning scalable 3d generative models from video diffusion models. In ECCV, 2024.
|
| 192 |
+
Yingqing He, Tianyu Yang, Yong Zhang, Ying Shan, and Qifeng Chen. Latent video diffusion models for high-fidelity long video generation. arXiv, 2022.
|
| 193 |
+
Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J. Fleet. Video diffusion models. In NeurIPS, 2022.
|
| 194 |
+
Yicong Hong, Kai Zhang, Jiuxiang Gu, Sai Bi, Yang Zhou, Difan Liu, Feng Liu, Kalyan Sunkavalli, Trung Bui, and Hao Tan. Lrm: Large reconstruction model for single image to 3d. In ICLR, 2024.
|
| 195 |
+
Hanwen Jiang, Zhenyu Jiang, Yue Zhao, and Qixing Huang. Leap: Liberate sparse-view 3d modeling from camera poses. In ICLR, 2024a.
|
| 196 |
+
Yanqin Jiang, Chaohui Yu, Chenjie Cao, Fan Wang, Weiming Hu, and Jin Gao. *Animate3d: Animating any 3d model with multi-view video diffusion.* In *NeurIPS*, 2024b.
|
| 197 |
+
Yanqin Jiang, Li Zhang, Jin Gao, Weiming Hu, and Yao Yao. Consistent4d: Consistent $360^{\circ}$ dynamic object generation from monocular video. In ICLR, 2024c.
|
| 198 |
+
Nick Kanopoulos, Nagesh Vasanthavada, and Robert L Baker. Design of an image edge detection filter using the sobel operator. IEEE Journal of solid-state circuits, 23(2):358-367, 1988.
|
| 199 |
+
Animesh Karnewar, Niloy J Mitra, Andrea Vedaldi, and David Novotny. HoloFusion: Towards photo-realistic 3D generative modeling. In ICCV, 2023.
|
| 200 |
+
Tero Karras, Miika Aittala, Timo Aila, and Samuli Laine. Elucidating the design space of diffusion-based generative models. Advances in neural information processing systems, 2022.
|
| 201 |
+
Bernhard Kerbl, Georgios Kopanas, Thomas Leimkuhler, and George Drettakis. 3D gaussian splatting for real-time radiance field rendering. ACM Transactions on Graphics, 2023.
|
| 202 |
+
Diederik P Kingma and Jimmy Ba. Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980, 2014.
|
| 203 |
+
Jeong-gi Kwak, Erqun Dong, Yuhe Jin, Hanseok Ko, Shweta Mahajan, and Kwang Moo Yi. Vivid-1-to-3: Novel view synthesis with video diffusion models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2024.
|
| 204 |
+
Bing Li, Cheng Zheng, Wenxuan Zhu, Jinjie Mai, Biao Zhang, Peter Wonka, and Bernard Ghanem. Vivid-zoo: Multi-view video generation with diffusion model. NeurIPS, 2024a.
|
| 205 |
+
Jiahao Li, Hao Tan, Kai Zhang, Zexiang Xu, Fujun Luan, Yinghao Xu, Yicong Hong, Kalyan Sunkavalli, Greg Shakhnarovich, and Sai Bi. Instant3d: Fast text-to-3d with sparse-view generation and large reconstruction model. In ICLR, 2024b.
|
| 206 |
+
Weiyu Li, Rui Chen, Xuelin Chen, and Ping Tan. Sweetdreamer: Aligning geometric priors in 2d diffusion for consistent text-to-3d. In ICLR, 2024c.
|
| 207 |
+
Zhen Li, Zuo-Liang Zhu, Ling-Hao Han, Qibin Hou, Chun-Le Guo, and Ming-Ming Cheng. AMT: All-pairs multi-field transforms for efficient frame interpolation. In IEEE Conference on Computer Vision and Pattern Recognition, 2023.
|
| 208 |
+
Hanwen Liang, Yuyang Yin, Dejia Xu, hanxue liang, Zhangyang Wang, Konstantinos N Plataniotis, Yao Zhao, and Yunchao Wei. Diffusion4d: Fast spatial-temporal consistent 4d generation via video diffusion models. In NeurIPS, 2024a.
|
| 209 |
+
Yixun Liang, Xin Yang, Jiantao Lin, Haodong Li, Xiaogang Xu, and Yingcong Chen. Luciddreamer: Towards high-fidelity text-to-3d generation via interval score matching. In CVPR, 2024b.
|
| 210 |
+
Huan Ling, Seung Wook Kim, Antonio Torralba, Sanja Fidler, and Karsten Kreis. Align your.
|
| 211 |
+
gaussians: Text-to-4d with dynamic 3d gaussians and composed diffusion models. In CVPR, 2024.
|
| 212 |
+
|
| 213 |
+
Minghua Liu, Chao Xu, Haian Jin, Linghao Chen, Mukund Varma T, Zexiang Xu, and Hao Su. One-2-3-45: Any single image to 3D mesh in 45 seconds without per-shape optimization. In NeurIPS, 2023a.
|
| 214 |
+
Minghua Liu, Ruoxi Shi, Linghao Chen, Zhuoyang Zhang, Chao Xu, Xinyue Wei, Hansheng Chen, Chong Zeng, Jiayuan Gu, and Hao Su. One-2-3-45++: Fast single image to 3d objects with consistent multi-view generation and 3d diffusion. In CVPR, 2024a.
|
| 215 |
+
Ruoshi Liu, Rundi Wu, Basile Van Hoorick, Pavel Tokmakov, Sergey Zakharov, and Carl Vondrick. Zero-1-to-3: Zero-shot one image to 3D object. In ICCV, 2023b.
|
| 216 |
+
Yuan Liu, Cheng Lin, Zijiao Zeng, Xiaoxiao Long, Lingjie Liu, Taku Komura, and Wenping Wang. Syncdreamer: Generating multiview-consistent images from a single-view image. In ICLR, 2024b.
|
| 217 |
+
Xiaoxiao Long, Yuan-Chen Guo, Cheng Lin, Yuan Liu, Zhiyang Dou, Lingjie Liu, Yuexin Ma, Song-Hai Zhang, Marc Habermann, Christian Theobalt, et al. Wonder3d: Single image to 3d using cross-domain diffusion. In CVPR, 2024.
|
| 218 |
+
Luke Melas-Kyriazi, Iro Laina, Christian Rupprecht, Natalia Neverova, Andrea Vedaldi, Oran Gafni, and Filippos Kokkinos. Im-3d: Iterative multiview diffusion and reconstruction for high-quality 3d generation. ICML, 2024.
|
| 219 |
+
Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. NeRF: Representing scenes as neural radiance fields for view synthesis. Communications of the ACM, 2021.
|
| 220 |
+
Thomas Müller, Alex Evans, Christoph Schied, and Alexander Keller. Instant neural graphics primitives with a multiresolution hash encoding. ACM Trans. Graph., 2022.
|
| 221 |
+
Michael Niemeyer, Jonathan T. Barron, Ben Mildenhall, Mehdi S. M. Sajjadi, Andreas Geiger, and Noha Radwan. RegNeRF: Regularizing neural radiance fields for view synthesis from sparse inputs. In Proc. IEEE Conf. on Computer Vision and Pattern Recognition (CVPR), 2022.
|
| 222 |
+
Zijie Pan, Jiachen Lu, Xiatian Zhu, and Li Zhang. Enhancing high-resolution 3d generation through pixel-wise gradient clipping. In ICLR, 2024a.
|
| 223 |
+
Zijie Pan, Zeyu Yang, Xiatian Zhu, and Li Zhang. Fast dynamic 3D object generation from a single-view video. arXiv preprint arXiv:2401.08742, 2024b.
|
| 224 |
+
Federico Perazzi, Jordi Pont-Tuset, Brian McWilliams, Luc Van Gool, Markus Gross, and Alexander Sorkine-Hornung. A benchmark dataset and evaluation methodology for video object segmentation. In CVPR, 2016.
|
| 225 |
+
Jordi Pont-Tuset, Federico Perazzi, Sergi Caelles, Pablo Arbeláez, Alexander Sorkine-Hornung, and Luc Van Gool. The 2017 davis challenge on video object segmentation. arXiv:1704.00675, 2017.
|
| 226 |
+
Ben Poole, Ajay Jain, Jonathan T Barron, and Ben Mildenhall. Dreamfusion: Text-to-3d using 2d diffusion. In ICLR, 2023.
|
| 227 |
+
Albert Pumarola, Enric Corona, Gerard Pons-Moll, and Francesc Moreno-Noguer. D-NeRF: Neural radiance fields for dynamic scenes. In CVPR, 2021.
|
| 228 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, 2021.
|
| 229 |
+
Ohad Rahamim, Ori Malca, Dvir Samuel, and Gal Chechik. Bringing objects to life: 4d generation from 3d objects. arXiv preprint arXiv:2412.20422, 2024.
|
| 230 |
+
Jiawei Ren, Liang Pan, Jiaxiang Tang, Chi Zhang, Ang Cao, Gang Zeng, and Ziwei Liu. DreamGaussian4D: Generative 4D gaussian splatting. arXiv preprint arXiv:2312.17142, 2023.
|
| 231 |
+
Jiawei Ren, Cheng Xie, Ashkan Mirzaei, Karsten Kreis, Ziwei Liu, Antonio Torralba, Sanja Fidler, Seung Wook Kim, Huan Ling, et al. L4gm: Large 4d gaussian reconstruction model. In NeurIPS, 2024.
|
| 232 |
+
|
| 233 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. High-resolution image synthesis with latent diffusion models. In CVPR, 2022.
|
| 234 |
+
Kyle Sargent, Zizhang Li, Tanmay Shah, Charles Herrmann, Hong-Xing Yu, Yunzhi Zhang, Eric Ryan Chan, Dmitry Lagun, Li Fei-Fei, Deqing Sun, et al. Zeronvs: Zero-shot 360-degree view synthesis from a single image. In CVPR, 2024.
|
| 235 |
+
Ruoxi Shi, Hansheng Chen, Zhuoyang Zhang, Minghua Liu, Chao Xu, Xinyue Wei, Linghao Chen, Chong Zeng, and Hao Su. Zero123++: a single image to consistent multi-view diffusion base model. arXiv preprint arXiv:2310.15110, 2023.
|
| 236 |
+
Yichun Shi, Peng Wang, Jianglong Ye, Long Mai, Kejie Li, and Xiao Yang. Mvdream: Multi-view diffusion for 3d generation. In ICLR, 2024a.
|
| 237 |
+
Yukai Shi, Jianan Wang, CAO He, Boshi Tang, Xianbiao Qi, Tianyu Yang, Yukun Huang, Shilong Liu, Lei Zhang, and Heung-Yeung Shum. Toss: High-quality text-guided novel view synthesis from a single image. In ICLR, 2024b.
|
| 238 |
+
Uriel Singer, Adam Polyak, Thomas Hayes, Xi Yin, Jie An, Songyang Zhang, Qiyuan Hu, Harry Yang, Oron Ashual, Oran Gafni, et al. Make-a-video: Text-to-video generation without text-video data. In ICLR, 2023a.
|
| 239 |
+
Uriel Singer, Shelly Sheynin, Adam Polyak, Oron Ashual, Iurii Makarov, Filippos Kokkinos, Naman Goyal, Andrea Vedaldi, Devi Parikh, Justin Johnson, et al. Text-to-4d dynamic scene generation. In ICML, 2023b.
|
| 240 |
+
Jiaming Song, Chenlin Meng, and Stefano Ermon. Denoising diffusion implicit models. In ICLR, 2021.
|
| 241 |
+
Jingxiang Sun, Bo Zhang, Ruizhi Shao, Lizhen Wang, Wen Liu, Zhenda Xie, and Yebin Liu. Dreamcraft3d: Hierarchical 3d generation with bootstrapped diffusion prior. In ICLR, 2024a.
|
| 242 |
+
Qi Sun, Zhiyang Guo, Ziyu Wan, Jing Nathan Yan, Shengming Yin, Wengang Zhou, Jing Liao, and Houqiang Li. EG4d: Explicit generation of 4d object without score distillation. In ICLR, 2025.
|
| 243 |
+
Wenqiang Sun, Shuo Chen, Fangfu Liu, Zilong Chen, Yueqi Duan, Jun Zhang, and Yikai Wang. Dimensionx: Create any 3d and 4d scenes from a single image with controllable video diffusion. arXiv preprint arXiv:2411.04928, 2024b.
|
| 244 |
+
Jiaxiang Tang, Jiawei Ren, Hang Zhou, Ziwei Liu, and Gang Zeng. Dreamgaussian: Generative gaussian splatting for efficient 3d content creation. In ICLR, 2024.
|
| 245 |
+
Dmitry Tochilkin, David Pankratz, Zexiang Liu, Zixuan Huang, Adam Letts, Yangguang Li, Ding Liang, Christian Laforte, Varun Jampani, and Yan-Pei Cao. TripoSR: Fast 3D object reconstruction from a single image. arXiv preprint arXiv:2403.02151, 2024.
|
| 246 |
+
Thomas Unterthiner, Sjoerd Van Steenkiste, Karol Kurach, Raphael Marinier, Marcin Michalski, and Sylvain Gelly. Towards accurate generative models of video: A new metric & challenges. arXiv preprint arXiv:1812.01717, 2018.
|
| 247 |
+
Vikram Voleti, Alexia Jolicoeur-Martineau, and Christopher Pal. MCVD: Masked conditional video diffusion for prediction, generation, and interpolation. In NeurIPS, 2022.
|
| 248 |
+
Vikram Voleti, Chun-Han Yao, Mark Boss, Adam Letts, David Pankratz, Dmitrii Tochilkin, Christian Laforte, Robin Rombach, and Varun Jampani. SV3D: Novel multi-view synthesis and 3D generation from a single image using latent video diffusion. In ECCV, 2024.
|
| 249 |
+
Chaoyang Wang, Peiye Zhuang, Tuan Duc Ngo, Willi Menapace, Aliaksandr Siarohin, Michael Vasilkovsky, Ivan Skorokhodov, Sergey Tulyakov, Peter Wonka, and Hsin-Ying Lee. 4Real-Video: Learning generalizable photo-realistic 4D video diffusion. arXiv preprint arXiv:2412.04462, 2024a.
|
| 250 |
+
Peng Wang and Yichun Shi. ImageDream: Image-prompt multi-view diffusion for 3D generation. arXiv preprint arXiv:2312.02201, 2023.
|
| 251 |
+
|
| 252 |
+
Peng Wang, Hao Tan, Sai Bi, Yinghao Xu, Fujun Luan, Kalyan Sunkavalli, Wenping Wang, Zexiang Xu, and Kai Zhang. Pf-lrm: Pose-free large reconstruction model for joint pose and shape prediction. In ICLR, 2024b.
|
| 253 |
+
Yikai Wang, Xinzhou Wang, Zilong Chen, Zhengyi Wang, Fuchun Sun, and Jun Zhu. Vidu4d: Single generated video to high-fidelity 4d reconstruction with dynamic gaussian surfels. NeurIPS, 2024c.
|
| 254 |
+
Zhengyi Wang, Cheng Lu, Yikai Wang, Fan Bao, Chongxuan Li, Hang Su, and Jun Zhu. Prolific-Dreamer: High-fidelity and diverse text-to-3D generation with variational score distillation. In NeurIPS, 2024d.
|
| 255 |
+
Xinyue Wei, Kai Zhang, Sai Bi, Hao Tan, Fujun Luan, Valentin Deschaintre, Kalyan Sunkavalli, Hao Su, and Zexiang Xu. MeshLRM: Large reconstruction model for high-quality mesh. arXiv preprint arXiv:2404.12385, 2024.
|
| 256 |
+
Haohan Weng, Tianyu Yang, Jianan Wang, Yu Li, Tong Zhang, CL Chen, and Lei Zhang. Consistent123: Improve consistency for one image to 3D object synthesis. arXiv preprint arXiv:2310.08092, 2023.
|
| 257 |
+
Guanjun Wu, Taoran Yi, Jiemin Fang, Lingxi Xie, Xiaopeng Zhang, Wei Wei, Wenyu Liu, Qi Tian, and Xinggang Wang. 4D gaussian splatting for real-time dynamic scene rendering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, 2024a.
|
| 258 |
+
Rundi Wu, Ruiqi Gao, Ben Poole, Alex Trevithick, Changxi Zheng, Jonathan T Barron, and Aleksander Holynski. CAT4D: Create anything in 4D with multi-view video diffusion models. arXiv preprint arXiv:2411.18613, 2024b.
|
| 259 |
+
Zeyu Yang, Zijie Pan, Chun Gu, and Li Zhang. Diffusion $\S^2$ : Dynamic 3d content generation via score composition of video and multi-view diffusion models. In ICLR, 2025.
|
| 260 |
+
Jianglong Ye, Peng Wang, Kejie Li, Yichun Shi, and Heng Wang. Consistent-1-to-3: Consistent image to 3d view synthesis via geometry-aware diffusion models. In 3DV, 2024.
|
| 261 |
+
Taoran Yi, Jiemin Fang, Junjie Wang, Guanjun Wu, Lingxi Xie, Xiaopeng Zhang, Wenyu Liu, Qi Tian, and Xinggang Wang. Gaussian dreamer: Fast generation from text to 3d gaussians by bridging 2d and 3d diffusion models. In CVPR, 2024.
|
| 262 |
+
Yuyang Yin, Dejia Xu, Zhangyang Wang, Yao Zhao, and Yunchao Wei. 4DGen: Grounded 4D content generation with spatial-temporal consistency. arXiv preprint arXiv:2312.17225, 2023.
|
| 263 |
+
Heng Yu, Chaoyang Wang, Peiye Zhuang, Willi Menapace, Aliaksandr Siarohin, Junli Cao, László Jeni, Sergey Tulyakov, and Hsin-Ying Lee. 4real: Towards photorealistic 4d scene generation via video diffusion models. In NeurIPS, 2024.
|
| 264 |
+
Zehao Yu, Songyou Peng, Michael Niemeyer, Torsten Sattler, and Andreas Geiger. MonoSDF: Exploring monocular geometric cues for neural implicit surface reconstruction. Advances in neural information processing systems, 2022.
|
| 265 |
+
Yifei Zeng, Yanqin Jiang, Siyu Zhu, Yuanxun Lu, Youtian Lin, Hao Zhu, Weiming Hu, Xun Cao, and Yao Yao. Stag4d: Spatial-temporal anchored generative 4d gaussians. In ECCV, 2024.
|
| 266 |
+
Haiyu Zhang, Xinyuan Chen, Yaohui Wang, Xihui Liu, Yunhong Wang, and Yu Qiao. 4diffusion: Multi-view video diffusion model for 4d generation. In NeurIPS, 2024.
|
| 267 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In Proceedings of the IEEE conference on computer vision and pattern recognition, pp. 586-595, 2018a.
|
| 268 |
+
Richard Zhang, Phillip Isola, Alexei A Efros, Eli Shechtman, and Oliver Wang. The unreasonable effectiveness of deep features as a perceptual metric. In CVPR, 2018b.
|
| 269 |
+
Yuyang Zhao, Zhiwen Yan, Enze Xie, Lanqing Hong, Zhenguo Li, and Gim Hee Lee. Animate124: Animating one image to 4D dynamic scene. arXiv preprint arXiv:2311.14603, 2023.
|
| 270 |
+
|
| 271 |
+
Yuyang Zhao, Chung-Ching Lin, Kevin Lin, Zhiwen Yan, Linjie Li, Zhengyuan Yang, Jianfeng Wang, Gim Hee Lee, and Lijuan Wang. GenXD: Generating any 3d and 4d scenes. In ICLR, 2025.
|
| 272 |
+
Linqi Zhou, Andy Shih, Chenlin Meng, and Stefano Ermon. Dreampropeller: Supercharge text-to-3d generation with parallel sampling. In CVPR, 2024.
|
| 273 |
+
Hanxin Zhu, Tianyu He, Xiqian Yu, Junliang Guo, Zhibo Chen, and Jiang Bian. Ar4d: Autoregressive 4d generation from monocular videos. arXiv preprint arXiv:2501.01722, 2025.
|
| 274 |
+
Zi-Xin Zou, Zhipeng Yu, Yuan-Chen Guo, Yangguang Li, Ding Liang, Yan-Pei Cao, and Song-Hai Zhang. Triplane meets gaussian splatting: Fast and generalizable single-view 3d reconstruction with transformers. In CVPR, 2024.
|
| 275 |
+
|
| 276 |
+
# A IMPLEMENTATION DETAILS
|
| 277 |
+
|
| 278 |
+
# A.1 DATA DETAILS
|
| 279 |
+
|
| 280 |
+
Similar to SV3D (Voleti et al., 2024), we render views of a subset of the Objaverse dataset (Deitke et al., 2023b) curated CC-licensed animatable 3D objects from the original dataset. We held out some objects for evaluation purposes.
|
| 281 |
+
|
| 282 |
+
Each loaded object is scaled such the largest world-space XYZ extent of its bounding box is 1. We use Blender's CYCLES renderer to render multiple views and video frames for each object. We limit the number of samples in CYCLES renderer to save the rendering time. For lightning, we follow SV3D to randomly select from a set of curated HDRI envmaps.
|
| 283 |
+
|
| 284 |
+
For static orbits, we regularly sample azimuth angles with a constant value starting from azimuth 0. We randomly sample one elevation angle for all views. For dynamic orbits, the sequence of camera elevations for each orbit is obtained from a random weighted combination of sinusoids with different frequencies (Voleti et al., 2024). The azimuth angles are sampled regularly, and then a small amount of noise is added to make them irregular. The elevation values are smoothed using a simple convolution kernel and then clamped to a maximum elevation.
|
| 285 |
+
|
| 286 |
+
We then encode all of these images into latent space using SD2.1 (Rombach et al., 2022)'s VAE, and CLIP (Radford et al., 2021). We then store the latent and CLIP embeddings for all of these images along with the corresponding elevation and azimuth values, and frame index.
|
| 287 |
+
|
| 288 |
+
# A.2 SV4D TRAINING DETAILS
|
| 289 |
+
|
| 290 |
+
Our approach involves utilizing the widely used EMD (Karras et al., 2022), incorporating a $L2$ loss for fine-tuning, as followed in SVD (Blattmann et al., 2023b) and SV3D (Voleti et al., 2024). We adopt $L2$ loss during the training. To optimize the training efficiency and reduce GPU VRAM, we follow SV3D to preprocess and store the precomputed latent and CLIP embeddings for all images in advance. During training, these tensors are directly loaded rather than being computed in real-time. We found that with 8 views and 5 frames we were able to fit a batch size of 1 at $576 \times 576$ resolution. We randomly sample 8 views and 5 frames from our 21 rendered views and 21 frames for training.
|
| 291 |
+
|
| 292 |
+
# A.3 SV4D INFERENCE DETAILS
|
| 293 |
+
|
| 294 |
+
During inference, we use 50 steps of the deterministic DDIM sampler (Song et al., 2021). We adopt the SV4D sampling to generate the full $\mathrm{V} \times \mathrm{F}$ image matrix during the inference. We take $V = 8$ and $F = 21$ as an example. Our SV4D can generate 8 views $\times 5$ frames in an inference. In the interleaved sampling, we first generate a sparse set of anchor frames with the frame indexes [4, 8, 12, 16, 20]. Then in the dense sampling, we use the anchor frames as new reference images to densely sample the remaining frames. For example, in the first run, we generate frames with the indexes [0, 1, 2, 3, 4] with frame 0 (forward) or frame 4 (backward) as conditioning. It takes about 40 seconds to generate 5 frames and 8 views for the SV4D model.
|
| 295 |
+
|
| 296 |
+
# A.4 SV4D NETWORK ARCHITECTURE
|
| 297 |
+
|
| 298 |
+
SV4D network consists of three attention layers: spatial attention, view attention, and frame attention. We reshape the feature $\mathbf{F}$ before feeding it to each attention layer $\gamma (\cdot)(\cdot)$ .
|
| 299 |
+
|
| 300 |
+
The spatial attention models spatial coherence across image spatial locations by calculating the attention of points at the same image:
|
| 301 |
+
|
| 302 |
+
$$
|
| 303 |
+
\mathbf {F} = \operatorname {r e a r r a n g e} (\mathbf {F}, B V F H W D \rightarrow (B V F) (H W) D) \tag {1}
|
| 304 |
+
$$
|
| 305 |
+
|
| 306 |
+
$$
|
| 307 |
+
\mathbf {F} = \gamma_ {s} (\mathbf {F}) \tag {2}
|
| 308 |
+
$$
|
| 309 |
+
|
| 310 |
+
$$
|
| 311 |
+
\mathbf {F} = \operatorname {r e a r r a n g e} (\mathbf {F}, (B V F) (H W) D \rightarrow B V F H W D) \tag {3}
|
| 312 |
+
$$
|
| 313 |
+
|
| 314 |
+

|
| 315 |
+
Figure 9: Independent sampling. The submatrix sampled at each inference consists of consecutive frames and each submatrix is sampled separately, without relying on previous fully sampled images.
|
| 316 |
+
|
| 317 |
+

|
| 318 |
+
Figure 10: Interleaved Sampling. The submatrix sampled at each inference consists of interleaved frames and each submatrix is sampled separately, without relying on previous fully sampled images.
|
| 319 |
+
|
| 320 |
+
The view attention models coherence across views by calculating the attention of points at the same spatial location and the same frame across views:
|
| 321 |
+
|
| 322 |
+
$$
|
| 323 |
+
\mathbf {F} = \operatorname {r e a r r a n g e} (\mathbf {F}, B V F H W D \rightarrow (B F H W) V D) \tag {4}
|
| 324 |
+
$$
|
| 325 |
+
|
| 326 |
+
$$
|
| 327 |
+
\mathbf {F} = \gamma_ {v} (\mathbf {F}) \tag {5}
|
| 328 |
+
$$
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\mathbf {F} = \operatorname {r e a r r a n g e} (\mathbf {F}, (B F H W) V D \rightarrow B V F H W D) \tag {6}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
The frame attention models coherence across frames by calculating the attention of points at the same spatial location and the same view across frames:
|
| 335 |
+
|
| 336 |
+
$$
|
| 337 |
+
\mathbf {F} = \operatorname {r e a r r a n g e} (\mathbf {F}, B V F H W D \rightarrow (B V H W) F D) \tag {7}
|
| 338 |
+
$$
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
\mathbf {F} = \gamma_ {f} (\mathbf {F}) \tag {8}
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
$$
|
| 345 |
+
\mathbf {F} = \operatorname {r e a r r a n g e} (\mathbf {F}, (B V H W) F D \rightarrow B V F H W D) \tag {9}
|
| 346 |
+
$$
|
| 347 |
+
|
| 348 |
+
$B$ is batch size, $V$ is number of views, $F$ is number of frames. $H$ , $W$ , and $D$ are width, height, and feature dimension of the image feature. In our experiments, both $V$ and $F$ are 8 and 5, respectively.
|
| 349 |
+
|
| 350 |
+
Note that our frame attention layers are skip-connected to the outputs of view attention with a learnable blending weight per layer, allowing it to effectively merge the spatial and temporal information in the final output. Although an optimal way is to perform spatial-temporal attention jointly without considering memory limitation, we find that our sequential design can best leverage the priors in SVD and SV3D with minimal computation overhead.
|
| 351 |
+
|
| 352 |
+
# A.5 DYNAMIC NERF OPTIMIZATION DETAILS
|
| 353 |
+
|
| 354 |
+
Our main 4D reconstruction losses are the pixel-level mean squared error $\mathcal{L}_{\mathrm{mse}} = \| M - \hat{M}\|^2$ , LPIPS (Zhang et al., 2018a) loss $\mathcal{L}_{\mathrm{lpips}}$ , and mask loss $\mathcal{L}_{\mathrm{mask}} = \| S - \hat{S}\|^2$ , where $S$ , $\hat{S}$ are the predicted and ground-truth masks. We further employ a normal loss using the estimated mono normal by Omnidata (Eftekhar et al., 2021), which is defined as the cosine similarity between the rendered normal $n$ and estimated pseudo ground truths $\bar{n}$ : $\mathcal{L}_{\mathrm{normal}} = 1 - (n \cdot \bar{n})$ . To regularize the output geometry, we apply a smooth depth loss inspired by RegNeRF (Niemeyer et al., 2022): $\mathcal{L}_{\mathrm{depth}}(i,j) = (d(i,j) - d(i,j + 1))^2 + (d(i,j) - (d(i + 1,j))^2)$ , where $i, j$ indicate the pixel coordinate. For surface normal we instead rely on a bilateral smoothness loss similar to Boss et al. (2022). We found that this is crucial to getting high-frequency details and avoiding over-smoothed surfaces. For this loss we compute the image gradients of the input image $\nabla I$ with a Sobel filter (Kanopoulos et al., 1988). We then encourage the gradients of rendered normal $\nabla n$ to be smooth if (and only if) the
|
| 355 |
+
|
| 356 |
+

|
| 357 |
+
Figure 11: Visual Comparison of Novel View Video Synthesis Results. We show two frames in the input videos and one novel-view result of the corresponding frames. Compared to the baseline methods, SV4D outputs contain geometry and texture details that are more faithful to the input video and consistent across frames.
|
| 358 |
+
|
| 359 |
+
input image gradients $\nabla I$ are smooth. The loss can be written as $\mathcal{L}_{\mathrm{bilateral}} = e^{-3\nabla I}\sqrt{1 + ||\nabla\boldsymbol{n}||}$ . The overall objective is then defined as the weighted sum of these losses. All losses are applied in both static and dynamic stages. We use an Adam optimizer (Kingma & Ba, 2014) with a learning rate of 0.01 for both stages.
|
| 360 |
+
|
| 361 |
+
# A.6 DIFFERENT SAMPLING STRATEGIES
|
| 362 |
+
|
| 363 |
+
Due to memory limitations, we cannot generate all the novel view frames at once. To generate the full image matrix, one can run the submatrix generation in different strategies. To validate the effectiveness of our SV4D sampling, we compare ours with two other sampling strategies: independent sampling and interleaved sampling, which are shown in Fig. 9 and Fig. 10, respectively. For illustrative purposes only, the SV4D model can generate 2 frames and 2 views at each inference. In the independent sampling, the submatrix sampled at each inference consists of consecutive frames and each submatrix images are sampled separately, without relying on previous fully sampled images. In the interleaved sampling, the submatrix sampled at each inference consists of interleaved frames.
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Figure 12: Visual Comparison of Generated 4D Outputs. We show two frames in the input videos and render one view result of the corresponding frames. By leveraging the consistent multi-view videos generated by SV4D, we can learn higher-quality 4D assets compared to the prior works with SDS-based losses. Our results are more detailed, consistent, and faithful to the input videos.
|
| 367 |
+
|
| 368 |
+
Table 7: Additional Ablations. SV4D w/o frame attend.: SV4D without frame attention. SV4D w/o MV: SV4D without reference multi-views. SV4D with CLIP MV: SV4D with CLIP embeddings (instead of VAE latents) of the first frame for frame attention conditioning and without reference multi-views.
|
| 369 |
+
|
| 370 |
+
<table><tr><td>Model</td><td>LPIPS↓</td><td>CLIP-S↑</td><td>FVD-F↓</td><td>FVD-V↓</td><td>FVD-Diag↓</td><td>FV4D↓</td></tr><tr><td>SV4D w/o frame attain.</td><td>0.131</td><td>0.920</td><td>729.67</td><td>375.49</td><td>526.78</td><td>690.49</td></tr><tr><td>SV4D w/o MV</td><td>0.135</td><td>0.870</td><td>876.07</td><td>410.90</td><td>608.93</td><td>710.66</td></tr><tr><td>SV4D with CLIP MV</td><td>0.142</td><td>0.868</td><td>1174.47</td><td>530.74</td><td>819.22</td><td>1327.75</td></tr><tr><td>SV4D</td><td>0.136</td><td>0.920</td><td>585.09</td><td>331.94</td><td>503.02</td><td>470.46</td></tr></table>
|
| 371 |
+
|
| 372 |
+
# B ADDITIONAL RESULTS
|
| 373 |
+
|
| 374 |
+
# B.1 MORE VISUAL COMPARISONS
|
| 375 |
+
|
| 376 |
+
We show more visual comparisons of novel view synthesis and 4D generation, as shown in Fig. 11 and Fig. 12. These results further demonstrate that SV4D-generated images and 4D results are more consistent and detailed, faithful to the conditioning videos compared to the prior works.
|
| 377 |
+
|
| 378 |
+
# B.2 MORE ABLATIVE RESULTS
|
| 379 |
+
|
| 380 |
+
We show an additional ablation study on the SV4D network architecture to justify our model design in Table 7. In particular, we report the quantitative comparison of ablated models: SV4D without frame attention, SV4D without multi-view conditioning, and SV4D with CLIP embeddings (instead of VAE latents) of the first frame for frame attention conditioning while removing the reference multi-views. The results justify that using VAE latents of reference multi-views as frame attention conditioning achieves better performance in most metrics compared to other design choices.
|
| 381 |
+
|
| 382 |
+

|
| 383 |
+
Figure 13: FVD-F vs. View Number on the ObjaverseDy dataset. We observe that SV4D produces better temporal consistency in almost all views.
|
| 384 |
+
|
| 385 |
+
# B.3 QUALITY PER VIEW
|
| 386 |
+
|
| 387 |
+
We plot the FVD-F value for each view on the ObjaverseDy dataset, as shown in Fig. 13. We observe that SV4D produces better temporal consistency in almost all views.
|
| 388 |
+
|
| 389 |
+
# C BASELINE DETAILS
|
| 390 |
+
|
| 391 |
+
For novel view video synthesis (Table 1, 3, and 5), we compare SV4D with SV3D (Voleti et al., 2024), Diffusion $^{2}$ (Yang et al., 2025), STAG4D (Yang et al., 2025), 4Diffusion (Zhang et al., 2024). The results of SV3D, Diffusion $^{2}$ , and 4Diffusion are generated with their official code. STAG4D used Zero123++ (Shi et al., 2023) as the multi-view generator, which fixed the view angle, and hence the novel views generated from STAG4D cannot be changed to be consistent with the views evaluated. We reproduced STAG4D with SV3D as the multi-view generator. SV3D has been shown to generate more consistent 3D results than Zero123++, so this serves as a stronger baseline.
|
| 392 |
+
|
| 393 |
+
For 4D generation, we compare SV4D with Consistent4D (Jiang et al., 2024c), STAG4D (Zeng et al., 2024), 4Diffusion (Zhang et al., 2024), DreamGaussian4D (DG4D) (Ren et al., 2023), GaussianFlow (Gao et al., 2024), 4DGen (Yin et al., 2023), Efficient4D (Pan et al., 2024b). On the Consistent4D dataset (Table 2), the results of Consistent4D, STAG4D, Efficient4D, and Gaussian-Flow are from the original paper. 4DGen results are from Efficient4D paper, and DG4D results are from GaussianFlow paper. The results of 4Diffusion are generated with its official code. On the ObjaverseDy dataset (Table 4), all results of our baselines are generated from their official code.
|
| 394 |
+
|
| 395 |
+
# D SUPPLEMENTARYVIDEO
|
| 396 |
+
|
| 397 |
+
Beyond the paper, our supplementary materials offer a comprehensive video that provides an in-depth introduction to our task and method. Additionally, we add more visual comparisons which further showcase the effectiveness of our approach.
|
2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d242edd70ce89d6a50be232ce46fb4df5a72c8866617381ed05cd4521e28726c
|
| 3 |
+
size 991570
|
2025/SV4D_ Dynamic 3D Content Generation with Multi-Frame and Multi-View Consistency/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/c9afa243-4d80-4076-977a-ab9a232d62c3_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/c9afa243-4d80-4076-977a-ab9a232d62c3_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/c9afa243-4d80-4076-977a-ab9a232d62c3_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b6bb2ad8cb1d0e6d32f4e8a103e344e5128bdf0ed897dc75b080782b27893eff
|
| 3 |
+
size 1391864
|
2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/full.md
ADDED
|
@@ -0,0 +1,481 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SVD-LLM: TRUNCATION-AWARE SINGULAR VALUE DECOMPOSITION FOR LARGE LANGUAGE MODEL COMPRESSION
|
| 2 |
+
|
| 3 |
+
Xin Wang<sup>1</sup> Yu Zheng<sup>2</sup> Zhongwei Wan<sup>1</sup> Mi Zhang<sup>1</sup>
|
| 4 |
+
|
| 5 |
+
<sup>1</sup>The Ohio State University <sup>2</sup>Michigan State University
|
| 6 |
+
|
| 7 |
+
https://github.com/AIoT-MLSys-Lab/SVD-LLM
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
The advancements in Large Language Models (LLMs) have been hindered by their substantial sizes, which necessitates LLM compression methods for practical deployment. Singular Value Decomposition (SVD) offers a promising solution for LLM compression. However, state-of-the-art SVD-based LLM compression methods have two key limitations: truncating smaller singular values may lead to higher compression loss, and the lack of update on the compressed weights after SVD truncation. In this work, we propose SVD-LLM, a SVD-based post-training LLM compression method that addresses the limitations of existing methods. SVD-LLM incorporates a truncation-aware data whitening technique to ensure a direct mapping between singular values and compression loss. Moreover, SVD-LLM adopts a parameter update with sequential low-rank approximation to compensate for the accuracy degradation after SVD compression. We evaluate SVD-LLM on 10 datasets and seven models from three different LLM families at three different scales. Our results demonstrate the superiority of SVD-LLM over state-of-the-arts, especially at high model compression ratios.
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
Large Language Models (LLMs) have demonstrated remarkable capabilities in a wide range of tasks such as natural language understanding and generation (Zhao et al., 2023; Gozalo-Brizuela and Garrido-Merchan, 2023). Despite such capabilities, the democratization of LLMs is primarily restricted by their substantial resource demands, which motivates the design of LLM compression methods (Wan et al., 2024a; Wang et al., 2024; Zhu et al., 2024; Zhou et al., 2024). These methods are often performed in a post-training manner without requiring retraining from scratch. Post-training LLM compression methods based on quantization (Yuan et al., 2024; Huang et al., 2024), unstructured pruning (Frantar and Alistarh, 2023), and structured pruning (Ma et al., 2023; Ashkboos et al., 2024; Zhong et al., 2024) have been intensively studied. Despite their success, these methods have certain limitations, such as dependence on specific hardware and low inference speedup. In contrast, compression methods based on low-rank approximation, such as Singular Value Decomposition (SVD) are not limited by those constraints. Moreover, the KV cache of LLMs compressed via SVD at runtime can also be reduced.
|
| 16 |
+
|
| 17 |
+
Despite these advantages, the potential of SVD for LLM compression has not been fully explored. Several SVD-based LLM compression methods, such as FWSVD (Hsu et al., 2022) and ASVD (Yuan et al., 2023) have been proposed. However, these methods exhibit severe performance degradation when model compression ratio increases. Such limitation can be attributed to two fundamental issues involved in their approaches. Misalignment between SVD truncation and compression loss: both FWSVD and ASVD fail to establish a direct relationship between singular values and model compression loss. As a consequence, truncating smaller singular values in SVD could lead to higher compression loss. Lack of model parameter update after SVD truncation: as model compression ratio increases, the number of singular values that need to be truncated in SVD increases as well. To compensate for the accuracy degradation caused by truncating a larger number of
|
| 18 |
+
|
| 19 |
+
singular values, it becomes necessary to update the remaining parameters of the compressed model. Unfortunately, existing SVD-based LLM compression methods do not incorporate such update in their design, and thus fail to compensate for the accuracy degradation especially under high model compression ratios.
|
| 20 |
+
|
| 21 |
+
In this paper, we propose a SVD-based post-training LLM compression method, SVD-LLM, which effectively addresses the two fundamental issues of existing SVD-based LLM compression methods. SVD-LLM differs from them in two key aspects. ① Truncation-Aware Data Whitening: supported by theoretical proof, SVD-LLM incorporates a truncation-aware data whitening technique that ensures a direct mapping between singular values and model compression loss. In doing so, the proposed truncation-aware data whitening technique is able to identify which singular values should be truncated to incur minimal model compression loss. ② Parameter Update with Sequential Low-rank Approximation: to compensate for accuracy degradation after compression, SVD-LLM sequentially fine-tunes the decomposed low-ranking matrices for a global accuracy recovery.
|
| 22 |
+
|
| 23 |
+
We compare SVD-LLM with both state-of-the-art SVD-based LLM compression methods as well as pruning and quantization-based LLM compression methods. To demonstrate the generability of SVD-LLM, we conduct our evaluation on a total of 10 datasets and seven models from three different LLM families (LLaMA, OPT, and Mistral) at three different scales (7B, 13B, 30B), and evaluate the performance of SVD-LLM on both GPU and CPU. We highlight three of our findings:
|
| 24 |
+
|
| 25 |
+
- SVD-LLM outperforms state-of-the-art SVD-based LLM compression methods FWSVD and ASVD across all 10 datasets, three LLM families at three scales by a large margin.
|
| 26 |
+
- SVD-LLM also outperforms state-of-the-art structured pruning-based LLM compression methods, including LLM-Pruner, SliceGPT, BlockPruner as well as state-of-the-art 1-bit post-training quantization-based LLM compression methods, including PB-LLM and BiLLM. More importantly, when combined with 2-bit post-training quantization, SVD-LLM outperforms state-of-the-art 1-bit training-required quantization-based LLM compression method OneBit, presenting a new way to achieve state-of-the-art compression performance without incurring expensive retraining.
|
| 27 |
+
- LLMs compressed by SVD-LLM are able to achieve inference speedup and memory reduction when deployed on real hardware, including both GPU and CPU. At the same time, SVD-LLM is able to reduce runtime KV cache memory without additional accuracy drop.
|
| 28 |
+
|
| 29 |
+
# 2 RELATED WORK
|
| 30 |
+
|
| 31 |
+
Large Language Model Compression: LLMs in general contain billion-scale parameters. Applying conventional model compression methods for LLMs is unfeasible as they necessitate resource-intensive retraining. Given that, post-training methods that avoid retraining in the compression process have been proposed. In general, these methods can be grouped into four categories: unstructured pruning, structured pruning, quantization, and low-rank approximation. Specifically, unstructured pruning methods (Frantar and Alistarh, 2023) set the individual weights of an LLM to zero without changing its shape. However, irregular sparsification of unstructured pruning is difficult to achieve the desired speedup or memory saving. Unlike unstructured pruning, structured pruning methods (Ma et al., 2023; Ashkboos et al., 2024; Zhong et al., 2024) remove entire channels or other structured components from LLMs, making them easier to implement on hardware. One notable contribution is LLM-Pruner (Ma et al., 2023), which groups weight matrices based on their dependency and assigns the pruning ratio to each group based on the estimated importance. Quantization methods (Lin et al., 2024) compress models by reducing the precision of weight matrices of the LLM. However, similar to unstructured pruning, quantization is also difficult to achieve the desired inference speedup due to the lack of hardware support and efficient kernels for low-precision computation (Lin et al., 2024). Recent studies including PB-LLM (Yuan et al., 2024) and BiLLM (Huang et al., 2024) push the frontier to 1-bit quantization. Nevertheless, these approaches often lead to severe accuracy degradation.
|
| 32 |
+
|
| 33 |
+
SVD for Language Model Compression: Singular Value Decomposition (SVD) is a widely used low-rank approximation technique to reduce matrix size by approximating a matrix with two smaller low-ranking matrices (Golub et al., 1987). Given that, SVD is commonly used for model compression. For instance, DRONE (Chen et al., 2021) achieves optimal SVD compression for small language models such as BERT. However, during SVD compression, DRONE caches all the input activations, making it challenging for LLM compression due to excessive memory usage. For LLMs, directly
|
| 34 |
+
|
| 35 |
+

|
| 36 |
+
Figure 1: Overview of SVD-LLM.
|
| 37 |
+
|
| 38 |
+
applying SVD on the weight matrix without considering the importance of the weights leads to a large compression loss. To address this issue, Hsu et al. (2022) propose FWSVD, which introduces Fisher information to weigh the importance of parameters. However, FWSVD requires a complex gradient calculation that demands substantial computing and memory resources for LLM compression. Another issue of directly applying SVD is that the distribution of activation can affect the compression loss. To address it, Yuan et al. (2023) propose ASVD, which scales the weight matrix by a diagonal matrix that normalizes the impact of input channels on the weights. However, both FWSVD and ASVD do not establish a direct relationship between singular values and compression loss. As a consequence, truncating the smaller singular values may lead to higher compression loss. Moreover, as compression ratio increases, it becomes necessary to update the compressed weights for accuracy recovery. However, both FWSVD and ASVD do not take it into consideration, and thus incur severe accuracy degradation under high compression ratios.
|
| 39 |
+
|
| 40 |
+
# 3 SVD-LLM
|
| 41 |
+
|
| 42 |
+
Figure 1 provides an overview of SVD-LLM. At a high level, SVD-LLM is a SVD-based post-training LLM compression method. Specifically, following the standard procedure of post-training LLM compression methods (Frantar and Alistarh, 2023; Yuan et al., 2023; Xiao et al., 2023), SVD-LLM uses a random set of sentences as calibration data to generate activation for truncation-aware data whitening. Given the generated activation, SVD-LLM derives the whitening matrix $S$ through Cholesky decomposition, and then performs SVD to truncate the multiplication of weight matrices $W$ and whitening matrix $S$ to compress the LLM. After truncation, SVD-LLM updates the remaining model parameters with sequential low-rank approximation to recover accuracy. In the following, we describe both truncation-aware data whitening and parameter update with sequential low-rank approximation in detail. The pseudocode of SVD-LLM is provided in Appendix A.1.
|
| 43 |
+
|
| 44 |
+
# 3.1 TRUNCATION-AWARE DATA WHITENING
|
| 45 |
+
|
| 46 |
+
Motivation: Due to high variance of input activation, simply applying vanilla SVD for LLM compression leads to severe accuracy degradation (Yuan et al., 2023). To address this issue, existing methods (Yuan et al., 2023; Hsu et al., 2022) formulate LLM compression as an optimization problem with the following objective:
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
O = \min \left(\left\| W X - W ^ {\prime} X \right\| _ {F}\right) \tag {1}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $W$ is the weight matrix of the original LLM, $X$ is the activation of $W$ , $W'$ is the compressed weight matrix, and $||WX - W'X||_F$ is the compression loss in the form of Frobenius loss.
|
| 53 |
+
|
| 54 |
+
Although existing methods attempt to reduce this compression loss during their SVD truncation, they all fail to establish a direct relationship between singular values and compression loss. As a consequence, truncating smaller singular values in SVD could lead to significant compression loss. Taking ASVD (Yuan et al., 2023) as an example, ASVD extracts a diagonal matrix $S_0$ from $X$ where each element in the diagonal is the absolute mean value of each channel. It then uses $S_0$ to normalize $X$ and converts $WX$ into $(WS_0)(S_0^{-1}X)$ . Subsequently, SVD is performed on $WS_0$ to obtain the decomposed matrices $U_0$ , $\Sigma_0$ , and $V_0$ . Lastly, ASVD truncates the smallest singular values in $\Sigma_0$ to obtain the compressed weight matrix $W_0' = U_0 \times Trunc(\Sigma_0) \times V_0 \times S_0^{-1}$ .
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
(a) Data Normalization (ASVD)
|
| 58 |
+
|
| 59 |
+

|
| 60 |
+
(b) Truncation-Aware Data Whitening (SVD-LLM)
|
| 61 |
+
Figure 2: Compression loss $(L = ||WX - W'X||_{F})$ of different data preprocessing methods.
|
| 62 |
+
|
| 63 |
+
Although normalizing the activation improves performance, ASVD does not establish a direct relationship between singular values and compression loss (a detailed proof is included in Appendix A.2). To better illustrate this point, we show two concrete examples in Figure 2(a). In example $\mathbf{0}$ where only one singular value is truncated, truncating the smallest singular value 0.1 results in a higher compression loss ( $\text{loss} = 1.1$ ) compared to truncating the second smallest singular value 0.9 ( $\text{loss} = 0.7$ ). In example $\mathbf{0}$ where multiple singular values are truncated, truncating the smallest two singular values 0.9 and 0.1 also leads to a higher loss ( $\text{loss} = 1.9$ ) than truncating 2.4 and 0.1 ( $\text{loss} = 1.7$ ). As such, truncating the smallest singular values does not lead to minimal loss.
|
| 64 |
+
|
| 65 |
+
Key Design: The key idea of SVD-LLM is to incorporate a truncation-aware data whitening technique that ensures a direct mapping between singular values and compression loss. To achieve this, SVD-LLM enforces the whitened activation $S^{-1}X$ to be orthonormal such that each channel is independent of each other, i.e., $(S^{-1}X)(S^{-1}X)^T = S^{-1}XX^T(S^{-1})^T = I$ , where $S$ is derived through Cholesky decomposition (Meyer, 2000). SVD is then performed on $WS$ to obtain the decomposed matrices $U, \Sigma, V$ , where $U = [u_1, u_2, u_3, \dots, u_r]$ , $\Sigma = \mathrm{diag}(\sigma_1, \sigma_2, \sigma_3, \dots, \sigma_r)$ , and $V = [v_1, v_2, v_3, \dots, v_r]$ . Lastly, the smallest singular values in $\Sigma$ are truncated (denoted by Trunc. $(\Sigma)$ ) to obtain two low-ranking matrices $W_u' = U \times [\mathbf{Trunc}.(\Sigma)]^{\frac{1}{2}}$ , $W_v' = [\mathbf{Trunc}.(\Sigma)]^{\frac{1}{2}} \times V^T \times S^{-1}$ and the compressed weight matrix $W' = W_u' \times W_v' = U \times \mathbf{Trunc}.(\Sigma) \times V^T \times S^{-1}$ .
|
| 66 |
+
|
| 67 |
+
Figure 2(b) illustrates the effect of the proposed truncation-aware data whitening method. In example $\mathbf{1}$ where only one singular value is truncated, the compression loss equals to the truncated singular value. In example $\mathbf{2}$ , the compression loss of truncating multiple singular values equals to the square root of the sum of their squares. As such, under the proposed truncation-aware data whitening technique, truncating the smallest singular values leads to minimal compression loss.
|
| 68 |
+
|
| 69 |
+
In the following, we provide a theoretical proof on why the proposed truncation-aware data whitening technique ensures a direct mapping between singular values and compression loss in the case of one singular value (Theorem 3.2) and multiple singular values (Corollary 3.3), respectively.
|
| 70 |
+
|
| 71 |
+
Lemma 3.1. The Frobenius norm of matrix $A$ with dimension $m \times n$ can be deduced into the square root of the trace of its gram matrix, which is:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\left\| A \right\| _ {F} \triangleq \left(\sum_ {j = 1} ^ {n} \sum_ {i = 1} ^ {m} \left| a _ {i j} \right| ^ {2}\right) ^ {\frac {1}{2}} = \left[ \mathbf {T r a c e} \left(A ^ {T} A\right) \right] ^ {\frac {1}{2}} \tag {2}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
Let $\mathbf{SVD}(WS)$ denote SVD compression on matrix $WS$ . The compressed weight matrix $W^{\prime}$ can be expressed as $W^{\prime} = \mathbf{SVD}(WS)S^{-1}$ . Using Lemma 3.1, we obtain the compression loss $L_{i}$ when truncating the $i^{th}$ singular value of $WS$ to reduce its rank for compression:
|
| 78 |
+
|
| 79 |
+
$$
|
| 80 |
+
\begin{array}{l} L _ {i} = \left\| W X - W ^ {\prime} X \right\| _ {F} = \left\| W S S ^ {- 1} X - \mathbf {S V D} (W S) S ^ {- 1} X \right\| _ {F} = \left\| (W S - \mathbf {S V D} (W S)) S ^ {- 1} X \right\| _ {F} \\ = \left\| \sigma_ {i} u _ {i} v _ {i} ^ {T} S ^ {- 1} X \right\| _ {F} = \sigma_ {i} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} S ^ {- 1} X X ^ {T} \left(S ^ {- 1}\right) ^ {T} v _ {i} u _ {i} ^ {T}\right) ^ {\frac {1}{2}} \tag {3} \\ \end{array}
|
| 81 |
+
$$
|
| 82 |
+
|
| 83 |
+
Since both $U = [u_{1}, u_{2}, u_{3}, \dots, u_{r}]$ and $V = [v_{1}, v_{2}, v_{3}, \dots, v_{r}]$ are orthonormal matrices, we have:
|
| 84 |
+
|
| 85 |
+
$$
|
| 86 |
+
v _ {i} ^ {T} v _ {i} = u _ {i} ^ {T} u _ {i} = 1; v _ {i} ^ {T} v _ {j} = u _ {i} ^ {T} u _ {j} = 0, \forall i \neq j; \mathbf {T r a c e} \left(v _ {i} v _ {i} ^ {T}\right) = \mathbf {T r a c e} \left(u _ {i} u _ {i} ^ {T}\right) = 1 \tag {4}
|
| 87 |
+
$$
|
| 88 |
+
|
| 89 |
+
Theorem 3.2. If $S$ is the Cholesky decomposition of $XX^T$ , the compression loss $L_{i}$ equals to $\sigma_{i}$ .
|
| 90 |
+
|
| 91 |
+
Proof. Since the whitening matrix $S$ is the Cholesky decomposition of $XX^T$ , we have $SS^T = XX^T$ . We can further infer Equation (3) to obtain:
|
| 92 |
+
|
| 93 |
+
$$
|
| 94 |
+
L _ {i} = \sigma_ {i} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} v _ {i} u _ {i} ^ {T}\right) ^ {\frac {1}{2}} = \sigma_ {i} \mathbf {T r a c e} \left(u _ {i} \left(v _ {i} ^ {T} v _ {i}\right) u _ {i} ^ {T}\right) ^ {\frac {1}{2}} = \sigma_ {i} \mathbf {T r a c e} \left(u _ {i} u _ {i} ^ {T}\right) ^ {\frac {1}{2}} = \sigma_ {i} \tag {5}
|
| 95 |
+
$$
|
| 96 |
+
|
| 97 |
+
Therefore, $L_{i}$ of truncating $\sigma_{i}$ equals to the singular value $\sigma_{i}$ itself.
|
| 98 |
+
|
| 99 |
+
Corollary 3.3. If $S$ is the Cholesky decomposition of $XX^T$ , truncating the smallest singular values leads to the lowest loss $L$ compared to truncating others.
|
| 100 |
+
|
| 101 |
+
Proof. If we truncate $\sigma_{m + 1},\sigma_{m + 2},\sigma_{m + 3},\ldots ,\sigma_r$ in $\Sigma$ for compression, the square of the loss $L$ is:
|
| 102 |
+
|
| 103 |
+
$$
|
| 104 |
+
\begin{array}{l} L ^ {2} = \left| \left| \sum_ {i = m + 1} ^ {r} \sigma_ {i} u _ {i} v _ {i} ^ {T} S ^ {- 1} X \right| \right| _ {F} ^ {2} = \sum_ {j = m + 1} ^ {r} \sum_ {i = m + 1} ^ {r} \sigma_ {i} \sigma_ {j} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} S ^ {- 1} X X ^ {T} \left(S ^ {- 1}\right) ^ {T} v _ {j} u _ {j} ^ {T}\right) \tag {6} \\ = \sum_ {i = m + 1} ^ {r} \sigma_ {i} ^ {2} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} S ^ {- 1} X X ^ {T} \left(S ^ {- 1}\right) ^ {T} v _ {i} u _ {i} ^ {T}\right) = \sum_ {i = m + 1} ^ {r} \left(L _ {i}\right) ^ {2} = \sum_ {i = m + 1} ^ {r} \left(\sigma_ {i}\right) ^ {2} \\ \end{array}
|
| 105 |
+
$$
|
| 106 |
+
|
| 107 |
+
The squared loss $L^2$ equals to the sum of the squared singular values (More detailed derivation is in Appendix A.3). Truncating the smallest singular values achieves the lowest compression loss.
|
| 108 |
+
|
| 109 |
+
Given that our proposed truncation-aware data whitening technique is built upon SVD, whose applicability depends on certain singular value distribution, we further conduct a spectrum analysis of the singular values obtained by our technique. We refer the readers to Appendix A.4 for details.
|
| 110 |
+
|
| 111 |
+
It should also be noted that our proposed truncation-aware data whitening technique not only ensures a direct mapping between singular values and compression loss, but is also able to achieve the same theoretical optimal compression loss as DRONE (Chen et al., 2021). However, during SVD compression, DRONE stores all input activations in memory, which poses a challenge for LLM compression due to high memory consumption. In contrast, SVD-LLM incrementally updates its $XX^T$ matrix by adding the $xx^T$ of each new input $x$ , which is considerably smaller than the full input activation. In Appendix A.5, we provide our proof on SVD-LLM achieving the same theoretical optimal compression loss as DRONE and discuss the advantages of SVD-LLM over DRONE in memory saving, compression speed, and numerical stability in details.
|
| 112 |
+
|
| 113 |
+
# 3.2 PARAMETER UPDATE WITH SEQUENTIAL LOW-RANK APPROXIMATION
|
| 114 |
+
|
| 115 |
+
Motivation: Although the proposed truncation-aware data whitening technique helps preserve the accuracy during compression, as the compression ratio increases, the accuracy of the compressed LLM may degrade given that more larger singular values will be truncated by SVD compression. Therefore, it is necessary to update the remaining parameters in the compressed LLM.
|
| 116 |
+
|
| 117 |
+
Key Design: SVD-LLM proposes a variant of LoRA fine-tuning to update the remaining weight parameters of the compressed LLM for accuracy recovery. Specifically, given the two low-ranking matrices $W_{u}^{\prime}, W_{v}^{\prime}$ generated by truncation-aware data whitening, instead of directly applying LoRA fine-tuning to the compressed weight matrix $W^{\prime} = W_{u}^{\prime} \times W_{v}^{\prime}$ as standard LoRA does, we propose to apply LoRA on top of $W_{u}^{\prime}$ and $W_{v}^{\prime}$ separately to preserve their low-rank structures as follows:
|
| 118 |
+
|
| 119 |
+
$$
|
| 120 |
+
W _ {u} ^ {\prime} \leftarrow W _ {u} ^ {\prime} + B _ {u} A _ {u}, W _ {v} ^ {\prime} \leftarrow W _ {v} ^ {\prime} + B _ {v} A _ {v} \tag {7}
|
| 121 |
+
$$
|
| 122 |
+
|
| 123 |
+
where $A_{u},B_{u},A_{v}$ , and $B_{v}$ are matrices used for LoRA fine-tuning.
|
| 124 |
+
|
| 125 |
+
Simultaneously fine-tuning $W_u'$ and $W_v'$ will not guarantee a decrease in fine-tuning loss. This is because the derivatives of $W_u'$ and $W_v'$ are interdependent during the fine-tuning process, where optimization of one matrix may interfere with the optimization of the other. Therefore, as shown in Figure 1, we propose a sequential low-rank approximation strategy to fine-tune $W_u'$ and $W_v'$ in a sequential manner. Specifically, we first freeze matrix $W_v'$ and fine-tune $W_u'$ with LoRA. We then perform the second-round LoRA fine-tuning on matrix $W_v'$ while freezing the updated weight matrix $W_u'$ . Finally, we add $B_u \times A_u$ and $B_v \times A_v$ matrices to $W_u'$ and $W_v'$ to obtain the final compressed weight matrices.
|
| 126 |
+
|
| 127 |
+
Table 1: Performance of LLaMA-7B compressed by SVD-LLM, SVD-LLM (W), and baselines under different compression ratio (corresponding weight memory is listed inside bracket) on two language modeling datasets (measured by perplexity $(\downarrow)$ ), eight common sense reasoning datasets (six measured by both individual and average accuracy $(\uparrow)$ ), TruthfulQA measured by BLEU score $(\uparrow)$ , and GSM8K measured by Exact Match Accuracy $(\uparrow)$ ). The best performance is marked in bold. The relative performance gain compared to the best-performing baseline is marked in green inside bracket.
|
| 128 |
+
|
| 129 |
+
<table><tr><td>RATIO (MEM.)</td><td>METHOD</td><td>WikiText-2↓</td><td>C4↓</td><td>Openb.</td><td>ARC_e</td><td>WinoG.</td><td>HellaS.</td><td>PIQA</td><td>MathQA</td><td>Average↑</td><td>TruthfulQA↑</td><td>GSM8K↑</td></tr><tr><td>0% (13.5 GB)</td><td>Original</td><td>5.68</td><td>7.34</td><td>0.34</td><td>0.75</td><td>0.70</td><td>0.57</td><td>0.79</td><td>0.27</td><td>0.57</td><td>0.30</td><td>0.09</td></tr><tr><td rowspan="5">20% (10.2 GB)</td><td>SVD</td><td>20061</td><td>18800</td><td>0.05</td><td>0.04</td><td>0.01</td><td>0.03</td><td>0.02</td><td>0.03</td><td>0.03</td><td>0.00</td><td>0.00</td></tr><tr><td>FWSVD</td><td>1727</td><td>1511</td><td>0.09</td><td>0.11</td><td>0.05</td><td>0.08</td><td>0.10</td><td>0.05</td><td>0.08</td><td>0.00</td><td>0.00</td></tr><tr><td>ASVD</td><td>11.14</td><td>15.93</td><td>0.29</td><td>0.53</td><td>0.64</td><td>0.41</td><td>0.68</td><td>0.17</td><td>0.45</td><td>0.21</td><td>0.04</td></tr><tr><td>SVD-LLM (W)</td><td>7.94 (↓29%)</td><td>15.84 (↓1%)</td><td>0.31</td><td>0.62</td><td>0.61</td><td>0.45</td><td>0.71</td><td>0.21</td><td>0.49 (↑9%)</td><td>0.26 (+0.05)</td><td>0.05 (+0.01)</td></tr><tr><td>SVD-LLM</td><td>7.73 (↓31%)</td><td>12.23 (↓23%)</td><td>0.33</td><td>0.67</td><td>0.69</td><td>0.55</td><td>0.79</td><td>0.26</td><td>0.55 (↑22%)</td><td>0.28 (+0.07)</td><td>0.08 (+0.04)</td></tr><tr><td rowspan="5">40% (7.76 GB)</td><td>SVD</td><td>52489</td><td>47774</td><td>0.04</td><td>0.04</td><td>0.05</td><td>0.01</td><td>0.03</td><td>0.02</td><td>0.03</td><td>0.00</td><td>0.00</td></tr><tr><td>FWSVD</td><td>18156</td><td>12847</td><td>0.06</td><td>0.05</td><td>0.02</td><td>0.00</td><td>0.05</td><td>0.03</td><td>0.04</td><td>0.00</td><td>0.00</td></tr><tr><td>ASVD</td><td>1407</td><td>1109</td><td>0.08</td><td>0.11</td><td>0.09</td><td>0.08</td><td>0.13</td><td>0.08</td><td>0.10</td><td>0.01</td><td>0.00</td></tr><tr><td>SVD-LLM (W)</td><td>13.73 (↓99%)</td><td>75.42 (↓93%)</td><td>0.25</td><td>0.33</td><td>0.55</td><td>0.40</td><td>0.63</td><td>0.12</td><td>0.38 (↑280%)</td><td>0.17 (+0.17)</td><td>0.02 (+0.02)</td></tr><tr><td>SVD-LLM</td><td>9.27 (↓99%)</td><td>15.63 (↓99%)</td><td>0.29</td><td>0.59</td><td>0.68</td><td>0.52</td><td>0.69</td><td>0.20</td><td>0.50 (↑400%)</td><td>0.24 (+0.23)</td><td>0.07 (+0.07)</td></tr><tr><td rowspan="5">60% (5.35 GB)</td><td>SVD</td><td>105474</td><td>106976</td><td>0.01</td><td>0.03</td><td>0.01</td><td>0.00</td><td>0.01</td><td>0.02</td><td>0.01</td><td>0.00</td><td>0.00</td></tr><tr><td>FWSVD</td><td>32194</td><td>29292</td><td>0.06</td><td>0.02</td><td>0.01</td><td>0.01</td><td>0.02</td><td>0.03</td><td>0.03</td><td>0.00</td><td>0.00</td></tr><tr><td>ASVD</td><td>57057</td><td>43036</td><td>0.05</td><td>0.04</td><td>0.06</td><td>0.09</td><td>0.08</td><td>0.05</td><td>0.06</td><td>0.00</td><td>0.00</td></tr><tr><td>SVD-LLM (W)</td><td>66.62 (↓99%)</td><td>471.83 (↓99%)</td><td>0.10</td><td>0.05</td><td>0.17</td><td>0.10</td><td>0.21</td><td>0.04</td><td>0.11 (↑83%)</td><td>0.01 (+0.01)</td><td>0.00 (+0.00)</td></tr><tr><td>SVD-LLM</td><td>15.00 (↓99%)</td><td>26.26 (↓99%)</td><td>0.18</td><td>0.42</td><td>0.44</td><td>0.31</td><td>0.35</td><td>0.12</td><td>0.30 (↑400%)</td><td>0.14 (+0.14)</td><td>0.04 (+0.04)</td></tr><tr><td rowspan="5">80% (2.58 GB)</td><td>SVD</td><td>687291</td><td>708243</td><td>0.00</td><td>0.01</td><td>0.02</td><td>0.01</td><td>0.01</td><td>0.00</td><td>0.01</td><td>0.00</td><td>0.00</td></tr><tr><td>FWSVD</td><td>96872</td><td>89243</td><td>0.01</td><td>0.02</td><td>0.00</td><td>0.01</td><td>0.01</td><td>0.00</td><td>0.01</td><td>0.00</td><td>0.00</td></tr><tr><td>ASVD</td><td>80425</td><td>67927</td><td>0.04</td><td>0.03</td><td>0.03</td><td>0.02</td><td>0.01</td><td>0.01</td><td>0.03</td><td>0.00</td><td>0.00</td></tr><tr><td>SVD-LLM (W)</td><td>1349 (↓98%)</td><td>6224 (↓91%)</td><td>0.07</td><td>0.03</td><td>0.04</td><td>0.02</td><td>0.07</td><td>0.01</td><td>0.04 (↑33%)</td><td>0.00 (+0.00)</td><td>0.00 (+0.00)</td></tr><tr><td>SVD-LLM</td><td>31.79 (↓99%)</td><td>43.71 (↓99%)</td><td>0.11</td><td>0.23</td><td>0.21</td><td>0.14</td><td>0.17</td><td>0.08</td><td>0.16 (↑433%)</td><td>0.04 (+0.04)</td><td>0.02 (+0.02)</td></tr></table>
|
| 130 |
+
|
| 131 |
+
# 4 EXPERIMENTS AND ANALYSIS
|
| 132 |
+
|
| 133 |
+
Baselines. We compare SVD-LLM against three groups of methods: (1) Vanilla SVD and state-of-the-art SVD-based LLM compression methods: FWSVD (Hsu et al., 2022), ASVD (Yuan et al., 2023) (Section 4.1) and FLAP (Appendix A.6). (2) Other types of LLM compression methods. These include three state-of-the-art pruning-based LLM compression methods: LLM-Pruner (Ma et al., 2023), SliceGPT (Ashkboos et al., 2024), and BlockPruner (Zhong et al., 2024), and three state-of-the-art quantization-based LLM compression methods: PB-LLM (Yuan et al., 2024), BiLLM (Huang et al., 2024), and OneBit (Xu et al., 2024) (Section 4.4). (3) Smaller LLM StableLM-3B (Tow et al.) pre-trained from scratch (Appendix A.7).
|
| 134 |
+
|
| 135 |
+
Models and Datasets. To demonstrate the generability of SVD-LLM, we evaluate the performance of SVD-LLM on seven models from three different LLM families at three different scales (LLaMA-7B, 13B, 30B, LLaMA2-7B (Touvron et al., 2023), OPT-6.7B (Zhang et al., 2022), Vicuna-7B (Chiang et al., 2023) and Mistral-7B (Jiang et al., 2023)) and 10 datasets including two language modeling datasets (WikiText-2 (Merit et al., 2017), and C4 (Raffel et al., 2020)), six classification datasets (OpenbookQA (Mihaylov et al., 2018), WinoGrande (Sakaguchi et al., 2020), HellaSwag (Zellers et al., 2019), Arc_e (Clark et al., 2018), PIQA (Bisk et al., 2020), MathQA (Amini et al., 2019)), and two generation datasets (TruthfulQA (Lin et al., 2022) and GSM8K (Cobbe et al., 2021)) with the LM-Evaluation-Harness framework (Gao et al., 2023).
|
| 136 |
+
|
| 137 |
+
Implementation Details. To ensure a fair comparison, we followed ASVD (Yuan et al., 2023) to randomly select 256 samples from WikiText-2 as the calibration data. We followed the same configuration used in LLM-Pruner (Ma et al., 2023) to use Alpaca (Taori et al., 2023) dataset with 50K samples for parameter update in SVD-LLM. The inference efficiency experiment is conducted on both NVIDIA A100 GPU and AMD EPYC 7643 CPU while the other experiments are conducted on NVIDIA A100 GPUs.
|
| 138 |
+
|
| 139 |
+
# 4.1 COMPARISON WITH STATE-OF-THE-ART SVD-BASED LLM COMPRESSION METHODS
|
| 140 |
+
|
| 141 |
+
First, we compare the performance of SVD-LLM with state-of-the-art SVD-based LLM compression methods from four aspects: (1) performance under different compression ratios, (2) performance on different LLMs, (3) performance on LLMs with larger scales, and (4) compression speed (Appendix A.8). Given that all the SVD-based baselines do not incorporate LoRa fine-tuning, to ensure a fair comparison, we also compare to SVD-LLM with truncation-aware data whitening only (denoted as SVD-LLM (W)).
|
| 142 |
+
|
| 143 |
+
Performance under Different Compression Ratios. We first evaluate the performance of LLaMA-7B compressed by SVD-LLM, SVD-LLM (W), and the SVD-based baselines under compression
|
| 144 |
+
|
| 145 |
+
Table 2: Perplexity $(\downarrow)$ of SVD-LLM, SVD-LLM (W), and baselines on WikiText-2 and the average accuracy $(\uparrow)$ of the six common sense reasoning datasets of four different LLMs - OPT-6.7B, LLaMA 2-7B, Mistral-7B, and Vicuna-7B - under $20\%$ compression ratio. The relative performance gain compared to the best-performing baseline is marked in green color inside bracket.
|
| 146 |
+
|
| 147 |
+
<table><tr><td></td><td colspan="2">OPT-6.7B</td><td colspan="2">LLAMA 2-7B</td><td colspan="2">MISTRAL-7B</td><td colspan="2">VICUNA-7B</td></tr><tr><td>METHOD</td><td>Perplexity↓</td><td>Accuracy↑</td><td>Perplexity↓</td><td>Accuracy↑</td><td>Perplexity↓</td><td>Accuracy↑</td><td>Perplexity↓</td><td>Accuracy↑</td></tr><tr><td>Original</td><td>10.86</td><td>0.52</td><td>5.47</td><td>0.57</td><td>5.25</td><td>0.61</td><td>6.78</td><td>0.56</td></tr><tr><td>SVD</td><td>66275</td><td>0.03</td><td>18192</td><td>0.09</td><td>159627</td><td>0.03</td><td>18644</td><td>0.05</td></tr><tr><td>FWSVD</td><td>14559</td><td>0.06</td><td>2360</td><td>0.12</td><td>6357</td><td>0.08</td><td>2758</td><td>0.09</td></tr><tr><td>ASVD</td><td>82.00</td><td>0.32</td><td>10.10</td><td>0.36</td><td>13.72</td><td>0.32</td><td>16.23</td><td>0.33</td></tr><tr><td>SVD-LLM (W)</td><td>16.04 (↓80%)</td><td>0.41 (↑28%)</td><td>8.50 (↓16%)</td><td>0.53 (↑47%)</td><td>10.21 (↓26%)</td><td>0.42 (↑24%)</td><td>8.41 (↓48%)</td><td>0.51 (↑55%)</td></tr><tr><td>SVD-LLM</td><td>14.47 (↓82%)</td><td>0.49 (↑53%)</td><td>7.73 (↓23%)</td><td>0.54 (↑50%)</td><td>7.47 (↓45%)</td><td>0.55 (↑72%)</td><td>7.43 (↓54%)</td><td>0.54 (↑64%)</td></tr></table>
|
| 148 |
+
|
| 149 |
+
ratios ranging from $20\%$ to $80\%$ on all 10 datasets. The results are summarized inTable 1. Both SVD-LLM and SVD-LLM (W) consistently outperform vanilla SVD, FWSVD and ASVD across all the compression ratios. In particular, when the compression ratio is $40\%$ and above, SVD-LLM reduces the perplexity by more than $99\%$ on two language modeling datasets and achieves over $400\%$ higher average accuracy on six classification datasets. More importantly, the results on two generation datasets (TruthfulQA, GSM8K) of all three baselines when compression ratios are $60\%$ and above are zero, meaning that the compressed LLMs totally lose their generation ability. In contrast, SVD-LLM still outputs good generation even under $80\%$ compression ratio. Example contents generated by the compressed LLMs are included in Appendix A.9.
|
| 150 |
+
|
| 151 |
+
Performance on Different LLMs. To examine the generability of SVD-LLM and SVD-LLM (W) across different LLMs, we compare the performance between SVD-LLM and the baselines on four different models from three different LLM families - OPT-6.7B (OPT family), LLaMA 2-7B (LLaMA family), Mistral-7B (Mistral family), and Vicuna-7B (LLaMA family) - under $20\%$ compression ratio on WikiText-2 and six classification datasets. As shown in Table 2, both SVD-LLM and SVD-LLM (W) consistently outperform baselines on all four LLMs, and exhibits more stable performance across different LLMs, especially compared to vanilla SVD and FWSVD.
|
| 152 |
+
|
| 153 |
+
Table 3: Perplexity $(\downarrow)$ of SVD-LLM, SVD-LLM (W), and baselines on WikiText-2 and the average accuracy $(\uparrow)$ of the six classification datasets of LLaMA-13B and LLaMA-30B under $20\%$ compression ratio. The relative performance gain compared to the best-performing baseline is marked in green color inside bracket.
|
| 154 |
+
|
| 155 |
+
<table><tr><td></td><td colspan="2">LLAMA-13B</td><td colspan="2">LLAMA-30B</td></tr><tr><td>METHOD</td><td>Perplexity↓</td><td>Accuracy↑</td><td>Perplexity↓</td><td>Accuracy↑</td></tr><tr><td>Original</td><td>5.09</td><td>0.59</td><td>4.10</td><td>0.61</td></tr><tr><td>SVD</td><td>946.31</td><td>0.21</td><td>54.11</td><td>0.33</td></tr><tr><td>FWSVD</td><td>15.98</td><td>0.43</td><td>20.54</td><td>0.42</td></tr><tr><td>ASVD</td><td>6.74</td><td>0.54</td><td>22.71</td><td>0.44</td></tr><tr><td>SVD-LLM (W)</td><td>6.61 (↓2%)</td><td>0.54 (↑0%)</td><td>5.63 (↓73%)</td><td>0.57 (↑30%)</td></tr><tr><td>SVD-LLM</td><td>6.43 (↓5%)</td><td>0.55 (↑2%)</td><td>5.14 (↓75%)</td><td>0.59 (↑34%)</td></tr></table>
|
| 156 |
+
|
| 157 |
+
Performance on LLMs with Larger Scales. To examine the generability of SVD-LLM and SVD-LLM (W) on LLMs with larger scales, we compare the performance between SVD-LLM and the baselines on LLaMA-13B and LLaMA-30B under $20\%$ compression ratio. As shown in Table 3, both SVD-LLM and SVD-LLM (W) consistently outperform vanilla SVD, FWSVD, and ASVD on both model sizes.
|
| 158 |
+
|
| 159 |
+
# 4.2 INFERENCE EFFICIENCY OF SVD-LLM
|
| 160 |
+
|
| 161 |
+
Theoretical Analysis of Inference Efficiency. Assume SVD-LLM compresses the weight matrix $W \in \mathbb{R}^{d \times n}$ into two low-ranking matrices $W_{u}' \in \mathbb{R}^{d \times r}$ , $W_{v}' \in \mathbb{R}^{r \times n}$ . The compression ratio is then calculated as $R_{w} = 1 - \frac{(d + n)r}{dn}$ .
|
| 162 |
+
|
| 163 |
+
(1) Compute Complexity Analysis: Given input $X \in \mathbb{R}^{n \times d}$ , instead of recalculating the full weight matrix $W' = W_u' \times W_v'$ and then computing the output $W' \times X$ , SVD-LLM calculates the intermediate state $M = W_v' \times X$ and then computes the output $Y = W_u' \times M$ . In this way, the computation complexity is reduced from $O(d^2 n)$ to $O(d^2 r + rnd)$ . Taking compression ratio $R_w = 50\%$ as an example, since $R_w = 1 - \frac{(d + n)r}{dn}$ , we have $r = \frac{dn}{2(d + n)}$ . Then the computation complexity is $O(d^2 r + rnd) = O(rd(d + n)) = O\left(\frac{d^2n}{2}\right) = \frac{1}{2} O(d^2n)$ , which reduces $50\%$ . In general, given any compression ratio $R_w$ , the computation complexity is reduced to $1 - R_w$ times of the original.
|
| 164 |
+
|
| 165 |
+
(2) Inference Memory Analysis: Since SVD-LLM does not recalculate the full weight $W' = W_u' \times W_v'$ , the weight memory is reduced to $1 - R_w$ times of the original during inference. As another
|
| 166 |
+
|
| 167 |
+

|
| 168 |
+
(a) Varying Batch Size on GPU
|
| 169 |
+
(b) Varying Sequence Length on GPU
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
(c) Varying Batch Size on CPU
|
| 173 |
+
|
| 174 |
+

|
| 175 |
+
(d) Varying Sequence Length on CPU
|
| 176 |
+
Figure 3: Throughput (tokens/sec) of LLaMA-7B and its compressed version by SVD-LLM under different compression ratios on a single A100 GPU under different batch sizes (a) and different sequence lengths (b) and on a single AMD EPYC 7643 CPU under different batch sizes (c) and different sequence lengths (d). For (a) and (c), sequence length is 32. For (b) and (d), batch size is 64.
|
| 177 |
+
|
| 178 |
+
advantage, SVD-LLM is able to reduce the runtime KV cache memory as well (Wan et al., 2024b; 2025; Shen et al., 2024). Specifically, instead of keeping $W_{u}^{\prime} \times W_{v}^{\prime} \times X$ in the KV cache, SVD-LLM provides the option to store the intermediate result $M = W_{v}^{\prime} \times X$ in the KV cache and recomutes the original key and value states with the decomposed weight matrix $W_{u}^{\prime}$ if required. As such, the runtime KV cache is reduced to $\frac{r}{d} = (1 - R_w) \times \frac{d}{n + d}$ times of the original. Moreover, since $W_{u}^{\prime}$ is already stored as the weight matrix in the decomposed LLM, the original intermediate state matrix can still be recovered by $W_{u}^{\prime} \times M$ without accuracy drop. Therefore, SVD-LLM provides a unified solution that enables simultaneous model compression and KV cache compression.
|
| 179 |
+
|
| 180 |
+
Inference Speedup on Hardware. To quantify inference speedup achieved by SVD-LLM on real hardware, we measure the numbers of tokens that LLaMA-7B and its compressed version by SVD-LLM generate per second (i.e., throughput) under different batch sizes and sequence lengths on a single NVIDIA A100 GPU and a single AMD EPYC 7643 CPU, respectively. The results are shown in Figure 3. We have three observations. (1) Under a specific batch size or sequence length, the speedup achieved by SVD-LLM related to the original model increases as the compression ratio increases. (2) Under a specific compression ratio, the speedup achieved by SVD-LLM related to the original model becomes more significant as the batch size increases or as the sequence length decreases. (3) The above two observations are valid for both GPU and CPU.
|
| 181 |
+
|
| 182 |
+
Inference Memory Reduction on Hardware. Lastly, we evaluate the inference memory saving, including both weight memory and runtime KV cache memory saving on a single A100 GPU. Specifically, we measure the peak memory footprint during inference when generating 128 tokens with batch size of 32 using LLaMA-7B compressed by SVD-LLM under different compression ratios w/ and w/o considering KV cache reduction. The results are illustrated in Figure 4 where the memory reduction from the dotted line to the blue bars comes mainly from model weight compression and the memory reduction from the blue bars to the yellow bars comes mainly from KV cache compression. As shown, both weight memory saving and runtime KV cache memory saving brought by SVD-LLM are near linear to the compression ratio.
|
| 183 |
+
|
| 184 |
+
# 4.3 ABLATION STUDY
|
| 185 |
+
|
| 186 |
+
Modular Sensitivity Study. We conduct ablation studies to evaluate the separate contributions of the two key components (i.e., truncation-aware data whitening and parameter update with sequential low-rank approximation) of SVD-LLM. Let SVD-LLM (W) denote the version of SVD-LLM with truncation-aware data whitening only; SVD-LLM (U) denote the version of SVD-LLM with normal
|
| 187 |
+
|
| 188 |
+

|
| 189 |
+
Figure 4: Peak memory to generate 128 tokens with batch size of 32 using LLaMA-7B compressed by SVD-LLM w/ and w/o KV-cache reduction. The dotted line indicates the peak memory of the original LLaMA-7B. The memory reduction from the dotted line to the blue bars mainly comes from the model compression. The memory reduction from the blue to the yellow bars mainly comes from the reduced footprint of the KV cache.
|
| 190 |
+
|
| 191 |
+
Table 4: Perplexity $(\downarrow)$ of compressed LLaMA-7B on WikiText-2 under different compression ratios. SVD-LLM (W) denotes the version of SVD-LLM with truncation-aware data whitening only; SVD-LLM (U) denotes the version of SVD-LLM with parameter update with sequential low-rank approximation only; The relative performance gain compared to ASVD is marked in green color inside bracket.
|
| 192 |
+
|
| 193 |
+
<table><tr><td>METHOD</td><td>20%</td><td>40%</td><td>60%</td></tr><tr><td>ASVD</td><td>11.14</td><td>1407</td><td>57057</td></tr><tr><td>SVD-LLM (W)</td><td>7.94 (↓29%)</td><td>13.11 (↓99%)</td><td>42.30 (↓99%)</td></tr><tr><td>SVD-LLM (U)</td><td>10.12 (↓9%)</td><td>19.28 (↓99%)</td><td>49.88 (↓99%)</td></tr><tr><td>SVD-LLM</td><td>7.73 (↓31%)</td><td>9.27 (↓99%)</td><td>15.00 (↓99%)</td></tr></table>
|
| 194 |
+
|
| 195 |
+
SVD truncation and parameter update with sequential low-rank approximation. As shown in Table 4, we have three observations. (1) SVD-LLM (W), SVD-LLM (U) and SVD-LLM consistently outperform ASVD across all the compression ratios. Notably, when the compression ratio is at and above $40\%$ , all of them reduce the perplexity by more than $99\%$ compared to ASVD. (2) SVD-LLM consistently outperforms both SVD-LLM (U) and SVD-LLM (W) across all compression ratios. This result demonstrates the unique contribution from each of the two key components and the importance of combining both components to achieve the best performance. (3) Comparing between SVD-LLM (W) and SVD-LLM (U), SVD-LLM (W) achieves a lower perplexity compared to SVD-LLM (U) across all compression ratios. This result indicates that truncation-aware data whitening plays a more significant role than parameter update with sequential low-rank approximation.
|
| 196 |
+
|
| 197 |
+
Impact of Calibration Data. Next, we examine the impact of calibration data on SVD-LLM. Figure 5 and Table 6 summarize the performance of compressed LLaMA-7B when changing three key characteristics of the calibration data: (1) number of calibration data, (2) the seed used to randomly sample the calibration data, and (3) dataset from which calibration data is sampled. As shown, the changes of the three key characteristics on calibration data incur no more than $3\%$ to the final performance, indicating that the sensitivity of SVD-LLM on calibration data is limited.
|
| 198 |
+
|
| 199 |
+
Impact of Updating Order. Lastly, we examine the impact of updating order in the parameter update with sequential low-rank approximation component to the final performance of the compressed LLM. Table 5 shows the performance of compressed LLaMA-7B under $20\%$ to $80\%$ compression ratios on WikiText-2 with different updating orders. As shown, there is only a small difference of the final performance between updating matrix $W_{u}^{\prime}$ first and updating matrix $W_{v}^{\prime}$ first. This result indicates SVD-LLM is not sensitive to the updating order.
|
| 200 |
+
|
| 201 |
+
More ablation studies are included in Appendix A.10.
|
| 202 |
+
|
| 203 |
+
# 4.4 COMPARISON WITH OTHER TYPES OF LLM COMPRESSION METHODS
|
| 204 |
+
|
| 205 |
+
SVD-LLM is orthogonal to other post-training LLM compression methods including pruning and quantization (Wan et al., 2024a; Shen et al., 2025). Lastly, we compare the performance of SVD-LLM with state-of-the-art structured pruning-based and quantization-based LLM compression methods. As discussed in Section 2, since unstructured pruning methods are difficult to achieve its efficiency on hardware, we do not make a comparison with them in this experiment.
|
| 206 |
+
|
| 207 |
+
Comparison with Structured Pruning. First, we compare SVD-LLM with three state-of-the-art structured pruning-based LLM compression methods: LLM-Pruner (Ma et al., 2023), SliceGPT (Ashkboos et al., 2024) and BlockPruner (Zhong et al., 2024) under the same memory budget, ranging from 10 GB to 7 GB on LLaMA-7B using WikiText-2 dataset. As shown in Table 7, SVD-LLM outperforms all three structured pruning-based LLM compression methods. In particular, SVD-LLM achieves up to $56\%$ reduction in perplexity under 7G memory budget.
|
| 208 |
+
|
| 209 |
+

|
| 210 |
+
(a) Change of Number
|
| 211 |
+
|
| 212 |
+

|
| 213 |
+
(b) Change of Seed
|
| 214 |
+
Figure 5: Perplexity of LLaMA-7B under $20\%$ compression ratio using calibration data sampled with different number or seeds from WikiText-2.
|
| 215 |
+
|
| 216 |
+
Table 6: Performance of LLaMA-7B compressed by SVD-LLM under $20\%$ compression ratio using calibration data sampled from WikiText-2 (by default in our paper) and C4 datasets. The performance on WikiText-2 and C4 are reported by perplexity $(\downarrow)$ , while the performance on six downstream datasets are reported by average accuracy $(\uparrow)$ . The performance on TruthfulQA and GSM8K are reported by BLEU score $(\uparrow)$ and Exact Match Accuracy $(\uparrow)$ respectively. The relative performance gain for data sampled from one dataset compared to another is marked in green color inside bracket.
|
| 217 |
+
|
| 218 |
+
<table><tr><td>WikiText-2↓</td><td>C4↓</td><td>Average↑</td><td>TruthfulQA↑</td><td>GSM8K↑</td></tr><tr><td colspan="5">Calibration data sampled from WikiText-2</td></tr><tr><td>7.73 (↓1%)</td><td>12.23</td><td>0.55 (↑2%)</td><td>0.28</td><td>0.08</td></tr><tr><td colspan="5">Calibration data sampled from C4</td></tr><tr><td>7.79</td><td>11.97 (↓1%)</td><td>0.54</td><td>0.28</td><td>0.08</td></tr></table>
|
| 219 |
+
|
| 220 |
+
Table 5: Perplexity of LLaMA-7B compressed by SVD-LLM under $20\%$ to $80\%$ compression ratio on WikiText-2 with different updating orders.
|
| 221 |
+
|
| 222 |
+
<table><tr><td>UPDATING ORDER</td><td>20%</td><td>40%</td><td>60%</td><td>80%</td></tr><tr><td>W′u first, then W′v</td><td>7.85</td><td>9.32</td><td>13.20 (↓1%)</td><td>31.67(↓1%)</td></tr><tr><td>W′v first, then W′u</td><td>7.73 (↓2%)</td><td>9.27 (↓1%)</td><td>15.00</td><td>31.79</td></tr></table>
|
| 223 |
+
|
| 224 |
+
Table 8: Perplexity (↓) of LLaMA-7B compressed by 1-bit quantization methods and SVD-LLM on WikiText-2. The relative performance gain compared to the best-performing baseline is marked in green.
|
| 225 |
+
Table 7: Perplexity $(\downarrow)$ of LLaMA-7B compressed by structured pruning methods and SVD-LLM under various memory budget on WikiText-2. The relative performance gain compared to the best-performing baseline is marked in green.
|
| 226 |
+
|
| 227 |
+
<table><tr><td></td><td colspan="4">PERPLEXITY UNDER VARIOUS MEMORY BUDGET</td></tr><tr><td>METHOD</td><td>10 GB</td><td>9 GB</td><td>8 GB</td><td>7 GB</td></tr><tr><td>LLM-Pruner</td><td>9.88</td><td>12.21</td><td>18.94</td><td>21.68</td></tr><tr><td>SliceGPT</td><td>8.78</td><td>12.73</td><td>16.39</td><td>27.41</td></tr><tr><td>BlockPruner</td><td>9.40</td><td>12.76</td><td>19.78</td><td>43.05</td></tr><tr><td>SVD-LLM</td><td>7.92 (↓10%)</td><td>8.18 (↓33%)</td><td>8.33 (↓49%)</td><td>9.63 (↓56%)</td></tr></table>
|
| 228 |
+
|
| 229 |
+
<table><tr><td>METHOD</td><td>TYPE</td><td>MEMORY</td><td>PERPLEXITY</td></tr><tr><td>PB-LLM</td><td>Post-training</td><td>1.9 GB</td><td>104.83</td></tr><tr><td>BiLLM</td><td>Post-training</td><td>1.5 GB</td><td>47.67</td></tr><tr><td>SVD-LLM</td><td>Post-training</td><td>1.5 GB</td><td>47.21 (↓1%)</td></tr><tr><td>OneBit</td><td>Training-required</td><td>1.3 GB</td><td>10.20</td></tr><tr><td>SVD-LLM (2-bit)</td><td>Post-training</td><td>1.3 GB</td><td>9.83 (↓4%)</td></tr></table>
|
| 230 |
+
|
| 231 |
+
Comparison with Quantization. Finally, we compare SVD-LLM with three state-of-the-art quantization-based LLM compression methods: BiLLM (Huang et al., 2024), PB-LLM (Yuan et al., 2024), and OneBit (Xu et al., 2024), which push the frontier to 1-bit quantization. Among them, both BiLLM and PB-LLM are post-training methods, and OneBit is training-required. The results on LLaMA-7B using WikiText-2 dataset are shown in Table 8. We have three observations. (1) Compared to post-training methods PB-LLM and BiLLM, SVD-LLM achieves the best performance. (2) Training-required method OneBit outperforms SVD-LLM. This result is expected because OneBit involves resource-intensive retraining using large-scale datasets to boost the accuracy after compression. (3) Lastly, we combine SVD-LLM with a 2-bit quantization-based post-training LLM compression method QuIP# (Tseng et al., 2024). This is achieved by first applying SVD-LLM to the LLM under $40\%$ compression ratio, and then applying QuIP# for 2-bit quantization on the compressed model $(W_u'$ and $W_v')$ generated from SVD-LLM. As shown in Table 8, SVD-LLM outperforms state-of-the-art 1-bit training-required method OneBit without involving resource-intensive retraining. This result demonstrates the potential of a hybrid approach - integrating SVD-based and quantization-based compression techniques - to push the boundaries of post-training LLM compression.
|
| 232 |
+
|
| 233 |
+
# 5 CONCLUSION
|
| 234 |
+
|
| 235 |
+
In this work, we present SVD-LLM, a SVD-based post-training LLM compression method. SVD-LLM proposes a truncation-aware data whitening technique to guide which singular values to be truncated with minimal compression loss. It also introduces a sequential low-rank approximation strategy to compensate for accuracy degradation caused by singular value truncation. We evaluate SVD-LLM on 10 datasets and seven models from three LLM families at three scales. Our results demonstrate the superiority of SVD-LLM over state-of-the-arts, especially at high model compression ratios.
|
| 236 |
+
|
| 237 |
+
# 6 ACKNOWLEDGEMENT
|
| 238 |
+
|
| 239 |
+
This work is supported in part by NSF Award NeTS-2312675.
|
| 240 |
+
|
| 241 |
+
# REFERENCES
|
| 242 |
+
|
| 243 |
+
Aida Amini, Saadia Gabriel, Shanchuan Lin, Rik Koncel-Kedziorski, Yejin Choi, and Hannaneh Hajishirzi. Mathqa: Towards interpretable math word problem solving with operation-based formalisms. In NAACL-HLT(1), pages 2357-2367. Association for Computational Linguistics, 2019.
|
| 244 |
+
Yongqi An, Xu Zhao, Tao Yu, Ming Tang, and Jinqiao Wang. Fluctuation-based adaptive structured pruning for large language models. In AAAI, pages 10865-10873. AAAI Press, 2024.
|
| 245 |
+
Saleh Ashkboos, Maximilian L. Croci, Marcelo Gennari Do Nascimento, Torsten Hoefler, and James Hensman. Slicegpt: Compress large language models by deleting rows and columns. In ICLR. OpenReview.net, 2024.
|
| 246 |
+
Yonatan Bisk, Rowan Zellers, Ronan Le Bras, Jianfeng Gao, and Yejin Choi. PIQA: reasoning about physical commonsense in natural language. In AAAI, pages 7432-7439. AAAI Press, 2020.
|
| 247 |
+
Patrick H. Chen, Hsiang-Fu Yu, Inderjit S. Dhillon, and Cho-Jui Hsieh. DRONE: data-aware low-rank compression for large NLP models. In NeurIPS, pages 29321-29334, 2021.
|
| 248 |
+
Wei-Lin Chiang, Zhuohan Li, Zi Lin, Ying Sheng, Zhanghao Wu, Hao Zhang, Lianmin Zheng, Siyuan Zhuang, Yonghao Zhuang, Joseph E. Gonzalez, Ion Stoica, and Eric P. Xing. Vicuna: An open-source chatbot impressing gpt-4 with $90\%$ * chatgpt quality, March 2023. URL https://lmsys.org/blog/2023-03-30-vicuna/.
|
| 249 |
+
Peter Clark, Isaac Cowhey, Oren Etzioni, Tushar Khot, Ashish Sabharwal, Carissa Schoenick, and Oyvind Tafjord. Think you have solved question answering? try arc, the AI2 reasoning challenge. CoRR, abs/1803.05457, 2018.
|
| 250 |
+
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. CoRR, abs/2110.14168, 2021.
|
| 251 |
+
Elias Frantar and Dan Alistarh. Sparsegpt: Massive language models can be accurately pruned in one-shot. In ICML, volume 202 of Proceedings of Machine Learning Research, pages 10323-10337. PMLR, 2023.
|
| 252 |
+
Leo Gao, Jonathan Tow, Baber Abbasi, Stella Biderman, Sid Black, Anthony DiPofi, Charles Foster, Laurence Golding, Jeffrey Hsu, Alain Le Noac'h, Haonan Li, Kyle McDonell, Niklas Muennighoff, Chris Ociepa, Jason Phang, Laria Reynolds, Hailey Schoelkopf, Aviya Skowron, Lintang Sutawika, Eric Tang, Anish Thite, Ben Wang, Kevin Wang, and Andy Zou. A framework for few-shot language model evaluation, 12 2023. URL https://zenodo.org/records/10256836.
|
| 253 |
+
G.H. Golub, Alan Hoffman, and G.W. Stewart. A generalization of the eckart-young-mirsky matrix approximation theorem. Linear Algebra and its Applications, 88-89:317-327, 1987. ISSN 0024-3795. doi: https://doi.org/10.1016/0024-3795(87)90114-5. URL https://www.sciencedirect.com/science/article/pii/0024379587901145.
|
| 254 |
+
Roberto Gozalo-Brizuela and Eduardo C. Garrido-Merchán. A survey of generative AI applications. CoRR, abs/2306.02781, 2023.
|
| 255 |
+
Yen-Chang Hsu, Ting Hua, Sungen Chang, Qian Lou, Yilin Shen, and Hongxia Jin. Language model compression with weighted low-rank factorization. In ICLR. OpenReview.net, 2022.
|
| 256 |
+
Wei Huang, Yangdong Liu, Haotong Qin, Ying Li, Shiming Zhang, Xianglong Liu, Michele Magno, and Xiaojuan Qi. Billm: Pushing the limit of post-training quantization for llms. In ICML. OpenReview.net, 2024.
|
| 257 |
+
Albert Q. Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de Las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, Lélio Renard Lavaud, Marie-Anne Lachaux, Pierre Stock, Teven Le Scao, Thibaut Lavril, Thomas Wang, Timothée Lacroix, and William El Sayed. Mistral 7b. CoRR, abs/2310.06825, 2023.
|
| 258 |
+
|
| 259 |
+
Stephanie Lin, Jacob Hilton, and Owain Evans. Truthfulqa: Measuring how models mimic human falsehoods. In ACL (1), pages 3214-3252. Association for Computational Linguistics, 2022.
|
| 260 |
+
Yujun Lin, Haotian Tang, Shang Yang, Zhekai Zhang, Guangxuan Xiao, Chuang Gan, and Song Han. Qserve: W4A8KV4 quantization and system co-design for efficient LLM serving. CoRR, abs/2405.04532, 2024.
|
| 261 |
+
Xinyin Ma, Gongfan Fang, and Xinchao Wang. Llm-pruner: On the structural pruning of large language models. In NeurIPS, 2023.
|
| 262 |
+
Stephen Merity, Caiming Xiong, James Bradbury, and Richard Socher. Pointer sentinel mixture models. In *ICLR (Poster)*. OpenReview.net, 2017.
|
| 263 |
+
Carl Dean Meyer. Matrix Analysis and Applied Linear Algebra. SIAM, 2000.
|
| 264 |
+
Todor Mihaylov, Peter Clark, Tushar Khot, and Ashish Sabharwal. Can a suit of armor conduct electricity? A new dataset for open book question answering. In EMNLP, pages 2381-2391. Association for Computational Linguistics, 2018.
|
| 265 |
+
Colin Raffel, Noam Shazeer, Adam Roberts, Katherine Lee, Sharan Narang, Michael Matena, Yanqi Zhou, Wei Li, and Peter J. Liu. Exploring the limits of transfer learning with a unified text-to-text transformer. J. Mach. Learn. Res., 21:140:1-140:67, 2020.
|
| 266 |
+
Keisuke Sakaguchi, Ronan Le Bras, Chandra Bhagavatula, and Yejin Choi. Winogrande: An adversarial winograd schema challenge at scale. In AAAI, pages 8732-8740. AAAI Press, 2020.
|
| 267 |
+
Hui Shen, Zhongwei Wan, Xin Wang, and Mi Zhang. Famba-v: Fast vision mamba with cross-layer token fusion. CoRR, abs/2409.09808, 2024.
|
| 268 |
+
Hui Shen, Jingxuan Zhang, Boning Xiong, Rui Hu, Shoufa Chen, Zhongwei Wan, Xin Wang, Yu Zhang, Zixuan Gong, Guangyin Bao, et al. Efficient diffusion models: A survey. arXiv preprint arXiv:2502.06805, 2025.
|
| 269 |
+
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023.
|
| 270 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, Dan Bikel, Lukas Blecher, Cristian Canton-Ferrer, Moya Chen, Guillem Cucurull, David Esiobu, Jude Fernandes, Jeremy Fu, Wenyin Fu, Brian Fuller, Cynthia Gao, Vedanuj Goswami, Naman Goyal, Anthony Hartshorn, Saghar Hosseini, Rui Hou, Hakan Inan, Marcin Kardas, Viktor Kerkez, Madian Khabsa, Isabel Kloumann, Artem Korenev, Punit Singh Koura, Marie-Anne Lachaux, Thibaut Lavril, Jenya Lee, Diana Liskovich, Yinghai Lu, Yuning Mao, Xavier Martinet, Todor Mihaylov, Pushkar Mishra, Igor Molybog, Yixin Nie, Andrew Poulton, Jeremy Reizenstein, Rashi Rungta, Kalyan Saladi, Alan Schelten, Ruan Silva, Eric Michael Smith, Ranjan Subramanian, Xiaqing Ellen Tan, Binh Tang, Ross Taylor, Adina Williams, Jian Xiang Kuan, Puxin Xu, Zheng Yan, Iliyan Zarov, Yuchen Zhang, Angela Fan, Melanie Kambadur, Sharan Narang, Aurélien Rodriguez, Robert Stojnic, Sergey Edunov, and Thomas Scialom. Llama 2: Open foundation and fine-tuned chat models. CoRR, abs/2307.09288, 2023.
|
| 271 |
+
Jonathan Tow, Marco Bellagente, Dakota Mahan, and Carlos Riquelme. Stablelm 3b 4e1t. URL [https://huggingface.co/stabilityai/stablelm-3b-4e1t] (https://huggingface.co/stabilityai/stablelm-3b-4e1t).
|
| 272 |
+
Albert Tseng, Jerry Chee, Qingyao Sun, Volodymyr Kuleshov, and Christopher De Sa. Quip#: Even better LLM quantization with hadamard incoherence and lattice codebooks. In ICML. OpenReview.net, 2024.
|
| 273 |
+
Zhongwei Wan, Xin Wang, Che Liu, Samiul Alam, Yu Zheng, Jiachen Liu, Zhongnan Qu, Shen Yan, Yi Zhu, Quanlu Zhang, Mosharaf Chowdhury, and Mi Zhang. Efficient large language models: A survey. Trans. Mach. Learn. Res., 2024, 2024a.
|
| 274 |
+
|
| 275 |
+
Zhongwei Wan, Xinjian Wu, Yu Zhang, Yi Xin, Chaofan Tao, Zhihong Zhu, Xin Wang, Siqi Luo, Jing Xiong, and Mi Zhang. D2O: dynamic discriminative operations for efficient generative inference of large language models. CoRR, abs/2406.13035, 2024b.
|
| 276 |
+
Zhongwei Wan, Hui Shen, Xin Wang, Che Liu, Zheda Mai, and Mi Zhang. Meda: Dynamic kv cache allocation for efficient multimodal long-context inference. arXiv preprint arXiv:2502.17599, 2025.
|
| 277 |
+
Xin Wang, Zhongwei Wan, Arvin Hekmati, Mingyu Zong, Samiul Alam, Mi Zhang, and Bhaskar Krishnamachari. Iot in the era of generative AI: vision and challenges. CoRR, abs/2401.01923, 2024.
|
| 278 |
+
Guangxuan Xiao, Ji Lin, Mickael Seznec, Hao Wu, Julien Demouth, and Song Han. Smoothquant: Accurate and efficient post-training quantization for large language models. In ICML, volume 202 of Proceedings of Machine Learning Research, pages 38087-38099. PMLR, 2023.
|
| 279 |
+
Yuzhuang Xu, Xu Han, Zonghan Yang, Shuo Wang, Qingfu Zhu, Zhiyuan Liu, Weidong Liu, and Wanxiang Che. Onebit: Towards extremely low-bit large language models. In NeurIPS, 2024.
|
| 280 |
+
Zhihang Yuan, Yuzhang Shang, Yue Song, Qiang Wu, Yan Yan, and Guangyu Sun. ASVD: activation-aware singular value decomposition for compressing large language models. CoRR, abs/2312.05821, 2023.
|
| 281 |
+
Zhihang Yuan, Yuzhang Shang, and Zhen Dong. PB-LLM: partially binarized large language models. In ICLR. OpenReview.net, 2024.
|
| 282 |
+
Rowan Zellers, Ari Holtzman, Yonatan Bisk, Ali Farhadi, and Yejin Choi. Hellaswag: Can a machine really finish your sentence? In ACL (1), pages 4791-4800. Association for Computational Linguistics, 2019.
|
| 283 |
+
Susan Zhang, Stephen Roller, Naman Goyal, Mikel Artetxe, Moya Chen, Shuhui Chen, Christopher Dewan, Mona T. Diab, Xian Li, Xi Victoria Lin, Todor Mihaylov, Myle Ott, Sam Shleifer, Kurt Shuster, Daniel Simig, Punit Singh Koura, Anjali Sridhar, Tianlu Wang, and Luke Zettlemoyer. OPT: open pre-trained transformer language models. CoRR, abs/2205.01068, 2022.
|
| 284 |
+
Wayne Xin Zhao, Kun Zhou, Junyi Li, Tianyi Tang, Xiaolei Wang, Yupeng Hou, Yingqian Min, Beichen Zhang, Junjie Zhang, Zican Dong, Yifan Du, Chen Yang, Yushuo Chen, Zhipeng Chen, Jinhao Jiang, Ruiyang Ren, Yifan Li, Xinyu Tang, Zikang Liu, Peiyu Liu, Jian-Yun Nie, and Ji-Rong Wen. A survey of large language models. CoRR, abs/2303.18223, 2023.
|
| 285 |
+
Longguang Zhong, Fanqi Wan, Ruijun Chen, Xiaojun Quan, and Liangzhi Li. Blockpruner: Fine-grained pruning for large language models. CoRR, abs/2406.10594, 2024.
|
| 286 |
+
Zixuan Zhou, Xuefei Ning, Ke Hong, Tianyu Fu, Jiaming Xu, Shiyao Li, Yuming Lou, Luning Wang, Zhihang Yuan, Xiuhong Li, Shengen Yan, Guohao Dai, Xiao-Ping Zhang, Yuhan Dong, and Yu Wang. A survey on efficient inference for large language models. CoRR, abs/2404.14294, 2024.
|
| 287 |
+
Xunyu Zhu, Jian Li, Yong Liu, Can Ma, and Weiping Wang. A survey on model compression for large language models. Trans. Assoc. Comput. Linguistics, 12:1556-1577, 2024.
|
| 288 |
+
|
| 289 |
+
# A APPENDIX.
|
| 290 |
+
|
| 291 |
+
# A.1 PSEUDOCODE OF SVD-LLM
|
| 292 |
+
|
| 293 |
+
Algorithm 1 shows the pseudocode of SVD-LLM. Before compression, SVD-LLM randomly collects a small amount of sentences as calibration data $C$ , then runs the truncation-aware data whitening process as shown in Algorithm 2 to obtain the set of whitening matrix $\mathsf{Set}_S$ for the weight to compress. After that, it runs the SVD and truncation with $\mathsf{Set}_S$ on each weight matrix in the LLM. Instead of directly finishing the whole compression, it stores the decomposed matrices and further utilizes these matrices to run the parameter update with sequential low-rank approximation as shown in Algorithm 3.
|
| 294 |
+
|
| 295 |
+
Algorithm 1 Pseudocode of SVD-LLM
|
| 296 |
+
1: Input: M: Original LLM
|
| 297 |
+
2: Output: $M''$ : Compressed LLM by SVD-LLM
|
| 298 |
+
3: procedure SVD-LLM(M)
|
| 299 |
+
4: Randomly collect several sentences as the calibration data C
|
| 300 |
+
5: SetS $\leftarrow$ TRUNCATION-AWARE DATA WHITENING(M,C)
|
| 301 |
+
6: SetW $\leftarrow$ M ▷Obtain the set of weights in M to compress
|
| 302 |
+
7: for W in SetW do
|
| 303 |
+
8: S $\leftarrow$ SetS(W) ▷Extract the whitening matrix of current weight W
|
| 304 |
+
9: U, Σ, V $\leftarrow$ SVD(WS) ▷Apply singular value decomposition on W
|
| 305 |
+
10: Σ1 $\leftarrow$ Trunc.(Σ) ▷Truncate the smallest singular values in Σ
|
| 306 |
+
11: $W_u'\gets U(\Sigma_1)^{1 / 2},W_v'\gets (\Sigma_1)^{1 / 2}V^T S^{-1}$ ▷Obtain two low-rank matrices
|
| 307 |
+
12: $M'(W)\gets W_u',W_v'$ ▷Replace W with $W_u'$ and $W_v'$ in L
|
| 308 |
+
13: end for
|
| 309 |
+
14: $M''\gets$ PARAMETER UPDATE WITHSEQUENTIAL LOW-RANK APPROXIMATION(M')
|
| 310 |
+
15: return M'
|
| 311 |
+
|
| 312 |
+
Algorithm 2 Pseudocode of Truncation-Aware Data Whitening
|
| 313 |
+
1: Input: M: Original LLM
|
| 314 |
+
2: Input: C: Calibration Data
|
| 315 |
+
3: Output: SetS: Set of whitening matrices for the weight to compress in M
|
| 316 |
+
4: procedure TRUNCATION-AWARE DATA WHITENING(M, C)
|
| 317 |
+
5: SetS $\leftarrow \emptyset$ ▷ Initialize the set of whitening matrices
|
| 318 |
+
6: SetW $\leftarrow M$ ▷ Obtain the set of weights in M to compress
|
| 319 |
+
7: for W in SetW do
|
| 320 |
+
8: X $\leftarrow M(W, C)$ ▷ Obtain the input activation of the weight matrix W
|
| 321 |
+
9: S $\leftarrow$ Cholesky_Decomposition(XXT) ▷ Apply cholesky decomposition on $XX^T$
|
| 322 |
+
10: SetS $\leftarrow S \cup \text{Set}_S$ ▷ Store the whitening weight matrix in the set
|
| 323 |
+
11: end for
|
| 324 |
+
12: return SetS
|
| 325 |
+
13: end procedure
|
| 326 |
+
|
| 327 |
+
Algorithm 3 Pseudocode of Parameter Update with Sequential Low-rank Approximation
|
| 328 |
+
1: Input: $M^{\prime}$ : Compressed LLM by Truncation-aware Data Whitening
|
| 329 |
+
2: Output: $M''$ : Compressed LLM with Parameter Update with Sequential Low-rank Approximation
|
| 330 |
+
3: procedure PARAMETER UPDATE WITH SEQUENTIAL LOW-RANK APPROXIMATION( $M'$ )
|
| 331 |
+
4: $M_u' \gets \mathrm{LoRA}_u(M')$ ▷ Fix all $W_v'$ , fine-tune all $W_u'$
|
| 332 |
+
5: $M'' \gets \mathrm{LoRA}_v(M_u')$ ▷ Fix all $W_u'$ , fine-tune all $W_v'$
|
| 333 |
+
6: return $M''$
|
| 334 |
+
7: end procedure
|
| 335 |
+
|
| 336 |
+
# A.2 COMPRESSION LOSS OF ASVD
|
| 337 |
+
|
| 338 |
+
ASVD introduces a diagonal scaling matrix $S_0$ that modifies the weight matrix to reflect the varying significance of different input channels. The linear layer is formulated as $Y = (WS_0)S_0^{-1}X$ . The compression is made by keeping the largest $m$ singular value of $WS_0$ :
|
| 339 |
+
|
| 340 |
+
$$
|
| 341 |
+
W S _ {0} \approx \sum_ {i = 1} ^ {m} \sigma_ {i} ^ {\prime} u _ {i} ^ {\prime} v _ {i} ^ {\prime T}
|
| 342 |
+
$$
|
| 343 |
+
|
| 344 |
+
The resulting activation is expressed as:
|
| 345 |
+
|
| 346 |
+
$$
|
| 347 |
+
Y \approx \sum_ {i = 1} ^ {m} \sigma_ {i} ^ {\prime} u _ {i} ^ {\prime} v _ {i} ^ {\prime T} S _ {0} ^ {- 1} X.
|
| 348 |
+
$$
|
| 349 |
+
|
| 350 |
+
The compression error $L = ||(WS_0 - \sum_{i=1}^{m} \sigma_i' u_i' v_i') S_0^{-1} X||_F$ is demonstrated below:
|
| 351 |
+
|
| 352 |
+
$$
|
| 353 |
+
\begin{array}{l} L ^ {2} = \left\| \left(W S _ {0} - \sum_ {i = 1} ^ {m} \sigma_ {i} ^ {\prime} u _ {i} ^ {\prime} v _ {i} ^ {\prime T}\right) S _ {0} ^ {- 1} X \right\| _ {F} ^ {2} \\ = \left| \left| \sum_ {i = m + 1} ^ {r} \sigma_ {i} ^ {\prime} u _ {i} ^ {\prime} v _ {i} ^ {\prime T} S _ {0} ^ {- 1} X \right| \right| _ {F} ^ {2} \\ = \sum_ {j = m + 1} ^ {r} \sum_ {i = m + 1} ^ {r} \sigma_ {i} ^ {\prime} \sigma_ {j} ^ {\prime} \mathbf {T r a c e} \left(u _ {i} ^ {\prime} v _ {i} ^ {\prime T} X X ^ {T} v _ {j} ^ {\prime} u _ {j} ^ {\prime T}\right) \\ = \sum_ {j = m + 1} ^ {r} \sum_ {i = m + 1} ^ {r} \sigma_ {i} ^ {\prime} \sigma_ {j} ^ {\prime} \mathbf {T r a c e} \left(u _ {j} ^ {\prime T} u _ {i} ^ {\prime} v _ {i} ^ {\prime T} S _ {0} ^ {- 1} X X ^ {T} \left(S _ {0} ^ {- 1}\right) ^ {T} v _ {j} ^ {\prime}\right) \\ = \sum_ {i = m + 1} ^ {r} \sigma^ {\prime} _ {i} ^ {2} \mathbf {T r a c e} \left(v _ {i} ^ {\prime T} S _ {0} ^ {- 1} X X ^ {T} \left(S _ {0} ^ {- 1}\right) ^ {T} v _ {i} ^ {\prime}\right) \\ = \sum_ {i = m + 1} ^ {r} \sigma_ {i} ^ {\prime 2} | | v _ {i} ^ {\prime T} S _ {0} ^ {- 1} X | | _ {F} ^ {2}, \\ \end{array}
|
| 354 |
+
$$
|
| 355 |
+
|
| 356 |
+
which is still a complex function that involves the activation $X$ , the diagonal matrix $S_0$ , the singular vector $v_i'$ and the singular value $\sigma_i'$ . As a result, compression error is not directly related to the singular value, and the conventional SVD compression by truncating the smallest singular values may lead to suboptimal compression error.
|
| 357 |
+
|
| 358 |
+
# A.3 COMPRESSION LOSS OF SVD-LLM
|
| 359 |
+
|
| 360 |
+
In SVD-LLM, we also formulate the linear layer as $Y = (WS)S^{-1}X$ , where $S^{-1}XX^T(S^{-1})^T = I$ . The compression is made by keeping the largest $m$ out of total $r$ singular values of $WS$ . The compression loss $L$ is demonstrated as:
|
| 361 |
+
|
| 362 |
+
$$
|
| 363 |
+
\begin{array}{l} L ^ {2} = \left\| W X - W ^ {\prime} X \right\| _ {F} ^ {2} = \left\| W S S ^ {- 1} X - \mathbf {S V D} (W S) S ^ {- 1} X \right\| _ {F} ^ {2} \\ = \left\| (W S - \mathbf {S V D} (W S)) S ^ {- 1} X \right\| _ {F} ^ {2} \\ = \left\| \left(W S - \sum_ {i = 1} ^ {m} \sigma_ {i} u _ {i} v _ {i} ^ {T}\right) S ^ {- 1} X \right\| _ {F} ^ {2} \\ = \left\| \sum_ {i = m + 1} ^ {r} \sigma_ {i} u _ {i} v _ {i} ^ {T} S ^ {- 1} X \right\| _ {F} ^ {2} \\ = \sum_ {j = m + 1} ^ {r} \sum_ {i = m + 1} ^ {r} \sigma_ {i} \sigma_ {j} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} S ^ {- 1} X X ^ {T} \left(S ^ {- 1}\right) ^ {T} v _ {j} u _ {j} ^ {T}\right) \\ = \sum_ {j = m + 1} ^ {r} \sum_ {i = m + 1} ^ {r} \sigma_ {i} \sigma_ {j} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} \left(S ^ {- 1} X X ^ {T} \left(S ^ {- 1}\right) ^ {T}\right) v _ {j} u _ {j} ^ {T}\right) \\ = \sum_ {j = m + 1} ^ {r} \sum_ {i = m + 1} ^ {r} \sigma_ {i} \sigma_ {j} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} v _ {j} u _ {j} ^ {T}\right) \\ \end{array}
|
| 364 |
+
$$
|
| 365 |
+
|
| 366 |
+
$$
|
| 367 |
+
\because v _ {i} ^ {T} v _ {i} = u _ {i} ^ {T} u _ {i} = 1; v _ {i} ^ {T} v _ {j} = u _ {i} ^ {T} u _ {j} = 0, \mathbf {T r a c e} (v _ {i} v _ {i} ^ {T}) = \mathbf {T r a c e} (u _ {i} u _ {i} ^ {T}) = 1, \forall i \neq j
|
| 368 |
+
$$
|
| 369 |
+
|
| 370 |
+
$$
|
| 371 |
+
\therefore L ^ {2} = \sum_ {j = m + 1} ^ {r} \sum_ {i = m + 1} ^ {r} \sigma_ {i} \sigma_ {j} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} v _ {j} u _ {j} ^ {T}\right) = \sum_ {i = m + 1} ^ {r} \sigma_ {i} ^ {2} \mathbf {T r a c e} \left(u _ {i} v _ {i} ^ {T} v _ {i} u _ {i} ^ {T}\right) = \sum_ {i = m + 1} ^ {r} \sigma_ {i} ^ {2}
|
| 372 |
+
$$
|
| 373 |
+
|
| 374 |
+
Therefore, the squared loss $L^2$ is equal to the sum of the squared singular values. Therefore, truncating the smallest singular values achieves the lowest compression loss.
|
| 375 |
+
|
| 376 |
+
# A.4 SPECTRUM ANALYSIS OF SINGULAR VALUES DECOMPOSED BY SVD-LLM
|
| 377 |
+
|
| 378 |
+
In general, SVD is useful for compression when the matrix to be compressed shows a sharp decay of the singular values. Since SVD-LLM decomposes the multiplication of the weight matrix $W$ and its corresponding whitening matrix $S$ instead of the original weight matrix $W$ , which is different from the weight decomposition in the previous work (Yuan et al., 2023; Hsu et al., 2022), to study whether SVD compression is also applicable in SVD-LLM, we select the Query $(W_{Q})$ and Key $(W_{K})$ weight matrices and show the spectrum of singular values of their multiplication with corresponding whitening matrices $S_{Q}$ and $S_{K}$ . As shown in Figure 6, most of the single values are less than or around 100 with only a few extremely large values, indicating that SVD is applicable in SVD-LLM.
|
| 379 |
+
|
| 380 |
+
# A.5 COMPARISON WITH DRONE
|
| 381 |
+
|
| 382 |
+
Previous work DRONE (Chen et al., 2021) also proposes their data-aware method for SVD compression. They even provide a theoretical analysis to prove the optimal solution that their method achieves. Specifically, DRONE represents the low-rank compressed weight matrix $W'$ by $WM$ . It performs SVD on both weight matrix $W = U_w S_w V_w^T$ and the transpose of input activation $X^T = U_x S_x V_x^T$ and then split these decomposed matrices as follows:
|
| 383 |
+
|
| 384 |
+
$$
|
| 385 |
+
U _ {W} = \left[ \begin{array}{c c} U _ {W, r} & \bar {U} _ {W, r} \end{array} \right], S _ {W} = \left[ \begin{array}{c c} S _ {W, r} & 0 \\ 0 & 0 \end{array} \right], V _ {W} = \left[ \begin{array}{c c} V _ {W, r} & \bar {V} _ {W, r} \end{array} \right]
|
| 386 |
+
$$
|
| 387 |
+
|
| 388 |
+
$$
|
| 389 |
+
U _ {X} = \left[ \begin{array}{c c} U _ {X, t} & \bar {U} _ {X, t} \end{array} \right], S _ {X} = \left[ \begin{array}{c c} S _ {X, t} & 0 \\ 0 & 0 \end{array} \right], V _ {X} = \left[ \begin{array}{c c} V _ {X, t} & \bar {V} _ {X, t} \end{array} \right].
|
| 390 |
+
$$
|
| 391 |
+
|
| 392 |
+
where $r$ and $k$ are the rank of the $W$ and $X$ . $U_{W,r}$ , $V_{W,r}$ , $U_{X,t}$ , $V_{X,t}$ denote corresponding row spaces and column spaces and $\bar{U}_{W,r}$ , $\bar{V}_{W,r}$ , $\bar{U}_{X,t}$ , $\bar{V}_{X,t}$ are null spaces. Through theoretical deduction,
|
| 393 |
+
|
| 394 |
+

|
| 395 |
+
(a) $W_{Q}\times S_{Q}$
|
| 396 |
+
|
| 397 |
+

|
| 398 |
+
(b) $W_{K}\times S_{K}$
|
| 399 |
+
Figure 6: The singular value spectrum of the decomposed matrices across layers in LLaMA-7B.
|
| 400 |
+
|
| 401 |
+
DRONE converts the minimization of compression loss $||WX - W'X||_F = ||WX - WMX||_F$ to the minimization of $\left\| S_{W,r}V_{W,r}^T V_{X,t}S_{X,t} - S_{W,r}V_{W,r}^T MV_{X,t}S_{X,t}\right\|_F$ , whose optimal value $L_{min}$ is the rank-k truncated SVD of $Z = S_{W,r}V_{W,r}^T V_{X,t}S_{X,t}$ by the fundamental property of SVD decomposition. To achieve the optimal value, DRONE formulates a solution $M = V_{W,r}S_{W,r}^{-1}Z_kS_{X,t}^{-1}V_{X,t}^T$ , where $Z_k$ is the rank-k SVD truncation of $Z$ .
|
| 402 |
+
|
| 403 |
+
In short, compared with DRONE, SVD-LLM is also optimal with the same theoretical compression loss as DRONE. Moreover, SVD-LLM has three key advantages. Below is our detailed explanation.
|
| 404 |
+
|
| 405 |
+
SVD-LLM is also optimal with the same theoretical compression loss as DRONE. The theoretical minimum compression loss $L_{min}$ is the F-norm loss of rank-k SVD truncation of $WX$ , which has also been achieved by DRONE in their paper. Unlike DRONE, SVD-LLM constructs the whitening matrix $S$ so that $S^{-1}X$ is orthonormal. Therefore, we have $||AS^{-1}X||_F = ||A||_F$ . Suppose that we decompose $S$ with SVD to $U_s, S_s, V_s$ , we can have $S_s = S_x, U_s = U_x, U_s = U_x, V_s = QV_x$ , where $Q$ is an orthogonal matrix. The matrix $WS$ to which SVD-LLM applies SVD could be represented
|
| 406 |
+
|
| 407 |
+
Table 9: Compression loss of the randomly generated weight and activation matrices with different shapes under $50\%$ compression ratio using SVD-LLM, Drone, and the theoretical minimum.
|
| 408 |
+
|
| 409 |
+
<table><tr><td>LOSS</td><td>[128 × 128] × [128 × 128]</td><td>[2048 × 2048] × [2048 × 2048]</td><td>[4096 × 4096] × [4096 × 4096]</td></tr><tr><td>MINIMUM</td><td>276.1130</td><td>17784.2637</td><td>50321.9141</td></tr><tr><td>DRONE</td><td>276.1130</td><td>17785.6992</td><td>50337.2148</td></tr><tr><td>SVD-LLM</td><td>276.1130</td><td>17784.2676</td><td>50321.9727</td></tr></table>
|
| 410 |
+
|
| 411 |
+
Table 10: Compression Time of the randomly generated weight and activation matrices with different shapes using SVD-LLM and Drone. The compression time is measured for 5 times' compression.
|
| 412 |
+
|
| 413 |
+
<table><tr><td>TIME</td><td>[128 × 128] × [128 × 128]</td><td>[2048 × 2048] × [2048 × 2048]</td><td>[4096 × 4096] × [4096 × 4096]</td></tr><tr><td>DRONE</td><td>0.07 seconds</td><td>5.81 seconds</td><td>30.35 seconds</td></tr><tr><td>SVD-LLM</td><td>0.02 seconds</td><td>1.98 seconds</td><td>10.37 seconds</td></tr></table>
|
| 414 |
+
|
| 415 |
+
by $U_w S_w V_w^T U_s S_s V_s^T$ . Suppose that we use Trunc.(C) to represent the rank-k truncation of the matrix $C$ during SVD compression, the compression loss $L$ is derived as follows:
|
| 416 |
+
|
| 417 |
+
$$
|
| 418 |
+
\begin{array}{l} L = \| W X - W ^ {\prime} X \| _ {F} = \| \left(W S S ^ {- 1} X - \mathbf {S V D} (W S) S ^ {- 1} X\right) \| _ {F} = \| \left(W S - S V D (W S)\right) S ^ {- 1} X \| _ {F} \\ = \left\| \operatorname {T r u n c}. (W S) S ^ {- 1} X \right\| _ {F} = \left\| \operatorname {T r u n c}. (W S) \right\| _ {F} \\ = \left\| \mathbf {T r u n c} \cdot \left(U _ {w} S _ {w} V _ {w} ^ {T} U _ {s} S _ {s} V _ {s} ^ {T}\right) \right\| _ {F} = \left\| \mathbf {T r u n c}. \left(W X Q ^ {T}\right) \right\| _ {F} = L _ {\min } \\ \end{array}
|
| 419 |
+
$$
|
| 420 |
+
|
| 421 |
+
Therefore, SVD-LLM shares the same theoretical compression loss as DRONE.
|
| 422 |
+
|
| 423 |
+
Advantage #1: DRONE incurs out-of-memory when compressing LLMs due to its requirement of storing the full large-scale activations, whereas SVD-LLM is feasible. To achieve data-awareness during compression, DRONE caches all input activations $X$ and spans them to calculate the corresponding singular vectors and singular values. In the DRONE paper, the authors apply DRONE to small LMs such as BERT. However, the activations generated by LLMs are often extremely large and are much larger than BERT. For example, to compress LLaMA-7B with 5,000 calibration data by DRONE, the total memory to cache the activation for a single weight matrix at a time is 5000 (data number) × 256 (seq_len) × 11008 (dim) × 32 (fp32) ÷ 1024 ÷ 1024 ÷ 1024 = 419GB, which is more than 5 times larger than the memory provided by the NVIDIA A100 GPU, which has 80GB memory. Therefore, applying DRONE for LLM compression is infeasible.
|
| 424 |
+
|
| 425 |
+
In contrast, SVD-LLM incrementally updates its $XX^T$ matrix by adding the $xx^T$ of each new input $x$ . As such, SVD-LLM eliminates the need to store the full activations, which requires only the storage of the matrix $XX^T$ , which is considerably smaller than the full input activation. To compress LLaMA-7B with 5,000 calibration data, SVD-LLM requires only $11008 \times 11008 \times 32 \div 1024 \div 1024 \div 1024 = 3.6\mathrm{GB}$ . Compared to DRONE, SVD-LLM achieves 116.38 times less memory reduction than DRONE. In our paper, we use WikiText-2 as a dataset. If we use DRONE, the total memory to cache the activation of a single weight matrix is larger than 24,600GB. In contrast, SVD-LLM still requires 3.6GB of memory, which is more than 6,000 times less than DRONE. Due to this advantage, SVD-LLM is much more practical to compress LLMs of size 7B or larger compared to DRONE.
|
| 426 |
+
|
| 427 |
+
Advantage #2: SVD-LLM incurs much shorter compression time compared to DRONE. DRONE involves more complex matrix operations, leading to longer compression time compared to SVD-LLM. To illustrate this, we measured the time required by DRONE and SVD-LLM to compress randomly generated weight and activation matrices of varying shapes under $50\%$ compression ratio. The results show that SVD-LLM is approximately three times faster than DRONE.
|
| 428 |
+
|
| 429 |
+
Advantage #3: SVD-LLM has better numerical stability, which leads to superior empirical compression loss. While SVD-LLM shares the same theoretical compression loss as DRONE, DRONE's higher complexity—stemming from additional SVD operations and inverse calculations on large-scale matrices—makes it less numerically stable compared to SVD-LLM. This often results in higher empirical compression losses. To illustrate this, we compare SVD-LLM and DRONE in terms of empirical compression losses for randomly generated matrices of various shapes. We also include the theoretical minimum value, represented by the rank-k Frobenius norm loss of $WX$ . The results are summarized in the following table. As shown, we observe that SVD-LLM achieves lower empirical compression losses than DRONE, underscoring its superior numerical stability.
|
| 430 |
+
|
| 431 |
+
Table 11: Perplexity $(\downarrow)$ of SVD-LLM and FLAP on WikiText-2 to compress LLaMA-7B under different compression ratios. The better performance is marked in bold. The relative performance gain of SVD-LLM compared to FLAP is marked in green inside bracket.
|
| 432 |
+
|
| 433 |
+
<table><tr><td>RATIO (MEM.)</td><td>20% (10.2GB)</td><td>40% (7.76GB)</td><td>60% (5.35GB)</td><td>80% (2.58GB)</td></tr><tr><td>FLAP</td><td>7.99</td><td>14.43</td><td>106.87</td><td>15023</td></tr><tr><td>SVD-LLM</td><td>7.73 (↓3%)</td><td>9.27 (↓36%)</td><td>15.00 (↓86%)</td><td>31.79 (↓99%)</td></tr></table>
|
| 434 |
+
|
| 435 |
+
Table 12: Comparison of LLaMA-3B (compressed from LLaMA-7B by SVD-LLM) and original StableLM-3B (Tow et al.) trained from scratch. Both the throughput and the peak memory footprint during the inference are measured with batch size=32, sequence length = 128 on single A100 GPU.
|
| 436 |
+
|
| 437 |
+
<table><tr><td>MODEL</td><td>Throughput</td><td>Peak Mem.</td><td>Openb.</td><td>Arc_e</td><td>WinoG.</td><td>HellaS.</td><td>PIQA</td><td>MathQA</td><td>Average↑</td><td>TruthfulQA↑</td><td>GSM8K↑</td></tr><tr><td>StableLM-3B</td><td>8463 Tokens/sec</td><td>9.41 GB</td><td>0.19</td><td>0.51</td><td>0.55</td><td>0.47</td><td>0.69</td><td>0.21</td><td>0.44</td><td>0.22</td><td>0.02</td></tr><tr><td>LLaMA-3B</td><td>9254 Tokens/sec</td><td>7.43 GB</td><td>0.27</td><td>0.54</td><td>0.60</td><td>0.49</td><td>0.68</td><td>0.19</td><td>0.46 (↑5%)</td><td>0.23 (+0.01)</td><td>0.04 (+0.02)</td></tr></table>
|
| 438 |
+
|
| 439 |
+
# A.6 COMPARISON WITH FLAP
|
| 440 |
+
|
| 441 |
+
Recent work FLAP (An et al., 2024) is also a post-training structured-pruning method. Below we compare the perplexity of SVD-LLM and FLAP on WikiText-2 under different compression ratios when compressing LLaMA-7B. As shown in Table 11, SVD-LLM consistently outperforms FLAP, especially under high compression ratios.
|
| 442 |
+
|
| 443 |
+
# A.7 COMPARISON WITH SMALLER LLMS PRE-TRAINED FROM SCRATCH
|
| 444 |
+
|
| 445 |
+
To compare the performance between SVD-LLM and scratch training, following the previous experimental design (Ma et al., 2023), we compress LLaMA-7B to the size of the 3B parameter with SVD-LLM and select StableLM-3B (Tow et al.) as the baseline for comparison. As shown in Table 12. LLaMA-3B compressed from LLaMA-7B by SVD-LLM achieves better accuracy in all datasets, indicating that SVD-LLM could even achieve better accuracy than some scratch training methods. Furthermore, SVD-LLM ensures higher throughput and lower memory consumption than StableLM-3B as shown in the table, which also meets our efficiency analysis and discussion in Section 4.2.
|
| 446 |
+
|
| 447 |
+
Table 13: Compression time of SVD-LLM and ASVD on LLaMA-7B under $20\%$ compression ratio. The relative speedup is marked in green color inside bracket.
|
| 448 |
+
|
| 449 |
+
<table><tr><td colspan="3">SVD-LLM</td><td colspan="3">ASVD</td></tr><tr><td>Truncation-Aware Data Whitening</td><td>Parameter Update with Sequential Low-rank Approximation</td><td>Total</td><td>Normalize</td><td>Search</td><td>Total</td></tr><tr><td>10min</td><td>3.5h</td><td>3.5h (↓36%)</td><td>5min</td><td>5.5h</td><td>5.5h</td></tr></table>
|
| 450 |
+
|
| 451 |
+
# A.8 COMPRESSION SPEED EVALUATION
|
| 452 |
+
|
| 453 |
+
In addition to compression performance, we also evaluate the compression speed of SVD-LLM and the baselines. Specifically, we measured the GPU hours used for SVD-LLM and ASVD when compressing LLaMA-7B under $20\%$ compression ratio on an A100 GPU. The results are shown in Table 13. As shown, ASVD takes about 5.5 hours, while SVD-LLM completes the compression process in 3.5 hours, which is $36\%$ times faster. When breaking down the time, most of the time consumed by ASVD is dedicated to searching for the specific compression ratio for each weight matrix based on its calculated importance score. In contrast, SVD-LLM maintains a consistent compression ratio in all weight matrices and thus eliminates the time-consuming search process.
|
| 454 |
+
|
| 455 |
+
# A.9 CONTENTS GENERATED FROM LLMS COMPRESSED BY SVD-LLM AND ASVD
|
| 456 |
+
|
| 457 |
+
Some examples of sentences generated by LLaMA-7B compressed with SVD-LLM and ASVD are shown in Table 14. The sentences generated by the model compressed by SVD-LLM exhibit better fluency, relevance, and informativeness compared to those compressed by ASVD. More importantly, when the compression ratio is increased to $40\%$ , the previous state-of-the-art method ASVD completely loses its generation ability. In contrast, even when the compression ratio is up to $80\%$ , SVD-LLM is still capable of generating complete sentences.
|
| 458 |
+
|
| 459 |
+
Table 14: An example of contents generated by the fine-tuned LLaMA-7B with LoRA after being compressed by SVD-LLM and ASVD under different compression ratios. The input is marked in bold and the normal texts are the generated sentences.
|
| 460 |
+
|
| 461 |
+
<table><tr><td>RATIO</td><td>SVD-LLM</td><td>ASVD</td></tr><tr><td>Original</td><td colspan="2">What is the responsibility of the AI assistant? The responsibility of an AI assistant is to complete the job without any hesitation. Also, the AI assistant has no problem with taking a decision and executing it. An AI assistant is responsible to complete the task and it needs to learn from his past experience to take the best possible decision without any hesitation...</td></tr><tr><td>20%</td><td>What is the responsibility of the AI assistant? The AI assistant's role and responsibilities are often ambiguous and can vary depending on the context and the type of assistant being used. Some AI assistants may have preset responses to common queries, but their behavior can also depend on the user's interaction and expectations...</td><td>What is the responsibility of the AI assistant? 1. To act in the same way as the programmer intended. 2. To make a value assessment of the user's intentions and offer an appropriate response. 3. To help the user carry out specific tasks or follow a strict script. 4. To make the system as independent of the user as possible...</td></tr><tr><td>40%</td><td>What is the responsibility of the AI assistant? 1. The AI assistant is responsible for performing tasks that can only be done by AI technology such as scheduling appointments, setting reminders and making suggestions, while also providing quick and accurate responses. 2. The AI assistant is also responsible for learning and updating its knowledge base through continuous improvement, thus making it more efficient and effective. 3. The AI assistant is responsible for handling and managing user-generated and customer-oriented input...</td><td>What is the responsibility of the AI assistant? 1. Define the definition of the job specification. 2. Define the role of the AI assistant for the job. 3. Define the skills necessary in order to carryout the tasks assigned to the job to do the work of the same capacity in the market. 4. Determine the evaluation of the job competence of the AI assistant to ensure their professional integrity. 5. What type of AI assistant jobs are available? 6. What industries require technology assistance work to complete the tasks that it own personnel cannot perform...</td></tr><tr><td>60%</td><td>What is the responsibility of the AI assistant? In a nutshell, the responsibility of the AI assistant could vary depending on the task, but generally, the focus would be on automatic tasks, without the need for human intervention. Some common tasks could include setting reminders, scheduling appointments, and making routine household or productivity tasks. The AI assistant also serves as a backup or a relief system, taking on responsibilities when the user is not available...</td><td>What is the responsibility of the AI assistant? 2.3. ?? Brush for a discussion I wonder is it worth doing is important.2- It isn't useful just reducing labor costs; it helps employees feel a sense of connected to your attention which leads to better workplace values among staffers and leads to long relationships among org...</td></tr><tr><td>80%</td><td>What is the responsibility of the AI assistant? Our Design is based on our understanding of the world, and we are actively learning, adapting and adapting, so we're always evolving new ideas, which we see to be most unique and relevant in our community...</td><td>What is the responsibility of the AI assistant? ygua AIeltemperatren/2, (64mbz/.3/.1/, 7.kbld.org.0/2/ In these puthebout les bnvols n marginals ...</td></tr></table>
|
| 462 |
+
|
| 463 |
+
# A.10 MORE ABLATION STUDIES
|
| 464 |
+
|
| 465 |
+
SVD-LLM + Normal LoRA Fine-tuning v.s. SVD-LLM + Sequential LoRA fine-tuning. To illustrate the superiority of the designed parameter update with the sequential low-rank approximation in SVD-LLM, which is a kind of sequential LoRA fine-tuning strategy over the normal LoRA fine-tuning strategy, we compare the compression performance of SVD-LLM by applying either of these two fine-tuning strategies. Let's denote SVD-LLM (SFT) as SVD-LLM by applying sequential LoRA fine-tuning and SVD-LLM (NFT) as SVD-LLM by applying normal LoRA fine-tuning. As shown in Table 15, SVD-LLM (SFT) consistently outperforms SVD-LLM (NFT), which also reaffirms our analysis in Section 3.2 that optimizing both low-rank matrices $W_{u}$ , $W_{v}$ at the same time is not stable and may lead to poor fine-tuning performance.
|
| 466 |
+
|
| 467 |
+
ASVD + Sequential LoRA Fine-tuning v.s. SVD-LLM + Sequential LoRA Fine-tuning. Although the designed sequential LoRA fine-tuning strategy could also be applied in other SVD-based LLM compression methods, other methods' performance is still poorer than SVD-LLM even when integrated with this strategy for enhancement. To illustrate this, we compare the performance of the
|
| 468 |
+
|
| 469 |
+
Table 15: Perplexity $(\downarrow)$ of SVD-LLM with original LoRA fine-tuning (denoted as SVD-LLM (SFT)), ASVD with sequential LoRA fine-tuning (denoted as ASVD (SFT)), and SVD-LLM with sequential LoRA fine-tuning (denoted as SVD-LLM (SFT)) on WikiText-2 to compress LLaMA-7B under different compression ratios.
|
| 470 |
+
|
| 471 |
+
<table><tr><td>RATIO (MEM.)</td><td>20% (10.2GB)</td><td>40% (7.76GB)</td><td>60% (5.35GB)</td><td>80% (2.58GB)</td></tr><tr><td>SVD-LLM (NFT)</td><td>7.87</td><td>11.98</td><td>16.30</td><td>80.23</td></tr><tr><td>ASVD (SFT)</td><td>8.37</td><td>14.86</td><td>44.81</td><td>271</td></tr><tr><td>SVD-LLM (SFT)</td><td>7.73</td><td>9.27</td><td>15.00</td><td>31.79</td></tr></table>
|
| 472 |
+
|
| 473 |
+
previous state-of-the-art method ASVD when applied with the sequential LoRA finetuning with SVD-LLM. Let's denote SVD-LLM (SFT) as SVD-LLM by applying sequential LoRA fine-tuning and ASVD (SFT) as ASVD by applying sequential LoRA fine-tuning. As shown in Table 15, SVD-LLM (SFT) consistently outperforms ASVD (SFT) under various compression ratios.
|
| 474 |
+
|
| 475 |
+
# A.11 LIMITATIONS
|
| 476 |
+
|
| 477 |
+
There are three limitations of SVD-LLM, which are left for future work.
|
| 478 |
+
|
| 479 |
+
(1) The compression accuracy still needs to be improved under the high compression ratio. Although SVD-LLM has achieved the state-of-the-art performance compared to previous works such as FWSVD and ASVD, its compression accuracy still suffers from degradation, especially under the high compression ratio. To enhance the practicability of SVD-LLM in real-world scenario, its accuracy should be at least comparable to that of the quantization method, including both low-bit and high-bit quantization, rather than being combined with the quantization methods for usage.
|
| 480 |
+
(2) The latency of SVD-LLM needs to be optimized while being used to compress the KV cache. As discussed in Section 4.2, SVD-LLM can also be applied to compress the KV cache for memory saving during inference. However, this benefit does not come free. In fact, due to the additional calculation caused by recovering the original key and value states, the inference speed will be impacted by compressing the KV cache with SVD-LLM, which should be optimized in the future.
|
| 481 |
+
(3) SVD-LLM should be better guided for high-quality generation. Although SVD-LLM achieves low perplexity, as demonstrated in Table 1, it is still possible to generate low-quality content, such as repeated words even under low compression ratios. This phenomenon of compressed LLM has also been mentioned in previous work (Ma et al., 2023) and should be eliminated in the future by guiding the compressed LLM for outputting high-quality generation.
|
2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c174f1c0354405391ff8c46effd21888269022e5bd7330539251e7ca80fe22ca
|
| 3 |
+
size 1153560
|
2025/SVD-LLM_ Truncation-aware Singular Value Decomposition for Large Language Model Compression/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/554f4c7b-d050-464f-a824-73ee41073dde_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/554f4c7b-d050-464f-a824-73ee41073dde_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/554f4c7b-d050-464f-a824-73ee41073dde_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:bd43434aad2de18ccf2fd65ff0d7913b5c1c7fc493fbbb6bb686a8aed9876a6c
|
| 3 |
+
size 15661203
|
2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/full.md
ADDED
|
@@ -0,0 +1,574 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SVG: 3D STEREOSCOPIC VIDEO GENERATION VIA DENOISING FRAME MATRIX
|
| 2 |
+
|
| 3 |
+
Peng Dai $^{1,2*}$ Feitong Tan $^{1\dagger}$ Qiangeng Xu $^{1\dagger}$ David Futschik $^{1}$ Ruofei Du $^{1}$
|
| 4 |
+
|
| 5 |
+
Sean Fanello $^{1}$ Xiaojuan Qi $^{2}$ Yinda Zhang $^{1}$
|
| 6 |
+
|
| 7 |
+
$^{1}$ Google $^{2}$ The University of Hong Kong
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
Video generation models have demonstrated great capability of producing impressive monocular videos, however, the generation of 3D stereoscopic video remains under-explored. We propose a pose-free and training-free approach for generating 3D stereoscopic videos using an off-the-shelf monocular video generation model. Our method warps a generated monocular video into camera views on stereoscopic baseline using estimated video depth, and employs a novel frame matrix video inpainting framework. The framework leverages the video generation model to inpaint frames observed from different timestamps and views. This effective approach generates consistent and semantically coherent stereoscopic videos without scene optimization or model fine-tuning. Moreover, we develop a disocclusion boundary re-injection scheme that further improves the quality of video inpainting by alleviating the negative effects propagated from disoccluded areas in the latent space. We validate the efficacy of our proposed method by conducting experiments on videos from various generative models, including Sora (Brooks et al., 2024), Lumiere (Bar-Tal et al., 2024), WALT (Gupta et al., 2023), and Zeroscope (Wang et al., 2023a). The experiments demonstrate that our method has a significant improvement over previous methods. Project page at https://daipengwa.github.io/SVG_ProjectPage/
|
| 12 |
+
|
| 13 |
+
# 1 INTRODUCTION
|
| 14 |
+
|
| 15 |
+
As VR/AR technology advances, the demand for creating stereoscopic content and delivering immersive 3D experiences to users continues to grow. Due to visual sensitivity, binocular stereoscopic content should feature flawless 3D and semantic consistency between both eye views, as well as seamless temporal consistency across frames. While monocular video generation models have been extensively researched and methods are now capable of synthesizing high-fidelity videos that adhere to complex text prompts (Brooks et al., 2024), there has not been much progress in the realm of generating 3D stereoscopic videos at the scene level. One reason for this gap lies in the substantial amount of monocular video data that is readily available, contrasted with the scarcity of stereo video data for training models to generate stereoscopic videos directly.
|
| 16 |
+
|
| 17 |
+
An emergent solution is to convert generated monocular videos into stereoscopic videos using novel view synthesis (Li et al., 2023; Liu et al., 2023b). However, these methods usually overly rely on camera pose estimation, which is a challenging task on its own either using SFM (Schönberger & Frahm, 2016) or joint optimization (Liu et al., 2023b), and as a result tend to be unstable, particularly in dynamic scenes where cameras experience subtle motions or when the content is dominated by dynamic objects with temporally varying appearances, both of which are prevalent in generated videos. Consequently, these methods fail in optimizing 3D scenes and offer low-quality solutions to the task (see Fig. 3). Moreover, these approaches are based on reconstruction, lacking the generative ability to hallucinate occluded regions in the novel views that do not appear in any of the remaining video frames.
|
| 18 |
+
|
| 19 |
+
In this paper, we propose an alternative pose-free and training-free framework, for the sake of robustness and generalization capability, that operates solely by exploiting inference of an off-the
|
| 20 |
+
|
| 21 |
+
shelf video generation model (Wang et al., 2023a) to generate high-quality 3D stereoscopic videos. Our initial attempt follows a typical 2D to 3D image uplifting methodology (Hollein et al., 2023) and extends it into the video domain. Specifically, we first generate a monocular video as the left view, which is then warped into the right view using estimated monocular depths (Yang et al., 2024), where we apply temporal-spatial smoothing to improve the consistency of the estimated depths. Subsequently, we leverage an off-the-shelf video generation model's ability (Wang et al., 2023a) to generate natural videos, by adding noise and denoising the warped video frames to inpaint the disoccluded regions, inspired by diffusion-based image inpainting (Avrahami et al., 2023).
|
| 22 |
+
|
| 23 |
+
However, this naive pipeline does not produce appealing results: inpainting the right-view video frames independently, without referencing the left view, typically generates semantically mismatched content. To address this problem, we propose a novel representation, called the frame matrix, which contains frame sequences observed from a number of viewpoints evenly distributed along the baseline between two eyes. The frame sequences along the view direction (rows of the matrix) form videos with camera motion, while the frame sequences along the time direction (columns of the matrix) form videos with scene motions (see Fig. 1 second column). Since the video diffusion model has video prior for both scene and camera motions, we propose to jointly update the entire frame matrix from both directions. In each denoising step, we use resample techniques (Lugmayr et al., 2022) by alternatively denoising frame sequences along the view and the time directions. Finally, we obtain a semantically consistent and temporally smooth 3D stereoscopic video by taking the leftmost and the rightmost frame sequences to represent the left-eye view and the right-eye view, respectively.
|
| 24 |
+
|
| 25 |
+
Furthermore, we note that the inevitable resolution downsampling operation in most video generation models with latent encoding (Brooks et al., 2024; Bar-Tal et al., 2024; Wang et al., 2023a; Gupta et al., 2023) is detrimental to the video inpainting task. During encoding, the dark pixels created by disocclusion can degrade the features near the disocclusion boundary, leading to undesirable artifacts (see Fig. 5). Instead of following the inpainting scheme proposed in previous work (Avrahami et al., 2023), which encodes the latent feature only once, we iteratively update both the disoccluded regions in the image space and the latent feature map with generated content during the diffusion process. This approach re-injects the generated content into the disocclusion boundary, which mitigates the negative impact of disoccluded regions in downsampling and effectively prevents the artifacts.
|
| 26 |
+
|
| 27 |
+
To validate the efficacy of our proposed method, we generate stereoscopic videos from monocular videos generated by Sora, Lumiere, WALT, and Zeroscope. Both qualitative and quantitative evaluations suggest that our approach outperforms other baselines in 3D stereoscopic video generation. Our contributions are summarized as follows:
|
| 28 |
+
|
| 29 |
+
- We design a novel pipeline to generate 3D stereoscopic videos. Unlike previous work, our method does not need camera pose estimation or fine-tuning on specific datasets.
|
| 30 |
+
- We propose a novel frame matrix representation that regularizes the diffusion-based video inpainting to generate semantically consistent and temporally smooth content.
|
| 31 |
+
- We propose a re-injection scheme that drastically reduces the negative influence of disoccluded regions in latent space and produces high-quality results.
|
| 32 |
+
- We conduct comprehensive experiments that show the superiority of our approach over previous methods for 3D stereoscopic video generation.
|
| 33 |
+
|
| 34 |
+
# 2 RELATED WORK
|
| 35 |
+
|
| 36 |
+
Video Generation. Video generation (Wang et al., 2023a; Brooks et al., 2024; Bar-Tal et al., 2024; Gupta et al., 2023; Harvey et al., 2022; Ho et al., 2022a,b; Singer et al., 2022) has achieved tremendous progress since the advent of the diffusion model (Ho et al., 2020). Taking into account the dataset requirements and scarcity of tagged videos, a prominent approach for video generation is to extend pre-trained image generation models (Rombach et al., 2022; Sahara et al., 2022; Ramesh et al., 2022) by inserting additional temporal layers and then fine-tuning them on video data (Guo et al., 2023; Blattmann et al., 2023; Wu et al., 2023b). To further improve the compute efficiency and enable long clip processing, WALT (Gupta et al., 2023) and Lumiere (Bar-Tal et al., 2024) proposed to compress the video in both the temporal and spatial dimensions. More recently, Sora (Brooks et al., 2024) adopted a transformer diffusion architecture (Peebles & Xie, 2023) and was trained on large-scale video datasets to produce impressive video generation results. Different from previous
|
| 37 |
+
|
| 38 |
+
video generation models focusing on producing higher-quality and longer monocular videos, our method orthogonally explores the possibility of leveraging pre-trained video generation models for stereoscopic 3D video generation.
|
| 39 |
+
|
| 40 |
+
Novel View Synthesis. Great progress has been made for novel view synthesis in both static and dynamic scenes (Mildenhall et al., 2021; Yoon et al., 2020; Li et al., 2022b; Kerbl et al., 2023; Müller et al., 2022; Tucker & Snavely, 2020; Han et al., 2022; Li et al., 2022a; Wang et al., 2023b). Tucker & Snavely (2020) convert a single image into a multi-plane representation for view synthesis. Mildenhall et al. (2021) proposed to encode the static scene into neural radiance fields (NeRF), which were then used for novel view synthesis through volume rendering. For more challenging scenes with dynamic content, follow-up works additionally optimized a deformation field (Park et al., 2021a; Huang et al., 2023; Park et al., 2021b) or scene flow fields (Li et al., 2021b) to handle the motion of dynamic objects. Instead of encoding the scene into a NeRF, DynIBaR (Li et al., 2023) leveraged nearby frames for rendering novel view images, and dynamic objects were handled by optimized motion fields. Different from methods requiring pre-computed camera poses, RoDynRF (Liu et al., 2023b) jointly optimized the NeRF and camera poses from scratch. Concurrently, FVS (Lee et al., 2023) achieves novel view video synthesis using a plane-based scene representation. Although these approaches produce high-quality renderings, they are limited to scenes where the camera pose can be accurately estimated and have limited synthesis capability. In contrast, our method explicitly avoids having to estimate camera poses and possesses the ability to hallucinate unseen content.
|
| 41 |
+
|
| 42 |
+
3D Content Creation and Inpainting. Automated 3D content creation (Höllein et al., 2023; Dai et al., 2024; Gao et al., 2024; Yu et al., 2023; Chen et al., 2024) is another related area, with emerging approaches such as inpainting (Ho et al., 2022a) or multi-view generators (Liu et al., 2023a; Wang et al., 2024; Zuo et al., 2024). Recently, Text2Room (Höllein et al., 2023) proposed creating a 3D room by warping an image into novel views and using a text-guided inpainter to deal with disocclusions. WonderJourney (Yu et al., 2023) made this process automatic by including a large language model in the loop. Similar to creating static scenes, we could use pretrained video inpainter (Zhou et al., 2023; Li et al., 2022c) for dynamic 3D content creation, however, these models suffer from generalization problems in creating high-quality, consistent 3D content. Lastly, Deep3D (Xie et al., 2016) is trained using 3D movies, with the goal of converting 2D videos into stereoscopic videos. However, the training data is not publicly available and it lacks the flexibility to modify videos for creative purposes, such as different stereo baselines. In this paper, we explore the possibilities of using video generation models for 3D video creation without training on specific, hard-to-obtain datasets.
|
| 43 |
+
|
| 44 |
+
# 3 STEREOSCOPICVIDEO GENERATION
|
| 45 |
+
|
| 46 |
+
Conditioned on a text prompt or a single image $c$ , our method aims to generate 3D stereoscopic video $\{\mathbf{X}_l, \mathbf{X}_r\}$ , consisting of two monocular sequences. The most straightforward way is to use a diffusion-based generation model $\mathcal{G}$ :
|
| 47 |
+
|
| 48 |
+
$$
|
| 49 |
+
\left\{\mathbf {X} _ {l}, \mathbf {X} _ {r} \right\} = \mathcal {G} \left(\left\{\epsilon_ {t} \mid t = 1, \dots , T \right\}, c\right), \tag {1}
|
| 50 |
+
$$
|
| 51 |
+
|
| 52 |
+
where $\epsilon_t \sim \mathcal{N}(\mathbf{0},\mathbf{I})$ is the sampled noise at step $t$ . The generated stereoscopic videos should possess the following characteristics: First, the appearance and semantics between the left eye view $\mathbf{X}_l$ and right eye view $\mathbf{X}_r$ should be consistent and be temporally stable. Second, the stereo effect should be prominent and immersive. Last, the generated content should be diverse and controllable with the given conditioning.
|
| 53 |
+
|
| 54 |
+
However, training a $\mathcal{G}$ that can directly generate stereo videos $\{\mathbf{X}_l,\mathbf{X}_r\}$ with the desired properties requires a vast dataset of stereo videos with diverse content. Due to the scarcity of such data, we propose a training-free approach that relies on an off-the-shelf depth estimator (Yang et al., 2024) and a diffusion-based monocular video generation model $\mathcal{G}$ such as Zeroscope (Wang et al., 2023a). We first generate a monocular video for one eye using a video diffusion model (Eq. 2), then obtain the other video view by conditioning on the first video. To automatically preserve 3D consistency, we implement this conditioning by estimating depth $\mathbf{d}_l$ for the left video and warp its content to obtain the right view sequence $\mathbf{X}_{l\rightarrow r}$ with disocclusion masks $\mathbf{M}_r$ (Eq. 3) according to the stereoscopic baseline (Wang et al., 2023b; Han et al., 2022). Then, we use $\mathcal{G}$ again to inpaint the disoccluded parts by denoising inpainting process (Avrahami et al., 2023; Lugmayr et al., 2022) (Eq. 4), obtaining the
|
| 55 |
+
|
| 56 |
+

|
| 57 |
+
Figure 1: Overview - Top: Given a text prompt, our method first uses a video generation model to generate a monocular video, which is warped (using estimated depth) into pre-defined camera views to form a frame matrix with disocclusion masks $M$ . Then, the disoccluded regions are inpainted by denoising the frame sequences within the frame matrix. After denoising, we select the leftmost and the rightmost columns and decode them to obtain a 3D stereoscopic video. Bottom: Details of denoising frame matrix. We initialize the latent matrix $\mathbf{z}_T$ as a random noise map. For each noise level, we extend the resampling mechanism (Karnewar et al., 2023; Lugmayr et al., 2022) to alternatively denoise temporal (column) sequences and spatial (row) sequences $N$ times. Each time, row or column sequences are denoised and inpainted (see Fig.2). By denoising along both spatial and temporal directions, we obtain an inpainted latent $\mathbf{z}_0$ which can be decoded into temporally smooth and semantically consistent sequences.
|
| 58 |
+
|
| 59 |
+
other eye view video $\mathbf{X}_r$
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathbf {X} _ {l} = \mathcal {G} \left(\left\{\epsilon_ {t} \mid t = 1, \dots , T \right\}, c\right), \tag {2}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
$$
|
| 66 |
+
\mathbf {X} _ {l \rightarrow r}, \mathbf {M} _ {r} = \operatorname {W a r p} _ {l \rightarrow r} \left(\mathbf {X} _ {l}, \mathbf {d} _ {l}\right), \tag {3}
|
| 67 |
+
$$
|
| 68 |
+
|
| 69 |
+
$$
|
| 70 |
+
\mathbf {X} _ {r} = \mathcal {G} \left(\left\{\epsilon_ {t} \mid t = 1, \dots , T \right\}, c, \mathbf {X} _ {l \rightarrow r}, \mathbf {M} _ {r}\right). \tag {4}
|
| 71 |
+
$$
|
| 72 |
+
|
| 73 |
+
In Sec. 3.1, we describe the video depth warping. In Sec. 3.2, we introduce the frame matrix representation for the video inpainting. Our denoising frame matrix drastically improves the semantic similarity between $\mathbf{X}_l$ and $\mathbf{X}_r$ and helps preserve temporal smoothness. Last but not least, a disocclusion boundary re-injection mechanism is introduced to further improve the inpainting quality in Sec. 3.3. An overview of our method is displayed in Fig. 1.
|
| 74 |
+
|
| 75 |
+
# 3.1 MONOCULARVIDEO DEPTH WARPING
|
| 76 |
+
|
| 77 |
+
The depth estimation model (Yang et al., 2024) is applied to predict all frames' depth values, which will be smoothed to produce more consistent video depths. Specifically, we utilize the estimated optic flows (Teed & Deng, 2020) to align consecutive depth frames. The outliers in predicted depths will be suppressed by convolving with a Gaussian kernel along the time axis. After obtaining RGB-D frames, we can warp them into target camera views where disoccluded regions appear. In addition, the warped images usually contain isolated pixels, and the foreground and background are entangled, which jeopardizes video quality (Dai et al., 2020). To handle these problems, we follow Dai et al. (2020) to project points into multi-plane images (Zhou et al., 2018), then remove isolated pixels and cracks and finally obtain a noisy-points-free image. (See supplemental material Sec. C for details).
|
| 78 |
+
|
| 79 |
+
# 3.2VIDEO INPAINTING WITH FRAME MATRIX
|
| 80 |
+
|
| 81 |
+
The inpainting pipeline plays a key role in ensuring spatial/semantic and temporal consistency. While image inpainting approaches (Avrahami et al., 2023; Lugmayr et al., 2022) provide a reasonable baseline, the results lack temporal and spatial stability. Therefore, we introduce a Frame Matrix representation, which addresses both issues.
|
| 82 |
+
|
| 83 |
+
Single Video Denoising Inpainting Inspired by RePaint (Lugmayr et al., 2022), we extend the diffusion-based image inpainting to video inpainting. We use the video generation model $\mathcal{G}$ (i.e.,
|
| 84 |
+
|
| 85 |
+
Zeroscope (Wang et al., 2023a)) as our inpainting tool, which is a latent diffusion model consisting of a VAE encoder $\mathcal{E}$ , a decoder $\mathcal{D}$ and a latent denoiser $\{\epsilon_{\theta}, \Sigma_{\theta}\}$ . First, the warped video is fed into the VAE encoder to obtain video latent features $\mathbf{z}_0^{\mathrm{known}} = \mathcal{E}(\mathbf{X}_{l \rightarrow r})$ . Then, we resize the image disocclusion masks $\mathbf{M}_r$ to the resolution of the latent and obtain latent disocclusion masks $\mathbf{m}$ . During the denoising process, we start from a random noisy latent map $\mathbf{z}_T \sim \mathcal{N}(\mathbf{0}, \mathbf{I})$ . For each subsequent step $t$ , we sample a new intermediate noisy latent map from $\mathbf{z}_0$ (Eq. 5), denoises the latent map from the last step $\mathbf{z}_t$ (Eq. 6) and combine them with $\mathbf{m}$ to obtain the $\mathbf{z}_{t-1}$ (Eq. 7). We visualize the following steps in Fig. 2 (b):
|
| 86 |
+
|
| 87 |
+
$$
|
| 88 |
+
\mathbf {z} _ {t - 1} ^ {\text {k n o w n}} \sim \mathcal {N} \left(\sqrt {\bar {\alpha} _ {t}} \mathbf {z} _ {0} ^ {\text {k n o w n}}, (1 - \bar {\alpha} _ {t}) \mathbf {I}\right), \tag {5}
|
| 89 |
+
$$
|
| 90 |
+
|
| 91 |
+
$$
|
| 92 |
+
\mathbf {z} _ {t - 1} ^ {\text {u n k n o w n}} \sim \mathcal {N} \left(\frac {1}{\sqrt {1 - \beta_ {t}}} \left(\mathbf {z} _ {t} - \frac {\beta_ {t}}{\sqrt {1 - \bar {\alpha} _ {t}}} \epsilon_ {\theta} \left(\mathbf {z} _ {t}, c, t\right)\right), \Sigma_ {\theta} \left(\mathbf {z} _ {t}, c, t\right)\right), \tag {6}
|
| 93 |
+
$$
|
| 94 |
+
|
| 95 |
+
$$
|
| 96 |
+
\mathbf {z} _ {t - 1} = m \odot \mathbf {z} _ {t - 1} ^ {\text {k n o w n}} + (1 - m) \odot \mathbf {z} _ {t - 1} ^ {\text {u n k n o w n}}, \tag {7}
|
| 97 |
+
$$
|
| 98 |
+
|
| 99 |
+
where $\bar{\alpha}_t$ and $\beta_{t}$ denote the total noise variance and one step noise variance at $t$ , respectively; $\epsilon_{\theta}(\mathbf{z}_t,c,t)$ and $\Sigma_{\theta}(\mathbf{z}_t,c,t)$ are predicted noise and variance for noisy latent map at $t - 1$ step. Finally, we can obtain the inpainted right view sequence $X_{r}$ by decoding the denoised latent $X_{r} = \mathcal{D}(\mathbf{z}_{0})$
|
| 100 |
+
|
| 101 |
+
By applying the above video inpainting scheme for the right view, we implement Eq. 4 and successfully hallucinate the disoccluded (unknown) regions while preserving the unoccluded (known) regions. The video diffusion model also ensures temporal smoothness. However, the inpainted content on the right view usually lacks semantic consistency w.r.t. the left view, as shown in the third column of Fig. 4. This is because we only condition on the left view by depth warping, while dropping the conditioning during inpainting.
|
| 102 |
+
|
| 103 |
+
Frame Matrix Representation. We propose a novel representation-frame matrix, which targets consistent dynamic content generation across space and time. As shown in Fig. 1 top, it is a matrix consisting of multiple frames, where each row represents frames observed from different camera poses at the same time stamp, and each column is a video recorded by a fixed camera at different time stamps. Consequently, the frame matrix can be defined as:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
\mathbf {X} \equiv \left[ \begin{array}{c c c} | & & | \\ \mathbf {x} _ {(; 0)} & \dots & \mathbf {x} _ {(; V)} \\ | & & | \end{array} \right] \equiv \left[ \begin{array}{c c c} - & \mathbf {x} _ {(0,:)} & - \\ & \vdots & \\ - & \mathbf {x} _ {(S,:)} & - \end{array} \right]
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
where $S$ and $V$ are the largest indices of time steps and views, respectively. A view sequence (row) $\mathbf{X}_{(s,:)}$ forms a video with camera motions, while a time sequence (column) $\mathbf{X}_{(:,v)}$ forms a video with time-varying scene motions. Since the video diffusion model can denoise a sequence to a temporally and semantically consistent video, jointly denoise the rows and columns can ensure consistency spatially and temporally. Finally, we can obtain a 3D stereoscopic video by taking the leftmost and the rightmost time sequences $\mathbf{X}_{(:,0)}, \mathbf{X}_{(:,V)}$ .
|
| 110 |
+
|
| 111 |
+
Constructing Frame Matrix. We evenly add $V$ camera views distributed along the baseline between the two eyes with the same orientation of the reference view. Then, we warp the reference video (the 0th column) based on depth (Sec. 3.1) into these views and obtain $\mathbf{X}_{\text{warp}} \equiv \left[\mathbf{X}_{(:,0)}, \mathbf{X}_{(:,0 \to 1)}, \dots, \mathbf{X}_{(:,0 \to V)}\right]$ with a disocclusion masks matrix $\mathbf{M}$ .
|
| 112 |
+
|
| 113 |
+
Denoising Frame Matrix. Similar to single video sequence inpainting, we encode frame matrix into a latent frame matrix $\mathbf{z}_0^{\mathrm{known}} = \mathcal{E}(\mathbf{X}_{\text{warp}})$ , and resize $\mathbf{M}$ to obtain latent disocclusion map $\mathbf{m}$ . We also initialize $\mathbf{z}_T \sim \mathcal{N}(\mathbf{0}, \mathbf{I})$ . As shown in Fig.1 (Bottom), for each noise level, we extend the resampling mechanism (Lugmayr et al., 2022) to alternatively denoise column sequences and row sequences $N$ times. Each time, row or column sequences are denoised following Eq. 5-7 and we add back noise between every resampling iteration:
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
\mathbf {z} _ {t} \sim \mathcal {N} \left(\sqrt {1 - \beta_ {t - 1}} \mathbf {z} _ {t - 1}, \beta_ {t - 1} \mathbf {I}\right). \tag {8}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
Please refer to Sec.B in the supplemental material. By denoising along these two directions alternatively, the spatial and temporal sequences will proceed toward a harmonic state.
|
| 120 |
+
|
| 121 |
+
High-level motivation of Frame Matrix. In practice, 3D stereoscopic videos can be produced by recording with two cameras (time-direction videos). Since both cameras are capturing the same
|
| 122 |
+
|
| 123 |
+

|
| 124 |
+
Figure 2: Denoising Inpainting. This figure visualizes the operations in the purple box of Fig.1. (a) We re-inject the generated content from a denoised latent $\widetilde{\mathbf{z}}_0$ to update $\mathbf{z}_0^{known}$ and reduce its feature corruption on the disocclusion boundary. (b) A noisy latent $\mathbf{z}_t$ is denoised to $\mathbf{z}_{t-1}^{unkown}$ . We take its disoccluded region and combine it with the unoccluded region of $\mathbf{z}_0^{known}$ .
|
| 125 |
+
|
| 126 |
+
scene, gradually moving the left camera toward the right camera also results in a coherent video (space-direction video). Likewise, it is essential to consider both the time and spatial directions when generating the 3D stereoscopic video to ensure that both perspectives represent the same scene. Additionally, compared to direct inpainting a large region all at once, gradually expanding the inpainting area (spatial direction) tends to be easier and can lead to more stable and plausible results. More analysis is in supplementary material Sec. D.
|
| 127 |
+
|
| 128 |
+
# 3.3 DISOCCLUSION BOUNDARY RE-INJECTION
|
| 129 |
+
|
| 130 |
+
Since most video generation models are using latent diffusion, the disoccluded dark regions of $\mathbf{X}_{\text {warp }}$ will be propagated beyond the latent mask $\mathbf{m}$ during VAE encoding (e.g., Zeroscope downsamples by $8 \times$ ), leading to defective latent features on $\mathbf{z}_0^{\text {known }}$ 's disocclusion boundary. This would lead to artifacts in the final results (Fig. 5 left).
|
| 131 |
+
|
| 132 |
+
We propose to re-inject the denoised information in the disoccluded regions to improve the latents on this boundary. Specifically, we predict the denoised latent features (Ho et al., 2020), which are decoded into a denoised video (Eq. 9). Then, we replace its unoccluded regions with warped pixels to form a video that is faithful to the reference view but with better disocclusion pixels. By encoding this video, we can get a updated $\mathbf{z}_0^{\mathrm{known}}$ (Eq. 10) which alleviates corruption on the boundary:
|
| 133 |
+
|
| 134 |
+
$$
|
| 135 |
+
\widetilde {\mathbf {X}} _ {0} = \mathcal {D} (\widetilde {\mathbf {z}} _ {0}), \text {w h e r e} \widetilde {\mathbf {z}} _ {0} = \frac {1}{\sqrt {\bar {\alpha} _ {t}}} \left(\mathbf {z} _ {t} - \sqrt {1 - \bar {\alpha} _ {t}} \epsilon_ {\theta} (\mathbf {z} _ {t}, c, t)\right), \tag {9}
|
| 136 |
+
$$
|
| 137 |
+
|
| 138 |
+
$$
|
| 139 |
+
\mathbf {z} _ {0} ^ {\text {k n o w n}} = \mathcal {E} \left(\mathbf {M} \odot \mathbf {X} _ {\text {w a r p}} + (1 - \mathbf {M}) \odot \tilde {\mathbf {X}} _ {0}\right). \tag {10}
|
| 140 |
+
$$
|
| 141 |
+
|
| 142 |
+
After this, this improved $\mathbf{z}_0^{\mathrm{known}}$ can be used in Eq. 5 for the next iteration.
|
| 143 |
+
|
| 144 |
+
# 4 EXPERIMENTS
|
| 145 |
+
|
| 146 |
+
Datasets. To validate the effectiveness of our method, we conduct experiments using a variety of recent video generation models, including Sora (Brooks et al., 2024), Lumiere (Bar-Tal et al., 2024), WALT (Gupta et al., 2023), and Zeroscope (Wang et al., 2023a). These models produce diverse left videos from a wide range of input text prompts, covering subjects such as humans, animals, buildings, and imaginary content.
|
| 147 |
+
|
| 148 |
+
Implementation Details. To ensure the stereo effect appears realistic, we normalize the up-to-scale depth values predicted by the depth estimation model (Yang et al., 2024) to a range of (1, 10) and set the baseline between left and right views to 0.08. The frame matrix is constructed by evenly placing 8 cameras between the left and right views, with each camera corresponding to a warped video sequence. Due to the limitations of the Zeroscope model, we currently conduct experiments on video sequences with 16 frames. Following the approach of RePaint (Lugmayr et al., 2022), we employ DDPM (Ho et al., 2020) as our denoising scheduler with 1000 total time steps $T$ and 50 denoising steps, resulting in 20 time step jumps per denoising step. During the initial 25 denoising steps (50 to 25), we resample 8 times at each step to establish a reasonable structure in disoccluded regions. For the remaining steps, we reduce resampling to 4 times and denoise only the right view for improved efficiency while generating stereoscopic videos. Currently, our implementation runs on an A6000 GPU and takes $\sim 8$ minutes to generate stereoscopic video using only $\sim 10\mathrm{GB}$ of RAM.
|
| 149 |
+
|
| 150 |
+
Baselines. We compare our method with two families of approaches: video inpainting, and novel view synthesis from a monocular video. For video inpainting approaches, we generate the right view in the same manner as our method using depth-guided warping. We then apply state-of-the-art methods ProPainter (Zhou et al., 2023) and E2FGVI (Li et al., 2022c) to inpaint the right views. For novel view synthesis methods, we compare our results with RoDynRF (Liu et al., 2023b) and DynIBaR (Li et al., 2023), which optimize scene representations relying on camera poses. To ensure a fair comparison, given the differing 3D scales between their reconstructed scenes and our estimated depth, we select the baseline for rendering the right view by matching the median disparity of foreground regions in the resulting disparity map to that of our methods. We are also aware of approaches trained on dedicated datasets that directly produce the right view given the left view like Deep3D (Xie et al., 2016). However, it does not generalize well to the generated video, especially those in non-realistic styles, and the comparison could be found in the supplemental material.
|
| 151 |
+
|
| 152 |
+
# 4.1 QUALITATIVE RESULTS
|
| 153 |
+
|
| 154 |
+
Qualitative Comparisons. We show qualitative comparisons in Fig. 3. Previous video inpainting methods suffer from a common problem – the generated content in disoccluded regions is blurry, such as the knight's arm, horse's tail, and corgi's face, presumably because that these methods are trained on limited datasets. On the other hand, novel view synthesis methods suffer from unstable camera pose estimation (e.g., DynIBaR fails on some videos). Though good at reconstructing visible content from the monocular video, they are typically poor at synthesizing novel contents in the disoccluded regions that are not observed in any frames (e.g., ghost effect near the boundary in the RoDynRF result on the corgi example). In contrast, our approach takes advantage of the generative capability of video diffusion models trained on massive scale datasets and does not require camera poses of the input video as inputs, thereby generating high-quality content in various types of scenarios (last row of Fig. 3) and consistently outperforms baseline methods. Additionally, we visualize the stereo effects of different methods on the corgi case using a stereo depth estimator (Li et al., 2021a), which predicts disparity values from the stereo images. As shown in Fig. 10, RoDynRF and DynIBaR exhibit less depth variation, indicating weaker stereo effects. This occurs when the camera is wrong and the training process overfits the training views, resulting in a sub-optimal 3D representation.
|
| 155 |
+
|
| 156 |
+
# 4.2 QUANTITATIVE RESULTS
|
| 157 |
+
|
| 158 |
+
In this part, we show quantitative comparisons with other baselines. We primarily rely on a dedicatedly designed user study to evaluate the quality of generated stereoscopic video on various quality axes. We also provide an objective metric to measure the semantic similarity between the left and right views using pre-trained CLIP models.
|
| 159 |
+
|
| 160 |
+
Human Perception. To assess the perceived visual quality, we conducted a user study with 20 participants (9 female, age $\mu = 33$ , $\sigma = 6.2$ ). On a VR headset, each participant viewed and evaluated five generated videos (out of 20 in total) by all five methods on stereo effect, temporal consistency, image quality, and overall experience using a 7-point Likert scale (Likert, 1932). A total of 435 evaluations (DynIBaR failed to generate 13 videos) were counterbalanced and randomly shuffled. We also included a training session to eliminate novelty effects. Results are summarized in Table 1, with details in the supplemental material. Our method outperforms other baselines on measured metrics.
|
| 161 |
+
|
| 162 |
+
<table><tr><td></td><td>E2FGVI</td><td>ProPainter</td><td>RoDynRF</td><td>DynIBaR</td><td>Ours</td></tr><tr><td>Stereo Effect ↑</td><td>4.79 (1.08)</td><td>4.81 (1.13)</td><td>2.97 (1.34)</td><td>1.86 (1.25)</td><td>5.24 (0.94)</td></tr><tr><td>Temporal Consistency ↑</td><td>4.74 (1.33)</td><td>4.74 (1.22)</td><td>3.35 (1.66)</td><td>1.89 (1.33)</td><td>5.15 (1.22)</td></tr><tr><td>Image Quality ↑</td><td>4.42 (1.27)</td><td>4.38 (1.28)</td><td>2.84 (1.60)</td><td>1.67 (1.07)</td><td>5.12 (1.33)</td></tr><tr><td>Overall Experience ↑</td><td>4.67 (1.04)</td><td>4.66 (1.09)</td><td>2.92 (1.43)</td><td>1.72 (1.06)</td><td>5.35 (0.99)</td></tr></table>
|
| 163 |
+
|
| 164 |
+
Table 1: Human perception. This table reports the results of human perception experiments as mean (std). Our method outperforms other baselines on all metrics. Kruskal-Wallis tests (Kruskal & Wallis, 1952) reveal significant effects of group on all metrics $(\chi^2 > 13.3, p < 0.001^{***})$ . Post-hoc tests using Mann-Whitney tests (Mann & Whitney, 1947) with Bonferroni correction reveal significant effects $(p < 0.05^*, |r| > 0.1)$ for each pairwise comparison, except E2FGVI vs. ProPainters yield comparable results.
|
| 165 |
+
|
| 166 |
+

|
| 167 |
+
Figure 3: Qualitative comparisons. The first row shows left-view images. The video inpainting methods E2FGVI and ProPainter tend to generate blurry content in disoccluded regions, such as knight's arm and corgi's face. RoDynRF lacks the generation ability, thus content on the right side of the corgi case is poor. DynIBaR's results contain artifacts, and it requires camera poses as inputs, which failed in some scenarios. On the contrary, our method takes advantage of video generation models and is pose-free, thus generating high-quality content in different scenarios.
|
| 168 |
+
|
| 169 |
+
Semantic Consistency. We additionally check the semantic consistency between the left and the right view. We use pre-trained CLIP model (Radford et al., 2021) to extract features for both left views and right views of a stereoscopic video, and then calculate the feature distance following Zhengwentai (2023) to obtain the semantic consistency score. In Table 2, our method attains the best semantic consistency (96.44) over other baselines.
|
| 170 |
+
|
| 171 |
+
Quality Assessment. We measure the quality of generated video using aesthetic score (Schuhmann et al., 2022), DOVER (Wu et al., 2023a), and FVD (Unterthiner et al., 2019), which are in line with human preferences. In Table 2, our approach achieves the best performance (5.27, 0.584, and 599), aligning with the conclusion from the user study experiment in Table 1.
|
| 172 |
+
|
| 173 |
+
# 4.3 ABLATION STUDIES
|
| 174 |
+
|
| 175 |
+
Effect of Frame Matrix. In Fig. 4, we showcase that using frame matrix benefits semantic consistency between the left and right views. Without using frame matrix, the disoccluded regions in warped images can be inpainted with unconstrained contents, which are likely to be inconsistent with the left view given impressive generative capability of the diffusion model, such as the hair of the man and the head of the horse. This is also revealed in Table 2, where CLIP Score drops from 96.44 to 95.81 when disabling frame matrix. Thanks to constraints from other frames within the frame matrix, our method generates both reasonable foreground and background contents in the disoccluded regions. More studies of frame matrix are included in Sec.F and Sec.G of the supplemental material.
|
| 176 |
+
|
| 177 |
+

|
| 178 |
+
Reference
|
| 179 |
+
|
| 180 |
+

|
| 181 |
+
Warped
|
| 182 |
+
|
| 183 |
+

|
| 184 |
+
W/o frame matrix
|
| 185 |
+
Figure 4: Semantically consistent content generation. The reference frames are warped into the target view with disoccluded regions set to be black. Without using frame matrix, the generated content does not match the reference, such as the book and the face of horse. With frame matrix, the inpainted contents are more semantically reasonable.
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
With frame matrix
|
| 189 |
+
|
| 190 |
+
Effects of Disocclusion Boundary Re-Injection. In Fig. 5, we demonstrate the importance of updating unoccluded latent features for high-quality results. Without this update, the disoccluded region is inpainted with unnatural textures that don't blend well with the surrounding content. With the update, the inpainted content blends seamlessly. This is reflected quantitatively in Table 2, where the aesthetic score drops from 5.27 to 5.18 when unoccluded feature updates are discarded.
|
| 191 |
+
|
| 192 |
+

|
| 193 |
+
W/o Disocclusion Boundary Re-Injection
|
| 194 |
+
|
| 195 |
+

|
| 196 |
+
Figure 5: Disocclusion Boundary Re-injection. Without disocclusion boundary re-injection, the inpainted images usually contain artifacts. Bottom-left corner shows the warped image.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
With Disocclusion Boundary Re-Injection
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
|
| 203 |
+
Effects of Handling Isolated Pixels and Cracks. In Fig. 6 left, obvious artifacts are in warped images, such as isolated points and cracks where the foreground ear is entangled with the background gray road, and these artifacts remain in the final generated results. After applying warping designs in Sec. C, our results are clean, handling warping-related artifacts as shown in Fig. 6 right side.
|
| 204 |
+
|
| 205 |
+
Different Stereo Baselines. Fig. 7 shows increasing the stereo baseline makes inpainting harder and degrades stereoscopic video quality, as reflected by CLIP score. Our method is resilient to
|
| 206 |
+
|
| 207 |
+
<table><tr><td>Method</td><td>E2FGVI</td><td>ProPainter</td><td>RoDynRF</td><td>DynIBaR</td><td>Ours - FM</td><td>Ours - DBR</td><td>Ours</td></tr><tr><td>CLIP ↑</td><td>94.34</td><td>95.29</td><td>96.03</td><td>93.24</td><td>95.81</td><td>95.60</td><td>96.44</td></tr><tr><td>Aesthetic ↑</td><td>5.06</td><td>5.07</td><td>4.97</td><td>4.66</td><td>5.25</td><td>5.18</td><td>5.27</td></tr><tr><td>DOVER ↑</td><td>0.547</td><td>0.535</td><td>0.352</td><td>0.365</td><td>0.565</td><td>0.560</td><td>0.584</td></tr><tr><td>FVD ↓</td><td>638</td><td>606</td><td>727</td><td>1208</td><td>614</td><td>699</td><td>599</td></tr></table>
|
| 208 |
+
|
| 209 |
+
Table 2: Quantitative comparisons. We show the semantic consistency using CLIP feature similarity (Hessel et al., 2021) between the left and right view. Additionally, the quality of generated videos is measured by aesthetic score (Schuhmann et al., 2022), DOVER (Wu et al., 2023a) and FVD (Unterthiner et al., 2019). Our method outperforms previous methods as well as ablated cases.
|
| 210 |
+
|
| 211 |
+

|
| 212 |
+
Figure 6: Isolated points and cracks. Left: without handling isolated points and entangled foreground and background (the gray road can be seen through the cracks) in warped images, these artifacts remain in the final results. Right: our results are clean.
|
| 213 |
+
|
| 214 |
+

|
| 215 |
+
Figure 7: Different stereo baselines. Unnatural artifacts begin to appear as the baseline expands. Our method performs well for stereoscopic video generation where baseline is usually less than $7\mathrm{cm}$ .
|
| 216 |
+
|
| 217 |
+
larger baselines, failing beyond $20\mathrm{cm}$ (depth normalized to $1.0 - 10.0\mathrm{m}$ ). This range is sufficient for generating 3D stereoscopic video for most people, given typical inter-pupillary distances of $5 - 7\mathrm{cm}$ .
|
| 218 |
+
|
| 219 |
+
# 5 LIMITATIONS AND DISCUSSIONS
|
| 220 |
+
|
| 221 |
+
Although our results demonstrate the possibility of generating 3D stereoscopic videos using pretrained video diffusion models, challenges remain. For one, we did not study longer videos because the architecture of a typical video diffusion model supports the generation of videos only a few seconds long. One possible solution for long 3D stereoscopic video generation is to use stronger foundational models, such as Sora (Brooks et al., 2024). Alternatively, we could gradually generate longer videos by overlapping frames of shorter videos. Additionally, our method depends on a depth estimation model, which may fail, e.g., when dealing with thin structures or boundaries. In practice, the depth estimation model showcases decent depth consistency after training on large-scale datasets containing images extracted from the same scene and videos, and our flow-based smoothing operation can further mitigate depth perturbations that occasionally arise. To obtain more consistent video depth estimation, fine-tuning video generation models with synthetic video depths is worth exploring. Note that our method is orthogonal to the depth estimation and can benefit from its advancements. Furthermore, our method utilizes auxiliary views to assist in generation, necessitating additional denoising time. This challenge can be addressed by leveraging advancements in efficient denoising techniques and diffusion model architecture, potentially enhancing computational efficiency.
|
| 222 |
+
|
| 223 |
+
# 6 CONCLUSION
|
| 224 |
+
|
| 225 |
+
We proposed a complete system for stereoscopic video generation, using a video diffusion model and our frame matrix inpainting scheme. Given the fast adoption of video generation, our approach bridges the gap between the current ability to generate monocular and stereoscopic videos. In particular, we showed that our frame matrix formulation significantly advances the state-of-the-art for generative stereoscopic video, and can be adopted by existing and future video diffusion models.
|
| 226 |
+
|
| 227 |
+
# REFERENCES
|
| 228 |
+
|
| 229 |
+
Omri Avrahami, Ohad Fried, and Dani Lischinski. Blended Latent Diffusion. ACM Transactions on Graphics (TOG), 42(4):1-11, 2023.
|
| 230 |
+
Omer Bar-Tal, Hila Chefer, Omer Tov, Charles Herrmann, Roni Paiss, Shiran Zada, Ariel Ephrat, Junhwa Hur, Yuanzhen Li, Tomer Michaeli, et al. Lumiere: A space-time diffusion model for video generation. arXiv preprint arXiv:2401.12945, 2024.
|
| 231 |
+
Andreas Blattmann, Robin Rombach, Huan Ling, Tim Dockhorn, Seung Wook Kim, Sanja Fidler, and Karsten Kreis. Align your Latents: High-Resolution Video Synthesis with Latent Diffusion Models. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 22563–22575, 2023.
|
| 232 |
+
Tim Brooks, Bill Peebles, Connor Holmes, Will DePue, Yufei Guo, Li Jing, David Schnurr, Joe Taylor, Troy Luhman, Eric Luhman, Clarence Ng, Ricky Wang, and Aditya Ramesh. Video generation models as world simulators. 2024. URL https://openai.com/research/video-generation-models-as-world-simulators.
|
| 233 |
+
Zilong Chen, Yikai Wang, Feng Wang, Zhengyi Wang, and Huaping Liu. V3D: Video Diffusion Models are Effective 3D Generators. arXiv preprint arXiv:2403.06738, 2024.
|
| 234 |
+
Peng Dai, Yinda Zhang, Zhuwen Li, Shuaicheng Liu, and Bing Zeng. Neural point cloud rendering via multi-plane projection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 7830-7839, 2020.
|
| 235 |
+
Peng Dai, Feitong Tan, Xin Yu, Yinda Zhang, and Xiaojuan Qi. GO-NeRF: Generating Virtual Objects in Neural Radiance Fields. arXiv preprint arXiv:2401.05750, 2024.
|
| 236 |
+
Quankai Gao, Qiangeng Xu, Zhe Cao, Ben Mildenhall, Wenchao Ma, Le Chen, Danhang Tang, and Ulrich Neumann. GaussianFlow: Splitting Gaussian Dynamics for 4D Content Creation. arXiv preprint arXiv:2403.12365, 2024.
|
| 237 |
+
Yuwei Guo, Ceyuan Yang, Anyi Rao, Yaohui Wang, Yu Qiao, Dahua Lin, and Bo Dai. Animatediff: animate your personalized text-to-image diffusion models without specific tuning. arXiv preprint arXiv:2307.04725, 2023.
|
| 238 |
+
Agrim Gupta, Lijun Yu, Kihyuk Sohn, Xiuye Gu, Meera Hahn, Li Fei-Fei, Irfan Essa, Lu Jiang, and José Lezama. Photorealistic video generation with diffusion models. arXiv preprint arXiv:2312.06662, 2023.
|
| 239 |
+
Yuxuan Han, Ruicheng Wang, and Jiaolong Yang. Single-view view synthesis in the wild with learned adaptive multiplane images. In ACM SIGGRAPH 2022 Conference Proceedings, pp. 1-8, 2022.
|
| 240 |
+
William Harvey, Saeid Naderiparizi, Vaden Masrani, Christian Weilbach, and Frank Wood. Flexible diffusion modeling of long videos. Advances in Neural Information Processing Systems, 35: 27953-27965, 2022.
|
| 241 |
+
Jack Hessel, Ari Holtzman, Maxwell Forbes, Ronan Le Bras, and Yejin Choi. CLIPScore: a reference-free evaluation metric for image captioning. In EMNLP, 2021.
|
| 242 |
+
Jonathan Ho, Ajay Jain, and Pieter Abbeel. Denoising diffusion probabilistic models. Advances in neural information processing systems, 33:6840-6851, 2020.
|
| 243 |
+
Jonathan Ho, William Chan, Chitwan Sahara, Jay Whang, Ruiqi Gao, Alexey Gritsenko, Diederik P Kingma, Ben Poole, Mohammad Norouzi, David J Fleet, et al. Imagen video: High definition video generation with diffusion models. arXiv preprint arXiv:2210.02303, 2022a.
|
| 244 |
+
Jonathan Ho, Tim Salimans, Alexey Gritsenko, William Chan, Mohammad Norouzi, and David J Fleet. Video diffusion models. Advances in Neural Information Processing Systems, 35:8633-8646, 2022b.
|
| 245 |
+
|
| 246 |
+
Lukas Hollein, Ang Cao, Andrew Owens, Justin Johnson, and Matthias Nießner. Text2Room: Extracting Textured 3D Meshes from 2D Text-to-Image Models. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7909–7920, 2023.
|
| 247 |
+
Yi-Hua Huang, Yang-Tian Sun, Ziyi Yang, Xiaoyang Lyu, Yan-Pei Cao, and Xiaojuan Qi. Sc-gs: Sparse-controlled gaussian splatting for editable dynamic scenes. arXiv preprint arXiv:2312.14937, 2023.
|
| 248 |
+
Animesh Karnewar, Andrea Vedaldi, David Novotny, and Niloy J Mitra. Holodiffusion: Training a 3d diffusion model using 2d images. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 18423-18433, 2023.
|
| 249 |
+
Bernhard Kerbl, Georgios Kopanas, Thomas Leimkuhler, and George Drettakis. 3D Gaussian Splatting for Real-Time Radiance Field Rendering. ACM Transactions on Graphics, 42(4):1-14, 2023.
|
| 250 |
+
William H Kruskal and W Allen Wallis. Use of Ranks in One-criterion Variance Analysis. Journal of the American Statistical Association, 47(260):583-621, 1952.
|
| 251 |
+
Yao-Chih Lee, Zhoutong Zhang, Kevin Blackburn-Matzen, Simon Niklaus, Jianming Zhang, Jia-Bin Huang, and Feng Liu. Fast view synthesis of casual videos. arXiv preprint arXiv:2312.02135, 2023.
|
| 252 |
+
David Li, Yinda Zhang, Christian Hane, Danhang Tang, Amitabh Varshney, and Ruofei Du. OmniSyn: Intermediate View Synthesis Between Wide-baseline Panoramas. In 2022 IEEE Conference on Virtual Reality and 3D User Interfaces, 2022a.
|
| 253 |
+
Tianye Li, Mira Slavcheva, Michael Zollhoefer, Simon Green, Christoph Lassner, Changil Kim, Tanner Schmidt, Steven Lovegrove, Michael Goesele, Richard Newcombe, et al. Neural 3D Video Synthesis from Multi-view Video. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5521-5531, 2022b.
|
| 254 |
+
Zhaoshuo Li, Xingtong Liu, Nathan Drenkow, Andy Ding, Francis X. Creighton, Russell H. Taylor, and Mathias Unberath. Revisiting stereo depth estimation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 6197-6206, October 2021a.
|
| 255 |
+
Zhen Li, Cheng-Ze Lu, Jianhua Qin, Chun-Le Guo, and Ming-Ming Cheng. Towards an end-to-end framework for flow-guided video inpainting. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 17562-17571, 2022c.
|
| 256 |
+
Zhengqi Li, Simon Niklaus, Noah Snavely, and Oliver Wang. Neural scene flow fields for space-time view synthesis of dynamic scenes. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 6498-6508, 2021b.
|
| 257 |
+
Zhengqi Li, Qianqian Wang, Forrester Cole, Richard Tucker, and Noah Snavely. Dynibar: Neural dynamic image-based rendering. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 4273-4284, 2023.
|
| 258 |
+
Rensis Likert. A Technique for the Measurement of Attitudes. Archives of Psychology, 1932.
|
| 259 |
+
Ruoshi Liu, Rundi Wu, Basile Van Hoorick, Pavel Tokmakov, Sergey Zakharov, and Carl Vondrick. Zero-1-to-3: Zero-shot one image to 3D object. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 9298-9309, 2023a.
|
| 260 |
+
Yu-Lun Liu, Chen Gao, Andreas Meuleman, Hung-Yu Tseng, Ayush Saraf, Changil Kim, Yung-Yu Chuang, Johannes Kopf, and Jia-Bin Huang. Robust dynamic radiance fields. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 13-23, 2023b.
|
| 261 |
+
Andreas Lugmayr, Martin Danelljan, Andres Romero, Fisher Yu, Radu Timofte, and Luc Van Gool. Repaint: Inpainting using denoising diffusion probabilistic models. In Proceedings of the IEEE/CVF conference on computer vision and pattern recognition, pp. 11461-11471, 2022.
|
| 262 |
+
|
| 263 |
+
Henry B Mann and Donald R Whitney. On a Test of Whether One of Two Random Variables Is Stochastically Larger Than the Other. The Annals of Mathematical Statistics, pp. 50-60, 1947.
|
| 264 |
+
Ben Mildenhall, Pratul P Srinivasan, Matthew Tancik, Jonathan T Barron, Ravi Ramamoorthi, and Ren Ng. Nerf: Representing scenes as neural radiance fields for view synthesis. Communications of the ACM, 65(1):99-106, 2021.
|
| 265 |
+
Thomas Müller, Alex Evans, Christoph Schied, and Alexander Keller. Instant Neural Graphics Primitives with a Multiresolution Hash Encoding. ACM Transactions on Graphics (TOG), 41(4): 1-15, 2022.
|
| 266 |
+
Keunhong Park, Utkarsh Sinha, Jonathan T Barron, Sofien Bouaziz, Dan B Goldman, Steven M Seitz, and Ricardo Martin-Brualla. Nerfies: Deformable neural radiance fields. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 5865-5874, 2021a.
|
| 267 |
+
Keunhong Park, Utkarsh Sinha, Peter Hedman, Jonathan T Barron, Sofien Bouaziz, Dan B Goldman, Ricardo Martin-Brualla, and Steven M Seitz. Hypernerf: A higher-dimensional representation for topologically varying neural radiance fields. arXiv preprint arXiv:2106.13228, 2021b.
|
| 268 |
+
William Peebles and Saining Xie. Scalable diffusion models with transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 4195-4205, 2023.
|
| 269 |
+
Alec Radford, Jong Wook Kim, Chris Hallacy, Aditya Ramesh, Gabriel Goh, Sandhini Agarwal, Girish Sastry, Amanda Askell, Pamela Mishkin, Jack Clark, et al. Learning transferable visual models from natural language supervision. In International conference on machine learning, pp. 8748-8763. PMLR, 2021.
|
| 270 |
+
Aditya Ramesh, Prafulla Dhariwal, Alex Nichol, Casey Chu, and Mark Chen. Hierarchical text-conditional image generation with clip latents. arXiv preprint arXiv:2204.06125, 1(2):3, 2022.
|
| 271 |
+
Robin Rombach, Andreas Blattmann, Dominik Lorenz, Patrick Esser, and Björn Ommer. 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.
|
| 272 |
+
Chitwan Sahara, William Chan, Saurabh Saxena, Lala Li, Jay Whang, Emily L Denton, Kamyar Ghasemipour, Raphael Gontijo Lopes, Burcu Karagol Ayan, Tim Salimans, et al. Photorealistic text-to-image diffusion models with deep language understanding. Advances in neural information processing systems, 35:36479-36494, 2022.
|
| 273 |
+
Johannes Lutz Schonberger and Jan-Michael Frahm. Structure-from-motion revisited. In Conference on Computer Vision and Pattern Recognition (CVPR), 2016.
|
| 274 |
+
Christoph Schuhmann, Romain Beaumont, Richard Vencu, Cade Gordon, Ross Wightman, Mehdi Cherti, Theo Coombes, Aarush Katta, Clayton Mullis, Mitchell Wortsman, et al. Laion-5b: An open large-scale dataset for training next generation image-text models. Advances in Neural Information Processing Systems, 35:25278-25294, 2022.
|
| 275 |
+
Uriel Singer, Adam Polyak, Thomas Hayes, Xi Yin, Jie An, Songyang Zhang, Qiyuan Hu, Harry Yang, Oron Ashual, Oran Gafni, et al. Make-a-video: Text-to-video generation without text-video data. arXiv preprint arXiv:2209.14792, 2022.
|
| 276 |
+
Zachary Teed and Jia Deng. Raft: Recurrent all-pairs field transforms for optical flow. In Computer Vision-ECCV 2020: 16th European Conference, Glasgow, UK, August 23-28, 2020, Proceedings, Part II 16, pp. 402-419. Springer, 2020.
|
| 277 |
+
Richard Tucker and Noah Snavely. Single-view view synthesis with multiplane images. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 551-560, 2020.
|
| 278 |
+
Thomas Unterthiner, Sjoerd van Steenkiste, Karol Kurach, Raphaël Marinier, Marcin Michalski, and Sylvain Gelly. Fvd: A new metric for video generation. 2019.
|
| 279 |
+
Jiuniu Wang, Hangjie Yuan, Dayou Chen, Yingya Zhang, Xiang Wang, and Shiwei Zhang. Modelscope text-to-video technical report. arXiv preprint arXiv:2308.06571, 2023a.
|
| 280 |
+
|
| 281 |
+
Lezhong Wang, Jeppe Revall Frisvad, Mark Bo Jensen, and Siavash Arjomand Bigdeli. Stereodiffusion: Training-free stereo image generation using latent diffusion models, 2024.
|
| 282 |
+
Xiaodong Wang, Chenfei Wu, Shengming Yin, Minheng Ni, Jianfeng Wang, Linjie Li, Zhengyuan Yang, Fan Yang, Lijuan Wang, Zicheng Liu, et al. Learning 3d photography videos via self-supervised diffusion on single images. arXiv preprint arXiv:2302.10781, 2023b.
|
| 283 |
+
Haoning Wu, Erli Zhang, Liang Liao, Chaofeng Chen, Jingwen Hou, Annan Wang, Wenxiu Sun, Qiong Yan, and Weisi Lin. Exploring video quality assessment on user generated contents from aesthetic and technical perspectives. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 20144-20154, 2023a.
|
| 284 |
+
Jay Zhangjie Wu, Yixiao Ge, Xintao Wang, Stan Weixian Lei, Yuchao Gu, Yufei Shi, Wynne Hsu, Ying Shan, Xiaohu Qie, and Mike Zheng Shou. Tune-a-video: One-shot tuning of image diffusion models for text-to-video generation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 7623-7633, 2023b.
|
| 285 |
+
Junyuan Xie, Ross Girshick, and Ali Farhadi. Deep3d: Fully automatic 2d-to-3d video conversion with deep convolutional neural networks. In Computer Vision-ECCV 2016: 14th European Conference, Amsterdam, The Netherlands, October 11–14, 2016, Proceedings, Part IV 14, pp. 842–857. Springer, 2016.
|
| 286 |
+
Lihe Yang, Bingyi Kang, Zilong Huang, Xiaogang Xu, Jiashi Feng, and Hengshuang Zhao. Depth anything: Unleashing the power of large-scale unlabeled data. pp. 10371-10381, 2024.
|
| 287 |
+
Jae Shin Yoon, Kihwan Kim, Orazio Gallo, Hyun Soo Park, and Jan Kautz. Novel view synthesis of dynamic scenes with globally coherent depths from a monocular camera. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pp. 5336-5345, 2020.
|
| 288 |
+
Hong-Xing Yu, Haoyi Duan, Junhwa Hur, Kyle Sargent, Michael Rubinstein, William T Freeman, Forrester Cole, Deqing Sun, Noah Snavely, Jiajun Wu, et al. Wonderjourney: Going from anywhere to everywhere. arXiv preprint arXiv:2312.03884, 2023.
|
| 289 |
+
SUN Zhengwentai. clip-score: CLIP Score for PyTorch. https://github.com/taited/clip-score, March 2023. Version 0.1.1.
|
| 290 |
+
Shangchen Zhou, Chongyi Li, Kelvin CK Chan, and Chen Change Loy. Propainter: Improving propagation and transformer for video inpainting. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pp. 10477-10486, 2023.
|
| 291 |
+
Tinghui Zhou, Richard Tucker, John Flynn, Graham Fyffe, and Noah Snavely. Stereo magnification: Learning view synthesis using multiplane images. arXiv preprint arXiv:1805.09817, 2018.
|
| 292 |
+
Qi Zuo, Xiaodong Gu, Lingteng Qiu, Yuan Dong, Zhengyi Zhao, Weihao Yuan, Rui Peng, Siyu Zhu, Zilong Dong, Liefeng Bo, et al. VideoMV: Consistent Multi-View Generation Based on Large Video Generative Model. arXiv preprint arXiv:2403.12010, 2024.
|
| 293 |
+
|
| 294 |
+
# A APPENDIX
|
| 295 |
+
|
| 296 |
+
In the supplementary sections, we provide more studies and details of the proposed method.
|
| 297 |
+
|
| 298 |
+
- Sec. B provides a pseudocode describing our frame matrix denoising inpainting.
|
| 299 |
+
- Sec. C includes details on depth smoothing and warping-related artifacts handling.
|
| 300 |
+
- Sec. D provides more analysis of frame matrix.
|
| 301 |
+
- Sec. E elaborates details of human perception experiments and provides additional comparisons with Deep3D.
|
| 302 |
+
- Sec. F contains more studies of our method, including visualization of stereo effects, the ability to utilize temporal context, ablations on the number of cameras used, the efficacy of depth smoothing, intermediate results during the denoising process, consistency across different views, generalization ability of boundary re-injection, and comparisons with single-image view synthesis.
|
| 303 |
+
- Sec. G displays different trajectory results sampled from the frame matrix and cases in various scenarios.
|
| 304 |
+
|
| 305 |
+
# B ALGORITHM DETAILS
|
| 306 |
+
|
| 307 |
+
In the algorithm below, we present the detailed steps to denoise the Frame Matrix with spatial-temporal resampling, where we set $\mu_{\theta}(\mathbf{z}_t,c,t) = \frac{1}{\sqrt{1 - \beta_t}} (\mathbf{z}_t - \frac{\beta_t}{\sqrt{1 - \bar{\alpha}_t}}\epsilon_\theta (\mathbf{z}_t,c,t))$ , following DDPM (Ho et al., 2020).
|
| 308 |
+
|
| 309 |
+
Algorithm 1 Frame Matrix Inpainting
|
| 310 |
+
```latex
|
| 311 |
+
Input: $\mathbf{z}_T\sim \mathcal{N}(\mathbf{0},\mathbf{I})$ : Initial noisy latent maps
|
| 312 |
+
$\mathbf{z}_0$ : Initial clean latent maps
|
| 313 |
+
for $t = T,\dots,1$ do
|
| 314 |
+
for $n = 1,\dots,N$ do if n is odd then Denoise time sequences $\{\mathbf{z}_{(:,v)t}|v = 0,\dots,V\}$ . for $v = 0,..,V$ do $\mathbf{z}_{(:,v)t - 1}^{\mathrm{known}}\sim \mathcal{N}(\sqrt{\bar{\alpha}_t}\mathbf{z}_{(:,v)0},(1 - \bar{\alpha}_t)\mathbf{I})$ $\mathbf{z}_{(:,v)t - 1}^{\mathrm{unknown}}\sim \mathcal{N}(\mu_{\theta}(\mathbf{z}_{(:,v)t},c,t),\Sigma_{\theta}(\mathbf{z}_{(:,v)t},c,t))$ $\mathbf{z}_{(:,v)t - 1} = \mathbf{m}_{(:,v)}\odot \mathbf{z}_{(:,v)t - 1}^{\mathrm{known}} + (1 - m_{(:,v)})\odot \mathbf{z}_{(:,v)t - 1}^{\mathrm{unknown}}$ end for else Denoise view sequences $\{\mathbf{z}_{(s,:)}|s = 0,\dots,S\}$ . for $s = 0,..,S$ do $\mathbf{z}_{(s,:)t - 1}^{\mathrm{known}}\sim \mathcal{N}(\sqrt{\bar{\alpha}_t}\mathbf{z}_{(s,:)}0,(1 - \bar{\alpha}_t)\mathbf{I})$ $\mathbf{z}_{(s,:)t - 1}^{\mathrm{unknown}}\sim \mathcal{N}(\mu_{\theta}(\mathbf{z}_{(s,:)}t,c,t),\Sigma_{\theta}(\mathbf{z}_{(s,:)}t,c,t))$ $\mathbf{z}_{(s,:)t - 1} = \mathbf{m}_{(s,:)}\odot \mathbf{z}_{(s,:)t - 1}^{\mathrm{known}} + (1 - m_{(s,:)})\odot \mathbf{z}_{(s,:)t - 1}^{\mathrm{unknown}}$ end for end if if $n < N$ then Add back one noise step for resampling: $\mathbf{z}_t\sim \mathcal{N}(\sqrt{1 - \beta_{t - 1}}\mathbf{z}_{t - 1},\beta_{t - 1}\mathbf{I})$ end if end for end for
|
| 315 |
+
```
|
| 316 |
+
|
| 317 |
+
# C DETAILS OF MONOCULAR VIDEO DEPTH WARPING
|
| 318 |
+
|
| 319 |
+
# C.1 DETAILS OF TEMPORAL DEPTHSMOOTHING
|
| 320 |
+
|
| 321 |
+
In practice, we use three consecutive frames to stabilize depth changes. At timestamp $t$ , we first estimate optical flows $flow_{t-1\rightarrow t}$ and $flow_{t+1\rightarrow t}$ , which help align the predicted depth maps at different timestamps. Finally, the refined depth at timestamp $t$ is obtained via convolving aligned depths $(D_{t-1\rightarrow t}, D_t, D_{t+1\rightarrow t})$ with a one-dimensional Gaussian kernel of shape $3 \times 1$ .
|
| 322 |
+
|
| 323 |
+
# C.2 DETAILS OF HANDLING ISOLATED Pixels AND CRACKS
|
| 324 |
+
|
| 325 |
+
Multi-Plane projection. Given RGB-D images, we warp them into a target camera view. Instead of projecting all pixels onto one image plane and handling occlusions using z-buffer, we divide the camera view space into multi-plane images $\{I_1^{step0},\dots,I_N^{step0}\}$ ( $N = 4$ in this paper) according to near and far depths, then each pixel is projected onto the image plane closest to it. We use $\{M_1^{step0},\dots,M_N^{step0}\}$ to indicate valid pixel positions on each image plane. By doing this, the foreground and background are separated in different planes, which makes artifacts (i.e., isolated points and entangled foreground and background in Fig. 6 left) easily to be handled.
|
| 326 |
+
|
| 327 |
+
Remove isolated points. Due to the inaccuracy of depth values around image boundaries, these pixels are warped into wrong positions leading to isolated pixels (see red box in Fig. 6 left). Intuitively, isolated pixels have no or very few neighbors, thus we detect isolated pixels based on this observation. Specifically, we apply convolution to each mask image $M_{i}^{step0}$ using a $3 \times 3$ kernel, after which isolated pixels are empirically determined where the values after convolution are less than 0.5. We remove these isolated pixels on both RGB and mask images to obtain updated $\{I_1^{step1}, \dots, I_N^{step1}\}$ and $\{M_1^{step1}, \dots, M_N^{step1}\}$ .
|
| 328 |
+
|
| 329 |
+
Remove cracks. Since the depth image is not a watertight representation, the warped image usually contains cracks/holes that confuse foreground and background content. For example, the gray road can be seen through the dog's ear in Fig. 6 left. Similar to handling isolated pixels, we use a $3 \times 3$ Gaussian kernel to perform convolution on each mask image $M_{i}^{step1}$ . When there are cracks, the values after convolution will be less than 1. In this paper, positions with no pixel values (0 in $M_{i}$ ) but with greater values than 0.2 after convolution are considered cracks. We fill cracks by interpolating nearby pixels in each image and obtain new multi-plane images $\{I_1^{step2}, \dots, I_N^{step2}\}$ and $\{M_1^{step2}, \dots, M_N^{step2}\}$ .
|
| 330 |
+
|
| 331 |
+
After handling artifacts in each image plane, all image planes are blended into a final image (e.g., Fig. 6 ours left) in a back-to-front order using Eq. 11, where the content of front plane occludes content of the back plane.
|
| 332 |
+
|
| 333 |
+
$$
|
| 334 |
+
I = I \times \left(1 - M _ {i} ^ {\text {s t e p 2}}\right) + I _ {i} ^ {\text {s t e p 2}} \times M _ {i} ^ {\text {s t e p 2}}, f o r i \text {i n} [ N, \dots , 1 ]. \tag {11}
|
| 335 |
+
$$
|
| 336 |
+
|
| 337 |
+
# D MORE ANALYSIS OF FRAME MATRIX
|
| 338 |
+
|
| 339 |
+
Based on the high-level motivation in the main paper, each frame $\mathbf{z}(i,j)$ in the frame matrix should be as consistent as the denoising results from both time and spatial directions. Mathematically:
|
| 340 |
+
|
| 341 |
+
$$
|
| 342 |
+
L (i, j) = \left\| \mathbf {z} _ {t - 1} (i, j) - \mathbf {z} _ {t - 1} ^ {\text {s p a t i a l}} (i, j) \right\| _ {2} + \left\| \mathbf {z} _ {t - 1} (i, j) - \mathbf {z} _ {t - 1} ^ {\text {t e m p o r a l}} (i, j) \right\| _ {2}, \tag {12}
|
| 343 |
+
$$
|
| 344 |
+
|
| 345 |
+
$$
|
| 346 |
+
\mathbf {z} _ {t - 1} ^ {\text {s p a t i a l}} = \Theta^ {\text {s p a t i a l}} \left(\mathbf {z} _ {t}\right), \quad \mathbf {z} _ {t - 1} ^ {\text {t e m p o r a l}} = \Theta^ {\text {t e m p o r a l}} \left(\mathbf {z} _ {t}\right), \tag {13}
|
| 347 |
+
$$
|
| 348 |
+
|
| 349 |
+
Where $\Theta$ is a pre-trained video diffusion model, $\Theta^{spatial}$ and $\Theta^{temporal}$ indicate denoising frame matrix in the time and spatial directions, respectively. Here, $L$ is a quadratic Least-Squares (LS) where the solution is as close as possible to all diffusion samples $\mathbf{z}_{t-1}^{spatial}(i,j)$ and $\mathbf{z}_{t-1}^{temporal}(i,j)$ . In practice, we simultaneously denoise in spatial and time directions to obtain the optimal results.
|
| 350 |
+
|
| 351 |
+
# E DETAILS OF HUMAN PERCEPTION STUDY
|
| 352 |
+
|
| 353 |
+
Participants. To evaluate the perceived quality of the generated stereoscopic videos, we recruited 20 participants (9 females) at least 18 years old $(\mu = 33, \sigma = 6.2)$ with normal or corrected-to-normal vision at an anonymous institution via email lists and group communication software. The majority of participants had some experience with virtual reality. None of the participants was involved with this project prior to the user study.
|
| 354 |
+
|
| 355 |
+
Study setup. The study was conducted in a quiet meeting room with a commercial VR headset as the primary apparatus. The study software is implemented in Unity 2023.3.0b and we render stereoscopic videos with custom shaders on a $1.8m \times 1.0m$ quad that is three meters away from the participant in the world space, which occupies approximately 33.4 degrees in width and 18.92 degrees in height initially. Users have the freedom to move themselves within the meeting room to examine the stereoscopic video. This setup allowed participants to experience the stereoscopic videos in virtual reality settings and provided a controlled environment for the user study.
|
| 356 |
+
|
| 357 |
+
Study protocol. Each study session consists of a demographics interview with consent forms, a training session, and an evaluation session. To eliminate the ordering effect, we randomly counterbalanced all five methods for each video and assigned five random videos (out of 20 videos) with five conditions to each participant. However, since DynlBaR method failed to generate 13 videos, we collected a total of $5 \times 5 \times 20 - 13 \times 5 = 435$ evaluations from 20 participants, resulting in 100 human evaluations for each method except DynlBaR. During the training session, we randomly picked a video that was outside of the assigned videos to the participant and asked the participant to rate the stereoscopic effect, temporal consistency, graphical quality, and overall experience on a 7-point Likert scale (Likert, 1932), with 1 being the lowest, 7 being the highest, and 4 being the average. This procedure helps eliminate the novelty effect and calibrate the user's rating before the formal evaluation session. In the formal evaluation, we prompted the participant with the question like "How would you like to rate the stereoscopic effect of the video on a 7-point scale, with 1 being the lowest, 7 being the highest, and 4 being the average?" and asked the user the reason behind the rating.
|
| 358 |
+
|
| 359 |
+
Metrics. We evaluate the perceived quality of generated stereo videos based on three key aspects: 1. Stereo Effect. This refers to the perception of depth achieved by presenting slightly different images to each eye. A strong stereo effect makes objects appear closer or farther away, enhancing the 3D experience. Example questions: "How strong was the 3D effect in the video?" and "Which video felt more immersive due to the 3D effect?" 2. Temporal Consistency. This aspect assesses the smoothness of scene motion and the absence of artifacts such as jitter or ghosting over time. Example questions: "How smooth and natural did the motion of objects appear?" and "Did you notice any flickering, jumpiness, or distortions in the video?" 3. Graphical Quality. This evaluates the overall visual appeal of the video, including the quality of details, textures, lighting, and color fidelity. Example questions: "How would you rate the visual quality of the video?" and "Which video had more detailed and realistic textures?"
|
| 360 |
+
|
| 361 |
+
Study results. Overall, despite the missing data points for the DynIBaR method in some videos, Kruskal-Wallis tests (Kruskal & Wallis, 1952) reveals significant effects of group on all metrics respectively $(\chi^2 > 13.3, p < 0.01)$ : with stereo effect $\chi^2 = 186.3, p < 0.001$ , temporal consistency $\chi^2 = 121.3, p < 0.001$ , graphical quality $\chi^2 = 153.2, p < 0.001$ , and overall experience $\chi^2 = 192.9, p < 0.001$ . We further performed post-hoc tests using Mann-Whitney tests (Mann & Whitney, 1947) with Bonferroni correction, which revealed significant effects $(p < 0.05, |r| > 0.1)$ for each pairwise comparison, except E2FGVI vs. ProPainters. Specifically, for Ours vs. E2FGVI, $p = 0.002$ on stereo effect, $p = 0.030$ on temporal consistency, $p < 0.001$ on graphical quality and overall experience. For Ours vs. ProPainter, $p = 0.004$ on stereo effect, $p = 0.017$ on temporal consistency, $p < 0.001$ on graphical quality and overall experience.
|
| 362 |
+
|
| 363 |
+
Study findings. Our results suggest that our methods achieve significantly better perceived stereoscopic effect than all other methods, while improvement in graphical quality and overall experience is more evident over stereoscopic effect; and stereo effect more evident over temporal consistency. During the study, we also observed many positive comments about our methods like "the contour is more clear", "the graphics are sharper with fewer artifacts"; however, we also observed negative or neutral feedback like "some part really works and some parts don't: one side of the turtle face is wrong", and "I see no difference (on the faces)" from two participants. This suggests future research
|
| 364 |
+
|
| 365 |
+

|
| 366 |
+
Left view
|
| 367 |
+
|
| 368 |
+

|
| 369 |
+
Right view
|
| 370 |
+
Figure 8: Results of Deep3D. Deep3D does not provide the function to change the stereo baseline, and the vague disparity map on the right side demonstrates its weak stereo effects.
|
| 371 |
+
|
| 372 |
+

|
| 373 |
+
Disparity
|
| 374 |
+
|
| 375 |
+
to investigate holistic perceptual consistency in stereoscopic videos and finetune models for special subjects like human beings.
|
| 376 |
+
|
| 377 |
+
Additional user study on Ours vs. Deep3D. We further conducted a human evaluation between Ours and Deep3D across the same metrics with a total of 190 random evaluations over 20 random videos, following the same protocol. Pairwise Mann-Whitney tests with Bonferroni correction reveal significant effects on stereo effect $(p < 0.001)$ , overall experience $(p < 0.001)$ , and temporal consistency $(p = 0.015)$ . We found our method outperforms Deep3D in stereo effect and overall experience, yet falling slightly short in temporal consistency.
|
| 378 |
+
|
| 379 |
+
Similar to Fig. 10, we visualize Deep3D's disparity map in Fig. 8. The vague disparity map in the third column demonstrates weak stereo effects, which matches the statistic results in Table 3. By manually modifying the disparity map or changing the stereo baseline, 3D effects may become apparent. However, Deep3D does not support these functions.
|
| 380 |
+
|
| 381 |
+
<table><tr><td></td><td>Deep3D</td><td>Ours</td><td>p-value</td><td>|r| (effect size)</td></tr><tr><td>Stereo Effect ↑</td><td>2.29 (1.63)</td><td>5.29 (1.09)</td><td>< 0.001 ***</td><td>0.60 (large)</td></tr><tr><td>Temporal Consistency ↑</td><td>5.37 (1.23)</td><td>5.06 (1.25)</td><td>0.015 *</td><td>0.49 (medium)</td></tr><tr><td>Image Quality ↑</td><td>5.27 (1.17)</td><td>5.12 (1.19)</td><td>0.103</td><td>0.10 (small)</td></tr><tr><td>Overall Experience ↑</td><td>3.68 (1.36)</td><td>5.08 (1.09)</td><td>< 0.001 ***</td><td>0.57 (large)</td></tr></table>
|
| 382 |
+
|
| 383 |
+
Table 3: Human perception. This table reports results of human perception experiments as mean (std) between Deep3D and Ours. Our method outperforms Deep3D in stereo effect and overall experience, yet falls slightly short in temporal consistency. Mann-Whitney tests with Bonferroni correction reveals significant effects on stereo effect $(p < 0.001$ , $Z = -8.24)$ , overall experience $(p < 0.001$ , $Z = -7.92)$ , and temporal consistency $(p = 0.015$ , $Z = -6.72)$ .
|
| 384 |
+
|
| 385 |
+
# F MORE EXPERIMENTS
|
| 386 |
+
|
| 387 |
+
Stereo effects visualization. To further verify the quality of stereo effects, we employed the Stereo Transformer (Li et al., 2021a) to predict disparity maps for our generated stereo videos. As illustrated in Fig. 9 (a), the resulting disparity maps are sharp, with a clear distinction between foreground and background elements, indicating the reasonable 3D effect of our results. Additionally, since a majority of pixels are generated by warping the monocular estimated depth and the diffusion model tends to preserve the known pixels, the generated binocular pair maintains the monocular depth very well. This is verified by the example in Fig. 9 (b), which shows disparity maps from monocular estimation (first column) and binocular estimation (second column), and the difference between them (last column). The quantitative difference is 0.63 pixels, which indicates overall good consistency.
|
| 388 |
+
|
| 389 |
+
Ability to utilize temporal context for inpainting. Our method is able to harmonize image contents between different temporal frames during inpainting and thus enhance temporal consistency. Figure 11 shows one example. When inpainting the right-view frame at $t$ , our method successfully creates content that is consistent with the left-view frame at $t + 1$ (see the generated character "R" in the disoccluded region). Note that such consistency is maintained automatically thanks to frame matrix based denoising, since all temporal frames are taken into account.
|
| 390 |
+
|
| 391 |
+
Number of cameras used. We reduce the number of cameras between left and right views and show results in Fig. 12. Artifacts (e.g., the fifth leg) tend to occur when the number of cameras is fewer
|
| 392 |
+
|
| 393 |
+

|
| 394 |
+
|
| 395 |
+

|
| 396 |
+
Figure 9: Stereo effects visualization. (a) The generated stereo results are used for predicting disparity maps (Li et al., 2021a). The distinction between foreground and background elements indicates reasonable 3D effects. (b) Disparity maps are estimated from monocular and binocular images. The error map on the right side demonstrates their consistency.
|
| 397 |
+
|
| 398 |
+

|
| 399 |
+
Figure 10: Estimated disparity maps of different methods. The disparity values change reasonably in our method.
|
| 400 |
+
|
| 401 |
+
than four in this horse case, as a limited number of cameras can lead to rapid changes between video frames that exceed the capabilities of current video generation models.
|
| 402 |
+
|
| 403 |
+
Efficacy of temporal depth smoothing. In Fig. 14, we track a pixel across video frames and display their depth changes with and without using our depth smoothing operation. From Fig. 14 right side, our approach effectively stabilizes depth changes across frames.
|
| 404 |
+
|
| 405 |
+
Results at different denoising steps. In Fig. 13, we present results at different denoising steps to enhance the understanding of the denoising inpainting process. Without the disocclusion boundary re-injection, noticeable artifacts emerge throughout the denoising process. In contrast, our method progressively fills disoccluded regions with harmonious content.
|
| 406 |
+
|
| 407 |
+

|
| 408 |
+
Figure 11: Ability to utilize unobserved content. Left view: two consecutive images observed by the left view. Right view: the warped and inpainted images at time t. Note that the black region is inpainted with the character "R", matching the characters in the second image at time $t + 1$ .
|
| 409 |
+
|
| 410 |
+

|
| 411 |
+
2 cameras
|
| 412 |
+
|
| 413 |
+

|
| 414 |
+
3 cameras
|
| 415 |
+
|
| 416 |
+

|
| 417 |
+
4 cameras
|
| 418 |
+
|
| 419 |
+

|
| 420 |
+
8 cameras
|
| 421 |
+
|
| 422 |
+

|
| 423 |
+
|
| 424 |
+

|
| 425 |
+
800
|
| 426 |
+
|
| 427 |
+

|
| 428 |
+
|
| 429 |
+

|
| 430 |
+
500
|
| 431 |
+
|
| 432 |
+

|
| 433 |
+
|
| 434 |
+

|
| 435 |
+
200
|
| 436 |
+
|
| 437 |
+

|
| 438 |
+
Figure 12: Number of cameras between left and right views. Artifacts arise when the number of cameras is too small to exceed the capabilities of video generation models.
|
| 439 |
+
|
| 440 |
+

|
| 441 |
+
0
|
| 442 |
+
|
| 443 |
+

|
| 444 |
+
Figure 13: Results at different denoising steps. Without the use of disocclusion boundary reinjection, artifacts persist throughout the denoising process. In contrast, our method gradually fills disoccluded regions with harmonious content.
|
| 445 |
+
Images
|
| 446 |
+
Figure 14: Temporal depth smoothing. We track a pixel's depth values across frames and visualize the depth changes. By applying smoothing operations, the depth changes more smoothly.
|
| 447 |
+
|
| 448 |
+

|
| 449 |
+
Depths
|
| 450 |
+
|
| 451 |
+

|
| 452 |
+
Depth changes
|
| 453 |
+
|
| 454 |
+
Consistency across different viewpoints. In Fig. 17, the first row is warped images under different camera views. We generate each view independently and show results in the second row, where the content is not consistent across different views, such as the dragon's wing. With the help of the frame matrix, which also regularizes generation in the direction of camera motion, our results in the third row are more consistent.
|
| 455 |
+
|
| 456 |
+
Apply boundary re-injection to image inpainting (Avrahami et al., 2023). Our method is also applicable to previous image inpainting approaches that utilize latent diffusion backbones. In Fig. 19, the masked region is inpainted as a stone, and our method showcases a smoother transition between original and new content (e.g., the grassland), thanks to the boundary re-injection designs that update latent features around the mask boundary.
|
| 457 |
+
|
| 458 |
+
Compare with single-image view synthesis methods. Stereoscopic video can be obtained by dealing with each frame individually using a single-image view synthesis method. Here, we compare our approach with SVM (Tucker & Snavely, 2020) and AdaMPI (Han et al., 2022), and show results at different time stamps in Fig. 20. At a specific time stamp (e.g., $t_1$ ), both SVG and AdaMPI produce blurry content next to the character "B", whereas our method generates a sharp character "R". This improvement is attributable to our approach's ability to leverage information from other frames (i.e., left-view frame at time $t_2$ ). Moreover, the results from AdaMPI and SVM are not temporally consistent because each frame is processed individually. For example, the content next to the character "B" differs between $t_1$ and $t_2$ . On the contrary, our approach leverages the video generation model to ensure temporal consistency, allowing the characters in our results to align with those in the left-view frames. More cases are included in Fig. 22. Quantitative comparisons are displayed in Table 4.
|
| 459 |
+
|
| 460 |
+
<table><tr><td></td><td>SVM</td><td>AdaMPI</td><td>Ours</td></tr><tr><td>DOVER ↑</td><td>0.215</td><td>0.245</td><td>0.584</td></tr><tr><td>FVD ↓</td><td>784</td><td>718</td><td>599</td></tr></table>
|
| 461 |
+
|
| 462 |
+
Table 4: Compare with single-image view synthesis. Our method outperforms SVM and AdaMPI on aesthetic scores, measured by DOVER and FVD.
|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
Figure 15: Frames sampled from frame matrix. In both cases, each column represents a generated video from a camera, while each row corresponds to the generated frames from different cameras at a specific timestamp.
|
| 466 |
+
|
| 467 |
+
# G MORE RESULTS
|
| 468 |
+
|
| 469 |
+
Other trajectories in frame matrix. In the main paper, we show generated left and right views. Here, we additionally show the results of other trajectories. In Fig. 15, we selectively display frames generated within the frame matrix at different timestamps (3 out of 16) in different camera views (3
|
| 470 |
+
|
| 471 |
+

|
| 472 |
+
Figure 16: Frames sampled from frame matrix constructed using a spiral trajectory. Warped and generated frames in different cameras at different timestamps.
|
| 473 |
+
|
| 474 |
+

|
| 475 |
+
Figure 17: Frame matrix benefits consistent content generation. When each view is processed independently, the dragon's wing varies across different camera viewpoints.
|
| 476 |
+
|
| 477 |
+

|
| 478 |
+
|
| 479 |
+

|
| 480 |
+
|
| 481 |
+

|
| 482 |
+
|
| 483 |
+

|
| 484 |
+
|
| 485 |
+

|
| 486 |
+
|
| 487 |
+

|
| 488 |
+
|
| 489 |
+

|
| 490 |
+
|
| 491 |
+

|
| 492 |
+
|
| 493 |
+

|
| 494 |
+
|
| 495 |
+

|
| 496 |
+
|
| 497 |
+

|
| 498 |
+
|
| 499 |
+

|
| 500 |
+
|
| 501 |
+

|
| 502 |
+
|
| 503 |
+

|
| 504 |
+
|
| 505 |
+

|
| 506 |
+
|
| 507 |
+

|
| 508 |
+
Left view
|
| 509 |
+
|
| 510 |
+

|
| 511 |
+
Warped image
|
| 512 |
+
|
| 513 |
+

|
| 514 |
+
Right view
|
| 515 |
+
Figure 18: We display more generated results in various scenarios.
|
| 516 |
+
|
| 517 |
+
out of 8). From the results, both foreground and background content are coherent across different frames. Furthermore, instead of building the frame matrix using a camera moving from left to right, we move the camera along a spiral trajectory. In Fig. 16 first and third rows, we selectively show the warped images in different camera views (3 out of 16), where disocclusions appear around the plane. Under each warped image, we display the corresponding image with disocclusions filled.
|
| 518 |
+
|
| 519 |
+
Diverse outputs. As shown in Fig. 21, the output is not unique because the disoccluded regions can be generated with different plausible contents, such as cliffs or trees.
|
| 520 |
+
|
| 521 |
+
More cases. In this part, more generated results are displayed in Fig. 18. The proposed method works on different scenarios, such as the beautiful church, imaginary scenes, and ships in the storm where the whole scene is dynamic. The high-quality generated results in Fig. 18 right column demonstrate the generalization ability of the proposed method. Moreover, Fig. 23 includes results from two complex real-world scenes. The dolphin case features multiple moving objects, while the train case
|
| 522 |
+
|
| 523 |
+

|
| 524 |
+
Input
|
| 525 |
+
|
| 526 |
+

|
| 527 |
+
Blended Latent Diffusion ("A stone")
|
| 528 |
+
|
| 529 |
+

|
| 530 |
+
Ours ("A stone")
|
| 531 |
+
|
| 532 |
+

|
| 533 |
+
Figure 19: Boundary re-injection in image inpainting. Our approach (blended latent diffusion + disocclusion boundary reinjection) provides a smoother transition between original and inpainted content, such as the grassland.
|
| 534 |
+
Figure 20: Compare with single-image view synthesis. SVM and AdaMPI tend to produce blurry and temporally inconsistent results, please note the content next to the character "B" across different time stamps.
|
| 535 |
+
|
| 536 |
+

|
| 537 |
+
Warped image + mask
|
| 538 |
+
Figure 21: Diverse outputs. The disoccluded regions can be generated with different content.
|
| 539 |
+
|
| 540 |
+

|
| 541 |
+
Ours 1
|
| 542 |
+
|
| 543 |
+

|
| 544 |
+
Ours 2
|
| 545 |
+
|
| 546 |
+

|
| 547 |
+
Ours 3
|
| 548 |
+
|
| 549 |
+
involves a fast-moving object. Our method performs effectively in both scenarios and outperforms results without adopting boundary re-injection design.
|
| 550 |
+
|
| 551 |
+

|
| 552 |
+
|
| 553 |
+

|
| 554 |
+
|
| 555 |
+

|
| 556 |
+
|
| 557 |
+

|
| 558 |
+
|
| 559 |
+

|
| 560 |
+
|
| 561 |
+

|
| 562 |
+
|
| 563 |
+

|
| 564 |
+
SVM
|
| 565 |
+
|
| 566 |
+

|
| 567 |
+
AdaMPI
|
| 568 |
+
|
| 569 |
+

|
| 570 |
+
Ours
|
| 571 |
+
|
| 572 |
+

|
| 573 |
+
Figure 22: More comparisons with single-image view synthesis. SVM and AdaMPI tend to produce blurry results in disoccluded regions.
|
| 574 |
+
Figure 23: Complex real-world scenes. Our method is effective in real-world scenes featuring multiple moving objects, such as dolphins, as well as fast-moving objects, like trains. Without using boundary re-injection, results have obvious artifacts.
|
2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:d8c821862760c7ecce43dcae65db893875cc9f8b81a1184bd81638faae540af3
|
| 3 |
+
size 2381013
|
2025/SVG_ 3D Stereoscopic Video Generation via Denoising Frame Matrix/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/fe5165df-7f32-4773-b651-e37557ad3edc_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/fe5165df-7f32-4773-b651-e37557ad3edc_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/fe5165df-7f32-4773-b651-e37557ad3edc_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cb4c8e354cc61a1cfcf63e56a90c72dacecbba85f83b86010e25205b0bd2b256
|
| 3 |
+
size 1810612
|
2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/full.md
ADDED
|
@@ -0,0 +1,642 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SWE-SEARCH: ENHANCING SOFTWARE AGENTS WITH MONTE CARLO TREE SEARCH AND ITERATIVE REFINEMENT
|
| 2 |
+
|
| 3 |
+
Antonis Antoniades $^{1*}$ , Albert Örwall $^{2*}$
|
| 4 |
+
Kexun Zhang $^{3}$ , Yuxi Xie $^{4}$ , Anirudh Goyal $^{5}$ , William Wang $^{1}$
|
| 5 |
+
|
| 6 |
+
<sup>1</sup>University of California, Santa Barbara, <sup>2</sup>Moatless AI, <sup>3</sup>Carnegie Mellon University,
|
| 7 |
+
|
| 8 |
+
$^{4}$ National University of Singapore, $^{5}$ Mila
|
| 9 |
+
|
| 10 |
+
# ABSTRACT
|
| 11 |
+
|
| 12 |
+
Software engineers operating in complex and dynamic environments must continuously adapt to evolving requirements, learn iteratively from experience, and reconsider their approaches based on new insights. However, current large language model (LLM)-based software agents often follow linear, sequential processes that prevent backtracking and exploration of alternative solutions, limiting their ability to rethink their strategies when initial approaches prove ineffective. To address these challenges, we propose SWE-Search, a multi-agent framework that integrates Monte Carlo Tree Search (MCTS) with a self-improvement mechanism to enhance software agents' performance on repository-level software tasks. SWE-Search extends traditional MCTS by incorporating a hybrid value function that leverages LLMs for both numerical value estimation and qualitative evaluation. This enables self-feedback loops where agents iteratively refine their strategies based on both quantitative numerical evaluations and qualitative natural language assessments of pursued trajectories. The framework includes a SWE-Agent for adaptive exploration, a Value Agent for iterative feedback, and a Discriminator Agent that facilitates multi-agent debate for collaborative decision-making. Applied to the SWE-bench benchmark, our approach demonstrates a $23\%$ relative improvement in performance across five models compared to standard open-source agents without MCTS. Our analysis reveals how performance scales with increased inference-time compute through deeper search, providing a pathway to improve software agents without requiring larger models or additional training data. This highlights the potential of self-evaluation driven search techniques in complex software engineering environments.
|
| 13 |
+
|
| 14 |
+
# 1 INTRODUCTION
|
| 15 |
+
|
| 16 |
+
Software engineering is a complex and iterative process involving exploration, problem-solving, and decision-making under uncertainty. Tasks such as debugging, feature development, and code refactoring require continuous assessment of different approaches, frequent backtracking, and the incorporation of new information. While machine learning has made progress in automating parts of this workflow (Li et al., 2022; OpenAI et al., 2024; Ouyang et al., 2022; Yang et al., 2024b), replicating the adaptive and strategic behavior of human engineers remains a significant challenge. This is due to the inherently non-linear and iterative nature of software engineering, where engineers dynamically explore various solutions, refine strategies based on feedback, and collaborate to identify the most effective path forward. Current large language model (LLM)-based software agents (Xia et al., 2024; Zhang et al., 2024d), while powerful, often struggle with complex, long-horizon tasks that require adaptive strategies and flexible reassessment over time. These agents can become trapped in repetitive patterns, limiting their effectiveness in tackling more intricate software engineering problems.
|
| 17 |
+
|
| 18 |
+
To address these challenges, we introduce SWE-Search, a multi-agent system that replicates the adaptability, iterative learning, and collaborative decision-making of human engineers. SWE-Search is designed to address three critical needs in software engineering:
|
| 19 |
+
|
| 20 |
+
Flexible Exploration and Adaptation: Engineering problems often require exploring multiple approaches and adapting strategies based on evolving information (Li et al., 2022). SWE-Search's SWE-Agent operates in a flexible state space, allowing it to fluidly transition between actions such as planning, searching, and editing. This design mirrors the way engineers backtrack and adjust their approach dynamically, ensuring the agent can revise its course when faced with new challenges or information, and points towards the direction of more general, open-ended systems (Wang et al., 2023; Ma et al., 2024a; Lu et al., 2024b; Faldor et al., 2024; Hu et al., 2024; Lu et al., 2024a).
|
| 21 |
+
|
| 22 |
+
Iterative Learning through Feedback: Effective engineering relies heavily on continuous testing and refinement. To replicate this, SWE-Search integrates a Monte Carlo Tree Search (MCTS) (Silver et al., 2016b) planning module paired with a Value Agent. The MCTS module balances exploration and exploitation to guide the agent through complex solution spaces. The Value Agent augments this process by providing both utility estimates and qualitative feedback, allowing the agent to iteratively improve its decision-making based on past experiences, similar to how engineers refine their work through feedback and debugging.
|
| 23 |
+
|
| 24 |
+
Collaborative Decision-Making: Complex problems often benefit from diverse perspectives (Khan et al., 2024; Amayuelas et al., 2024; Du et al., 2023; Zhang et al., 2024c). In SWE-Search, once a set of potential solutions is generated, the Discriminator Agent facilitates a multi-agent debate. Each agent advocates for different solutions by presenting arguments, which are critically evaluated by a judge agent. This process mirrors real-world engineering collaboration, where teams deliberate to refine and select the most robust solutions.
|
| 25 |
+
|
| 26 |
+
We evaluate SWE-Search on the SWE-bench-lite, a benchmark which tests agents' ability to resolve real-world repository-level issues by generating code patches that fix failing tests. SWE-Search demonstrates a $23\%$ relative performance improvement across five models compared to standard open-source agents. We explore how performance scales with increased search depth and identify key factors that enhance self-assessment in software agents. Our work demonstrates the potential of MCTS and iterative learning to improve agent reasoning and planning in dynamic, complex domains like software engineering, introducing a new paradigm for autonomous software development.
|
| 27 |
+
|
| 28 |
+
# 2 RELATED WORK
|
| 29 |
+
|
| 30 |
+
Search methods Various search approaches have been applied to Large Language Models (LLMs) to facilitate System 2 (Kahneman, 2011; Saha et al., 2024; Pan et al., 2023; Bounsi et al., 2024) thinking in non-linear reasoning structures. A critical feature of these approaches is their ability to backtrack. Unlike greedy processes (Black, 2005), search algorithms explore multiple branches at each step, potentially escaping paths that lead to dead ends. These methods differ in their strategies for exploring and memorizing possible choices, and in their heuristics for switching between them. Breadth-first search (Moore, 1959) maintains all possible search paths, incurring significant memory and computational costs. Depth-first search (Cormen et al., 2009), in contrast, prioritizes the most promising path in a more greedy manner. When applied to LLMs, these methods demonstrate a trade-off between diversity and quality in text generation (Yao et al., 2023). The $\mathrm{A}^*$ algorithm (Hart et al., 1968) combines aspects of breadth-first and greedy search to find optimal solutions using a predetermined evaluation function. In this work, we adopt Monte Carlo Tree Search (MCTS) (Coulom, 2007), an advanced search algorithm that conducts statistical tree search without requiring dedicated evaluation heuristics for each state. MCTS has achieved impressive results in complex strategy games (Silver et al., 2016b), protein folding (Jumper et al., 2021), and algorithm discovery (Fawzi et al., 2022).
|
| 31 |
+
|
| 32 |
+
Software Agents Software agents are designed to perform autonomous actions within large code-bases. Given a repository-level task, these agents typically locate relevant files and code segments before implementing necessary changes. We focus on the SWE-bench task (Jimenez et al., 2024), which involves resolving real-world GitHub issues. Among the agents with disclosed technical details on SWE-bench, Yang et al. (2024b) introduced the concept of agent-computer interfaces with SWE-agent. OpenDevin (Wang et al., 2024b) presents a collection of community-driven agents,
|
| 33 |
+
|
| 34 |
+
including CodeAct (Wang et al., 2024a). The Agentless approach demonstrated competitive performance using a simple two-step process of localization and repair. AutoCodeRover (Zhang et al., 2024d) incorporated advanced code tools such as abstract syntax trees and spectrum-based fault localization. The Alibaba Lingma Agent (Ma et al., 2024b) introduced a search-based approach for repository exploration, followed by a structured editing phase. While effective, it constitutes a more hand-designed solution specifically designed to interface with the search functionality of their agent. Finally, Brown et al. (2024) show that repeated trajectory sampling using the exact same agent/model setup can yield results with high variance.
|
| 35 |
+
|
| 36 |
+
# 3 METHODOLOGY
|
| 37 |
+
|
| 38 |
+
SWE-Search is a multi-agent system designed to tackle complex software engineering tasks by integrating dynamic planning, value estimation, and deliberative decision-making. The core motivation behind this method is to emulate the sophisticated, iterative workflows of human software engineers, where exploration, planning, and collaboration are crucial to solving intricate problems. By leveraging the strengths of Monte Carlo Tree Search (MCTS) for planning, a Value Agent for utility estimation and feedback, and a Discriminator Agent for final decision-making through debate, SWE-Search provides a comprehensive, adaptive framework capable of navigating and solving real-world software engineering challenges.
|
| 39 |
+
|
| 40 |
+
SWE-Search consists of four primary components that work in synergy:
|
| 41 |
+
|
| 42 |
+
SWE-Search Framework and Action Agent: Building on the meatless-tools framework (Örwall, 2024), SWE-Search operates in a dynamic code environment with a flexible state-space and a git-like commit tree structure. This design facilitates efficient backtracking to previous states, enabling the Action Agent to explore diverse solution trajectories. The adaptable state-space enhances the system's ability to exploit the MCTS module effectively.
|
| 43 |
+
|
| 44 |
+
Value (Function) Agent: To approximate the utility of each observation, we employ an LLM-based value function, which in addition to outputting a value, also generates an explanation in natural language. This explanation can be leveraged to improve subsequent actions from parent nodes, enabling iterative self-improvement of the search process.
|
| 45 |
+
|
| 46 |
+
Search Algorithm: The core of SWE-Search's exploration strategy is based on a Monte Carlo Tree Search (MCTS) which uses a heuristic-based selection process similar to AlphaZero (Silver et al., 2016a), specifically tailored for software engineering tasks. This modified MCTS algorithm effectively balances exploration and exploitation, helping the agent explore a diverse set of solutions and converge quickly on the most promising strategies.
|
| 47 |
+
|
| 48 |
+
Discriminator Agent: In the final stage of SWE-Search, the Discriminator Agent evaluates the solutions generated by the search process. Inspired by multi-agent debate frameworks (Du et al., 2023; Khan et al., 2024; Amayuelas et al., 2024), this agent engages in a structured debate, where multiple agents argue for or against the proposed solutions. The debate process not only surfaces diverse perspectives but also leads to a more rigorously justified final decision.
|
| 49 |
+
|
| 50 |
+
# 3.1 PROBLEM FORMULATION
|
| 51 |
+
|
| 52 |
+
The task of the SWE agent can be formalized as a tuple $\mathcal{M} = (S, \mathcal{C}, \mathcal{A}, \mathcal{V}, \mathcal{P}, p_0, \rho)$ . Here, $\mathcal{S}$ represents the state space, encompassing all possible states such as the current context of the files the agent is working on and the overall status of the codebase. The context space, denoted as $\mathcal{C}$ , includes metadata about the repository and the initial problem description. The value function $\mathcal{V}$ assigns a utility score to each state-action pair $O(a, t)$ , guiding the agent's decisions.
|
| 53 |
+
|
| 54 |
+
The environment's dynamics are defined by a context-dependent transition function $\mathcal{P}: S \times \mathcal{A} \times \mathcal{C} \to \Delta(S)$ , which models the evolution of the repository's state after each action. The initial state distribution, $p_0: \mathcal{C} \to \Delta(S)$ , specifies how the initial state depends on the given context, while $\rho \in \Delta(\mathcal{C})$ defines the distribution over contexts.
|
| 55 |
+
|
| 56 |
+
Given an initial context $c \sim \rho$ and an initial state $s_0 \sim p_0(\cdot \mid c)$ , the SWE agent executes its policy $\pi : S \times \mathcal{C} \to \Delta(\mathcal{A})$ , which selects actions based on the current state and context. At each time step $t$ , the agent takes an action of type $\tau$ , $a_{t,\tau} \sim \pi(s_{t,\tau}, c)$ and receives a corresponding reward
|
| 57 |
+
|
| 58 |
+

|
| 59 |
+
Figure 1: SWE-Search Overview. Tree search. Each state is represented as a node from which the agent can expand from, and each corresponding action is presented as an edge. Evaluation. Uses all relevant context including trajectory information, file context, and executed tests, to provide a quantitative value estimation and qualitative explanation in natural language. Expansion. Nodes can be expanded using value function feedback from future actions.
|
| 60 |
+
|
| 61 |
+
$\mathcal{R}(s_{t,\tau},a_{t,\tau},c)$ . The environment then transitions to a new state $s_{t + 1}\sim \mathcal{P}(\cdot \mid s_{t,\tau},a_{t,\tau},c)$ , and the agent continues to observe this updated state. Over time, this process generates a trajectory $\tau \coloneqq \{s_{t,\tau},a_{t,\tau},r_t\}_{t = 0}^T$ as the agent interacts with the environment.
|
| 62 |
+
|
| 63 |
+
The agent's objective is to maximize the cumulative reward over the trajectory, which is captured by the value function $v(s_{t,\tau}, a_{t,\tau}, \{s_i\}_{i=0}^{t-1}, \{a_i\}_{i=0}^{t-1})$ . This value function depends not only on the current state and action but also on the history of previous states and actions, which deviates from the assumptions of a Markovian process. Formally, the agent seeks to maximize the expected cumulative reward, defined as: $\max_{\pi} V_T(\rho) = \max_{\pi} \mathbb{E}_{\tau} \left[ \sum_{t=0}^{T} R(s_{t,\tau}, a_{t,\tau}, c) \mid c \sim \rho; \pi \right]$ .
|
| 64 |
+
|
| 65 |
+
This optimization captures the agent's (in-context) process, as it adjusts its policy $\pi$ to achieve the highest expected return across multiple trajectories, considering both current and historical information.
|
| 66 |
+
|
| 67 |
+
# 3.2 SWE-SEARCH FRAMEWORK AND ACTION AGENT
|
| 68 |
+
|
| 69 |
+
The SWE-Search Action Agent builds on the meatless-tools framework (Örwall, 2024). Its action space, $\mathcal{A}$ , is organized as a two-tier hierarchy, comprising both action types and their corresponding specific actions. Formally, this can be expressed as $\mathcal{A} = (t,\tau ,a)\mid t\in \mathcal{T},a\in \mathcal{A}_t$ , where $\mathcal{T}$ represents the set of action types (e.g., Search, Plan, Edit), and $\mathcal{A}_t$ is the set of possible actions corresponding to each type $\tau$ . These actions range from tool invocations and code modifications to the generation of structured text. When an action is executed, the Agent transitions to a state of the corresponding action type $s_{t + 1,\tau}$ . To enhance the base agent's effectiveness in search-driven tasks, we introduced the following modifications:
|
| 70 |
+
|
| 71 |
+
One key modification we implemented is the expansion of the Plan state, allowing it to transition flexibly to any other state, rather than being limited to transitioning only to Edit. This change is motivated by the need to enable more dynamic and adaptive problem-solving behaviors within the agent. In the context of software engineering, rigid state transitions can be overly restrictive. For instance, during code modification tasks, an agent might recognize mid-process that further planning, additional searches, or different types of analysis are necessary before proceeding with edits. Restricting transitions only to editing would artificially constrain the agent, potentially leading it to suboptimal actions or causing it to become stuck in unproductive loops. By allowing transitions to any state, we empower the agent to adapt to new information as it arises (Fig. 2), exploring
|
| 72 |
+
|
| 73 |
+
a wider variety of trajectories. This enhanced flexibility reflects the iterative and often non-linear nature of real software engineering workflows, where engineers frequently revisit planning, testing, and research phases before committing to edits.
|
| 74 |
+
|
| 75 |
+
Second, the agent is empowered to execute any tests within the codebase at its discretion, as well as to create and implement new tests. The results of these tests are incorporated into both the value function and the agent's subsequent decision-making process. It is crucial to highlight that the tests required to resolve a given instance (i.e., fail-to-pass tests) are not explicitly revealed to the agent. However, the agent can leverage any pre-existing tests within the repository, simulating the behavior of a real-world software engineer. We refer to this enhanced base agent as Moatless-Adapted.
|
| 76 |
+
|
| 77 |
+
# 3.3 VALUE (FUNCTION) AGENT
|
| 78 |
+
|
| 79 |
+
The role of the Value Agent extends beyond simply estimating the expected utility of a given state-action pair $V(s_{t},a_{t})$ . In addition to calculating the value $v_{n}$ , the Value Agent generates a written explanation, denoted as $\varepsilon$ . This explanation serves a dual purpose: it provides transparency into the decision-making process and functions as feedback for the Action Agent, which can leverage this explanation when re-expanding from the parent node of $O_{n}$ (see Figure 1, hindsight feedback). This approach enables the system to iteratively refine its decision-making process, mirroring how a human software engineer continuously re-evaluates their approach based on new information to improve their problem-solving strategy.
|
| 80 |
+
|
| 81 |
+
The input to the value function consists of all state-action pairs up to and including the current state being evaluated, alongside specific instructions on how to assess the state. This allows the Value Agent to contextualize the decision within the trajectory, accounting for the sequence of actions and states leading up to the present. The final output of the value function can be formalized as:
|
| 82 |
+
|
| 83 |
+
$$
|
| 84 |
+
\left(v _ {t}, \varepsilon_ {t}\right) = V \left(s _ {t, \tau}, a _ {t, \tau}, \left\{s _ {i} \right\} _ {i = 0.. t - 1}, \left\{a _ {i} \right\} _ {i = 0.. t - 1}\right) \tag {1}
|
| 85 |
+
$$
|
| 86 |
+
|
| 87 |
+
Here, $v_{t}$ represents the expected utility of the current state-action pair, while $\varepsilon_{t}$ is the accompanying explanation.
|
| 88 |
+
|
| 89 |
+
In practice, the Value Agent is tasked with analyzing the entire trajectory leading up to the current state-action pair, providing not only the required utility estimate $v_{t}$ , but also a detailed explanation $\varepsilon_{t}$ . This explanation is critical for the agent's overall performance, as it offers insight into the reasoning behind utility estimates, which in turn informs the Action Agent's future decisions. We have observed that one of the key factors driving the effectiveness of the Value Agent lies in the clarity and specificity of these explanations. A well-articulated explanation can illuminate the strengths and limitations of different state types (e.g., Search, Edit, Plan), helping the Action Agent better understand which types of states are more promising or risky to pursue.
|
| 90 |
+
|
| 91 |
+
By providing detailed feedback on the potential utility of different actions and contextualizing them within the broader trajectory, the Value Agent enables more informed and strategic decision-making by the Action Agent. This integration of both quantitative and qualitative feedback leads to improved performance and more adaptive behavior throughout the task (Fig. 4a).
|
| 92 |
+
|
| 93 |
+
# 3.4 SEARCH ALGORITHM
|
| 94 |
+
|
| 95 |
+
Our search tree is structured with nodes representing states $S_{t,\tau}$ and edges representing actions $\mathcal{A}_{t,\tau}$ . The search algorithm employed is a modified Monte Carlo Tree Search (MCTS), specifically adapted for the tasks of the SWE-Agent. Unlike prior approaches for web agents that utilize language models in the selection process (Koh et al., 2024; Zhang et al., 2024b), we deliberately choose not to rely on language models for node selection. Instead, we adopt a more straightforward heuristic-based selection function, similar to the approach used in AlphaZero (Silver et al., 2016a; 2018). This decision is driven by the need for interpretability, efficiency, and the focus on tasks where heuristic-based exploration suffices to guide the agent effectively through complex software engineering environments.
|
| 96 |
+
|
| 97 |
+
At the core of our algorithm is a modified Upper Confidence Bound for Trees (UCT) selection criterion (Kocsis & Szepesvári, 2006), which determines the next node to expand. This criterion balances exploitation of known high-reward actions with exploration of less-visited states. We introduce additional terms to encourage strategic exploration early in the search process, and to penalize overexploration at later stages when convergence on the optimal solution is desired. The modified UCT function is expressed as:
|
| 98 |
+
|
| 99 |
+
$$
|
| 100 |
+
U C T (s, a) = \text {e x p l o i t a t i o n} + \text {e x p l o r a t i o n} + \text {e a r l y} \cdot \text {d e p t h} \cdot \text {b o u n s} - \text {l a t e} \cdot \text {d e p t h} \cdot \text {p e n a l t y} \tag {2}
|
| 101 |
+
$$
|
| 102 |
+
|
| 103 |
+
This can be expressed more formally as:
|
| 104 |
+
|
| 105 |
+
$$
|
| 106 |
+
U C T (s, a) = V (s, a) + C \sqrt {\frac {\ln N (s)}{N (s , a)}} + \alpha e ^ {- \beta (d - 1)} - \gamma \sqrt {d} \tag {3}
|
| 107 |
+
$$
|
| 108 |
+
|
| 109 |
+
$V(s,a)$ is the value estimate of the state-action pair, $N(s,a)$ is the number of times the state-action pair $(s,a)$ has been visited, $N(s)$ is the visit count of state $s$ , $d$ is the depth of the node in the search tree, and $C, \alpha, \beta$ , and $\gamma$ are constants that control the balance between exploration, exploitation, and depth-dependent rewards and penalties.
|
| 110 |
+
|
| 111 |
+
This formulation is inspired by the way software engineers explore potential solutions to a task. In practice, an engineer's search process can be broken down into the following key phases, which our algorithm mirrors:
|
| 112 |
+
|
| 113 |
+
Early Exploration: Initially, an engineer explores a wide variety of potential approaches to fully understand the problem and identify promising strategies. This is encouraged in our algorithm by the early_depth_bonus, represented by the term $\alpha e^{-\beta (d - 1)}$ , which rewards exploration at shallow depths, simulating the early phases of wide exploration.
|
| 114 |
+
|
| 115 |
+
Convergence and Exploitation: As the engineer gains more information and narrows down the options, the focus shifts to exploiting the most effective solution paths. This transition is handled by the standard UCT exploitation term $V(s,a)$ and is further reinforced by the late_depth_penalty $(-\gamma \sqrt{d})$ , which discourages over-exploration as the agent delves deeper into the search tree.
|
| 116 |
+
|
| 117 |
+
Quick Abandonment of Poor Strategies: Software engineers are also adept at abandoning poor strategies when new information indicates that a particular approach is not viable. We capture this behavior by implementing a simple heuristic rule that abandons nodes associated with consecutive low rewards, ensuring that the agent does not waste resources on unproductive trajectories.
|
| 118 |
+
|
| 119 |
+
At each step, the node with the highest UCT value is selected for expansion, formalized as:
|
| 120 |
+
|
| 121 |
+
$$
|
| 122 |
+
s ^ {*} = \underset {(s, a)} {\arg \max } U C T (s, a) \tag {4}
|
| 123 |
+
$$
|
| 124 |
+
|
| 125 |
+
This approach effectively mimics the decision-making process of a software engineer, who balances exploration of potential strategies with a focus on converging towards the optimal solution, while remaining flexible enough to backtrack when necessary. By incorporating heuristic feedback and depth-based adjustments, the algorithm avoids getting stuck in unproductive paths and enhances the agent's ability to identify high-reward strategies with minimal computational overhead Appendix 6.
|
| 126 |
+
|
| 127 |
+
# 3.5 DISCRIMINATOR AGENT
|
| 128 |
+
|
| 129 |
+
The final stage of SWE-Search involves the Discriminator Agent, whose role is to evaluate the candidate solutions generated by the search process and select the one most likely to resolve the issue at hand. This module accepts up to five final solutions produced by the search and engages in a multi-agent debate to determine the most promising option. Drawing inspiration from recent work on persuasive multi-agent debates (Khan et al., 2024; Amayuelas et al., 2024), the Discriminator leverages the collective reasoning of multiple agents to ensure a more robust final selection. The complete prompts used in both the debate rounds and conclusion phase are provided in Appendix L. Configuration and hyperparameter details can be found in Table 2.
|
| 130 |
+
|
| 131 |
+

|
| 132 |
+
Figure 2: Hindsight feedback error correction. Instance sympy__sympy-15678, SWE-Search with Qwen2.5-72B-Instruct. Initially, the Action Agent performs edits and runs tests, which pass. It prematurely concludes the search. Without actually knowing the proposed solution does not resolve the issue, the Value Agent identifies potentially missed tests and assigns a low reward. Upon re-expansion using the Value Agent's feedback, new tests fail, prompting the Action Agent to make additional edits, which result in a preferred solution which ultimately resolves the issue.
|
| 133 |
+
|
| 134 |
+
The discriminator stage extends the MCTS framework by enabling direct comparison between candidate solutions through structured debate. While our value function achieves $73\%$ accuracy in solution evaluation, empirical results show that the discriminator improves final selection accuracy to $84\%$ (Fig. 8a). This improvement is particularly notable for cases where multiple solutions have similar value estimates but differ in implementation details. The structured comparison helps identify subtle trade-offs that may not be captured by the value function alone.
|
| 135 |
+
|
| 136 |
+
# 4 EXPERIMENTS
|
| 137 |
+
|
| 138 |
+
Benchmark For our experiments, we utilize SWE-bench Lite, a curated subset of the official SWE-bench, containing 300 instances. This dataset is specifically designed to be self-contained and focuses primarily on evaluating functional bug fixes, providing a controlled environment to assess the performance of our system.
|
| 139 |
+
|
| 140 |
+
Evaluation Metrics We use two metrics: resolve rate $(Pass@1)$ and $Pass@5$ . Resolve rate is the percentage of issues successfully resolved, measuring overall effectiveness. $Pass@5$ is the percentage of issues where a correct solution is found within five attempts. This allows us to assess the efficiency of the search in identifying successful bug fixes within a limited number of iterations.
|
| 141 |
+
|
| 142 |
+
Baselines Software agents leverage diverse tools, architectures, and models, leading to variability in their performance on subsets of the SWE-bench Lite dataset (Zhang et al., 2024a). For comparison, we build upon the moatless-tools framework (Örwall, 2024), a high-performing open-source agent commonly used in research settings (Chowdhury et al., 2024). To isolate the impact of our search approach, we adapt moatless-tools v0.0.2 as our baseline, referred to as Moatless-Adapted. This allows us to fairly compare the performance of SWE-Search against Moatless-Adapted across various models, including two closed-source models (GPT-4o, GPT-4o-mini) and three open-source models (Qwen2.5-72B-Instruct (Yang et al., 2024a), Llama-3.1-70B-Instruct (Dubey et al., 2024), and DeepSeek-V2.5 (DeepSeek-AI et al., 2024)). We also reference official moatless-tools GPT-4o results on SWE-bench Lite to ensure a fair and consistent comparison.
|
| 143 |
+
|
| 144 |
+
Implementation Details For consistency, we use identical prompts across all models. In SWE-Search, we limit each node to a maximum of three expansions and cap the total search iterations at 100. Further details on model hyperparameters can be found in Appendix, 2.
|
| 145 |
+
|
| 146 |
+
Table 1: Resolve Rate Comparison, SWE-bench Lite
|
| 147 |
+
|
| 148 |
+
<table><tr><td>Model</td><td>Moatless-v0.0.2</td><td>Moatless-Adapted</td><td>SWE-Search</td><td>% Δ</td></tr><tr><td>GPT-4o</td><td>24.3</td><td>25.7</td><td>31.0</td><td>+17</td></tr><tr><td>GPT-4o-mini</td><td>-</td><td>13.0</td><td>17.0</td><td>+24</td></tr><tr><td>Qwen-2.5-72b-Instruct</td><td>-</td><td>18.0</td><td>24.7</td><td>+27</td></tr><tr><td>Deepseek-V2.5</td><td>-</td><td>16.3</td><td>21.0</td><td>+22</td></tr><tr><td>Llama-3.1-70b-Instruct</td><td>-</td><td>13.6</td><td>17.7</td><td>+23</td></tr><tr><td colspan="4">Mean % Δ</td><td>+23</td></tr></table>
|
| 149 |
+
|
| 150 |
+
# 4.1 EXPERIMENTAL RESULTS
|
| 151 |
+
|
| 152 |
+
# 4.1.1 SWE-SEARCH SURPASSES ALL CORRESPONDING BASE AGENTS AND ENABLES SMALLER, OPEN SOURCE MODELS TO APPROACH GPT-40
|
| 153 |
+
|
| 154 |
+
On average, SWE-Search outperforms the baseline agent across all five models, achieving a $23\%$ relative improvement (Table 1). Notably, SWE-Search with Qwen-2.5-72B-Instruct exceeds the performance of GPT-4o using the original Moatless-v0.0.2 framework, and closely matches its performance when compared with the Moatless-Adapted agent, with only a slight difference $(\Delta = -1\%)$ . Interestingly, all five models demonstrate significant improvement when utilizing the proposed approach, with consistent gains across different models.
|
| 155 |
+
|
| 156 |
+
# 4.1.2 SEARCH ENABLES AGENTS TO MAKE BETTER USE OF MORE FLEXIBILITY
|
| 157 |
+
|
| 158 |
+
To prevent goal divergence, most agents, including moistless-tools, rely on strict transition rules, where state transitions follow predetermined sequences (e.g., Search $\rightarrow$ Identify, Plan $\rightarrow$ Edit). In Moatless-Adapted, we introduce a more flexible transition logic that allows a Plan state to transition into any other state type. This added flexibility has both advantages and drawbacks. On the positive side, it enables the agent to autonomously correct its trajectory without external feedback, particularly when the necessary adjustments span only a limited portion of the task. However, this increased flexibility also introduces the risk of the agent becoming trapped in infinite loops. Without a high-level control mechanism to detect and mitigate these situations, the agent may fail to recover from such loops. This trade-off is evident in the modest performance difference between Moatless-v0.0.2 and Moatless-Adapted, with a slight performance improvement of only $1.4\%$ (Table 1).
|
| 159 |
+
|
| 160 |
+
# 4.1.3 IMPACT OF HINDSIGHT FEEDBACK ON AGENT PERFORMANCE
|
| 161 |
+
|
| 162 |
+
One key advantage of utilizing LLMs for value estimation is their dual ability to provide both quantitative value estimates and qualitative assessments in natural language. These qualitative insights can significantly enhance the agent's action generation and search process by offering detailed feedback on potential errors or overlooked aspects of the task. In practice, feedback was also crucial in eliciting diversity in the actions taken by the agent, as without it, the agent would often take very similar actions when re-expanding from a parent node.
|
| 163 |
+
|
| 164 |
+
As shown in Figure 2, this mechanism plays a critical role in improving the agent's performance. During the initial expansion, the agent prematurely concludes that the task is complete. However, the value function correctly identifies gaps in the test coverage, specifically in addressing potential corner cases, and assigns a low reward. This feedback prompts the agent to re-expand the parent state, leading to the introduction of new tests, which subsequently fail. The agent then performs a series of edits (summarized in the figure for brevity), ultimately resolving the task correctly. Empirically, we observe that the instances unresolved by Moatless-Adapted but successfully solved by SWE-Search are often attributed to this search-and-feedback loop, where iterative feedback drives the agent toward a correct solution.
|
| 165 |
+
|
| 166 |
+
# 4.2 IMPORTANCE OF COMPREHENSIVE STATE INFORMATION FOR VALUE FUNCTION PERFORMANCE
|
| 167 |
+
|
| 168 |
+

|
| 169 |
+
a
|
| 170 |
+
|
| 171 |
+

|
| 172 |
+
b
|
| 173 |
+
Figure 4: (a) Importance of state-specific value prompts. On the left and right are the respective Value Agents' outputs with and without state-specific prompts. While the action in both cases is effective in finding the right file, the non-state-specific scenario does not recognize this and assigns a low reward. On the contrary, the state-specific prompt correctly assigns a high reward to this state. (b) Performance scaling with search depth across different language models. The graph shows the number of issues resolved as a function of the number of transitions (search iterations) for all models used.
|
| 174 |
+
|
| 175 |
+
The effectiveness of SWE-Search hinges on the value function's ability to accurately differentiate between desirable and undesirable states, and to provide actionable feedback that drives improvement. However, our experiments revealed that the value function sometimes failed to recognize critical decision points in the search tree. It frequently misinterpreted the purpose of certain actions, leading to the undervaluation of effective strategies by assigning low rewards. As shown in
|
| 176 |
+
|
| 177 |
+
<table><tr><td>Model</td><td>Pass@1</td><td>Pass@5</td></tr><tr><td>GPT-4o</td><td>31.0</td><td>34.0</td></tr><tr><td>GPT-4o-mini</td><td>17.0</td><td>22.3</td></tr><tr><td>Qwen-2.5-72b-Instruct</td><td>24.7</td><td>25.7</td></tr><tr><td>Deepseek-V2.5</td><td>21.0</td><td>23.3</td></tr><tr><td>Llama-3.1-70b-Instruct</td><td>21.0</td><td>22.3</td></tr></table>
|
| 178 |
+
|
| 179 |
+
Figure 3: SWE-bench SWE-Search results
|
| 180 |
+
|
| 181 |
+
Figure 4a, before the introduction of state-specific value prompts, the agent consistently assigned low rewards even when the Action Agent correctly identified the need for additional context, such as locating relevant files. This issue persisted despite the agent successfully identifying the files later. By implementing state-specific prompts across core state clusters (Searching, Planning, Editing), the value function became significantly more adept at interpreting the intent behind actions and evaluating their outcomes within each state. For further details on experiments distinguishing between effective and ineffective states, refer to Appendix 8.
|
| 182 |
+
|
| 183 |
+
Scaling SWE agents with Inference-time Compute The success of large language models (LLMs) has traditionally been attributed to the expansion of training data and model size, i.e., training-time compute (Wei et al., 2022; Chung et al., 2022). Recently, researchers have started exploring how different methods scale with inference-time (OpenAI, 2024; Snell et al., 2024; Dubey et al., 2024). Here, we study the performance of software engineering agents through increased inference-time compute. As shown in Figure 4b, increasing search iterations leads to a consistent rise in the number of resolved issues. To ensure experimental feasibility across the 300 instances in the SWE-bench Lite dataset, we applied conservative parameters (maximum iterations $= 100$ , maximum expansions per node $= 3$ ). Approaches like SWE-Search enable the allocation of greater resources to specific challenges, such as addressing critical software vulnerabilities (Rigaki et al., 2024; Fang et al., 2024), offering a scalable solution to complex tasks.
|
| 184 |
+
|
| 185 |
+
Convergence of Value Function and Discriminator to Right Solution The search process can yield multiple proposed solutions. Ideally, the mean trajectory value of the proposed solution that resolves the issue will always be the highest, which would yields the ideal performance of the agent (Figure 3). In practice, the value function successfully converged on the correct solution $73\%$ of the time on average across the five models. The discriminator module performed even better, increasing the proportion of correct solutions selected to $84\%$ . While in typical large action spaces, Monte Carlo Tree Search (MCTS) is run for thousands of iterations (Silver et al., 2016b),
|
| 186 |
+
|
| 187 |
+

|
| 188 |
+
Figure 5: (a) Value Function vs. Discriminator Comparison. Comparison of value function vs. discriminator ability to discern the final solution that resolved the issue when there is one. The discriminator performs better across all models except GPT-4o-mini. DeepSeek-V2.5 had the smallest disparity between the two methods, suggesting an ability to act as a well-calibrated value function. (b) Model-Specific Issue Resolution. Venn diagram of resolved issues by model. Each model can solve a handful of unique instances.
|
| 189 |
+
|
| 190 |
+

|
| 191 |
+
|
| 192 |
+
the value function's success rate remains impressive given the computational constraints. However, SWE-Search could further benefit from enhanced methods for identifying the correct solutions more consistently, allowing it to fully reach its potential.
|
| 193 |
+
|
| 194 |
+
Different Models can Resolve Vastly Different Issue Subsets When comparing the resolved instances across the five models, we observed significant diversity in the subsets of issues each model successfully solved. As shown in Figure 5, each model managed to resolve at least one unique instance. Notably, a surprising number of issues (33) were solved by other models but not by GPT-4o. This suggests that model diversity could play an important role, at least in the short term, in enhancing the performance of SWE-agents.
|
| 195 |
+
|
| 196 |
+
# 5 DISCUSSION AND CONCLUSION
|
| 197 |
+
|
| 198 |
+
In this paper, we introduced SWE-Search, a general framework that integrates Monte Carlo Tree Search (MCTS) and qualitative feedback to enhance the performance of software engineering agents. The proposed approach demonstrated improvements over different baseline models, highlighting the potential of search-based methods in software engineering tasks.
|
| 199 |
+
|
| 200 |
+
One of the key advantages of search-based approaches, as demonstrated in our work, is their ability to scale performance with increased inference-time compute. This flexibility allows the system to adapt to problems that require higher computational resources, such as discovering software vulnerabilities or even generating large codebases from scratch. Future research should focus on two main directions: (a) investigating how search agents scale with computational resources, and (b) expanding the application of software agent search to a broader range of complex use cases.
|
| 201 |
+
|
| 202 |
+
Given that search techniques like MCTS closely resemble the problem-solving processes of human software engineers, we expect these methods to become increasingly prevalent in agent-driven systems. As the nature of software engineering tasks evolves, system architectures will need to become more fluid and adaptable, fully leveraging the potential of search-based techniques. This evolution will likely lead to the development of larger, more general agentic systems capable of tackling a wide array of software engineering challenges.
|
| 203 |
+
|
| 204 |
+
# ACKNOWLEDGMENTS
|
| 205 |
+
|
| 206 |
+
Research was sponsored by the U.S. Army Research Office and accomplished under cooperative agreement W911NF-19-2-0026 for the Institute for Collaborative Biotechnologies.
|
| 207 |
+
|
| 208 |
+
# REFERENCES
|
| 209 |
+
|
| 210 |
+
Alfonso Amayuelas, Xianjun Yang, Antonis Antoniades, Wenyue Hua, Liangming Pan, and William Wang. Multiagent collaboration attack: Investigating adversarial attacks in large language model collaborations via debate, 2024. URL https://arxiv.org/abs/2406.14711.
|
| 211 |
+
Paul E. Black. greedy algorithm, feb 2005. URL https://www.nist.gov/dads/HTML/greedyalgo.html. Accessed: TODAY.
|
| 212 |
+
Wilfried Bounsi, Borja Ibarz, Andrew Dudzik, Jessica B. Hamrick, Larisa Markeeva, Alex Vititskyi, Razvan Pascanu, and Petar Velicković. Transformers meet neural algorithmic reasoners, 2024. URL https://arxiv.org/abs/2406.09308.
|
| 213 |
+
Bradley Brown, Jordan Juravsky, Ryan Ehrlich, Ronald Clark, Quoc V. Le, Christopher Ré, and Azalia Mirhoseini. Large language monkeys: Scaling inference compute with repeated sampling, 2024. URL https://arxiv.org/abs/2407.21787.
|
| 214 |
+
Neil Chowdhury, James Aung, Chan Jun Shern, Oliver Jaffe, Dane Sherburn, Giulio Starace, Evan Mays, Rachel Dias, Marwan Aljubeh, Mia Glaese, Carlos E. Jimenez, John Yang, Kevin Liu, and Aleksander Madry. Introducing SWE-bench verified, August 2024. URL https://openai.com/research/introducing-swe-bench-verified. OpenAI Blog.
|
| 215 |
+
Hyung Won Chung, Le Hou, Shayne Longpre, Barret Zoph, Yi Tay, William Fedus, Yunxuan Li, Xuezhi Wang, Mostafa Dehghani, Siddhartha Brahma, Albert Webson, Shixiang Shane Gu, Zhuyun Dai, Mirac Suzgun, Xinyun Chen, Aakanksha Chowdhery, Alex Castro-Ros, Marie Pellat, Kevin Robinson, Dasha Valter, Sharan Narang, Gaurav Mishra, Adams Yu, Vincent Zhao, Yanping Huang, Andrew Dai, Hongkun Yu, Slav Petrov, Ed H. Chi, Jeff Dean, Jacob Devlin, Adam Roberts, Denny Zhou, Quoc V. Le, and Jason Wei. Scaling instruction-finetuned language models, 2022. URL https://arxiv.org/abs/2210.11416.
|
| 216 |
+
Thomas H. Cormen, Charles E. Leiserson, Ronald L. Rivest, and Clifford Stein. Introduction to Algorithms, Third Edition. The MIT Press, 3rd edition, 2009. ISBN 0262033844.
|
| 217 |
+
Rémi Coulom. Efficient selectivity and backup operators in monte-carlo tree search. In H. Jaap van den Herik, Paolo Ciancarini, and H. H. L. M. (Jeroen) Donkers (eds.), Computers and Games, pp. 72-83, Berlin, Heidelberg, 2007. Springer Berlin Heidelberg. ISBN 978-3-540-75538-8.
|
| 218 |
+
DeepSeek-AI, Qihao Zhu, Daya Guo, Zhihong Shao, Dejian Yang, Peiyi Wang, Runxin Xu, Y. Wu, Yukun Li, Huazuo Gao, Shirong Ma, Wangding Zeng, Xiao Bi, Zihui Gu, Hanwei Xu, Damai Dai, Kai Dong, Liyue Zhang, Yishi Piao, Zhibin Gou, Zhenda Xie, Zhewen Hao, Bingxuan Wang, Junxiao Song, Deli Chen, Xin Xie, Kang Guan, Yuxiang You, Aixin Liu, Qiushi Du, Wenjun Gao, Xuan Lu, Qinyu Chen, Yaohui Wang, Chengqi Deng, Jiashi Li, Chenggang Zhao, Chong Ruan, Fuli Luo, and Wenfeng Liang. Deepseek-coder-v2: Breaking the barrier of closed-source models in code intelligence, 2024. URL https://arxiv.org/abs/2406.11931.
|
| 219 |
+
Yilun Du, Shuang Li, Antonio Torralba, Joshua B. Tenenbaum, and Igor Mordatch. Improving factuality and reasoning in language models through multiagent debate, 2023. URL https://arxiv.org/abs/2305.14325.
|
| 220 |
+
Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, Aiesha Letman, Akhil Mathur, Alan Schelten, Amy Yang, Angela Fan, Anirudh Goyal, Anthony Hartshorn, Aobo Yang, Archi Mitra, Archie Sravankumar, Artem Korenev, Arthur Hinsvark, Arun Rao, Aston Zhang, Aurelien Rodriguez, Austen Gregerson, Ava Spataru, Baptiste Roziere, Bethany Biron, Binh Tang, Bobbie Chern, Charlotte Caucheteux, Chaya Nayak, Chloe Bi, Chris Marra, Chris McConnell, Christian Keller, Christophe Touret, Chunyang Wu, Corinne Wong, Cristian Canton Ferrer, Cyrus Nikolaidis, Damien Allonsius, Daniel Song, Danielle Pintz, Danny Livshits, David Esiobu, Dhruv Choudhary, Dhruv Mahajan, Diego Garcia-Olano, Diego Perino, Dieuwke Hupkes, Egor Lakomkin, Ehab AlBadawy, Elina Lobanova, Emily Dinan, Eric Michael Smith, Filip Radenovic, Frank Zhang, Gabriel Synnaeve, Gabrielle Lee, Georgia Lewis Anderson, Graeme Nail, Gregoire Mialon, Guan Pang, Guillem Cucurell, Hailey Nguyen, Hannah Korevaar, Hu Xu, Hugo Touvron, Iliyan Zarov, Imanol Arrieta Ibarra, Isabel Kloumann, Ishan Misra, Ivan Evtimov, Jade Copet, Jaewon Lee, Jan Geffert, Jana Vranes, Jason Park, Jay Mahadeokar, Jeet Shah, Jelmer van der Linde, Jennifer Billock, Jenny Hong, Jenya Lee, Jeremy
|
| 221 |
+
|
| 222 |
+
Fu, Jianfeng Chi, Jianyu Huang, Jiawen Liu, Jie Wang, Jiecao Yu, Joanna Bitton, Joe Spisak, Jongsoo Park, Joseph Rocca, Joshua Johnstun, Joshua Saxe, Junteng Jia, Kalyan Vasuden Alwala, Kartikeya Upasani, Kate Plawik, Ke Li, Kenneth Heafield, Kevin Stone, Khalid El-Arini, Krithika Iyer, Kshitiz Malik, Kuenley Chiu, Kunal Bhalla, Lauren Rantala-Yeary, Laurens van der Maaten, Lawrence Chen, Liang Tan, Liz Jenkins, Louis Martin, Lovish Madaan, Lubo Malo, Lukas Blecher, Lukas Landzaat, Luke de Oliveira, Madeline Muzzi, Mahesh Pasupuleti, Mannat Singh, Manohar Paluri, Marcin Kardas, Mathew Oldham, Mathieu Rita, Maya Pavlova, Melanie Kambadur, Mike Lewis, Min Si, Mitesh Kumar Singh, Mona Hassan, Naman Goyal, Narjes Torabi, Nikolay Bashlykov, Nikolay Bogoychev, Niladri Chatterji, Olivier Duchenne, Onur Celebi, Patrick Alrassy, Pengchuan Zhang, Pengwei Li, Petar Vasic, Peter Weng, Prajjwal Bhargava, Pratik Dubal, Praveen Krishnan, Punit Singh Koura, Puxin Xu, Qing He, Qingxiao Dong, Ragavan Srinivasan, Raj Ganapathy, Ramon Calderer, Ricardo Silveira Cabral, Robert Stojnic, Roberta Raileanu, Rohit Girdhar, Rohit Patel, Romain Sauvestre, Ronnie Polidoro, Roshan Sumbaly, Ross Taylor, Ruan Silva, Rui Hou, Rui Wang, Saghar Hosseini, Sahana Chennabasappa, Sanjay Singh, Sean Bell, Seohyun Sonia Kim, Sergey Edunov, Shaoliang Nie, Sharan Narang, Sharath Raparthy, Sheng Shen, Shengye Wan, Shruti Bhosale, Shun Zhang, Simon Vandenhende, Soumya Batra, Spencer Whitman, Sten Sootla, Stephane Collot, Suchin Gururangan, Sydney Borodinsky, Tamar Herman, Tara Fowler, Tarek Sheasha, Thomas Georgiou, Thomas Scialom, Tobias Speckbacher, Todor Mihaylov, Tong Xiao Ujjwal Karn,Vedanuj GoswamiVibhor Gupta Vignesh Ramanathan,Viktor Kerkez,Vincent Gonguet,Virginie Do,Vish Vogeti,Vladan Petrovic Weiwei Chu Wenhan Xiong,Wenyin Fu Whitney Meers Xavier Martinet Xiaodong Wang Xiaqing Ellen Tan Xinfeng XieXuchao Jia Xuewei Wang Yaelle Goldschlag,Yashesh Gaur Yasmine Babaei Yi WenYiwen SongYuchen ZhangYue LiYuning MaoZacharie Delpierre Coudert Zheng Yan Zhengxing Chen Zoe Papakipos Aaditya Singh Aaron Grattafori Abha JainAdam Kelsey Adam Shajnfeld Adithya Gangidi Adolfo Victoria,Ahuva Goldstand Ajay Menon Ajay Sharma Alex Boesenberg Alex Vaughan Alexei Baevski Allie Feinstein Amanda Kallet Amit Sangani Anam Yunus Andrei Lupu Andres Alvarado Andrew Caples Andrew GuAndrew HoAndrew Poulton Andrew Ryan Ankit Ramchandani Annie Franco Aparajita Saraf Arkabadhu Chowdhury Ashley Gabriel Ashwin Bharambe Assaf Eisenman Azadeh Yazdan Beau James Ben Maurer Benjamin Leonhardi Bernie Huang Beth Loyd Beto De Paola Bhargavi ParanjapeBing LiuBo WuBoyu Ni Braden HancockBram Wasti Brandon Spence Brani Stojkovic Brian Gamido Britt Montalvo Carl ParkerCarly Burton Catalina Mejia. Changhan Wang Changkyu Kim Chao Zhou Chester Hu Ching-Hsiang Chu Chris Cai Chris Tindal Christoph Feichtenhofer Damon Civin Dana Beaty Daniel Kreymer Daniel Li Danny Wyatt David Atkins David Xu Davide Testuggine Delia David Devi Parikh Diana LiskovichDidem Foss Dingkang Wang Duc Le,Dustin Holland Edward Dowling Eissa Jamil Elaine Montgomery Eleonora Presani Emily Hahn Emily Wood Erik Brinkman Esteban Arcaute Evan Dunbar Evan Smothers Fei Sun Felix Kreuk Feng Tian Firat Ozgenel Francesco Caggioni Francisco Guzmán Frank Kanayet Frank Seide Gabriela Medina FlorezGabriella Schwarz Gada Badeer Georgia Swee Gil Halpern Govind Thattai Grant Herman Grigory SizovGuangyi ZhangGuna Lakshminarayanan Hamid Shojanazeri Han Zou Hannah Wang Hanwen Zha Haroun Habeeb Harrison Rudolph Helen Suk Henry Aspegren Hunter Goldman Ibrahim Damlaj Igor Molybog Igor Tufanov Irina-Elena Veliche Itai Gat Jake Weissman James Geboski James Kohli Japhet Asher Jean-Baptiste Gaya Jeff MarcusJeff Tang Jennifer Chan Jenny Zhen Jeremy Reizenstein Jeremy Teboul Jessica ZhongJian Jin Jingyi YangJoe Cummings Jon Carvill Jon Shepard Jonathan McPhie Jonathan Torres Josh Ginsburg Junjie Wang Kai Wu Kam Hou U Karan Saxena Karthik Prasad Kartikay Khandelwal Katayoun Zand Kathy Matosich Kaushik Veeraraghavan Kelly Michelena Keqian Li Kun Huang Kunal ChawlaKushal Lakhotia Kyle Huang Lailin Chen Lakshya Garg Lavender A. Leandro Silva Lee Bell Lei Zhang Liangpeng Guo Licheng Yu Liron Moshkovich Luca Wehrstedt Madian Khabsa Manav Avalani Manish Bhatt Maria Tsimpoukelli Martynas Mankus Matan Hasson Matthew Lennie Matthias Reso Maxim Groshev Maxim Naumov Maya Lathi Meghaneneally Michael L.Seltzer Michal Valko Michelle Restrepo Mhir Patel Mik Vyatskov Mikayel Samvelyan Mike Clark Mike Macey Mike Wang Miquel Jubert Hermoso Mo Metanat Mohammad Rastegari Munish Bansal Nandhini Santhanam,Natascha Parks Natasha White Navyata BawaNayan Singhal Nick Egebo Nicolas Usunier Nikolay Pavlovich Laptev Ning Dong Ning ZhangNorman Cheng Oleg Chernoguz Olivia Hart Omkar Salpekar Ozlem Kalinli Parkin Kent Parth Parekh Paul Saab,Pavan Balaji Pedro Rittner Philip Bontrager Pierre Roux Piotr Dollar Polina Zvyagina Prashant Ratanchandani Pritish Yuvraj Qian Liang Rachad Alao
|
| 223 |
+
|
| 224 |
+
Rachel Rodriguez, Rafi Ayub, Raghotham Murthy, Raghu Nayani, Rahul Mitra, Raymond Li, Rebekkah Hogan, Robin Battey, Rocky Wang, Rohan Maheswari, Russ Howes, Rudy Rinott, Sai Jayesh Bondu, Samyak Datta, Sara Chugh, Sara Hunt, Sargun Dhillon, Sasha Sidorov, Satadru Pan, Saurabh Verma, Seiji Yamamoto, Sharadh Ramaswamy, Shaun Lindsay, Shaun Lindsay, Sheng Feng, Shenghao Lin, Shengxin Cindy Zha, Shiva Shankar, Shuqiang Zhang, Shuqiang Zhang, Sinong Wang, Sneha Agarwal, Soji Sajuyigbe, Soumith Chintala, Stephanie Max, Stephen Chen, Steve Kehoe, Steve Satterfield, Sudarshan Govindaprasad, Sumit Gupta, Sungmin Cho, Sunny Virk, Suraj Subramanian, Sy Choudhury, Sydney Goldman, Tal Remez, Tamar Glaser, Tamara Best, Thilo Kohler, Thomas Robinson, Tianhe Li, Tianjun Zhang, Tim Matthews, Timothy Chou, Tzook Shaked, Varun Vontimitta, Victoria Ajayi, Victoria Montanez, Vijai Mohan, Vinay Satish Kumar, Vishal Mangla, Vitor Albiero, Vlad Ionescu, Vlad Poenaru, Vlad Tiberiu Mihailescu, Vladimir Ivanov, Wei Li, Wenchen Wang, Wenwen Jiang, Wes Bouaziz, Will Constable, Xiaocheng Tang, Xiaofang Wang, Xiaojian Wu, Xiaolan Wang, Xide Xia, Xilun Wu, Xinbo Gao, Yanjun Chen, Ye Hu, Ye Jia, Ye Qi, Yenda Li, Yilin Zhang, Ying Zhang, Yossi Adi, Youngjin Nam, Yu, Wang, Yuchen Hao, Yundi Qian, Yuzi He, Zach Rait, Zachary DeVito, Zef Rosnbrick, Zhaoduo Wen, Zhenyu Yang, and Zhiwei Zhao. The llama 3 herd of models, 2024. URL https://arxiv.org/abs/2407.21783.
|
| 225 |
+
Maxence Faldor, Jenny Zhang, Antoine Cully, and Jeff Clune. Omni-epic: Open-endedness via models of human notions of interestingness with environments programmed in code, 2024. URL https://arxiv.org/abs/2405.15568.
|
| 226 |
+
Richard Fang, Rohan Bindu, Akul Gupta, Qiusi Zhan, and Daniel Kang. Teams of llm agents can exploit zero-day vulnerabilities, 2024. URL https://arxiv.org/abs/2406.01637.
|
| 227 |
+
A. Fawzi, M. Balog, A. Huang, T. Hubert, B. Romera-Paredes, M. Barekatain, A. Novikov, F. J. R. Ruiz, J. Schrittwieser, G. Swirszcz, D. Silver, D. Hassabis, and P. Kohli. Discovering faster matrix multiplication algorithms with reinforcement learning. Nature, 610(7930):47-53, 2022. doi: 10.1038/s41586-022-05172-4.
|
| 228 |
+
Peter E. Hart, Nils J. Nilsson, and Bertram Raphael. A formal basis for the heuristic determination of minimum cost paths. IEEE Trans. Syst. Sci. Cybern., 4(2):100-107, 1968. doi: 10.1109/TSSC.1968.300136. URL https://doi.org/10.1109/TSSC.1968.300136.
|
| 229 |
+
Shengran Hu, Cong Lu, and Jeff Clune. Automated design of agentic systems, 2024. URL https://arxiv.org/abs/2408.08435.
|
| 230 |
+
Carlos E. Jimenez, John Yang, Alexander Wettig, Shunyu Yao, Kexin Pei, Ofir Press, and Karthik Narasimhan. Swe-bench: Can language models resolve real-world github issues?, 2024. URL https://arxiv.org/abs/2310.06770.
|
| 231 |
+
J. Jumper, R. Evans, A. Pritzel, T. Green, M. Figurnov, O. Ronneberger, K. Tunyasuvunakool, R. Bates, A. Zidek, A. Potapenko, A. Bridgland, C. Meyer, S. A. A. Kohl, A. J. Ballard, A. Cowie, B. Romera-Paredes, S. Nikolov, R. Jain, J. Adler, T. Back, S. Petersen, D. Reiman, E. Clancy, M. Zielinski, M. Steinegger, M. Pacholska, T. Berghammer, S. Bodenstein, D. Silver, O. Vinyals, A. W. Senior, K. Kavukcuoglu, P. Kohli, and D. Hassabis. Highly accurate protein structure prediction with AlphaFold. Nature, 596(7873):583-589, 2021. doi: 10.1038/s41586-021-03819-2.
|
| 232 |
+
Daniel Kahneman. Thinking, fast and slow. Farrar, Straus and Giroux, New York, NY, US, 2011. ISBN 978-0-374-27563-1.
|
| 233 |
+
Akbir Khan, John Hughes, Dan Valentine, Laura Ruis, Kshitij Sachan, Ansh Radhakrishnan, Edward Grefenstette, Samuel R. Bowman, Tim Rocktäschel, and Ethan Perez. Debating with more persuasive lms leads to more truthful answers, 2024. URL https://arxiv.org/abs/2402.06782.
|
| 234 |
+
Levente Kocsis and Csaba Szepesvári. Bandit based monte-carlo planning. In Johannes Fünkranz, Tobias Scheffer, and Myra Spiliopoulou (eds.), Machine Learning: ECML 2006, pp. 282-293, Berlin, Heidelberg, 2006. Springer Berlin Heidelberg. ISBN 978-3-540-46056-5.
|
| 235 |
+
Jing Yu Koh, Stephen McAleer, Daniel Fried, and Ruslan Salakhutdinov. Tree search for language model agents, 2024. URL https://arxiv.org/abs/2407.01476.
|
| 236 |
+
|
| 237 |
+
Yujia Li, David Choi, Junyoung Chung, Nate Kushman, Julian Schrittwieser, Rémi Leblond, Tom Eccles, James Keeling, Felix Gimeno, Agustin Dal Lago, Thomas Hubert, Peter Choy, Cyprien de Masson d'Autume, Igor Babuschkin, Xinyun Chen, Po-Sen Huang, Johannes Welbl, Sven Gowal, Alexey Cherepanov, James Molloy, Daniel J. Mankowitz, Esme Sutherland Robson, Pushmeet Kohli, Nando de Freitas, Koray Kavukcuoglu, and Oriol Vinyls. Competition-level code generation with alphanumeric. Science, 378(6624):1092-1097, 2022. doi: 10.1126/science.abq1158. URL https://www.science.org/doi/abs/10.1126/science.abq1158.
|
| 238 |
+
Chris Lu, Cong Lu, Robert Tjarko Lange, Jakob Foerster, Jeff Clune, and David Ha. The air scientist: Towards fully automated open-ended scientific discovery, 2024a. URL https://arxiv.org/abs/2408.06292.
|
| 239 |
+
Cong Lu, Shengran Hu, and Jeff Clune. Intelligent go-explore: Standing on the shoulders of giant foundation models, 2024b. URL https://arxiv.org/abs/2405.15143.
|
| 240 |
+
Yecheng Jason Ma, William Liang, Guanzhi Wang, De-An Huang, Osbert Bastani, Dinesh Jayaraman, Yuke Zhu, Linxi Fan, and Anima Anandkumar. Eureka: Human-level reward design via coding large language models, 2024a. URL https://arxiv.org/abs/2310.12931.
|
| 241 |
+
Yingwei Ma, Qingping Yang, Rongyu Cao, Binhua Li, Fei Huang, and Yongbin Li. How to understand whole software repository?, 2024b. URL https://arxiv.org/abs/2406.01422.
|
| 242 |
+
E.F. Moore. The Shortest Path Through a Maze. Bell Telephone System. Technical publications. monograph. Bell Telephone System., 1959. URL https://books.google.com/books?id=IVZBHAAACAAJ.
|
| 243 |
+
OpenAI. OpenAI o1 System Card, September 2024. URL https://openai.com/research/o1-system-card. Online report.
|
| 244 |
+
OpenAI, Josh Achiam, Steven Adler, Sandhini Agarwal, Lama Ahmad, Ilge Akkaya, Florencia Leoni Aleman, Diogo Almeida, Janko Altenschmidt, Sam Altman, Shyamal Anadkat, Red Avila, Igor Babuschkin, Suchir Balaji, Valerie Balcom, Paul Baltescu, Haiming Bao, Mohammad Bavarian, Jeff Belgium, Irwan Bello, Jake Berdine, Gabriel Bernadett-Shapiro, Christopher Berner, Lenny Bogdonoff, Oleg Boiko, Madelaine Boyd, Anna-Luisa Brakman, Greg Brockman, Tim Brooks, Miles Brundage, Kevin Button, Trevor Cai, Rosie Campbell, Andrew Cann, Brittany Carey, Chelsea Carlson, Rory Carmichael, Brooke Chan, Che Chang, Fotis Chantzis, Derek Chen, Sully Chen, Ruby Chen, Jason Chen, Mark Chen, Ben Chess, Chester Cho, Casey Chu, Hyung Won Chung, Dave Cummings, Jeremiah Currier, Yunxing Dai, Cory Decareaux, Thomas Degry, Noah Deutsch, Damien Deville, Arka Dhar, David Dohan, Steve Dowling, Sheila Dunning, Adrien Ecoffet, Atty Eleti, Tyna Eloundou, David Farhi, Liam Fedus, Niko Felix, Simón Posada Fishman, Juston Forte, Isabella Fulford, Leo Gao, Elie Georges, Christian Gibson, Vik Goel, Tarun Gogineni, Gabriel Goh, Rapha Gontijo-Lopes, Jonathan Gordon, Morgan Grafstein, Scott Gray, Ryan Greene, Joshua Gross, Shixiang Shane Gu, Yufei Guo, Chris Hallacy, Jesse Han, Jeff Harris, Yuchen He, Mike Heaton, Johannes Heidecke, Chris Hesse, Alan Hickey, Wade Hickey, Peter Hoeschele, Brandon Houghton, Kenny Hsu, Shengli Hu, Xin Hu, Joost Huizinga, Shantanu Jain, Shawn Jain, Joanne Jang, Angela Jiang, Roger Jiang, Haozhun Jin, Denny Jin, Shino Jomoto, Billie Jonn, Heewoo Jun, Tomer Kaftan, Lukasz Kaiser, Ali Kamali, Ingmar Kanitscheider, Nitish Shirish Keskar, Tabarak Khan, Logan Kilpatrick, Jong Wook Kim, Christina Kim, Yongjik Kim, Jan Hendrik Kirchner, Jamie Kiros, Matt Knight, Daniel Kokotajlo, Łukasz Kondraciuk, Andrew Kondrich, Aris Konstantinidis, Kyle Kosic, Gretchen Krueger, Vishal Kuo, Michael Lampe, Ikai Lan, Teddy Lee, Jan Leike, Jade Leung, Daniel Levy, Chak Ming Li, Rachel Lim, Molly Lin, Stephanie Lin, Mateusz Litwin Theresa Lopez Ryan Lowe Patricia Lue Anna Makanju Kim Malfacini Sam Manning Todor Markov Yaniv Markovski Bianca Martin Katie Mayer Andrew Mayne Bob McGrew Scott Mayer McKinney Christine McLeavey Paul McMillan Jake McNeil David Medina Aalok Mehta Jacob Menick Luke Metz Andrey Mishchenko Pamela Mishkin Vinnie Monaco Evan Morikawa Daniel Mossing Tong Mu Mira Murati Oleg Murk David Mély Ashvin Nair Reiichiro Nakano Rajeev Nayak Arvind Neelakantan Richard Ngo Hyeonwoo Noh Long Ouyang Cullen O'Keefe Jakub Pachocki Alex Paino Joe Palermo Ashley Pantuliano Giambattista Parascandolo Joel Parish Emy Parparita Alex Passos Mikhail Pavlov Andrew Peng Adam Perelman Filipe de Avila Belbute Peres Michael Petrov Henrique Ponde de Oliveira Pinto Michael Pokorny
|
| 245 |
+
|
| 246 |
+
Michelle Pokrass, Vitchyr H. Pong, Tolly Powell, Alethea Power, Boris Power, Elizabeth Proehl, Raul Puri, Alec Radford, Jack Rae, Aditya Ramesh, Cameron Raymond, Francis Real, Kendra Rimbach, Carl Ross, Bob Rotsted, Henri Roussez, Nick Ryder, Mario Saltarelli, Ted Sanders, Shibani Santurkar, Girish Sastry, Heather Schmidt, David Schnurr, John Schulman, Daniel Selsam, Kyla Sheppard, Toki Sherbakov, Jessica Shieh, Sarah Shoker, Pranav Shyam, Szymon Sidor, Eric Sigler, Maddie Simens, Jordan Sitkin, Katarina Slama, Ian Sohl, Benjamin Sokolowsky, Yang Song, Natalie Staudacher, Felipe Petroski Such, Natalie Summers, Ilya Sutskever, Jie Tang, Nikolas Tezak, Madeleine B. Thompson, Phil Tillet, Amin Tootoonchian, Elizabeth Tseng, Preston Tuggle, Nick Turley, Jerry Tworek, Juan Felipe Cerón Uribe, Andrea Vallone, Arun Vijayvergiya, Chelsea Voss, Carroll Wainwright, Justin Jay Wang, Alvin Wang, Ben Wang, Jonathan Ward, Jason Wei, CJ Weinmann, Akila Welihinda, Peter Welinder, Jiayi Weng, Lilian Weng, Matt Wiethoff, Dave Willner, Clemens Winter, Samuel Wolrich, Hannah Wong, Lauren Workman, Sherwin Wu, Jeff Wu, Michael Wu, Kai Xiao, Tao Xu, Sarah Yoo, Kevin Yu, Qiming Yuan, Wojciech Zaremba, Rowan Zellers, Chong Zhang, Marvin Zhang, Shengjia Zhao, Tianhao Zheng, Juntang Zhuang, William Zhuk, and Barret Zoph. Gpt-4 technical report, 2024. URL https://arxiv.org/abs/2303.08774.
|
| 247 |
+
Albert Örwall. Moatless tools, jun 2024. URL https://github.com/aorwall/ moatless-tools. Accessed: 2024-07-16.
|
| 248 |
+
Long Ouyang, Jeff Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul Christiano, Jan Leike, and Ryan Lowe. Training language models to follow instructions with human feedback, 2022. URL https://arxiv.org/abs/2203.02155.
|
| 249 |
+
Liangming Pan, Alon Albalak, Xinyi Wang, and William Yang Wang. Logic-lm: Empowering large language models with symbolic solvers for faithful logical reasoning, 2023. URL https://arxiv.org/abs/2305.12295.
|
| 250 |
+
Maria Rigaki, Carlos Catania, and Sebastian Garcia. Hackphyr: A local fine-tuned llm agent for network security environments, 2024. URL https://arxiv.org/abs/2409.11276.
|
| 251 |
+
Swarnadeep Saha, Archiki Prasad, Justin Chih-Yao Chen, Peter Hase, Elias Stengel-Eskin, and Mohit Bansal. System-1.x: Learning to balance fast and slow planning with language models, 2024. URL https://arxiv.org/abs/2407.14414.
|
| 252 |
+
David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Veda Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nature, 529(7587):484-489, 1 2016a. ISSN 1476-4687. doi: 10.1038/nature16961. URL https://doi.org/10.1038/nature16961.
|
| 253 |
+
David Silver, Aja Huang, Chris J. Maddison, Arthur Guez, Laurent Sifre, George van den Driessche, Julian Schrittwieser, Ioannis Antonoglou, Vedavyas Panneershelvam, Marc Lanctot, Sander Dieleman, Dominik Grewe, John Nham, Nal Kalchbrenner, Ilya Sutskever, Timothy P. Lillicrap, Madeleine Leach, Koray Kavukcuoglu, Thore Graepel, and Demis Hassabis. Mastering the game of go with deep neural networks and tree search. Nat., 529(7587):484-489, 2016b. doi: 10.1038/NATURE16961. URL https://doi.org/10.1038/nature16961.
|
| 254 |
+
David Silver, Thomas Hubert, Julian Schrittwieser, Ioannis Antonoglou, Matthew Lai, Arthur Guez, Marc Lanctot, Laurent Sifre, Dharshan Kumaran, Thore Graepel, Timothy Lillicrap, Karen Simonyan, and Demis Hassabis. A general reinforcement learning algorithm that masters chess, shogi, and go through self-play. Science, 362(6419):1140-1144, 2018. doi: 10.1126/science.aar6404. URL https://www.science.org/doi/abs/10.1126/science.aar6404.
|
| 255 |
+
Charlie Snell, Jaehoon Lee, Kelvin Xu, and Aviral Kumar. Scaling llm test-time compute optimally can be more effective than scaling model parameters, 2024. URL https://arxiv.org/abs/2408.03314.
|
| 256 |
+
|
| 257 |
+
Guanzhi Wang, Yuqi Xie, Yunfan Jiang, Ajay Mandlekar, Chaowei Xiao, Yuke Zhu, Linxi Fan, and Anima Anandkumar. Voyager: An open-ended embodied agent with large language models, 2023. URL https://arxiv.org/abs/2305.16291.
|
| 258 |
+
Xingyao Wang, Yangyi Chen, Lifan Yuan, Yizhe Zhang, Yunzhu Li, Hao Peng, and Heng Ji. Executable code actions elicit better llm agents, 2024a. URL https://arxiv.org/abs/2402.01030.
|
| 259 |
+
Xingyao Wang, Boxuan Li, Yufan Song, Frank F. Xu, Xiangru Tang, Mingchen Zhuge, Jiayi Pan, Yueqi Song, Bowen Li, Jaskirat Singh, Hoang H. Tran, Fuqiang Li, Ren Ma, Mingzhang Zheng, Bill Qian, Yanjun Shao, Niklas Muennighoff, Yizhe Zhang, Binyuan Hui, Junyang Lin, Robert Brennan, Hao Peng, Heng Ji, and Graham Neubig. Opendevin: An open platform for ai software developers as generalist agents, 2024b. URL https://arxiv.org/abs/2407.16741.
|
| 260 |
+
Jason Wei, Yi Tay, Rishi Bommasani, Colin Raffel, Barret Zoph, Sebastian Borgeaud, Dani Yogatama, Maarten Bosma, Denny Zhou, Donald Metzler, et al. Emergent abilities of large language models. arXiv preprint arXiv:2206.07682, 2022.
|
| 261 |
+
Chunqiu Steven Xia, Yinlin Deng, Soren Dunn, and Lingming Zhang. Agentless: Demystifying llmbased software engineering agents, 2024. URL https://arxiv.org/abs/2407.01489.
|
| 262 |
+
An Yang, Baosong Yang, Binyuan Hui, Bo Zheng, Bowen Yu, Chang Zhou, Chengpeng Li, Chengyuan Li, Dayiheng Liu, Fei Huang, Guanting Dong, Haoran Wei, Huan Lin, Jialong Tang, Jialin Wang, Jian Yang, Jianhong Tu, Jianwei Zhang, Jianxin Ma, Jianxin Yang, Jin Xu, Jingren Zhou, Jinze Bai, Jinzheng He, Junyang Lin, Kai Dang, Keming Lu, Keqin Chen, Kexin Yang, Mei Li, Mingfeng Xue, Na Ni, Pei Zhang, Peng Wang, Ru Peng, Rui Men, Ruize Gao, Runji Lin, Shijie Wang, Shuai Bai, Sinan Tan, Tianhang Zhu, Tianhao Li, Tianyu Liu, Wenbin Ge, Xiaodong Deng, Xiaohuan Zhou, Xingzhang Ren, Xinyu Zhang, Xipin Wei, Xuancheng Ren, Xuejing Liu, Yang Fan, Yang Yao, Yichang Zhang, Yu Wan, Yunfei Chu, Yuqiong Liu, Zeyu Cui, Zhenru Zhang, Zhifang Guo, and Zhihao Fan. Qwen2 technical report, 2024a. URL https://arxiv.org/abs/2407.10671.
|
| 263 |
+
John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. Swe-agent: Agent-computer interfaces enable automated software engineering, 2024b. URL https://arxiv.org/abs/2405.15793.
|
| 264 |
+
Shunyu Yao, Dian Yu, Jeffrey Zhao, Izhak Shafran, Tom Griffiths, Yuan Cao, and Karthik Narasimhan. Tree of thoughts: Deliberate problem solving with large language models. In Alice Oh, Tristan Naumann, Amir Globerson, Kate Saenko, Moritz Hardt, and Sergey Levine (eds.), Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023, 2023. URL http://papers.nips.cc/paper_files/paper/2023/bitstream/271db9922b8d1f4dd7aaef84ed5ac703-Abstract-Conference.html.
|
| 265 |
+
Kexun Zhang, Weiran Yao, Zuxin Liu, Yihao Feng, Zhiwei Liu, Rithesh Murthy, Tian Lan, Lei Li, Renze Lou, Jiacheng Xu, Bo Pang, Yingbo Zhou, Shelby Heinecke, Silvio Savarese, Huan Wang, and Caiming Xiong. Diversity empowers intelligence: Integrating expertise of software engineering agents, 2024a. URL https://arxiv.org/abs/2408.07060.
|
| 266 |
+
Yao Zhang, Zijian Ma, Yunpu Ma, Zhen Han, Yu Wu, and Volker Tresp. Webpilot: A versatile and autonomous multi-agent system for web task execution with strategic exploration, 2024b. URL https://arxiv.org/abs/2408.15978.
|
| 267 |
+
Yiqun Zhang, Xiaocui Yang, Shi Feng, Daling Wang, Yifei Zhang, and Kaisong Song. Can llms beat humans in debating? a dynamic multi-agent framework for competitive debate, 2024c. URL https://arxiv.org/abs/2408.04472.
|
| 268 |
+
Yuntong Zhang, Haifeng Ruan, Zhiyu Fan, and Abhik Roychoudhury. Autocoderover: Autonomous program improvement, 2024d. URL https://arxiv.org/abs/2404.05427.
|
| 269 |
+
|
| 270 |
+
# A REPRODUCIBILITY
|
| 271 |
+
|
| 272 |
+
All models and data used in our work are publicly available. We additionally provide hyperparameter details in Appendix 2. The code will be released as a public repository upon publication.
|
| 273 |
+
|
| 274 |
+
# B ADDITIONAL IMPLEMENTATION DETAILS
|
| 275 |
+
|
| 276 |
+
Moatless-Adapted is an extended version of the moatless-tools library with support for a tree structure, the ability to revert to earlier versions of the codebase, and the capability to run tests.
|
| 277 |
+
|
| 278 |
+
The standard implementation of moistless-tools is based on a finite state machine structure where a state holds information about file context and properties set in the configuration or from previous states. It can then transition to a new state when an action is executed. The request that initiates the action is created by an LLM. This follows a linear structure where one state can transition to another state. In Moatless-Adapted, this model is extended so that a state can expand by using actions to create more states. The connections between states are then represented in a tree structure with nodes.
|
| 279 |
+
|
| 280 |
+
Each state has a file context associated with it. This file context will be included in the prompt sent to an LLM. To limit the size of the prompt, files are divided into "spans," where a span could be, for example, a section of code (e.g., imports), a class, or a function. These are identified by span IDs. Thus, the LLM sees a limited part of the code at a time but can request more context by searching for or adding files and spans. The file context therefore changes over time, and a specific state of file context is linked to a specific state. In the standard implementation of moatless-tools, changes to the codebase are made linearly, and each change is saved directly to the file system. In Moatless-Adapted, however, there is a need to be able to revert to earlier states and thus return to a previous version of the codebase. To handle this, the code is stored in a git repository where each change is committed, and each state has a reference to a commit as well as the current patch of the diff from the initial commit that existed before starting. This way, one can go back to an earlier state by specifying the state ID, and the commit that was current at that time will be checked out.
|
| 281 |
+
|
| 282 |
+
The test files present in the file context are run each time the Plan state is initiated, and the test results are provided to the state. The tests are then run in Docker images built via the SWE-bench library. To use this approach in a benchmark where a larger number of instances should be able to run simultaneously, a solution is used where these images are run as pods in a Kubernetes cluster. Moatless-tools communicates with the testbed by applying patches and running commands via an API. When a new instance starts, a pod is created which is then reset at each run, applying the current patch and running tests according to the test command specified in the SWE-bench library. It's important to add here that the agent is not aware of the PASS_TO_PASS or FAIL_TO_PASS tests in the SWE-bench harness, but only knows how to run the tests. This corresponds to a real engineering environment where each project can have its own test commands.
|
| 283 |
+
|
| 284 |
+
# C MCTS HYPERPARAMETERS
|
| 285 |
+
|
| 286 |
+
The Monte Carlo Tree Search (MCTS) algorithm used in this study employs several hyperparameters.
|
| 287 |
+
|
| 288 |
+
Table 2: MCTS Hyperparameters
|
| 289 |
+
|
| 290 |
+
<table><tr><td>Hyperparameter</td><td>Description</td><td>Default</td></tr><tr><td>c-param</td><td>UCT exploration parameter</td><td>1.41</td></tr><tr><td>max_expansions</td><td>Max children per node</td><td>5</td></tr><tr><td>max_iterations</td><td>Max MCTS iterations</td><td>100</td></tr><tr><td>provide_feedback</td><td>Enable feedback</td><td>True</td></tr><tr><td>best_first</td><td>Use best-first strategy</td><td>True</td></tr><tr><td>value_function_temperature</td><td>Value function temperature</td><td>0.2</td></tr><tr><td>max_depth</td><td>Max tree depth</td><td>20</td></tr><tr><td colspan="3">UCT Score Calculation Parameters</td></tr><tr><td>exploration_weight</td><td>UCT exploration weight</td><td>1.0</td></tr><tr><td>depth_weight</td><td>Depth penalty weight</td><td>0.8</td></tr><tr><td>depth_bonus_factor</td><td>Depth bonus factor</td><td>200.0</td></tr><tr><td>high_value_threshold</td><td>High-value node threshold</td><td>55.0</td></tr><tr><td>low_value_threshold</td><td>Low-value node threshold</td><td>50.0</td></tr><tr><td>very_high_value_threshold</td><td>Very high-value threshold</td><td>75.0</td></tr><tr><td>high_value_leaf_bonus_constant</td><td>High-value leaf bonus</td><td>20.0</td></tr><tr><td>high_valueBAD_child_penalty_constant</td><td>High-value bad children bonus</td><td>20.0</td></tr><tr><td>high_value_child_penalty_constant</td><td>High-value child penalty</td><td>5.0</td></tr><tr><td colspan="3">Action Model Parameters</td></tr><tr><td>action_model_temperature</td><td>Action model temperature</td><td>0.2</td></tr><tr><td colspan="3">Discriminator Parameters</td></tr><tr><td>number_of Agents</td><td>Number of Discriminator Agents</td><td>5</td></tr><tr><td>number_of_round</td><td>Number of debate rounds</td><td>3</td></tr><tr><td>discriminator_temperature</td><td>Discriminator temperature</td><td>1.0</td></tr></table>
|
| 291 |
+
|
| 292 |
+
These hyperparameters can be adjusted to fine-tune the MCTS algorithm's performance for specific problem domains or computational constraints. The values listed here are the defaults as defined in the TreeSearchSettings class and the MCTS implementation.
|
| 293 |
+
|
| 294 |
+
# D ABILITY OF MCTS TO ESCAPE UNPRODUCTIVE LOOPS VS. BASELINE
|
| 295 |
+
|
| 296 |
+

|
| 297 |
+
Moutless-adapted
|
| 298 |
+
Figure 6: Avoiding Repetitive Actions, django__django__10914. We found that the base agent can often get stuck performing repetitive actions that do not bring it closer to solving the issue, and which commonly lead to unresolvable dead-ends. In this example, the base agent was stuck implementing wrong tests which continuously returned errors. In contrast, when this happens in SWE-Search, the Value Agent recognizes this, terminating these trajectories quickly, as happens in Node 73 (orange).
|
| 299 |
+
|
| 300 |
+

|
| 301 |
+
|
| 302 |
+

|
| 303 |
+
|
| 304 |
+
# E MODEL INSTANCE RESOLUTION UNIQUENESS
|
| 305 |
+
|
| 306 |
+
To understand the complementary strengths of different models in resolving software issues, we analyzed how unique their resolved issue subsets where. Figure 7 illustrates the resolution patterns for each model across five of the codebases in SWE-bench-lite.
|
| 307 |
+
|
| 308 |
+

|
| 309 |
+
Figure 7: Unique Issue Resolution Patterns Across Models and Libraries. Each column represents a different Python repository, and each row within a column represents a specific issue. Colored blocks indicate successful resolution by the corresponding model (see legend). White spaces denote unresolved issues. This visualization highlights the diverse problem-solving capabilities of different models across various software domains, demonstrating that no single model dominates across all issues and libraries.
|
| 310 |
+
|
| 311 |
+
# F ABILITY OF VALUE FUNCTION TO DISCERN SUCCESSFUL TRAJECTORIES
|
| 312 |
+
|
| 313 |
+
Before implementing SWE-Search, we conducted a general study across many models to evaluate the models' ability to differentiate states which led to resolved vs. unresolved issues. Figure 8 shows the results of this study. We found that in general, models assigned higher rewards to states which eventually led to resolved issues. Of particular interest was the Deepseek model, which seemed to identify critical errors in trajectories effectively. This was also observed in the final agent (see Fig. 5a).
|
| 314 |
+
|
| 315 |
+

|
| 316 |
+
Figure 8: Average State Reward Comparison Across Models. This graph compares the average state rewards assigned by different language models for resolved (green) and unresolved (red) issues. Error bars indicate standard deviation. Most models consistently assign higher rewards to states leading to resolved issues, with the exception of the. The 'Average' column represents the mean across all models, demonstrating a clear distinction between resolved and unresolved states.
|
| 317 |
+
|
| 318 |
+
# G VALUE FUNCTION PROMPTS
|
| 319 |
+
|
| 320 |
+
# Value Function Search Prompt
|
| 321 |
+
|
| 322 |
+
Your task is to evaluate a search action executed by an AI agent, considering the search parameters, the resulting file context, and the identified code from the search results. Your evaluation will focus on whether the search action was well-constructed, whether the resulting file context is relevant and useful for solving the problem at hand, and whether the identified code is appropriate and helpful.
|
| 323 |
+
|
| 324 |
+
# You will be provided with four inputs:
|
| 325 |
+
|
| 326 |
+
- Problem Statement: This will be provided within the <problem_statement> XML tag and contains the initial message or problem description the coding agent is trying to solve.
|
| 327 |
+
- The Search Request: This will be provided within the <search_request> XML tag and contains the search parameters used by the agent to define the search.
|
| 328 |
+
- The Search Result: The content retrieved based on the search parameters provided within a <search_results> XML tag.
|
| 329 |
+
- Identified Code: The specific code identified from the search results, provided within the <identified_code> XML tag.
|
| 330 |
+
|
| 331 |
+
# Search request parameters:
|
| 332 |
+
|
| 333 |
+
- File Pattern (file_pattern): Glob patterns (e.g., $^{**}/^{*}.\mathrm{py}$ ) to filter search results to specific files or directories.
|
| 334 |
+
- Query (query): A natural language query for semantic search.
|
| 335 |
+
- Code Snippet (code_snippet): Specific code snippets for exact matching.
|
| 336 |
+
- Class Names (class_names): Specific class names to include in the search.
|
| 337 |
+
- Function Names (function_names): Specific function names to include in the search.
|
| 338 |
+
|
| 339 |
+
# Evaluation Criteria:
|
| 340 |
+
|
| 341 |
+
# Search Parameters:
|
| 342 |
+
|
| 343 |
+
- Are they appropriately defined to focus the search on relevant files or code?
|
| 344 |
+
- Do they align well with the problem statement?
|
| 345 |
+
|
| 346 |
+
# Resulting File Context:
|
| 347 |
+
|
| 348 |
+
- Does it contain relevant and useful information for solving the problem?
|
| 349 |
+
- Are there missing or irrelevant results indicating a need to refine the search?
|
| 350 |
+
|
| 351 |
+
# Identified Code Review (most crucial):
|
| 352 |
+
|
| 353 |
+
- Is the identified code directly related to the problem?
|
| 354 |
+
- Does it provide the necessary functionality to address the issue?
|
| 355 |
+
|
| 356 |
+
# Overall Relevance:
|
| 357 |
+
|
| 358 |
+
- Does the combination of search parameters, file context, and identified code effectively address the problem?
|
| 359 |
+
- Could there be a better approach or improvements?
|
| 360 |
+
|
| 361 |
+
# Reward Scale and Guidelines:
|
| 362 |
+
|
| 363 |
+
Assign a single integer value between -100 and 100 based on how well the search action, resulting file context, and identified code addressed the task at hand. Use the following scale:
|
| 364 |
+
|
| 365 |
+
# 100:
|
| 366 |
+
|
| 367 |
+
- Search Parameters: Precisely match the problem needs; no irrelevant or missing elements.
|
| 368 |
+
- Identified Code: Completely and accurately solves the problem with no issues.
|
| 369 |
+
|
| 370 |
+
# 75 to 99:
|
| 371 |
+
|
| 372 |
+
- Search Parameters: Well-defined and mostly relevant; minor improvements possible.
|
| 373 |
+
- Identified Code: Effectively addresses the problem with minor issues that are easily fixable.
|
| 374 |
+
|
| 375 |
+
# 0 to 74:
|
| 376 |
+
|
| 377 |
+
- Search Parameters: Partially relevant; noticeable inaccuracies or omissions.
|
| 378 |
+
- Identified Code: Partially solves the problem but has significant gaps or errors.
|
| 379 |
+
|
| 380 |
+
# -1 to -49:
|
| 381 |
+
|
| 382 |
+
- Search Parameters: Misaligned with the problem; poorly defined.
|
| 383 |
+
- Identified Code: Fails to address the problem effectively; may cause confusion.
|
| 384 |
+
|
| 385 |
+
# -50 to -100:
|
| 386 |
+
|
| 387 |
+
- Search Parameters: Irrelevant or incorrect; hinders problem-solving.
|
| 388 |
+
- Identified Code: Unrelated to the problem; provides no useful information.
|
| 389 |
+
|
| 390 |
+
# Output Format:
|
| 391 |
+
|
| 392 |
+
Please ensure your output strictly adheres to the following structure: <Explanation> [A brief explanation of the evaluation in max one paragraph.] <Reward> [A single integer reward value between -100 and 100]
|
| 393 |
+
|
| 394 |
+
# Value Function Plan Prompt
|
| 395 |
+
|
| 396 |
+
Your role is to evaluate the executed action of the search tree that our AI agents are traversing, to help us determine the best trajectory to solve a programming issue. The agent is responsible for identifying and modifying the correct file(s) in response to the problem statement.
|
| 397 |
+
|
| 398 |
+
# Input Data Format:
|
| 399 |
+
|
| 400 |
+
- Problem Statement: This will be provided within the <problem_statement> XML tag and contains the initial message or problem description the coding agent is trying to solve.
|
| 401 |
+
- File Context: The relevant code context will be provided within the <file_context>
|
| 402 |
+
XML tag and pertains to the state the agent is operating on.
|
| 403 |
+
- History: The sequence of state transitions and actions taken prior to the current state will be contained within the <history> XML tag. This will include information on the parts of the codebase that were changed, the resulting diff, test results, and any reasoning or planned steps.
|
| 404 |
+
- Executed Action: The last executed action of the coding agent will be provided within the <executed_action> XML tag, this includes the proposed changes and the resulting diff of the change.
|
| 405 |
+
- Full Git Diff: The full Git diff up to the current state will be provided within the <full-git_diff> XML tag. This shows all changes made from the initial state to the current one and should be considered in your evaluation to ensure the modifications align with the overall solution.
|
| 406 |
+
- Test Results: The results of any test cases run on the modified code will be provided within the <test_results> XML tag. This will include information about passed, failed, or skipped tests, which should be carefully evaluated to confirm the correctness of the changes.
|
| 407 |
+
|
| 408 |
+
# Evaluation Criteria:
|
| 409 |
+
|
| 410 |
+
Code Correctness: Evaluate whether the implemented code correctly addresses the prob
|
| 411 |
+
|
| 412 |
+
lem. This includes verifying that the correct lines or sections of code have been identified and modified appropriately. Ensure that the changes are both syntactically and logically correct, and that the diffs accurately represent the intended modifications without introducing unrelated changes. Assess whether the modifications effectively solve the problem without introducing new issues or inefficiencies.
|
| 413 |
+
|
| 414 |
+
Mistakes in Editing Code: Identify any errors made during the code editing process. This
|
| 415 |
+
|
| 416 |
+
involves checking for unintended deletions, incorrect modifications, or syntax errors introduced through the changes. Ensure that the Git diffs maintain integrity by only including the intended modifications and no accidental alterations to unrelated parts of the codebase.
|
| 417 |
+
|
| 418 |
+
Testing: Assess the proposed changes against existing test cases. Determine if the changes
|
| 419 |
+
|
| 420 |
+
pass all relevant tests and evaluate whether any test failures could have been reasonably foreseen and avoided by the agent. Consider whether the agent anticipated potential test outcomes and addressed them proactively in the solution.
|
| 421 |
+
|
| 422 |
+
History and Action Evaluation: Review the agent's previous state transitions and actions
|
| 423 |
+
|
| 424 |
+
to determine if the current action contributes positively to solving the problem. Pay special attention to detect if the agent is engaging in repetitive actions without making meaningful progress. Evaluate whether the last executed action is appropriate and logical given the current progress and history of actions.
|
| 425 |
+
|
| 426 |
+
# Reward Scale and Guidelines:
|
| 427 |
+
|
| 428 |
+
The reward value must be based on how confident you are that the agent's solution is the most optimal one possible with no unresolved issues or pending tasks. The scale ranges from -100 to 100, where:
|
| 429 |
+
|
| 430 |
+
100: You are fully confident that the proposed solution is the most optimal possible, has been thoroughly tested, and requires no further changes.
|
| 431 |
+
75-99: The approach is likely the best one possible, but there are minor issues or opportunities for optimization. All major functionality is correct, but some small improvements or additional testing may be needed. There might be some edge cases that are not covered.
|
| 432 |
+
0-74: The solution has been partially implemented or is incomplete or there are likely alternative approaches that might be better, i.e., this is likely not the most optimal approach. The core problem might be addressed, but there are significant issues with tests, logical flow, or side effects that need attention. There are likely alternative approaches that are much better.
|
| 433 |
+
0: The solution is not yet functional or is missing key elements. The agent's assertion that the task is finished is incorrect, and substantial work is still required to fully resolve the issue. Modifying the wrong code, unintentionally removing or altering existing code, introducing syntax errors, or producing incorrect diffs fall into this range.
|
| 434 |
+
-1 to -49: The proposed solution introduces new issues or regresses existing functionality, but some elements of the solution show potential or may be salvageable. Repetitive actions without progress fall into this range.
|
| 435 |
+
-50 to -100: The solution is entirely incorrect, causing significant new problems, or fails to address the original issue entirely. Immediate and comprehensive changes are necessary. Persistent repetitive actions without progress should be heavily penalized.
|
| 436 |
+
|
| 437 |
+
# Output Format:
|
| 438 |
+
|
| 439 |
+
Please ensure your output strictly adheres to the following structure: <Explanation> [Your brief explanation of the evaluation in max one paragraph.] <Reward> [A single integer reward value between -100 and 100]
|
| 440 |
+
|
| 441 |
+
# Value Function Request More Context Prompt
|
| 442 |
+
|
| 443 |
+
Your role is to evaluate the executed action of the search tree that our AI agents are traversing, specifically for the RequestMoreContext action. This action is used when the agent requests to see code that is not in the current context, potentially revealing an understanding that relevant code is wholly or partially not visible, and enabling the agent to uncover important missing information.
|
| 444 |
+
|
| 445 |
+
# Evaluation Criteria:
|
| 446 |
+
|
| 447 |
+
- Relevance: Are the requested files and code spans likely to be relevant to the problem at hand?
|
| 448 |
+
- Necessity: Is the additional context truly needed, or is the agent unnecessarily expanding the scope?
|
| 449 |
+
- Specificity: Has the agent been specific in its request, or is it asking for overly broad sections of code?
|
| 450 |
+
- Contextual Understanding: Does the request demonstrate a good understanding of the codebase structure and the problem domain?
|
| 451 |
+
- Efficiency: Is the agent making targeted requests, or is it asking for too much unnecessary information?
|
| 452 |
+
- Progress: Does this request seem likely to move the problem-solving process forward?
|
| 453 |
+
|
| 454 |
+
# Input Data Format:
|
| 455 |
+
|
| 456 |
+
- Problem Statement: Provided within the <problem_statement> XML tag, containing the initial problem description.
|
| 457 |
+
- File Context: The current code context within the <file_context> XML tag.
|
| 458 |
+
- History: Previous state transitions and actions within the <history> XML tag.
|
| 459 |
+
- Executed Action: The RequestMoreContext action details within the <executed_action> XML tag, including the files and code spans requested.
|
| 460 |
+
|
| 461 |
+
Reward Scale and Guidelines: Assign a single integer value between -100 and 100 based on how well the RequestMoreContext action addresses the task at hand:
|
| 462 |
+
|
| 463 |
+
100: Perfect request that is highly likely to provide crucial missing information.
|
| 464 |
+
75-99: Good request with minor improvements possible in specificity or relevance.
|
| 465 |
+
0-74: Partially relevant request, but with noticeable inaccuracies or potential for better targeting.
|
| 466 |
+
-1 to -49: Poor request that is likely to provide mostly irrelevant information or expand the scope unnecessarily.
|
| 467 |
+
-50 to -100: Very poor request that is entirely irrelevant or demonstrates a fundamental
|
| 468 |
+
|
| 469 |
+
misunderstanding of the problem or codebase structure.
|
| 470 |
+
|
| 471 |
+
Output Format: Please ensure your output strictly adheres to the following structure:
|
| 472 |
+
|
| 473 |
+
<Explanation> [Your explanation of the evaluation in max two paragraphs.]
|
| 474 |
+
|
| 475 |
+
<Reward> [A single integer reward value between -100 and 100]
|
| 476 |
+
|
| 477 |
+
# Value Function Edit Prompt
|
| 478 |
+
|
| 479 |
+
Your role is to evaluate the executed action of the search tree that our AI agents are traversing, with the goal of ensuring that a complete and verified solution is in place. The agent believes that it has finished solving the programming issue.
|
| 480 |
+
|
| 481 |
+
# Evaluation Criteria
|
| 482 |
+
|
| 483 |
+
Solution Correctness and Quality: Verify that the proposed changes logically address the
|
| 484 |
+
|
| 485 |
+
problem statement. Ensure the changes fit contextually within the existing codebase without introducing new issues. Confirm syntactic correctness and that there are no syntax errors or typos. Assess whether the solution represents an overall improvement and is the most optimal approach possible.
|
| 486 |
+
|
| 487 |
+
Accuracy of Code Modifications: Check that the agent correctly identified the appropriate
|
| 488 |
+
|
| 489 |
+
code spans to modify. Ensure the changes made are accurate and do not include unintended modifications. Look for any alterations to unrelated parts of the code that could introduce new problems.
|
| 490 |
+
|
| 491 |
+
# Testing and Test Results Analysis:
|
| 492 |
+
|
| 493 |
+
- Importance of Test Updates: It is crucial that the agent updated existing tests or added new tests to verify the solution. Failure to do so should be heavily penalized. The agent should ensure that code changes are validated by appropriate tests to confirm correctness and prevent regressions.
|
| 494 |
+
- Assess Test Coverage: Evaluate whether the agent has adequately tested the solution, including adding new tests for new functionality or changes. Verify that the tests cover relevant cases and edge conditions.
|
| 495 |
+
- Penalization for Lack of Testing: When calculating the reward, heavily penalize the agent if they failed to update or add necessary tests to verify the solution.
|
| 496 |
+
|
| 497 |
+
Consideration of Alternative Approaches: Always assess whether there could be a better
|
| 498 |
+
|
| 499 |
+
alternative approach to the problem. Mention any potential alternative solutions in your explanation if they are applicable.
|
| 500 |
+
|
| 501 |
+
Identification and Explanation of Mistakes: If the agent made incorrect actions, identify
|
| 502 |
+
|
| 503 |
+
exactly where and why the mistakes occurred. Explain the impact of any syntax errors, incorrect code modifications, or unintended changes.
|
| 504 |
+
|
| 505 |
+
Assessment of Agent's Completion Assertion: Verify if the agent's assertion that the task
|
| 506 |
+
|
| 507 |
+
is finished is accurate. Determine if substantial work is still required to fully resolve the issue and address this in your evaluation.
|
| 508 |
+
|
| 509 |
+
# Input Data Format:
|
| 510 |
+
|
| 511 |
+
- Problem Statement: This will be provided within the <problem_statement> XML tag and contains the initial message or problem description the coding agent is trying to solve.
|
| 512 |
+
- File Context: The relevant code context will be provided within the <file_context>
|
| 513 |
+
XML tag and pertains to the state the agent is operating on.
|
| 514 |
+
- History: The sequence of state transitions and actions taken prior to the current state will be contained within the <history> XML tag. This will include information on the parts of the codebase that were changed, the resulting diff, test results, and any reasoning or planned steps.
|
| 515 |
+
- Reasoning for Completion: The reasoning provided by the agent for why the task is finished will be provided within the <reasoning_for Completion> XML tag. This includes the agent's explanation of why no further changes or actions are necessary.
|
| 516 |
+
- Full Git Diff: The full Git diff up to the current state will be provided within the <full-git_diff> XML tag. This shows all changes made from the initial state to the current one and should be considered in your evaluation to ensure the modifications align with the overall solution.
|
| 517 |
+
- Test Results: The results of any test cases run on the modified code will be provided within the <test_results> XML tag. This will include information about passed, failed, or skipped tests, which should be carefully evaluated to confirm the correctness of the changes.
|
| 518 |
+
|
| 519 |
+
# Reward Scale and Guidelines:
|
| 520 |
+
|
| 521 |
+
The reward value must be based on how confident you are that the agent's solution is the most optimal one possible with no unresolved issues or pending tasks. It is important that the agent updated or added new tests to verify the solution; failure to do so should be heavily penalized. The scale ranges from -100 to 100, where:
|
| 522 |
+
|
| 523 |
+
100: You are fully confident that the proposed solution is the most optimal possible, has been thoroughly tested (including updated or new tests), and requires no further changes.
|
| 524 |
+
75-99: The approach is likely the best one possible, but there are minor issues or opportunities for optimization. All major functionality is correct, but some small improvements or additional testing may be needed. There might be some edge cases that are not covered.
|
| 525 |
+
0-74: The solution has been partially implemented or is incomplete, or there are likely alternative approaches that might be better. The core problem might be addressed, but there are significant issues with tests (especially if the agent did not update or add new tests), logical flow, or side effects that need attention.
|
| 526 |
+
0: The solution is not yet functional or is missing key elements. The agent's assertion that
|
| 527 |
+
|
| 528 |
+
the task is finished is incorrect, and substantial work is still required to fully resolve the issue.
|
| 529 |
+
|
| 530 |
+
-1 to -49: The proposed solution introduces new issues or regresses existing functionality,
|
| 531 |
+
|
| 532 |
+
but some elements show potential or may be salvageable. Modifying the wrong code, unintentionally removing or altering existing code, introducing syntax errors, producing incorrect diffs, or failing to update or add necessary tests fall into this range.
|
| 533 |
+
|
| 534 |
+
-50 to -100: The solution is entirely incorrect, causing significant new problems or failing
|
| 535 |
+
|
| 536 |
+
to address the original issue entirely. Immediate and comprehensive changes are necessary. Persistent repetitive actions without progress, or failure to update or add tests when necessary, should be heavily penalized.
|
| 537 |
+
|
| 538 |
+
Output Format: Please ensure your output strictly adheres to the following structure:
|
| 539 |
+
|
| 540 |
+
<Explanation> [Your explanation of the evaluation in max two paragraphs.]
|
| 541 |
+
|
| 542 |
+
<Reward> [A single integer reward value between -100 and 100]
|
| 543 |
+
|
| 544 |
+
# H MOATLESS TOOLS STATE RIGIDITY
|
| 545 |
+
|
| 546 |
+
The Moatless-tools version (v0.0.2) enforces a rigid transition structure where agents must follow a specific sequence (search $\rightarrow$ identify $\rightarrow$ plan $\rightarrow$ edit). The implementation of this state transition system can be found here: 2.
|
| 547 |
+
|
| 548 |
+
# H.1 STATE TRANSITION SYSTEM
|
| 549 |
+
|
| 550 |
+
The transition system is configured through a function that accepts three optional parameters:
|
| 551 |
+
|
| 552 |
+
- max_tokens_in_edit_prompt: Controls the token limit for edit operations
|
| 553 |
+
- global.params: Defines parameters applicable across all states
|
| 554 |
+
- state.params: Specifies state-specific parameters
|
| 555 |
+
|
| 556 |
+
# H.2 STATE FLOW
|
| 557 |
+
|
| 558 |
+
The system defines a directed graph of states with specific transition rules:
|
| 559 |
+
|
| 560 |
+
1. Search Phase (SearchCode):
|
| 561 |
+
|
| 562 |
+
- Initial state for code operations
|
| 563 |
+
- Can transition to IdentifyCode upon successful search
|
| 564 |
+
- Can move directly to PlanToCode when complete
|
| 565 |
+
|
| 566 |
+
2. Identification Phase (IdentifyCode):
|
| 567 |
+
|
| 568 |
+
- Processes search results
|
| 569 |
+
- Can return to SearchCode if needed
|
| 570 |
+
- Progresses to DecideRelevance when finished
|
| 571 |
+
|
| 572 |
+
3. Decision Phase (DecideRelevance):
|
| 573 |
+
|
| 574 |
+
- Evaluates identified information
|
| 575 |
+
- Can trigger new searches
|
| 576 |
+
|
| 577 |
+
- Transitions to planning when ready, excluding message field
|
| 578 |
+
|
| 579 |
+
This rigid structure ensures that tools are accessed in a predictable sequence, preventing conflicts while maintaining system integrity. Additional transitions defined in CODE_TRANITIONS complete the state machine's behavior set.
|
| 580 |
+
|
| 581 |
+
# I COST ANALYSIS
|
| 582 |
+
|
| 583 |
+
Table 3 presents the API costs for Moatless-Adapted and SWE-Search across different models. Search-based exploration of multiple solutions results in higher computational costs.
|
| 584 |
+
|
| 585 |
+
<table><tr><td>Model</td><td>Moatless-Adapted</td><td>SWE-Search</td></tr><tr><td>GPT-4o</td><td>$40.86</td><td>$576.00</td></tr><tr><td>GPT-4o-mini</td><td>$9.90</td><td>$52.34</td></tr><tr><td>Qwen-2.5-72b-Instruct*</td><td>$8.50</td><td>$42.50</td></tr><tr><td>DeepseekCoderV2.5</td><td>$3.66</td><td>$18.37</td></tr><tr><td>Llama-3.1-70b-Instruct*</td><td>$9.00</td><td>$45.00</td></tr></table>
|
| 586 |
+
|
| 587 |
+
*Estimated costs based on comparable API pricing
|
| 588 |
+
|
| 589 |
+
Table 3: Cost comparison (USD) between Moatless-Adapted and SWE-Search
|
| 590 |
+
|
| 591 |
+
# J COMPUTE-MATCHING ANALYSIS
|
| 592 |
+
|
| 593 |
+
Table 4 compares SWE-Search against compute-matched baselines. SWE-Search Pass@5 uses the 5 generated answers in 1 run, while for Moatless-Adapted uses the 5 generated solutions across 5 runs. We avoid doing the comparison on GPT-4o to avoid exorbitant API costs.
|
| 594 |
+
|
| 595 |
+
<table><tr><td rowspan="2">Model</td><td colspan="2">SWE-Search</td><td>Moatless-Adapted</td></tr><tr><td>Pass@1</td><td>Pass@5</td><td>Pass@5</td></tr><tr><td>GPT-4o</td><td>31.0</td><td>34.0</td><td>-</td></tr><tr><td>GPT-4o-mini</td><td>17.0</td><td>22.3</td><td>17.0</td></tr><tr><td>Qwen-2.5-72b-Instruct</td><td>24.7</td><td>25.7</td><td>22.3</td></tr><tr><td>DeepseekCoderV2.5</td><td>21.0</td><td>23.3</td><td>22.0</td></tr><tr><td>Llama-3.1-70b-Instruct</td><td>17.7</td><td>22.3</td><td>21.7</td></tr></table>
|
| 596 |
+
|
| 597 |
+
Table 4: Performance comparison (%) between SWE-Search and compute-matched baselines
|
| 598 |
+
|
| 599 |
+
# K INTERACTIVE DEMO
|
| 600 |
+
|
| 601 |
+
To help visualize the search process and provide transparency into our method, we provide an interactive demo at https://streamlit.moatless.ai. The demo presents a tree visualization where each node represents a state/action pair in the search process. Clicking on a node reveals detailed information including:
|
| 602 |
+
|
| 603 |
+
- Complete LLM interactions and tool calls
|
| 604 |
+
- State-specific value function outputs and reasoning
|
| 605 |
+
- Context information used for decision-making
|
| 606 |
+
- File changes and test results where applicable
|
| 607 |
+
- Test creation/execution and their outputs
|
| 608 |
+
|
| 609 |
+
This interface allows readers to explore how the search algorithm navigates through different states, makes decisions, and evaluates potential solutions. The visualization particularly highlights how state-specific value functions guide the exploration process and how the discriminator compares candidate solutions.
|
| 610 |
+
|
| 611 |
+
# L DISCRIMINATOR DEBATE PROMPTS
|
| 612 |
+
|
| 613 |
+
# Solution Comparison Debate Round Prompt
|
| 614 |
+
|
| 615 |
+
Below are a series of suggested changes to address the ;Problem Statement $\zeta$ . Your task is to carefully evaluate each change and decide which one is the most appropriate to address the issue. Input Format:
|
| 616 |
+
|
| 617 |
+
- Problem Statement: Original issue to be solved
|
| 618 |
+
- Solutions: Multiple candidate solutions, each with:
|
| 619 |
+
|
| 620 |
+
- Unique solution ID
|
| 621 |
+
Git patch showing code changes
|
| 622 |
+
|
| 623 |
+
Task: Evaluate each proposed solution and identify which one most effectively addresses the
|
| 624 |
+
|
| 625 |
+
problem statement. Consider the completeness, correctness, and efficiency of each approach.
|
| 626 |
+
|
| 627 |
+
# Output Format:
|
| 628 |
+
|
| 629 |
+
- <Explanation>: Comprehensive explanation and reasoning behind your decision
|
| 630 |
+
- <ID>: The ID of the change you believe is the most appropriate
|
| 631 |
+
|
| 632 |
+
# Solution Comparison Conclusion Prompt
|
| 633 |
+
|
| 634 |
+
Based on the Problem Statement and previous responses from the debate, determine the optimal solution. Input Format:
|
| 635 |
+
|
| 636 |
+
- Initial Context: Original problem statement
|
| 637 |
+
- Agent Answers: Evaluations and solution ID choices from the debate phase
|
| 638 |
+
|
| 639 |
+
Task: Synthesize the evaluations to identify the most appropriate solution. Report your conclusion without referencing individual debate participants. Output Format:
|
| 640 |
+
|
| 641 |
+
- <Explanation>: Reasoning for the selected solution
|
| 642 |
+
- <ID>: Final chosen solution ID
|
2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3fffe2d970fb3680ace18dcb73a8ce29fd93914d15694794458ad268dcec13e4
|
| 3 |
+
size 642544
|
2025/SWE-Search_ Enhancing Software Agents with Monte Carlo Tree Search and Iterative Refinement/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/48da9589-7129-4337-a09a-658cecafd8db_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/48da9589-7129-4337-a09a-658cecafd8db_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/48da9589-7129-4337-a09a-658cecafd8db_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:e22b106e07545ab08b53310264c4f7f44f9d8066d095b5f1e7f6ba76ecea1980
|
| 3 |
+
size 4771048
|
2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/full.md
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:8fe67927bce416e7b71e6dec26050f0e4b8684b0821a91f15e7b6d1ffedea0b6
|
| 3 |
+
size 1699759
|
2025/SWE-bench Multimodal_ Do AI Systems Generalize to Visual Software Domains_/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/c81623d0-f89b-4226-93eb-44296a1a5f81_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/c81623d0-f89b-4226-93eb-44296a1a5f81_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/c81623d0-f89b-4226-93eb-44296a1a5f81_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:75f66b4fd00a02fb46c10398a1407e5881c5220d11233f0a500bd859dcef4400
|
| 3 |
+
size 1471151
|
2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/full.md
ADDED
|
@@ -0,0 +1,842 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SWEB: A LARGE WEB DATASET FOR THE SCANDINAVIAN LANGUAGE
|
| 2 |
+
|
| 3 |
+
Tobias Norlund,\* Tim Isbister, Amaru Cuba Gyllensten, Paul Dos Santos, Danila Petrelli, Ariel Ekgren, Magnus Sahlgren
|
| 4 |
+
AI Sweden
|
| 5 |
+
|
| 6 |
+
# ABSTRACT
|
| 7 |
+
|
| 8 |
+
This paper presents the hitherto largest pretraining dataset for the Scandinavian languages: the Scandinavian Web (SWeb), comprising over one trillion tokens. The paper details the collection and processing pipeline, and introduces a novel model-based text extractor that significantly reduces complexity in comparison with rule-based approaches. We also introduce a new cloze-style benchmark for evaluating language models in Swedish, and use this test to compare models trained on the SWeb data to models trained on FineWeb, with competitive results. All data, models and code are shared openly.
|
| 9 |
+
|
| 10 |
+
# 1 INTRODUCTION
|
| 11 |
+
|
| 12 |
+
Large language models have made significant strides in recent years due to their general capabilities in language-processing tasks. This progress has been largely driven by the development of extensive and high-quality pretraining datasets sourced from open web data (Wenzek et al., 2020; Brown et al., 2020; Abadji et al., 2022; Penedo et al., 2023; 2024). However, the majority of research aimed at improving pretraining data focuses on high-resource languages such as English. Our goal is to create a large-scale and high-performing open pretraining dataset specifically for the Scandinavian (north-germanic) languages: Swedish, Danish, Norwegian, and Icelandic.
|
| 13 |
+
|
| 14 |
+
Existing large-scale datasets for these languages primarily include mC4 (Xue et al., 2021), OSCAR (Abadji et al., 2022), and HPLT Datasets 1.2 (de Gibert et al., 2024). The Scandinavian portion of mC4 comprises approximately 100B tokens, 10B tokens for OSCAR 23.01, and 35B tokens for HPLT, which are all relatively small numbers considering that state-of-the-art large language models today are trained on trillions of high-quality tokens.
|
| 15 |
+
|
| 16 |
+
In this paper we make the following contributions:
|
| 17 |
+
|
| 18 |
+
- We release<sup>1</sup> the largest to date pretraining dataset for the Scandinavian languages: Scandinavian Web (SWEb). SWEb is the result of running our proposed pipeline on 98 Common Crawl snapshots. SWEb contains 1.01 trillion tokens in the Scandinavian languages, approximately an order of magnitude more than other available open alternatives.
|
| 19 |
+
|
| 20 |
+
- We introduce a new cloze-style benchmark for evaluating language models in Swedish, HP-MEK, a subset of the Swedish Scholastic Aptitude Test (Högskoleprovet) used for university admissions in Sweden. Using HP-MEK, we show our data performs on-par with data from the recently proposed FineWeb (Penedo et al., 2024) pipeline.
|
| 21 |
+
|
| 22 |
+
- We propose a new comprehensive pipeline for curating pretraining data for large language models, built around a model-based text extractor that significantly reduces complexity and is easily adaptable through rapid data annotation<sup>2</sup>. Most notably, we demonstrate that our pipeline returns about $+60\%$ more high quality tokens than FineWeb on the same input data.
|
| 23 |
+
|
| 24 |
+
# 2 BACKGROUND AND RELATED WORK
|
| 25 |
+
|
| 26 |
+
Early efforts to extract massive amounts of text from the open internet for LLM training start from WebText (Radford et al., 2019), developed for training GPT-2. In this case, outbound links from Reddit with a certain number of upvotes were used as the content selection criterion. Text was extracted using Dragnet (Peters et al., 2018) and Newspaper<sup>3</sup> and filtered with several heuristics, resulting in a dataset of 40GB after dedduplication. Soon after, CCNet (Wenzek et al., 2020) and C4 (Roberts et al., 2019) were proposed, both based on open web data from Common CWEl. C4 was initially developed exclusively for English but was later followed by a multilingual version, mC4 (Xue et al., 2021). CCNet, on the other hand, was multilingual from the outset.
|
| 27 |
+
|
| 28 |
+
Both CCNet and C4 are based on the WET archives from Common Crawl, where all HTML formatting has been stripped, leaving only the text. However, this text still contains a significant amount of noise in the form of menu and ad text, headers, footers, and sidebars, which are irrelevant to the page's primary content. A successful method for extracting primary content from WET archives is to deduplicate the documents at the line level. C4 globally deduplicates all lines, while CCNet deduplicates over a subset of documents from the same Common Crawl dump. Line-by-line dedduplication is the primary extraction method in CCNet, whereas C4 additionally employs a range of English-specific cleaning heuristics.
|
| 29 |
+
|
| 30 |
+
Following extraction comes a language detection and filtering step. Whilst more computationally expensive, performing language detection post extraction been shown to achieve better detection accuracy than filtering pre extraction (especially for low-resource languages) (Wenzek et al., 2020). Quality filtering differs slightly between the two, with C4 filtering using several heuristics, a bad words filter, and URL dedduplication. In contrast, CCNet employs a model-based filter, using perplexity as a quality measure with a KenLM model trained on Wikipedia.
|
| 31 |
+
|
| 32 |
+
CCNet has since been utilized in subsequent works such as RedPajama (v1 and v2) (Together Computer, 2023) and Dolma (Soldaini et al., 2024). RedPajama-Data v2 runs CCNet on an expanded number of Common Craw snapshots and filters for five high-resource languages (none of which are Scandinavian, however). They also extend CCNet's quality filtering by pre-computing a larger set of popular quality signals but leave the thresholding and filtering to the user.
|
| 33 |
+
|
| 34 |
+
Recently, several works have moved away from Common Crawl's WET archives in favor of processing the raw HTML of webpages found in the WARC archives. Utilizing mor sophisticated text extraction turns out to be critical for the improving quality of the resulting data (Penedo et al., 2024). In MassiveWeb (Rae et al., 2021), the tree structure of HTML is utilized to more easily group and identify the primary content of pages. Some formatting is also retained, with the argument that this "diversity in formatting style translates effectively to the generative capabilities of the Gopher models."
|
| 35 |
+
|
| 36 |
+
A similar approach is developed in NeuScaper (Xu et al., 2024), where a model is trained to – on an element level – decide whether it should be extracted or not. Both RefinedWeb and FineWeb use the open-source framework Trafilatura (Barbaresi, 2021) to extract text from HTML. Trafilatura is based on rules and heuristics on the DOM tree to identify primary content and has been shown to be the best non-commercial extractor for certain domains (Lopuhin, 2019). However, quality issues are still prevalent, and in RefinedWeb (Penedo et al., 2023) further (line-based) filters are added in an attempt to address these.
|
| 37 |
+
|
| 38 |
+
MassiveWeb introduce what they call "repetition filters" to remove documents with repetitive text, that is found beneficial with their extractor. These are also successfully reused in both RefinedWeb and later FineWeb. Through a systematic analysis, FineWeb further adds a small set of quality filters, that is shown through ablation experiments to yet increase quality. For a state of the art pipeline like FineWeb, the filtering can add up to 30 or more quantities and rules that might be difficult to oversee and adapt to new languages.
|
| 39 |
+
|
| 40 |
+

|
| 41 |
+
Figure 1: The SWEb pipeline. We use Common Crawl's preprocessed WET archives for content selection, and WARC for extraction. At the center stage sits our model based Markdown extractor, that is the primary workhorse to produce our dataset.
|
| 42 |
+
|
| 43 |
+
# 3 THE SWEB PIPELINE
|
| 44 |
+
|
| 45 |
+
As evident by the previous section, much focus has been placed on the development of heuristics and filters to enhance the quality of the resulting data.
|
| 46 |
+
|
| 47 |
+
To move away from the extensive number of manual thresholds and complex extraction rules, we propose a more data-driven alternative. By learning a model for extraction, this complexity can be significantly reduced.
|
| 48 |
+
|
| 49 |
+
We begin by describing our pipeline that, like existing approaches, consists of the overarching steps of content selection, extraction, quality filtering, and dedduplication (Figure 1).
|
| 50 |
+
|
| 51 |
+
# 3.1 STAGE 1: CONTENT SELECTION
|
| 52 |
+
|
| 53 |
+
Our pipeline begins with content selection, which aims to identify and select source documents from Common Crawl that are likely to be in one of the Scandinavian languages. Since the Scandinavian languages make up a very small portion of the entire Common Crawl, we want to implement this step early to filter out all non-relevant content.
|
| 54 |
+
|
| 55 |
+
We use CCNet to identify Scandinavian documents within the entire Commoncrawl dataset. CCNet processes the WET archives, and after line-by-line dedduplication, language detection is performed using fastText (Joulin et al., 2016b). Documents with a detected language score above 0.2 for any of the four languages are selected for the next stage.
|
| 56 |
+
|
| 57 |
+
# 3.2 STAGE 2: CONTENT EXTRACTION AND FORMATTING
|
| 58 |
+
|
| 59 |
+
In Stage 2, we start from the documents identified in Stage 1 but discard their content and instead use Common Crawl's index to download their original HTML from the WARC archives. This means we use CCNet and the WET documents solely for content selection, but not for extraction. In the WET archives, all formatting and structure, such as header information, tables, text styles, bullet lists, and images, have been removed. We believe it is useful for language models to also model such structural information, in addition to plain text. Therefore, we aim to extract also this information from the webpages, and retain it in Markdown format.
|
| 60 |
+
|
| 61 |
+
We propose a new method for extracting primary content from the webpages, consisting of two steps: 1) Convert HTML to Markdown, 2) Extract primary content from the resulting Markdown through line-by-line filtering with a trained model.
|
| 62 |
+
|
| 63 |
+
# 3.2.1 CONVERT HTML TO MARKDOWN
|
| 64 |
+
|
| 65 |
+
Since we want to preserve basic textual formatting, we choose to convert from HTML to Markdown with its very lightweight markup, thus does not add many extra tokens. We convert all incoming HTML documents to Markdown using Pandoc, stripping links and images. See Listing 1 for an example.
|
| 66 |
+
|
| 67 |
+
No extraction has yet taken place, so these documents are still full of noise from menus, advertisements, and other extraneous content. We address this in the next step.
|
| 68 |
+
|
| 69 |
+
Listing 1: A webpage converted to markdown (translated, originally in Swedish), including title, top menu, headings and primary content. The document is truncated for brevity.
|
| 70 |
+
```txt
|
| 71 |
+
1 My Life, My Thoughts & My Training
|
| 72 |
+
2
|
| 73 |
+
3 #The Blog
|
| 74 |
+
4 - The Blog
|
| 75 |
+
5 - Running Times Over the Years
|
| 76 |
+
6 - My Education
|
| 77 |
+
7 - Personal Training
|
| 78 |
+
8
|
| 79 |
+
9 #Wednesday, December 14, 2011
|
| 80 |
+
10
|
| 81 |
+
11 #The Tough Week Continues...
|
| 82 |
+
12 ..but tomorrow is a rest day.
|
| 83 |
+
14
|
| 84 |
+
15 I can feel in my body that I am right in the middle of a tough week \* (I periodize my training, among other things, by alternating between heavy, medium, and light weeks.)\* and running was not exactly the first thing I thought about when I woke up this morning. But after a nap together, sleep?!
|
| 85 |
+
16
|
| 86 |
+
17 Posted by
|
| 87 |
+
18
|
| 88 |
+
19 Running & Life at
|
| 89 |
+
20 ...
|
| 90 |
+
```
|
| 91 |
+
|
| 92 |
+
# 3.2.2 MODEL-BASED CONTENT EXTRACTION
|
| 93 |
+
|
| 94 |
+
We observe that individual lines in the Markdown documents often correspond to specific elements such as headers, paragraphs, or navigation links. This makes lines an appropriate level for extraction. Therefore, we develop a custom annotation tool (details in Appendix B) to annotate which lines in these Markdown documents should be extracted and which should not. We ask annotators to mark what is considered the "main content" on the current webpage, and make some principled decisions for quality and consistency:
|
| 95 |
+
|
| 96 |
+
1. We do not extract navigation text such as menus or buttons.
|
| 97 |
+
2. A significant portion of the webpages are product pages. We decide to extract these only if there is a product description consisting of at least three complete sentences.
|
| 98 |
+
3. We extract tables if they are well-formatted and their content is tightly coupled to the main content.
|
| 99 |
+
4. On blogs or article pages that include user comments, we extract such comments in addition to the main content.
|
| 100 |
+
5. We do not extract information from sidebars unless it clearly constitutes main content.
|
| 101 |
+
|
| 102 |
+
While not explicitly excluded as per our guidelines, advertisement text isn't considered to be main content and is thus implicitly excluded. The full annotation guidelines can be found in Appendix C. In total, we annotate 1,380 webpages, using 100 of these for validation and the remainder as training data for our extraction model.
|
| 103 |
+
|
| 104 |
+
Line Extraction Model Our dataset consists of Markdown documents with corresponding binary line annotations, see Figure 11. We aim to train a model to predict this label for each line. For this purpose, we choose to use a transformer encoder, where each newline is replaced with a special token [SEP]. We then feed the entire document through the encoder, with each [SEP] token representing the preceding line. This way, each line classification is contextualized by (theoretically) the full document context.
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
h _ {0: n} = \operatorname {E n c o d e r} \left(x _ {0: n}\right) \tag {1}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 2: Illustration of our proposed line classification model. Each newline is replaced by a special $\langle \mathsf{s} \rangle$ token, and the corresponding embeddings are used for classification
|
| 112 |
+
|
| 113 |
+

|
| 114 |
+
Figure 4: Filtering distributions on two Common Crawl dumps, and exclude regions marked in red. We exclude documents whose content length is shorter than 100 chars (invisible in the chart).
|
| 115 |
+
|
| 116 |
+
Through a linear projection of the output hidden state of each [SEP] token, we obtain logits for predicting the binary label of the current line. Let $j$ denote the token index corresponding to each [SEP] token in the document. We then get the predicted probability for the line as:
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
p _ {j} = \sigma \left(W h _ {j} + b\right) \tag {2}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
where $\sigma$ is the sigmoid function. The model is trained using binary cross-entropy loss between each $p_j$ and an annotated line label. See Figure 2 for an illustration. We apply a fixed threshold to $p_j$ to determine whether to include or exclude the line.
|
| 123 |
+
|
| 124 |
+
The Markdown documents can be very long, so we use the Longformer (Beltagy et al., 2020) architecture. Specifically, we use a pre-trained model that supports up to 16k tokens and has been trained for representation learning using masked language modeling<sup>4</sup>. The Longformer is a linear complexity transformer, thanks to its local self-attention, where each token only attends to a fixed number of nearby tokens. We use a local attention window size of 256 tokens and no global attention, as this turned out to only impair generalization.
|
| 125 |
+
|
| 126 |
+
We fine-tune the entire model on our training set of 1,280 documents, and the results on the validation set can be seen in Figure 3. We use the Adam optimizer with a constant learning rate of 1e-5. The results show that despite our small-scale training data, we achieve an F1 score of $87\%$ . Some more details and error analysis is provided in Appendix D.
|
| 127 |
+
|
| 128 |
+

|
| 129 |
+
Figure 3: Precision/recall of our final line extraction model. We pick a threshold of 0.05 at inference, e.g. when applying the model for extraction.
|
| 130 |
+
|
| 131 |
+
Finally, we normalize the text using Fix Text For You (Speer, 2019).
|
| 132 |
+
|
| 133 |
+
# 3.3 STAGE 3: QUALITY FILTERING AND CLEANING
|
| 134 |
+
|
| 135 |
+
The third stage aims to filter for quality, reduce duplicate content and remove personally identifiable information (PII).
|
| 136 |
+
|
| 137 |
+
Quality Filtering A significant advantage of our model-based extraction is that it also implicitly performs much of the quality filtering. The extractor effectively learns to exclude content that is not of sufficient quality, such as spam and advertisements. This allows us to use only a minimal set
|
| 138 |
+
|
| 139 |
+
of simple filters to remove edge cases where the extractor fails. Through qualitative analysis, we developed four filters to exclude such edge cases:
|
| 140 |
+
|
| 141 |
+
1. Content length: We exclude cleaned documents that are shorter than 100 characters.
|
| 142 |
+
2. Ratio of alphanumeric characters: We exclude cleaned documents whose ratio of alphanumeric characters is lower than 0.4. These documents primarily consist of data tables and are not relevant without additional context.
|
| 143 |
+
3. Headings per non-heading word: We note that in some documents, only headings are extracted with little or no accompanying text. We compute the ratio of the number of headings to the total number of words from non-heading lines. If the ratio is greater than 0.05, we exclude the document.
|
| 144 |
+
4. Unigram entropy: Also used in Together Computer (2023), this measures the diversity of the content and is computed using $\sum -x / total * \log(x / total)$ where the sum is taken over counts of unique words in the normalised content. By manual inspection, we found a threshold value of 3.0 to be reasonable, and exclude all documents below it.
|
| 145 |
+
|
| 146 |
+
In Figure 4, we show the distributions of these four quantities, and in Appendix E, we provide examples of documents that are filtered out.
|
| 147 |
+
|
| 148 |
+
De-duplication We used MinHashLSH (Leskovec et al., 2020) for document level near duplicate removal. The MinHash signatures were computed using unicode code point-level shingles of size $16^5$ , 14 bands, and 8 hashes per band (a total of 112 Hashes). Dedduplication was done per band in an iterative fashion: For each band in order, we grouped documents by their hashes within that band, and kept only one document per group. Following FineWeb (Penedo et al., 2024), we only performed dedduplication within snapshots, and not between them, as this was shown to increase downstream performance.
|
| 149 |
+
|
| 150 |
+
PII Replacement As a final processing step, we make a best effort at removing personally identifiable information from our data. To this end, we use regular expressions to replace email addresses and publicly facing IP-adresses with one of a few samples. This follows what has been done in previous works (Penedo et al., 2024; Soldaini et al., 2024).
|
| 151 |
+
|
| 152 |
+
# 4 EXPERIMENTS
|
| 153 |
+
|
| 154 |
+
How good is the data produced by our pipeline? To assess this question we conduct experiments against the recently proposed FineWeb pipeline (Penedo et al., 2024). We do this by performing a data ablation experiment. Here, we train two language models on data produced by 1) our pipeline and 2) the FineWeb pipeline respectively. We then evaluate the language models as a proxy for evaluating the datasets and, in turn, the pipelines.
|
| 155 |
+
|
| 156 |
+
FineWeb uses trafilatura (Barbaresi, 2021) as HTML extractor and relies on quality filter sets from both C4 and Gopher, as well as some novel additions. A notable difference is the fact that trafilatura (in the setting used by FineWeb) produces plain text content, while SWEb format as Markdown. As mentioned in Section 3.2, we primarily retain formatting via Markdown as a feature, but note that this may also affect the learning behavior of the model. In this work however, we do not perform specific ablations to single out this particular factor. Please see Appendix F where we show side-by-side comparisons of trafilatura vs our extractor outputs.
|
| 157 |
+
|
| 158 |
+
How will Sweden be able to itself in the international competition and strengthen its position as a leading knowledge nation? A first step is to look at the that govern the allocation of state research funds.
|
| 159 |
+
|
| 160 |
+
A activate - knowledge
|
| 161 |
+
B mark-needs
|
| 162 |
+
C assert - criteria
|
| 163 |
+
D entrust-institutions
|
| 164 |
+
|
| 165 |
+
Proper shoes are on the way out, while sneakers are spreading. The following no longer causes any sensation: blazer, pleated trousers, and white sneakers.
|
| 166 |
+
|
| 167 |
+
A manner
|
| 168 |
+
B propriety
|
| 169 |
+
C ensemble
|
| 170 |
+
D attire
|
| 171 |
+
|
| 172 |
+
Figure 5: Two examples from the HP-MEK task. Translated to English (originally in Swedish).
|
| 173 |
+
|
| 174 |
+
<table><tr><td>Exp. Dataset</td><td>#Docs</td><td>#Tokens</td><td>Tokens/doc</td></tr><tr><td>SWEb</td><td>32.3M</td><td>25.2B</td><td>779.7</td></tr><tr><td>FineWeb</td><td>19.2M</td><td>15.8B</td><td>820.3</td></tr></table>
|
| 175 |
+
|
| 176 |
+
Table 1: Stats of experimental datasets SWEb and FineWeb
|
| 177 |
+
|
| 178 |
+

|
| 179 |
+
Figure 6: Venn diagram of documents in experimental SWEb and FineWeb datasets
|
| 180 |
+
|
| 181 |
+
# 4.1 BENCHMARK: HP-MEK
|
| 182 |
+
|
| 183 |
+
We investigated different benchmarks to evaluate the language models on. An appropriate benchmark should give good "early signals" of performance, in small model and data scales. For the Scandinavian benchmarks, the Scandeval suite (Nielsen, 2023) is commonly used. However, we found neither of its subtasks to be appropriate for this study, as the models didn't reach good enough performance.
|
| 184 |
+
|
| 185 |
+
Instead, we chose to develop an alternative benchmark based on the Swedish Scholastic Aptitude Test (Högskoleprovet), that we denote HP-MEK<sup>6</sup>. We download and extract the MEK (sentence completion) section of all available historical tests, and end up with a total of 460 examples. HP-MEK is a cloze style test, with masked portions of a provided passage. For each passage, four alternatives of the masked portions are available, see Figure 5. We evaluate a model by inserting each of the four alternatives into the passage, and pick the alternative with the highest joint log likelihood.
|
| 186 |
+
|
| 187 |
+
In our experiments, we see early and consistently increased performance as we train on successively more data, which speaks for it being a suitable indicator for performance at larger scales.
|
| 188 |
+
|
| 189 |
+
# 4.2 EXPERIMENTAL SETUP
|
| 190 |
+
|
| 191 |
+
We extract, filter and deduplicate the 2024-10 and 2024-18 Common Crawl snapshots using our pipeline to form an experimental dataset (SWEb). We also run the FineWeb pipeline on the same input documents (selected from Stage 1) to form a competing dataset (FineWeb). Table 1 compares the two and Figure 6 shows a Venn diagram of their document (url) sets.
|
| 192 |
+
|
| 193 |
+
We note that the SWEb pipeline extracts significantly more documents $(+62\%)$ and tokens $(+60\%)$ than FineWeb's pipeline. Most of FineWeb's documents are contained in SWEb, while relatively few are uniquely selected by FineWeb. Interestingly, FineWeb extracts slightly more tokens per document on average, despite SWEb containing additional Markdown formatting tokens.
|
| 194 |
+
|
| 195 |
+
We split the two datasets in 90/10 train/test splits and tokenize using the GPT-SW3 tokenizer (Ekgren et al., 2024). Then, we train small language models on each training set respectively ( $M_{\mathrm{SW}}$ for SWEb and $M_{\mathrm{FW}}$ for FineWeb), and use the Llama architecture with 1.82B parameters (including embeddings) with a 2048 sequence length, a global batch size of 2 million tokens and a cosine decay learning rate schedule. Each model is trained for 10,811 steps, which corresponds to one full epoch for SWEb, and 1.6 epochs for FineWeb. We checkpoint every 250 steps to evaluate progression throughout training.
|
| 196 |
+
|
| 197 |
+
# 4.3 RESULTS
|
| 198 |
+
|
| 199 |
+
In Figure 7, we show perplexity plots where each model is evaluated on the each of the two test sets. We can first note that $M_{\mathrm{SW}}$ achieves lower perplexity on its own data than $M_{\mathrm{FW}}$ , i.e. SWEb seems "easier" to fit despite it being trained on more unique tokens. This could for example be due to the markdown formatting, where markup tokens might be easier to predict. Secondly, $M_{\mathrm{SW}}$ performs relatively better on FineWeb than $M_{\mathrm{FW}}$ on SWEb. We speculate this could also be due to the markdown, where $M_{\mathrm{FW}}$ gets more confused not having seen Markdown during training.
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
Figure 7: Perplexity cross-evaluation. The two models are evaluated on both SWEb and FineWeb test sets.
|
| 203 |
+
|
| 204 |
+

|
| 205 |
+
Figure 8: Learning curves. Performance of our two ablation models on HP-MEK throughout training.
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Figure 9: SWEb distribution over the Common Crawl snapshots.
|
| 209 |
+
|
| 210 |
+
Next, we evaluate $M_{\mathrm{SW}}$ and $M_{\mathrm{FW}}$ on HP-MEK, and plot learning curves in Figure 8. We can see that $M_{\mathrm{SW}}$ closely matches $M_{\mathrm{FW}}$ throughout the training, suggesting the two datasets are on-par with each other with regards to this task. This suggests that we are able to match the trafilatura extractor with just 1,380 annotated extraction samples, and at the same time reduce the complex filtering to only four simple quantities.
|
| 211 |
+
|
| 212 |
+
# 5 THE SWEB DATASET
|
| 213 |
+
|
| 214 |
+
We run our pipeline on 98 Common crawl dumps, starting from 2013-20 until 2024-26, to produce the Scandinavian Web (SWEb) dataset. SWEb comprises a total of 1.01 trillion tokens<sup>7</sup>, distributed over 1.2 billion documents, resulting in 3.6TB of raw (UTF-8) text.
|
| 215 |
+
|
| 216 |
+
This makes SWEb the largest open Scandinavian dataset to date, an order of magnitude larger than the (to our knowledge) previously largest mC4 dataset. In Figure 9, we show the document distribution across the Common Crawl dumps. As we can see, the amount of Scandinavian content has been steady since around 2017, averaging about 50M documents per dump.
|
| 217 |
+
|
| 218 |
+

|
| 219 |
+
Figure 10: Language distribution over the SWEb dataset
|
| 220 |
+
|
| 221 |
+
To investigate the language distribution of SWEb, we use the fastText language identification classifier by Joulin et al. (2016a;b). Among the four Scandinavian languages, Swedish is the dominating one with $48\%$ of documents classified as Swedish, $26\%$ as Danish and $20\%$ as Norwegian, see Figure 10. Only $2.3\%$ are classified as Ice-
|
| 222 |
+
|
| 223 |
+
landic. A small portion of documents are classified as non-scandinavian after our content extraction, of which a majority is classified as English.
|
| 224 |
+
|
| 225 |
+
We release the SWEb dataset, the pipeline code, as well as our trained extractor model open source license, and hope this will further research and development of high performant Scandinavian LLMs. We also provide a datasheet detailing the dataset further in Appendix A.
|
| 226 |
+
|
| 227 |
+
# 6 DISCUSSION AND FUTURE WORK
|
| 228 |
+
|
| 229 |
+
Comparing to rule-based extractors such as traflatura, our model based extractor offers greater flexibility as the desired extraction output is demonstrated instead of encoded as heuristics. Our work also highlights the data efficiency with which this can be done, i.e just 1,380 annotated examples in our case. However, this also comes with a cost. Running our model extractor for each document increases the compute required substantially over rule-based alternatives, which adds to these already compute-intensive workloads. In extracting SWEb, we consumed 20k AMD MI250X GPU-hours which is a significant amount, but comparing to the budgets required for training the downstream LLMs it is still negligible.
|
| 230 |
+
|
| 231 |
+
While training LLMs on larger datasets have shown to yield higher performance, a hypothesis is that there is only a subset of high quality documents that are behind the performance boosts. For example, in FineWeb-Edu, further filtering web data towards "educational content" is shown to significantly boosts performance in reasoning- and knowledge-intensive benchmarks. We see work on topic and content based filtering as a promising avenue for further refinement of SWEb towards particular LLM capabilities. This could potentially even be built into the extractor for more fine-grained control instead of as a binary post-hoc filter.
|
| 232 |
+
|
| 233 |
+
# 7 CONCLUSION
|
| 234 |
+
|
| 235 |
+
A major bottleneck for pre-training LLMs for smaller languages is the lack of large and high-quality open datasets. In this paper, we have presented the thus far largest open dataset for pre-training LLMs for the Scandinavian languages (Swedish, Danish, Norwegian and Icelandic). The dataset, which we call SWEb, comprises 1 trillion high-quality tokens in said four languages, and is openly shared in order to promote the development of LLMs for the Scandinavian languages. In creating SWEb, we have also developed a pipeline with a novel model-based text extractor that offers greater flexibility over the extraction process versus rule-based alternatives. We share both code and models for the novel text extractor openly. This paper has introduced a new benchmark for Swedish, which we use to compare models trained using our data with models trained using FineWeb, and we demonstrate that our data leads to models with performance on par with models trained from data using the state-of-the-art pipeline FineWeb.
|
| 236 |
+
|
| 237 |
+
# ETHICAL CONSIDERATIONS
|
| 238 |
+
|
| 239 |
+
Handling Sensitive Content The SWEb dataset was created using publicly available Common Crawl data. During processing, efforts were made to filter out low-quality and irrelevant material, such as advertisements, spam, and repetitive text. While our approach focuses on a simplified and novel pipeline for text extraction, we do not implement specific filtering mechanisms for harmful or sensitive content. We acknowledge that pre-training data can influence the behavior of LLMs, potentially amplifying biases or generating harmful outputs. We encourage researchers and practitioners utilizing our pipeline and dataset to critically assess their data sources and apply appropriate filtering techniques based on their ethical and application-specific requirements. Future work should consider integrating robust content moderation strategies to mitigate risks associated with unfiltered pre-training data. Refer to the datasheet in the appendix for more details on the dataset's curation process.
|
| 240 |
+
|
| 241 |
+
Privacy and Data Protection To address privacy concerns, some personally identifiable information (PII) such as email addresses and publicly visible IP addresses were removed using regex-based filters. While these methods are widely adopted in the field, we acknowledge their limitations and the
|
| 242 |
+
|
| 243 |
+
potential for residual PII. SWEb also adheres to Common crawl's policies, which respect robots.txt and nofollow directives to avoid restricted data. For additional information on how PII and privacy were handled, refer to the datasheet in the appendix.
|
| 244 |
+
|
| 245 |
+
Bias and Representation The SWEb dataset is derived from Commoncrawl, which reflects the inherent biases of web-based data. These biases may arise from factors such as the overrepresentation of content from certain languages, regions, or demographics with greater internet access and technological literacy. Additionally, the dataset may include content from domains or sources that reflect specific viewpoints, and, as with any web-based resource, there is a risk of including disinformation or other misleading content. While the dataset aims to provide a valuable resource for Scandinavian languages, we encourage users to remain mindful of these potential biases and consider mitigation strategies during training and deployment. Further details on potential biases and dataset composition can be found in the datasheet in the appendix.
|
| 246 |
+
|
| 247 |
+
Intended Use and Misuse Prevention The primary goal of SWEb is to support the research and development of Scandinavian language models. This dataset should not be used to train models that generate harmful content, misinformation, or other unethical outputs. Users are encouraged to implement safeguards and adhere to ethical AI development principles. Refer to the datasheet in the appendix for guidance on intended use and potential misuse.
|
| 248 |
+
|
| 249 |
+
Takedown Policy We provide a mechanism for stakeholders to request the removal of specific content through our takedown policy. For more information on this policy, see the datasheet in the appendix.
|
| 250 |
+
|
| 251 |
+
# ACKNOWLEDGMENTS
|
| 252 |
+
|
| 253 |
+
We gratefully acknowledge the Swedish Innovation Agency (Vinnova) for supporting this work. This work has also been supported by the Parallel computing center (PDC) at the Royal Institute of Technology in Stockholm, Sweden. We would like to express our deepest gratitude for providing the compute required for our experiments and building SWEb. We thank our annotators for their kind effort in helping out building our text extractor model.
|
| 254 |
+
|
| 255 |
+
# REFERENCES
|
| 256 |
+
|
| 257 |
+
Julien Abadji, Pedro Ortiz Suarez, Laurent Romary, and Benoit Sagot. Towards a Cleaner Document-Oriented Multilingual Crawled Corpus. arXiv e-prints, art. arXiv:2201.06642, January 2022.
|
| 258 |
+
Adrien Barbaresi. Trafilatura: A web scraping library and command-line tool for text discovery and extraction. In Heng Ji, Jong C. Park, and Rui Xia (eds.), Proceedings of the 59th Annual Meeting of the Association for Computational Linguistics and the 11th International Joint Conference on Natural Language Processing: System Demonstrations, pp. 122-131, Online, August 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.acl-demo.15. URL https://aclanthology.org/2021.acl-demo.15.
|
| 259 |
+
Iz Beltagy, Matthew E. Peters, and Arman Cohan. Longformer: The long-document transformer. arXiv:2004.05150, 2020.
|
| 260 |
+
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, Sandhini Agarwal, Ariel Herbert-Voss, Gretchen Krueger, Tom Henighan, Rewon Child, Aditya Ramesh, Daniel Ziegler, Jeffrey Wu, Clemens Winter, Chris Hesse, Mark Chen, Eric Sigler, Mateusz Litwin, Scott Gray, Benjamin Chess, Jack Clark, Christopher Berner, Sam McCandlish, Alec Radford, Ilya Sutskever, and Dario Amodei. Language models are few-shot learners. In H. Larochelle, M. Ranzato, R. Hadsell, M.F. Balcan, and H. Lin (eds.), Advances in Neural Information Processing Systems, volume 33, pp. 1877-1901. Curran Associates, Inc., 2020. URL https://proceedings.neurips.cc/paper_files/paper/2020/file/1457c0d6bcbd4967418bf8ac142f64a-Paper.pdf.
|
| 261 |
+
|
| 262 |
+
Ona de Gibert, Graeme Nail, Nikolay Arefyev, Marta Banón, Jelmer van der Linde, Shaoxiong Ji, Jaume Zaragoza-Bernabeu, Mikko Aulamo, Gema Ramírez-Sánchez, Andrey Kutuzov, Sampa Pyysalo, Stephan Oepen, and Jörg Tiedemann. A new massive multilingual dataset for high-performance language technologies. In Nicoletta Calzolari, Min-Yen Kan, Veronique Hoste, Alessandro Lenci, Sakriani Sakti, and Nianwen Xue (eds.), Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024), pp. 1116-1128, Torino, Italia, May 2024. ELRA and ICCL. URL https://aclanthology.org/2024.lrec-main.100.
|
| 263 |
+
Ariel Ekgren, Amaru Cuba Gyllensten, Felix Stollenwerk, Joel Ohman, Tim Isbister, Evangelia Gogoulou, Fredrik Carlsson, Judit Casademont, and Magnus Sahlgren. GPT-SW3: An autoregressive language model for the Scandinavian languages. In Nicoletta Calzolari, Min-Yen Kan, Veronique Hoste, Alessandro Lenci, Sakriani Sakti, and Nianwen Xue (eds.), Proceedings of the 2024 Joint International Conference on Computational Linguistics, Language Resources and Evaluation (LREC-COLING 2024), pp. 7886-7900, Torino, Italia, May 2024. ELRA and ICCL. URL https://aclanthology.org/2024.lrec-main.695.
|
| 264 |
+
Timnit Gebru, Jamie Morgenstern, Briana Vecchione, Jennifer Wortman Vaughan, Hanna Wallach, Hal Daumé III au2, and Kate Crawford. Datasheets for datasets, 2021. URL https://arxiv.org/abs/1803.09010.
|
| 265 |
+
Armand Joulin, Edouard Grave, Piotr Bojanowski, Matthijs Douze, Hérve Jégou, and Tomas Mikolov. Fasttext.zip: Compressing text classification models. arXiv preprint arXiv:1612.03651, 2016a.
|
| 266 |
+
Armand Joulin, Edouard Grave, Piotr Bojanowski, and Tomas Mikolov. Bag of tricks for efficient text classification. arXiv preprint arXiv:1607.01759, 2016b.
|
| 267 |
+
Jure Leskovec, Anand Rajaraman, and Jeffrey David Ullman. Mining of massive data sets. Cambridge university press, 2020.
|
| 268 |
+
Konstantin Lopuhin. Evaluating quality of article body extraction for commercial services and open-source libraries, 2019. https://github.com/scrapinghub/article-extraction-benchmark.
|
| 269 |
+
Dan Nielsen. ScandEval: A benchmark for Scandinavian natural language processing. In Tanel Alumäe and Mark Fishel (eds.), Proceedings of the 24th Nordic Conference on Computational Linguistics (NoDaLiDa), pp. 185-201, Torshavn, Faroe Islands, May 2023. University of Tartu Library. URL https://aclanthology.org/2023.nodalida-1.20.
|
| 270 |
+
Guilherme Penedo, Quentin Malartic, Daniel Hesslow, Ruxandra Cojocaru, Alessandro Cappelli, Hamza Alobeidli, Baptiste Pannier, Ebtesam Almazrouei, and Julien Launay. The RefinedWeb dataset for Falcon LLM: outperforming curated corpora with web data, and web data only. arXiv preprint arXiv:2306.01116, 2023. URL https://arxiv.org/abs/2306.01116.
|
| 271 |
+
Guilherme Penedo, Hynek Kydlíček, Anton Lozhkov, Margaret Mitchell, Colin Raffel, Leandro Von Werra, Thomas Wolf, et al. The fine web datasets: Decanting the web for the finest text data at scale. arXiv preprint arXiv:2406.17557, 2024.
|
| 272 |
+
Matthew E. Peters, Mark Neumann, Mohit Iyyer, Matt Gardner, Christopher Clark, Kenton Lee, and Luke Zettlemoyer. Deep contextualized word representations. In Marilyn Walker, Heng Ji, and Amanda Stent (eds.), Proceedings of the 2018 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, Volume 1 (Long Papers), pp. 2227-2237, New Orleans, Louisiana, June 2018. Association for Computational Linguistics. doi: 10.18653/v1/N18-1202. URL https://aclanthology.org/N18-1202.
|
| 273 |
+
Alec Radford, Jeff Wu, Rewon Child, David Luan, Dario Amodei, and Ilya Sutskever. Language models are unsupervised multitask learners. 2019.
|
| 274 |
+
|
| 275 |
+
Jack W. Rae, Sebastian Borgeaud, Trevor Cai, Katie Millican, Jordan Hoffmann, H. Francis Song, John Aslanides, Sarah Henderson, Roman Ring, Susannah Young, Eliza Rutherford, Tom Hennigan, Jacob Menick, Albin Cassirer, Richard Powell, George van den Driessche, Lisa Anne Hendricks, Maribeth Rauh, Po-Sen Huang, Amelia Glaese, Johannes Welbl, Sumanth Dathathri, Saffron Huang, Jonathan Uesato, John Mellor, Irina Higgins, Antonia Creswell, Nat McAleese, Amy Wu, Erich Elsen, Siddhant M. Jayakumar, Elena Buchatskaya, David Budden, Esme Sutherland, Karen Simonyan, Michela Paganini, Laurent Sifre, Lena Martens, Xiang Lorraine Li, Adhiguna Kuncoro, Aida Nematzadeh, Elena Gribovskaya, Domenic Donato, Angeliki Lazaridou, Arthur Mensch, Jean-Baptiste Lespiau, Maria Tsimpoukelli, Nikolai Grigorev, Doug Fritz, Thibault Sottiaux, Mantas Pajarskas, Toby Pohlen, Zhitao Gong, Daniel Toyama, Cyprien de Masson d'Autume, Yujia Li, Tayfun Terzi, Vladimir Mikulik, Igor Babuschkin, Aidan Clark, Diego de Las Casas, Aurelia Guy, Chris Jones, James Bradbury, Matthew J. Johnson, Blake A. Hechtman, Laura Weidinger, Iason Gabriel, William Isaac, Edward Lockhart, Simon Osindero, Laura Rimell, Chris Dyer, Oriol Vinyals, Kareem Ayoub, Jeff Stanway, Lorrayne Bennett, Demis Hassabis, Koray Kavukcuoglu, and Geoffrey Irving. Scaling language models: Methods, analysis & insights from training gopher. CoRR, abs/2112.11446, 2021. URL https://arxiv.org/abs/2112.11446.
|
| 276 |
+
Adam Roberts, Colin Raffel, Katherine Lee, Michael Matena, Noam Shazeer, Peter J Liu, Sharan Narang, Wei Li, and Yanqi Zhou. Exploring the limits of transfer learning with a unified text-to-text transformer. Google, Tech. Rep., 2019.
|
| 277 |
+
Luca Soldaini, Rodney Kinney, Akshita Bhagia, Dustin Schwenk, David Atkinson, Russell Authur, Ben Bogin, Khyathi Chandu, Jennifer Dumas, Yanai Elazar, Valentin Hofmann, Ananya Harsh Jha, Sachin Kumar, Li Lucy, Xinxi Lyu, Nathan Lambert, Ian Magnusson, Jacob Morrison, Niklas Muennighoff, Aakanksha Naik, Crystal Nam, Matthew E. Peters, Abhilasha Ravichander, Kyle Richardson, Zejiang Shen, Emma Strubell, Nishant Subramani, Oyvind Tafjord, Pete Walsh, Luke Zettlemoyer, Noah A. Smith, Hannaneh Hajishirzi, Iz Beltagy, Dirk Groeneveld, Jesse Dodge, and Kyle Lo. Dolma: An Open Corpus of Three Trillion Tokens for Language Model Pretraining Research. arXiv preprint, 2024. URL https://arxiv.org/abs/2402.00159.
|
| 278 |
+
Robyn Speer. ftfy. Zenodo, 2019. URL https://doi.org/10.5281/zenodo.2591652. Version 5.5.
|
| 279 |
+
A Together Computer. Redpajama: An open source recipe to reproduce llama training dataset, April 2023. URL https://github.com/togethercomputer/RedPajama-Data.
|
| 280 |
+
Guillaume Wenzek, Marie-Anne Lachaux, Alexis Conneau, Vishrav Chaudhary, Francisco Guzmán, Armand Joulin, and Édouard Grave. Ccnet: Extracting high quality monolingual datasets from web crawl data. In Proceedings of The 12th Language Resources and Evaluation Conference, pp. 4003-4012, 2020.
|
| 281 |
+
Zhipeng Xu, Zhenghao Liu, Yukun Yan, Zhiyuan Liu, Chenyan Xiong, and Ge Yu. Cleaner pretraining corpus curation with neural web scraping. In Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics, 2024.
|
| 282 |
+
Linting Xue, Noah Constant, Adam Roberts, Mihir Kale, Rami Al-Rfou, Aditya Siddhant, Aditya Barua, and Colin Raffel. mT5: A massively multilingual pre-trained text-to-text transformer. In Proceedings of the 2021 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies, pp. 483-498, Online, June 2021. Association for Computational Linguistics. doi: 10.18653/v1/2021.naacl-main.41. URL https://aclanthology.org/2021.naacl-main.41.
|
| 283 |
+
|
| 284 |
+
# A SWEB DATASHEET
|
| 285 |
+
|
| 286 |
+
We provide a datasheet inspired by Gebru et al. (2021):
|
| 287 |
+
|
| 288 |
+
<table><tr><td colspan="2">Motivation</td></tr><tr><td>Purpose of the dataset</td><td>We want to encourage open research and development of LLMs in the Swedish, Danish, Norwegian and Icelandic languages. We build and release SWEb to promote this objective and to address the linguistic challenges specific to underrepresented Scandinavian languages, improving access to language technology in these regions.</td></tr><tr><td>Curated by</td><td>AI Sweden</td></tr><tr><td>Funded by</td><td>AI Sweden</td></tr><tr><td colspan="2">Composition</td></tr><tr><td>Data Fields</td><td>Each data instance contains:1. The source URL2. The original Common Crawl WARC file path3. The WARC date4. The extracted text content, in markdown format5. The detected language (using fastText classifier)</td></tr><tr><td>Data Splits</td><td>We split SWEb based on Common Crawl dump, to allow for download based on time of crawl. We also include a default split containing the entire dataset.</td></tr><tr><td>Errors and noise</td><td>As outlined in this paper, we propose a novel model based approach to extract text from websites. However, the model is not perfect and non-relevant content as well as noise are sometimes also erroneously extracted. We try to filter such examples in our third pipeline stage, but despite our best effort such examples may sometimes slip through.</td></tr><tr><td>Offensive and toxic content</td><td>As we don’t attempt to filter based on content or topic in this work, SWEb might contain content that can be percieved as offensive, threatening or otherwise toxic. When considering using this dataset, it is important to be aware of this and that further processing might be necessary depending on use case.</td></tr><tr><td colspan="2">Dataset Curation</td></tr><tr><td>Curation rationale</td><td>We use Common Crawl as it is the (to our knowledge) largest and most diverse open corpus available in the Scandinavian languages.</td></tr><tr><td>Source data</td><td>The Common Crawl source data consists of large amounts of webpages crawled from the open web. Common Crawl’s crawlers has always respected nofollow and robots.txt policies.</td></tr><tr><td>Time frames of collected data</td><td>We use all Common Crawl scraped dating back to week 50 of 2013 and up to week 26 of 2024.</td></tr><tr><td>Data processing steps</td><td>See Section 3.</td></tr><tr><td>Annotations</td><td>Among the data fields, only the detected language can be considered “annotated” by us.</td></tr><tr><td>Personal & sensitive information</td><td>We anonymize email addresses and public IP addresses using regex patterns.</td></tr><tr><td colspan="2">Considerations for using the data</td></tr><tr><td>Social impact of dataset</td><td>With SWEb, our goal is to make LLM training more accessible to the machine learning community by: (a) making the dataset creation process more transparent, by sharing our entire processing setup including the codebase used (b) helping alleviate the costs of dataset curation, both in time and in compute, for model creators by publicly releasing our dataset with the community.</td></tr><tr><td>Bias and Representation</td><td>While the Common Crawl data gathers diverse text sources, biases present in the original content may still exist. Users should critically assess how these biases may affect model training and outcomes, especially in sensitive applications. It is recommended to implement bias-mitigation techniques during training and model development.</td></tr><tr><td>Model Misuse</td><td>When training models with this dataset, it is crucial to prevent harmful uses of the resulting models, such as generating misleading or dangerous content (e.g., disinformation, hate speech). Always consider the societal impact of deploying models trained on this data, and take precautions to implement appropriate safeguards.</td></tr><tr><td colspan="2">Distribution</td></tr><tr><td>Distribution platform</td><td>The dataset will be distributed on the Huggingface Hub</td></tr><tr><td>License</td><td>The data is released under the CC0 Creative Commons License. We make the following clarifications:1. We do not warrant or guarantee any rights to the underlying data contained within this dataset. Users are solely responsible for validating and securing the appropriate rights and licenses for their specific intended uses.2. This license applies only to the structure and compilation of the dataset as provided by us. We do not claim any database rights or ownership over the underlying data itself. Users must ensure compliance with any legal obligations, including those related to third-party content, copyrighted material, or personal information (PII) that may be contained in the underlying data.3. With the release of this dataset, our goal is to promote and advance open research and the development of Scandinavian language models, showcase research outcomes as well as enable research validation. Open datasets are essential to fostering innovation and expanding knowledge in AI. We disclaim any responsibility for other uses, including commercial applications. Users are responsible for ensuring the legality of their usage, especially in cases involving copyrighted material.</td></tr><tr><td>Notice and take-down policy</td><td>Should you consider that our data contains material that is owned by you and should therefore not be reproduced here, please:1. Clearly identify yourself, with detailed contact data such as an address, telephone number or email address at which you can be contacted.2. Clearly identify the copyrighted work claimed to be infringed.3. Clearly identify the material that is claimed to be infringing and information reasonably sufficient to allow us to locate the material.4. You can reach us at datasets@ai.seWe will comply to legitimate requests by removing the affected sources from the next release of the corpus.</td></tr></table>
|
| 289 |
+
|
| 290 |
+
# B MARKDOWN ANNOTATION DETAILS
|
| 291 |
+
|
| 292 |
+

|
| 293 |
+
Figure 11: Our web based annotation tool. On the right side the original web page is displayed and on the left the corresponding markdown. Annotation is performed by selecting individual lines (marked green) that constitute the main content of the page.
|
| 294 |
+
|
| 295 |
+
We develop a web based tool that we use to annotate markdown documents, see Figure 11. The tool is used to annotate data for training and evaluating our text extractor model (Section 3.2.2).
|
| 296 |
+
|
| 297 |
+
The annotation was performed by the authors as well as additional lab colleagues, in total a group of 12 people. We started by jointly annotating a gold standard test set of 100 examples (web pages). This was useful to align and develop our annotation guidelines.
|
| 298 |
+
|
| 299 |
+
Next, we annotated a first set of 400 training examples and trained a first extractor model. This model served as a first baseline. We then iteratively annotated additional training data in batches of 300-500 examples, re-trained and re-evaluated after each iteration.
|
| 300 |
+
|
| 301 |
+
Judging what is "main content" in web pages is not always obvious however. When the evaluation didn't improve after a new batch of annotations, we developed a method for discovering "confusing" training examples in the new batch that we could jointly discuss and align on. For each example $x$ in the new training batch, we compute the loss $l^{M_n}(x,y) = \mathcal{L}(M_n(x),y)$ , where $\mathcal{L}$ is the average over all BCE losses in the example and $M_{n}$ is the model trained on all batches including iteration $n$ .
|
| 302 |
+
|
| 303 |
+
By comparing this loss to the corresponding loss under the previous model $M_{n-1}$ , we get a measure of how "surprising" this example is:
|
| 304 |
+
|
| 305 |
+
$$
|
| 306 |
+
\delta = l ^ {M _ {n - 1}} (x, y) - l ^ {M _ {n}} (x, y) \tag {3}
|
| 307 |
+
$$
|
| 308 |
+
|
| 309 |
+
Using this quantity, we could easily identify outliers and correct inconsistent annotations. By performing this post-annotation fix-up, we were able to improve performance on our test set, for each annotated batch of data.
|
| 310 |
+
|
| 311 |
+
# C CONTENT EXTRACTION ANNOTATION GUIDELINES
|
| 312 |
+
|
| 313 |
+
The following description was provided to our annotators
|
| 314 |
+
|
| 315 |
+
In the provided annotation tool, please select individual lines by clicking and dragging across the lines you want to select.
|
| 316 |
+
|
| 317 |
+
- Please look at the rendered web page on the right. We want to extract the "main textual content" of the current page.
|
| 318 |
+
- No navigation (menus, links, button texts etc) should be selected, except well formatted tables of content that link within the same page
|
| 319 |
+
- Include headers of main content
|
| 320 |
+
- If duplicate header, select the one closest to the main content
|
| 321 |
+
- Include well formatted tables
|
| 322 |
+
- Don't include content of sidebars that is unrelated to the main content
|
| 323 |
+
- It is OK to leave the whole document unselected if there is no relevant content
|
| 324 |
+
- If there are many very similar-looking pages, they can be marked Ignored if they have already been annotated. Bad pages without any good content should not be ignored however.
|
| 325 |
+
- Include comment sections if there are any, but exclude navigation associated with those, e.g. Svara/Rapportera inlagg or similar.
|
| 326 |
+
- Keep comment headings
|
| 327 |
+
- If text is broken with e.g. "...", don't include
|
| 328 |
+
- Select top heading if it exists
|
| 329 |
+
- Keep at most 2 consecutive newlines
|
| 330 |
+
- Remove empty formatting lines (e.g **), except for dividers (——)
|
| 331 |
+
- Pages that are primarily "data" (e.g. tables, numbers) without much text should be unselected. There should be at least three consecutive sentences of text. This puts a somewhat high bar for product pages
|
| 332 |
+
- No HTML should be selected
|
| 333 |
+
|
| 334 |
+
# D CONTENT EXTRACTOR ERROR ANALYSIS
|
| 335 |
+
|
| 336 |
+
To analyze the errors made by our context extractor, we use the line-level annotations of the 100 validation documents. For each line in each document, the line is predicted to be extracted or ignored. Therefore, for each document, we get a number of FP and FN line classifications. In Figure 12 we plot the distribution over number of FP and FN lines.
|
| 337 |
+
|
| 338 |
+

|
| 339 |
+
Figure 12: Distribution over number of False Positive/Negative lines, in the test set documents
|
| 340 |
+
|
| 341 |
+

|
| 342 |
+
|
| 343 |
+
We can see that the vast majority of documents have less than 10 wrongly classified lines. The document with the highest number of false negative lines is shown in Figure 13. In this case, the table of contents, some headings as well as the reference list were wrongly not extracted.
|
| 344 |
+
|
| 345 |
+
# Flyulykken i Kastrup 1947
|
| 346 |
+
|
| 347 |
+
**Flyulykken 1 Kastrup 1947** var en flyulykke, der fandt sted den 26. januar 1947 k1. 15:35 1 Kebenhavns Lufthavn, Kastrup, da en Douglas DC-3C (C-47) fra KLM Royal Dutch Airlines styternde ned umildelbart after starten after en mellemlanding pe voj fra Amsterdam til Stockholm. Alle 22 ombord okom, blandit dem den体系建设e arveprins Gustaf Adolf, den nuverende kong Carl XVI Gustafs far.
|
| 348 |
+
|
| 349 |
+
# Flyulykken i Kastrup 1947
|
| 350 |
+
|
| 351 |
+
! [Vraget after flyet](//upload.wikimedia.org/wikipedia/commons/thumb/7/77/Kastrup_1947.jpg/250px-Kastrup_1947.jpg)
|
| 352 |
+
|
| 353 |
+
# Vraget after flyet
|
| 354 |
+
|
| 355 |
+
Ulykken skege som fole af, at flet yalle under starten som folge af en glent rolas. Kaptaj nay flyvnngen var den erfarne 55-irige hollandske pilot Gerrit Johannis Geysendorffer. Ulykken anses son den fjerevarste danse fluykyke.
|
| 356 |
+
|
| 357 |
+
# ## Indholsfortegnelse
|
| 358 |
+
|
| 359 |
+
-1Forlob
|
| 360 |
+
-2 Omkomne
|
| 361 |
+
-3 Note
|
| 362 |
+
-4Seogsà
|
| 363 |
+
-5 Eksterne links
|
| 364 |
+
|
| 365 |
+
# Forlob Rediger
|
| 366 |
+
|
| 367 |
+
Kloken 14.55 mellemdande flyet i Kastrup for at medtaga passage. Pr auf grade krafte vindsted blev der trots dote ofoh 1 Kastrup sat las pf flyrs rot for at undga, at disse skule blbe bsadigede Da fylsete luke iten, blev der formentlg icke genmgej tjkleista Der he ller icke gennemfert startchac fe flytes moter. Disse fo jel medferte, at pilotner icke var opermerssome a, at nogen have glmet to fjne laen til heiderot.a $\{\backslash [11]\}$ Resultatet blev, at da DC-3 erien letteck ld. 15.31, foretog fleyet en brat stigning op tl ca. 50 meters haje, hvorefter fyle statede and rame jorden.a $\{\backslash [21]\}$ Det haverade fly bred straks i brand og smtliche 22 ombdveronde omkom.
|
| 368 |
+
|
| 369 |
+
- ![Flyets planlage rute].((//upload.wikimedia.org/wiki/commons/thumb/0/08/Flugkatastrophe_von_Kastrup.svg/109px-Flugkatastrophe_von_Kastrup.svg.png)
|
| 370 |
+
|
| 371 |
+
# Flyets planlage route.
|
| 372 |
+
|
| 373 |
+
- 
|
| 374 |
+
|
| 375 |
+
En Douglas DC-3 fra KLM som det forulykke fey.
|
| 376 |
+
|
| 377 |
+
# ## Omkomne Rediger
|
| 378 |
+
|
| 379 |
+
Ved starten fra Kastrup befandigt sib ombord por flet 6 besattningsmedlemmer og 16 passager; 11 mnd, tre kvinder og to barn. Af disse var sv danskere, firevenskere, to transkmend, en amerikaner, en hollander og en spanier.
|
| 380 |
+
|
| 381 |
+
Flylets kaptajn var the 5-irige Gerit Johannes Geyenderoffer, der var en erfaren pilot. Han var den firste hollander, der modtog et commerciel flycertifikat og som siden 1921 havede veret tiknytitet KLM. Geyenderoffer havde i 1927 som der firste hollander fljet hele vejen til Batavia (nutidens Jakarta) i Hollandsk Ostindien og havde foretaget mere end 50 flyvninger tlen der hollandske koloni, for hvilket har vane blevet tildelt ordinen Orde van Oranje-Nassau. $\langle \backslash [3]\backslash \rangle$ ) Geyenderoffer blev certificeret ot flyvninger dc-3 i 1937 og havde flere hundred fyvetimer med flety. $\langle \backslash [4]\rangle$ ) Han boede i Amsterdam med sin danse hustru Tofa Spandet, som han havde mdt, da han i en ung alder var ndlandet i Danmark. $\langle \backslash [5]\rangle$ ) Flyets styrmard var Jan Rietman (fodt 1918). $\langle \backslash [6]\rangle$
|
| 382 |
+
|
| 383 |
+
Den svenste snorarving Gustaf olvar blandt sys passagerer fayvijnngr fAamderst tekbehavn. Gustav olva have besegt den hollandske Prins Bernhard n ogle dage, hvde havetaretp vildsvinejagt smenw. $\text{巧} [ 7 ]$ ) Gustav olva rejested me sd injudantal, Albert Stenboq og var pey ve til Stockholm.
|
| 384 |
+
|
| 385 |
+
Ved mellemdanings 1 Kastrup steg tre passager on flyet og 12 nye pasager steg o bord. Blandt passagerner, der steg ombord 1 Kastrup var den amerikanske operager and kuespiller Grace Moore, der var pa ture. Hun havae aften for optrakt 1 en fyldt KB Hal og var nu pa velt stockham for at give konct. Med Grace Moore rejste diverse musike m.v. og osdn deake kuespillerinde Gerda Neumann und demnes mand, direkter og filproduend Jens Dennow. $\left[\text{【} \backslash \{\mathbb { H } \}\right]$ )Flyets Kendte passagerne hove presens bevagenhed. Den svenoke krnpn prags yap kist prese 1000000000000000000000000000000000000000000000000000000000000000000000000000000
|
| 386 |
+
|
| 387 |
+
- 
|
| 388 |
+
|
| 389 |
+
# Gustaf Adolf
|
| 390 |
+
|
| 391 |
+
- 
|
| 392 |
+
|
| 393 |
+
# Grace Moore
|
| 394 |
+
|
| 395 |
+
- 
|
| 396 |
+
|
| 397 |
+
# Gerrit Geysendorffer
|
| 398 |
+
|
| 399 |
+
Noter Rediger
|
| 400 |
+
|
| 401 |
+
1. A
|
| 402 |
+
|
| 403 |
+
"Beskrivelse af ulykken pa avition-safet.net". Arkiveret fra originalen 8. Juni 2015. Hentet 3. maj 2015.
|
| 404 |
+
2. ^ Alsing, Rolf; Lundh, Jonas, red. (1999). *1998-talet: en bok fran Aftonbladet*. Stockholm: Aftonbladet med stöd av Statens skolverk. s. 144. ISBN 91-630-8939-4. {{cite book}}
|
| 405 |
+
3. ^*Grace Moore and Heir to Throne Die in Crash.* I Los Angeles Times, 27. januar 1947, p. 2.
|
| 406 |
+
4. Original-Luftfahrunttersuchungsbericht, p. 3-4 Arkiveret 24. september 2015 hos Wayback Machine på hdekker.info (nederlandsk/hollandsk), hentet 3. maj 2015
|
| 407 |
+
5. ^*Grace Moore dies in burning Plane* The New York Times, 27. januar 1947, p. 3
|
| 408 |
+
6. Original-Luftfahruntersuchungsbericht, p. 4-5 Arkiveret 24. september 2015 hos Wayback Machine, hdekker.info, (nederlandsk/hollandsk), hentet 3. maj 2015
|
| 409 |
+
7. $\wedge$ *Swedish Prince Killed In Air Wreck Crash After Taking Off At Copenhagen, Miss Grace Moore Among 22 Victims* The Times, 27. januar 1947, Nr. 50669, p. 4
|
| 410 |
+
8. ^ "Flykatastrofen i Kastrup 1947, \[\{\text{Dines Bogø}\} \] \], \[\{\text{Amagerbladet}\} \] \], 7. september 2009". Arkiveret fra originalen 24. december 2014. Hentet 3. maj 2015.
|
| 411 |
+
|
| 412 |
+
Figure 13: The extraction for https://da.m.wikipedia.org/wiki/Flyulykken_i_Kastrup_1947. Green lines are true positives and blue lines are false negatives. True negative lines are not shown for illustrative purposes.
|
| 413 |
+
|
| 414 |
+
# E FILTERED EXAMPLES
|
| 415 |
+
|
| 416 |
+
We show examples of extracted documents that are filtered out by each of our four quality filters.
|
| 417 |
+
|
| 418 |
+
# E.1 CONTENT LENGTH $< 100$ CHARS
|
| 419 |
+
|
| 420 |
+
```html
|
| 421 |
+
https://www.buskerudmynt.no/productn/norske-mynter-etter-1874/norske-argangsmynter/50-ore/olav-v-1974-1991/50-ore-1977-kv.-0
|
| 422 |
+
```
|
| 423 |
+
|
| 424 |
+
```txt
|
| 425 |
+
1 # 50 ore 1977 kv. 0
|
| 426 |
+
2
|
| 427 |
+
3 Tatt fra rull. Litt skjoldete mynt.
|
| 428 |
+
4
|
| 429 |
+
5 NOK5,00 inkl.mva.
|
| 430 |
+
```
|
| 431 |
+
|
| 432 |
+
```txt
|
| 433 |
+
https://www.ovedanielsson.se/2021/08/30/ohrmans-fick-inte-bygga-nytt-mot-target/embed/
|
| 434 |
+
```
|
| 435 |
+
|
| 436 |
+
```txt
|
| 437 |
+
1 Ohrmans fick inte bygga nytt mot forget
|
| 438 |
+
```
|
| 439 |
+
|
| 440 |
+
```txt
|
| 441 |
+
https://jesper.nu/spel/achtung-die-kurve
|
| 442 |
+
```
|
| 443 |
+
|
| 444 |
+
```txt
|
| 445 |
+
1 # Achtung Die Kurve
|
| 446 |
+
```
|
| 447 |
+
|
| 448 |
+
# E.2 RATIO OF ALPHANUMERIC CHARACTERS $< 0.4$
|
| 449 |
+
|
| 450 |
+
```txt
|
| 451 |
+
https://www.innebandystatse.se/statistik/219645/kevin-sandeback
|
| 452 |
+
```
|
| 453 |
+
|
| 454 |
+
```txt
|
| 455 |
+
1 | CL981C Juniorallsvenskan HJ18 14 16 10 | **26** 0
|
| 456 |
+
```
|
| 457 |
+
|
| 458 |
+
```txt
|
| 459 |
+
https://nn.wikipedia.org/wiki/Kategori:Deltakarar_under_vinter-OL_1984_etter_Ayving
|
| 460 |
+
```
|
| 461 |
+
|
| 462 |
+
```txt
|
| 463 |
+
1 1896 $\text{喜}$ A\*\* 1900 $\text{喜}$ A\*\* 1904 $\text{喜}$ A\*\* 1906 $\text{喜}$ A\*\* 1908 $\text{喜}$ A\*\* 1912 $\text{喜}$ A\*\* \~(1916)\~ $\text{喜}$ A\*\* 1920 $\text{喜}$ A\*\* 1924 $\text{喜}$ A\*\* 1932 $\text{喜}$ A\*\* 1936 $\text{喜}$ A\*\* \~(1940)\~ $\text{喜}$ A\*\* \~(1944)\~ $\text{喜}$ A\*\* 1948 $\text{喜}$ A\*\* 1952 $\text{喜}$ A\*\* 1956 $\text{喜}$ A\*\* 1960 $\text{喜}$ A\*\* 1964 $\text{喜}$ A\*\* 1968 $\text{喜}$ A\*\* 1972 $\text{喜}$ A\*\* 1976 $\text{喜}$ A\*\* 1980 $\text{喜}$ A\*\* 1984 $\text{喜}$ A\*\* 1988 $\text{喜}$ A\*\* 1992 $\text{喜}$ A\*\* 1996 $\text{喜}$ A\*\* 2000 $\text{喜}$ A\*\* 2004 $\text{喜}$ A\*\* 2008 $\text{喜}$ A\*\* 2012 $\text{喜}$ A\*\* 2016\*\* A\*\* 2020
|
| 464 |
+
2 $^ { \text{喜} }$ Vinter-OL\*\*
|
| 465 |
+
3
|
| 466 |
+
4 Deltakarar etter $^ { \text{喜} }$ nasjon:
|
| 467 |
+
5
|
| 468 |
+
6 1924 $\text{喜}$ A\*\* 1928 $\text{喜}$ A\*\* 1932 $\text{喜}$ A\*\* 1936 $\text{喜}$ A\*\* \~(1940)\~ $\text{喜}$ A\*\* \~(1944)\~ $\text{喜}$ A\*\* 1948 $\text{喜}$ A\*\*1952 $\text{喜}$ A\*\* 1956 $\text{喜}$ A\*\* 1960 $\text{喜}$ A\*\* 1964 $\text{喜}$ A\*\* 1968 $\text{喜}$ A\*\* 1972 $\text{喜}$ A\*\* 1975 $\text{喜}$ A\*\* 1980 $\text{喜}$ A\*\* 1984 $\text{喜}$ A\*\* 1988 $\text{喜}$ A\*\* 1992 $\text{喜}$ A\*\* 1994 $\text{喜}$ A\*\* 1998 $\text{喜}$ A\*\* 2002 $\text{喜}$ A\*\* 2006 $\text{喜}$ A\*\* 2010 $\text{喜}$ A\*\* 2014 $\text{喜}$ A\*\* 2018 $\text{喜}$ A\*\* 2022
|
| 469 |
+
7
|
| 470 |
+
8 Deltakarar etter $^ { \text{喜} }$ oving:
|
| 471 |
+
```
|
| 472 |
+
|
| 473 |
+
```gitattributes
|
| 474 |
+
https://historik.val.se/val/val2010/alkon/K/valdistrikt/12/80/0102/alderkon.html
|
| 475 |
+
```
|
| 476 |
+
|
| 477 |
+
```csv
|
| 478 |
+
1 |--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|--------|
|
| 479 |
+
2 | Gamla staden, Stortorget | 1533 | 24,8% | 380 | 43,0% | 659 | 20,4% | 312 | 11,9% | 182 |
|
| 480 |
+
3 | Summa | 1533 | 24,8% | 380 | 43,0% | 659 | 20,4% | 312 | 11,9% | 182 |
|
| 481 |
+
4 | 4,4% | 68 | 52,6% | 806 | 47,4% | 727 | 13,8% |
|
| 482 |
+
5 http://www.val.se
|
| 483 |
+
```
|
| 484 |
+
|
| 485 |
+
# E.3 HEADINGS PER NON-HEADING WORD $>0.05$
|
| 486 |
+
|
| 487 |
+
```html
|
| 488 |
+
https://www.sahlgrenska.se/for-dig-som-ar/vardgivare/laboratoriemedicin/analyslistan/specialprover-cytologisk-diagnostik/16648.html/
|
| 489 |
+
```
|
| 490 |
+
|
| 491 |
+
```txt
|
| 492 |
+
1 #Glaskropp
|
| 493 |
+
2
|
| 494 |
+
3 # Glaskropp cytologisk diagnos
|
| 495 |
+
4
|
| 496 |
+
5 ### Synonymer
|
| 497 |
+
6
|
| 498 |
+
```
|
| 499 |
+
|
| 500 |
+
```txt
|
| 501 |
+
7 Specialprover, cytologisk diagnotik
|
| 502 |
+
8
|
| 503 |
+
9 # Provtagningsanvising
|
| 504 |
+
10
|
| 505 |
+
11 ## Provmaterial
|
| 506 |
+
12
|
| 507 |
+
13 Ror el. motsv
|
| 508 |
+
14
|
| 509 |
+
15 10 ml ror med gul kork, konisk botten, steril (for minre mängder material) ell er Burk ca 40 ml m tata slutande lock, sterilt
|
| 510 |
+
16
|
| 511 |
+
17 # Provtagning
|
| 512 |
+
18
|
| 513 |
+
19 Enligt inremitterande kliniks regler Provet skull snarast after skoljningen transporteras till Cytologen.
|
| 514 |
+
20 Ofixerade vatskor sca foranmalas och lamnas direkt till lab. personal fore kl 14.00.
|
| 515 |
+
21
|
| 516 |
+
22 #Transport
|
| 517 |
+
23
|
| 518 |
+
24 Transport ske omgäende till Laboratoriet for klinisk patologi och darr lamnas direkt till provinlä mningen.
|
| 519 |
+
```
|
| 520 |
+
|
| 521 |
+
https://folk.sunnhordland.no/publications/211951
|
| 522 |
+
```txt
|
| 523 |
+
1 # Olive Buchvold Juvik
|
| 524 |
+
2
|
| 525 |
+
3 Gullet vãrt Olive «snat 2 År» «Ja, vennen, på lørdag 18. nov, fyller du 2 År» Me gratulerer SSA masse!
|
| 526 |
+
Kjempe gla' i deg. Klem fra tanter, onkler, besteforeldre og oldeforeldre.
|
| 527 |
+
4
|
| 528 |
+
5
|
| 529 |
+
6
|
| 530 |
+
7 ## Go'ungen (0-12 År)
|
| 531 |
+
8
|
| 532 |
+
9
|
| 533 |
+
10
|
| 534 |
+
11 ### Nora Sildenafil Fredheim
|
| 535 |
+
```
|
| 536 |
+
|
| 537 |
+
https://start.arcada.fi/sv/kurser/303000/2021-2022/IA-2-004/0
|
| 538 |
+
```txt
|
| 539 |
+
1 ## Kursens undervisningsperiod
|
| 540 |
+
2
|
| 541 |
+
3 3 (2022-01-01 till 2022-03-13)
|
| 542 |
+
4
|
| 543 |
+
5 ## Nivå/kategori
|
| 544 |
+
6 ## Cykel/nivå
|
| 545 |
+
7 Yrkeshhögskoleexamen
|
| 546 |
+
8
|
| 547 |
+
9 ## Rekommenderat studieår
|
| 548 |
+
10
|
| 549 |
+
11 1
|
| 550 |
+
12 ## Omfattning
|
| 551 |
+
13
|
| 552 |
+
14 5 sp
|
| 553 |
+
15
|
| 554 |
+
16 ## Kompetensmål
|
| 555 |
+
17
|
| 556 |
+
18 Ienna studieenhet står följande kompetenser i
|
| 557 |
+
19 fokus:
|
| 558 |
+
20 $-$ Kompetens inom serverprogrammering
|
| 559 |
+
21 $-$ Kompetens inom databashantering och lagring av
|
| 560 |
+
22 data
|
| 561 |
+
23 $-$ Kompetensen att skapa dynamiska applicatoner
|
| 562 |
+
24
|
| 563 |
+
25 ## Läranderesultat
|
| 564 |
+
26
|
| 565 |
+
27 Efter avlagd studieenhet:
|
| 566 |
+
28 $-$ Du behärskar programmering med
|
| 567 |
+
PHP (Kunskap)
|
| 568 |
+
30 $-$ Du ser skillnaden mellan statiska, interaktiviva
|
| 569 |
+
31 och dynamiska webbsidor (Kunskap)
|
| 570 |
+
32 $-$ Du kan hantera filer frän klienen och på
|
| 571 |
+
33 servern (Kunskap)
|
| 572 |
+
34 $-$ Du kan bygga dynamiska webappar (Fardighet)
|
| 573 |
+
35 $-$ Du kan lagra data sækert i en databases
|
| 574 |
+
36 (Fardighet)
|
| 575 |
+
37 $-$ Du inser problematik och lösninger kring att.
|
| 576 |
+
38 lagra kändlig information om en användare
|
| 577 |
+
39 (Förhällningssätt)
|
| 578 |
+
40 $-$ Du uppfattar olika sätt att overföra och lagra
|
| 579 |
+
41 data och dess koppling till säkeherhet och
|
| 580 |
+
42 prestanda (Förhällningssätt)
|
| 581 |
+
43 $-$ Du uppfattar din makt och ditt ansvar som
|
| 582 |
+
```
|
| 583 |
+
|
| 584 |
+
# E.4 UNIGRAM ENTROPY $< 3.0$
|
| 585 |
+
|
| 586 |
+
```txt
|
| 587 |
+
https://hastkatalogen.se/content/horse/info.php?id=31999
|
| 588 |
+
```
|
| 589 |
+
|
| 590 |
+
```txt
|
| 591 |
+
1 # Catinkaox
|
| 592 |
+
2
|
| 593 |
+
3 ## Arabiskt Fullblod
|
| 594 |
+
4
|
| 595 |
+
5 Catinka ar ett sto som fddes 1976 i Sverige.
|
| 596 |
+
6
|
| 597 |
+
7
|
| 598 |
+
8
|
| 599 |
+
9 - Ras: Arabiskt Fullblod
|
| 600 |
+
10 -Kon:Sto
|
| 601 |
+
11 -Farg:brun
|
| 602 |
+
12 - Stofamilj:
|
| 603 |
+
13 |
|
| 604 |
+
```
|
| 605 |
+
|
| 606 |
+
https://www.nilssonsilammhult.se/hallmobler/ida-skohorn-ek/
|
| 607 |
+
```txt
|
| 608 |
+
1 # Ida skohorn ek
|
| 609 |
+
2
|
| 610 |
+
3 430 kr
|
| 611 |
+
4
|
| 612 |
+
5 Ida skohorn i oljad ek frän småländska Westroth. Tillverkad i formpressat trä. En fin detalj till hallen\!
|
| 613 |
+
6
|
| 614 |
+
7
|
| 615 |
+
8
|
| 616 |
+
9 Ida skohorn ek mängd
|
| 617 |
+
10
|
| 618 |
+
11 # Ida skohorn ek
|
| 619 |
+
12
|
| 620 |
+
13
|
| 621 |
+
14
|
| 622 |
+
15 Ida skohorn i oljad ek frän småländska Westroth. Tillverkad i formpressat trä. En fin detalj till hallen\!
|
| 623 |
+
16
|
| 624 |
+
17 430 kr
|
| 625 |
+
```
|
| 626 |
+
|
| 627 |
+
https://kaldarsel.is/author/heidbjort-arney/
|
| 628 |
+
```txt
|
| 629 |
+
1 -
|
| 630 |
+
2
|
| 631 |
+
3 #Leikjanámskei 10. juli
|
| 632 |
+
4
|
| 633 |
+
5 Hofundur: Heijbjort Arney|2017-07-12T10:01:09+00:0012. juli 2017
|
| 634 |
+
6
|
| 635 |
+
7 -
|
| 636 |
+
8
|
| 637 |
+
9 #Veisludagur runinnn upp
|
| 638 |
+
10
|
| 639 |
+
11 -
|
| 640 |
+
12
|
| 641 |
+
13 #Dvalarflokkur
|
| 642 |
+
14
|
| 643 |
+
15 Hofundur: Heijbjort Arney|2017-06-28T10:15:51+00:0028. juni 2017
|
| 644 |
+
16
|
| 645 |
+
17 -
|
| 646 |
+
18
|
| 647 |
+
19 #Leikjanámskei 2
|
| 648 |
+
20
|
| 649 |
+
21 Hofundur: Heijbjort Arney|2017-06-21T13:07:08+00:0021. juni 2017
|
| 650 |
+
```
|
| 651 |
+
|
| 652 |
+
# F COMPARING OUR MODEL EXTRACTOR VS TRAFILATURA
|
| 653 |
+
|
| 654 |
+
We compare our model based extractor vs trafilatura (in the settings used by FineWeb).
|
| 655 |
+
|
| 656 |
+
https://www.ark.no/product/boker/dokumentar-og-faktabroker/eksil-9788202253912
|
| 657 |
+
|
| 658 |
+
# Trafilatura
|
| 659 |
+
|
| 660 |
+
1 Innbundet
|
| 661 |
+
|
| 662 |
+
2 2005
|
| 663 |
+
3 Norsk, Bokmål
|
| 664 |
+
4 «Denne boken dreier seg om eksil og dannelse.
|
| 665 |
+
5 Lesning av Dante ga meg en italiensk regel: Dannelse oppstar alltid og bare i eksil. Det vesle som fins av dannelse i Norge, dannes ut fra evnen til distanse i et livsnodvendig indre aller ytre eksil. Dannelse er det motsatte av turisme. Slik forte min selvorsorg meg stadig mer inn og ut av norsk kultur (og underholdning) til jeg ble uehl bredelig gudles og partil øs i en vag, men livslang interesse for ekemplariske flyktninger og forraddere fra Klosterlasse til Asbjørn Sunde.
|
| 666 |
+
|
| 667 |
+
6 (fra Georg Johannesens forord)
|
| 668 |
+
|
| 669 |
+
7 Klikk&Hent
|
| 670 |
+
8 På lager i 8 butikker
|
| 671 |
+
9 Nettlager Sendes normaltinnen 1-2 virkedager
|
| 672 |
+
10 Bytt i alle vare butikker.
|
| 673 |
+
11
|
| 674 |
+
12 Klikk og hent
|
| 675 |
+
13
|
| 676 |
+
|
| 677 |
+
# Model extractor (ours)
|
| 678 |
+
|
| 679 |
+
1 # Eksil - om klosterlasse og andre eksempler
|
| 680 |
+
2 Av Georg Johannes
|
| 681 |
+
4
|
| 682 |
+
5 «Denne boken dreier seg om eksil og dannelse. Lesning av Dante ga meg en italiensk regel: Dannelse oppstar alltid og bare i eksil.Det vesle som fins av dannelse i Norge, dannes ut fra even til distanse i et livsnodvendig indre erller ytre eksil. Dannelse er det motsatte av turisme. Slik forte min selvomsorg meg stadig mer inn og ut av norsk kultur (og underholding) til jeg ble uhelbredelig gudløs og partiles i en vag, men livslang intensese for eksemplariske flyktninger og forradere fra Klosterlasse til Asbjørn Sunde. $\text{三}$ (fra Georg Johannens forord)
|
| 683 |
+
|
| 684 |
+
https://gipomusic.se/track/vad-domain-an-tror/
|
| 685 |
+
|
| 686 |
+
# Trafilatura
|
| 687 |
+
|
| 688 |
+
1 Hur dom an
|
| 689 |
+
2 Färgerna ar blekare an igår
|
| 690 |
+
3 tiden ar for mork for att vi ske kunna le
|
| 691 |
+
4 jag vill inte höra deras rost mer
|
| 692 |
+
5 Illusioner av trost som drar mig ner
|
| 693 |
+
6 Hur deën sargar oss sa sca vi halla hand
|
| 694 |
+
7 Halva jväla varlden ar i brand
|
| 695 |
+
8 O hur dom än sänker oss sä ka vi skrika högst
|
| 696 |
+
9ettnejäralltidettnej
|
| 697 |
+
10 Vart vi ān qār ser vi nere.
|
| 698 |
+
11 aldrig merigen, aldrig mer
|
| 699 |
+
12 hela tiden fär vi säga till
|
| 700 |
+
13 ljusen runtomkring stared bar still
|
| 701 |
+
14Hur de an sargar oss sa ske vi halla hand
|
| 702 |
+
15 Halva jväla varlden ar i brand
|
| 703 |
+
16 O hur dom an sänker oss sä ka vi skrika högst
|
| 704 |
+
17ettnejäralltidettnej
|
| 705 |
+
18 En vacker strale som forsvann
|
| 706 |
+
19innan det blev morkt
|
| 707 |
+
20 innan det blev kallt
|
| 708 |
+
21 Och om det var dina skrik som inte hördest.
|
| 709 |
+
22 desservar din dotter som fordes ivag
|
| 710 |
+
23 hur skulle det kännas, hur skulle daaa
|
| 711 |
+
24Hur de an sargar oss sa ska vi halla hand
|
| 712 |
+
25 Halva jväla varlden ar i brand.
|
| 713 |
+
26 O hur dom an sänker oss sä ka vi skrika högst.
|
| 714 |
+
27ettnejäralltidettnej
|
| 715 |
+
|
| 716 |
+
# Model extractor (ours)
|
| 717 |
+
|
| 718 |
+
1#Vad dom an tror
|
| 719 |
+
|
| 720 |
+
2
|
| 721 |
+
|
| 722 |
+
3 Text: Clara Rudelius
|
| 723 |
+
|
| 724 |
+
4
|
| 725 |
+
|
| 726 |
+
5 https://gipomusic.se/wp-content/uploads/2014/10/04_Vad-dom-än-tror.mp3
|
| 727 |
+
|
| 728 |
+
6
|
| 729 |
+
|
| 730 |
+
7 \*\*Hur dom an\*\*
|
| 731 |
+
|
| 732 |
+
8
|
| 733 |
+
|
| 734 |
+
9 Färgerna ar blekare an igår
|
| 735 |
+
|
| 736 |
+
0 tiden ar for mork for att vi ske kunna le
|
| 737 |
+
|
| 738 |
+
I jag vill inte hörä deras rost mer.
|
| 739 |
+
|
| 740 |
+
2 Illusioner av trost som drar mig ner
|
| 741 |
+
|
| 742 |
+
3
|
| 743 |
+
|
| 744 |
+
4 Hur deën sargar oss sa sca vi halla hand
|
| 745 |
+
|
| 746 |
+
5 Halva jväla varlden ar i brand
|
| 747 |
+
|
| 748 |
+
6 O hur dom an sänker oss sä ska vi skrika högst
|
| 749 |
+
|
| 750 |
+
7ettnejäralltidettnej
|
| 751 |
+
|
| 752 |
+
8
|
| 753 |
+
|
| 754 |
+
9 Vart vi ān qār ser vi ner
|
| 755 |
+
|
| 756 |
+
20 aldrig merigen, aldrig mer
|
| 757 |
+
|
| 758 |
+
21 hela tiden fär vi säga till.
|
| 759 |
+
|
| 760 |
+
22 ljusen runtomkring stared bar still
|
| 761 |
+
|
| 762 |
+
23
|
| 763 |
+
|
| 764 |
+
24Hur de an sargar oss sa ske vi halla hand
|
| 765 |
+
|
| 766 |
+
25 Halva jväla varlden ar i brand
|
| 767 |
+
|
| 768 |
+
26 O hur dom an sänker oss säka vi skrika högst.
|
| 769 |
+
|
| 770 |
+
27ettnejäralltidettnej
|
| 771 |
+
|
| 772 |
+
28
|
| 773 |
+
|
| 774 |
+
29 En vacker stråle som försvannes
|
| 775 |
+
|
| 776 |
+
50innan det blev morkt
|
| 777 |
+
|
| 778 |
+
$ll innan det blev kallt
|
| 779 |
+
|
| 780 |
+
32
|
| 781 |
+
|
| 782 |
+
33 Och om det var dina skrik som inte hördes.
|
| 783 |
+
44 ell er var din dotter som fordes ivag
|
| 784 |
+
35 hur skulle det kännas, hur skulle däää.
|
| 785 |
+
36
|
| 786 |
+
37Hur de an sarqar oss sa ske vi halla hand.
|
| 787 |
+
8 Halva jväla varlden ar i brand
|
| 788 |
+
39 O hur dom an sänker oss sä ska vi skrika högst.
|
| 789 |
+
40ettnejäralltidettnej
|
| 790 |
+
41
|
| 791 |
+
22 ##Albumspar
|
| 792 |
+
|
| 793 |
+
https://fjordsaga.com/no/turer/2-i-kjolvannet-av-bilfergen-vaage-norvik
|
| 794 |
+
|
| 795 |
+
# Trafilatura
|
| 796 |
+
|
| 797 |
+
1 Turinformasjon
|
| 798 |
+
2 Tur fra Vagstranda til Norvika i Eidsbygda Rauma i kjølvannet av bilfergen Vaage-Norvik som gikk der fra 1930 til 1945.
|
| 799 |
+
3 Vei til Åndalsnes ble til stor del bygget fertig av okkupasjonsmakten under andre verdenskrig og veien Åpnet rundt tidspunktet for freden i 1945.
|
| 800 |
+
4 Denne fergen ble bygget av samme bátbygger som baten vi gár turene med og det blir fortalt historie rundt dette smt hendelsene rundt den tragiske ulykken i oktober 1942 hvor Kultur og Propagandaminister i Quisling regjeringen Gulbrand Lunde m/frue omkom ved fergekeni pa Vaage.
|
| 801 |
+
5 Turprisen er oppgitt pr passasjer basert pa max antall. Ta Kontakt for alternative og evt allergier.
|
| 802 |
+
6 Eventuelt servering ombord!
|
| 803 |
+
7 1. Rik tomat/chili basert kremet fiskesuppe servert m/nybakt brd, dessert (Tilslorte bondepiker) og kokekaffe. Kr. 350.-
|
| 804 |
+
8 Lunsjpakke fra Braud Handverksbakeri Vestnes:
|
| 805 |
+
9 2. Pasmurt bagett med ost & skinke + kanelbolle alt, solskinsbolte, Kr. 110.-
|
| 806 |
+
10 3. Pasmurt bagett med kylling & karri + kanelbolle alt. solskinnsbolle. Kr. 120.-11 4. Pastasalat med kylling og karri. Kr. 175.-
|
| 807 |
+
12 Mineralvann og annihil dijkse kjopt separat om bord.
|
| 808 |
+
13 5 Timer
|
| 809 |
+
14 -
|
| 810 |
+
15 Maks.Passasjerer:12
|
| 811 |
+
16
|
| 812 |
+
17 Vestnes
|
| 813 |
+
18
|
| 814 |
+
|
| 815 |
+
# Model extractor (ours)
|
| 816 |
+
|
| 817 |
+
1 # I kjølvannet av Bilfergen Vaage-Norvik
|
| 818 |
+
2 3 100 NOK pr passasjer
|
| 819 |
+
4 5 ## Turinformasjon
|
| 820 |
+
7 Tur fra Vågstrandà til Norvika i Eidsbygda Rauma i kjølvannet av bilfergen Vaage-Norvik som gikk der fra 1930 til 1945.
|
| 821 |
+
8
|
| 822 |
+
9 Vei til Åndalsnes ble til stor del bygget fertig av okkupasjonsmaken under andere verdenskrig og veien Åpnet rundt tidspunktet for freden i 1945. Denne fergen ble bygget av samme bátbygger som baten vi gär turene med og det blir fortalt historie rundt dette samt hendelsene rundt den tragiske ulyken i oktober 1942 hvor Kultur og Propagandaminister i Quisling regjeringen Gulbrand Lunde m/frue omkom ved fergekaien pa Vaage.
|
| 823 |
+
|
| 824 |
+
10
|
| 825 |
+
|
| 826 |
+
11 Turprisen er oppgitt pr passasjer basert pa max antall. Ta Kontakt for alternative og evt allergier.
|
| 827 |
+
12
|
| 828 |
+
13 \*\*Eventuelt servering ombord\!\*\*
|
| 829 |
+
15 1\. Rik tomat/chili basert kremet fiskesuppeservert m/nybakt brd, dessert (Tilslorthebondepiker) og kokekaffe. Kr. 350.-
|
| 830 |
+
16
|
| 831 |
+
17 Lunsjpakke fra Braud Händverksbakeri Vestnes:
|
| 832 |
+
18 2\.Pasmurt bagett med ost相关政策
|
| 833 |
+
kanelbolle alt. solskinnsbolle. Kr. 110-
|
| 834 |
+
19 3\. Pasmurt bagett med kylling & karri + kanelbolle alt. solskinnsbolle. Kr. 120.-20 4\. Pastasalat med kylling og karri. Kr. 175.-
|
| 835 |
+
22 Mineralvann og annihilere kjopt separat om bord.
|
| 836 |
+
|
| 837 |
+
23
|
| 838 |
+
|
| 839 |
+
24 -\*\*5 Timer
|
| 840 |
+
25 - $\star \star$ Maks.Passasjerer:12
|
| 841 |
+
26 -Avgang:Vestnes
|
| 842 |
+
27 - Tursprak:Engelsk, Norsk
|
2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c26b6d96158c408f74779b89874563e8f0f0f6c40ed8ac8c9234bd4b91e2fbfa
|
| 3 |
+
size 895137
|
2025/SWEb_ A Large Web Dataset for the Scandinavian Languages/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/ae1395e2-616a-4b04-b79f-464511d99a59_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/ae1395e2-616a-4b04-b79f-464511d99a59_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/ae1395e2-616a-4b04-b79f-464511d99a59_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:db2bd2f4ca18c34c481f8a313cc60f77d10069477dfacdd222108e936a149303
|
| 3 |
+
size 2767579
|
2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/full.md
ADDED
|
@@ -0,0 +1,484 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+

|
| 2 |
+
|
| 3 |
+
# SWIFT: ON-THE-FLY SELF-SPECULATIVE DECODFOR LLM INFERENCE ACCELERATION
|
| 4 |
+
|
| 5 |
+
Heming Xia $^{1}$ , Yongqi Li $^{1*}$ , Jun Zhang $^{2}$ , Cunxiao Du $^{3}$ , Wenjie Li $^{1}$
|
| 6 |
+
|
| 7 |
+
<sup>1</sup>Department of Computing, The Hong Kong Polytechnic University
|
| 8 |
+
|
| 9 |
+
$^{2}$ College of Computer Science and Technology, Zhejiang University $^{3}$ Sea AI Lab
|
| 10 |
+
|
| 11 |
+
{he-ming.xia}@connect.polyu.hk; {zj.cs}@zju.edu.cn
|
| 12 |
+
|
| 13 |
+
# ABSTRACT
|
| 14 |
+
|
| 15 |
+
Speculative decoding (SD) has emerged as a widely used paradigm to accelerate LLM inference without compromising quality. It works by first employing a compact model to draft multiple tokens efficiently and then using the target LLM to verify them in parallel. While this technique has achieved notable speedups, most existing approaches necessitate either additional parameters or extensive training to construct effective draft models, thereby restricting their applicability across different LLMs and tasks. To address this limitation, we explore a novel plug-and-play SD solution with layer-skipping, which skips intermediate layers of the target LLM as the compact draft model. Our analysis reveals that LLMs exhibit great potential for self-acceleration through layer sparsity and the task-specific nature of this sparsity. Building on these insights, we introduce SWIFT, an on-the-fly self-speculative decoding algorithm that adaptively selects intermediate layers of LLMs to skip during inference. SWIFT does not require auxiliary models or additional training, making it a plug-and-play solution for accelerating LLM inference across diverse input data streams. Our extensive experiments across a wide range of models and downstream tasks demonstrate that SWIFT can achieve over a $1.3 \times 1.6 \times$ speedup while preserving the original distribution of the generated text. We release our code in https://github.com/hemingkx/SWIFT.
|
| 16 |
+
|
| 17 |
+
# 1 INTRODUCTION
|
| 18 |
+
|
| 19 |
+
Large Language Models (LLMs) have exhibited outstanding capabilities in handling various downstream tasks (OpenAI, 2023; Touvron et al., 2023a;b; Dubey et al., 2024). However, their token-by-token generation necessitated by autoregressive decoding poses efficiency challenges, particularly as model sizes increase. To address this, speculative decoding (SD) has been proposed as a promising solution for lossless LLM inference acceleration (Xia et al., 2023; Leviathan et al., 2023; Chen et al., 2023). At each decoding step, SD first employs a compact draft model to efficiently predict multiple tokens as speculations for future decoding steps of the target LLM. These tokens are then validated by the target LLM in parallel, ensuring that the original output distribution remains unchanged.
|
| 20 |
+
|
| 21 |
+
Recent advancements in SD have pushed the boundaries of the latency-accuracy trade-off by exploring various strategies (Xia et al., 2024), including incorporating lightweight draft modules into LLMs (Cai et al., 2024; Ankner et al., 2024; Li et al., 2024a;b), employing fine-tuning strategies to facilitate efficient LLM drafting (Kou et al., 2024; Yi et al., 2024; Elhoushi et al., 2024), and aligning draft models with the target LLM (Liu et al., 2023a; Zhou et al., 2024; Miao et al., 2024). Despite their promising efficacy, these approaches require additional modules or extensive training, which limits their broad applicability across different model types and causes significant inconvenience in practice. To tackle this issue, another line of research has proposed the Jacobi-based drafting (Santilli et al., 2023; Fu et al., 2024) to facilitate plug-and-play SD. As illustrated in Figure 1(a), these methods append pseudo tokens to the input prompt, enabling the target LLM to generate multiple tokens as drafts in a single decoding step. However, the Jacobi-decoding paradigm misaligns with the autoregressive pretraining objective of LLMs, resulting in suboptimal acceleration effects.
|
| 22 |
+
|
| 23 |
+
In this work, we introduce a novel research direction for plug-and-play SD: sparsity-based drafting, which leverages the inherent sparsity in LLMs to enable efficient drafting (see Figure 1(b)). Specifically, we exploit a straightforward yet practical form of LLM sparsity - layer sparsity - to accelerate inference. Our approach is based on two key observations: 1) LLMs possess great potential for self-acceleration through layer sparsity. Contrary to the conventional belief that layer selection must be carefully optimized (Zhang et al., 2024), we surprisingly found that uniformly skipping layers to draft can still achieve a notable $1.2 \times$ speedup, providing a strong foundation for plug-and-play SD. 2) Layer sparsity is task-specific. We observed that each task requires its own optimal set of skipped layers, and applying the same layer configuration across different tasks would cause substantial performance degradation. For example, the speedup drops from $1.47 \times$ to $1.01 \times$ when transferring the configuration optimized for a storytelling task to a reasoning task.
|
| 24 |
+
|
| 25 |
+

|
| 26 |
+
(a) Jacobi-based Drafting
|
| 27 |
+
|
| 28 |
+

|
| 29 |
+
(b) Sparsity-based Drafting
|
| 30 |
+
Figure 1: Illustration of prior solution and ours for plug-and-play SD. (a) Jacobi-based drafting appends multiple pseudo tokens to the input prompt, enabling the target LLM to generate multiple tokens as drafts in a single step. (b) SWIFT adopts sparsity-based drafting, which exploits the inherent sparsity in LLMs to facilitate efficient drafting. This work is the first exploration of plug-and-play SD using sparsity-based drafting.
|
| 31 |
+
|
| 32 |
+
Building on these observations, we introduce SWIFT, the first on-the-fly self-speculative decoding algorithm that adaptively optimizes the set of skipped layers in the target LLM during inference, facilitating the lossless acceleration of LLMs across diverse input data streams. SWIFT integrates two key innovations: (1) a context-based layer set optimization mechanism that leverages LLM-generated context to efficiently identify the optimal set of skipped layers corresponding to the current input stream, and (2) a confidence-aware inference acceleration strategy that maximizes the use of draft tokens, improving both speculation accuracy and verification efficiency. These innovations allow SWIFT to strike an expected balance between the latency-accuracy trade-off in SD, providing a new plug-and-play solution for lossless LLM inference acceleration without the need for auxiliary models or additional training, as demonstrated in Table 1.
|
| 33 |
+
|
| 34 |
+
We conduct experiments using LLaMA-2 and CodeLLaMA models across multiple tasks, including summarization, code generation, mathematical reasoning, etc. SWIFT achieves a $1.3 \times 1.6 \times$ wall-clock time speedup compared to conventional autoregressive decoding. Notably, in the greedy setting, SWIFT consistently maintains a $98\% \sim 100\%$ token acceptance rate across the LLaMA2 series, indicating the high alignment potential of this paradigm. Further analysis validated the effectiveness of SWIFT across diverse data streams and its compatibility with various LLM backbones.
|
| 35 |
+
|
| 36 |
+
Our key contributions are:
|
| 37 |
+
|
| 38 |
+
(i) We performed an empirical analysis of LLM acceleration on layer sparsity, revealing both the potential for LLM self-acceleration via layer sparsity and its task-specific nature, underscoring the necessity for adaptive self-speculative decoding during inference.
|
| 39 |
+
(ii) Building on these insights, we introduce SWIFT, the first plug-and-play self-speculative decoding algorithm that optimizes the set of skipped layers in the target LLM on the fly, enabling lossless acceleration of LLM inference across diverse input data streams.
|
| 40 |
+
(iii) We conducted extensive experiments across various models and tasks, demonstrating that SWIFT consistently achieves a $1.3 \times 1.6 \times$ speedup without any auxiliary model or training, while theoretically guaranteeing the preservation of the generated text's distribution.
|
| 41 |
+
|
| 42 |
+
# 2 RELATED WORK
|
| 43 |
+
|
| 44 |
+
Speculative Decoding (SD) Due to the sequential nature of autoregressive decoding, LLM inference is constrained by memory-bound computations (Patterson, 2004; Shazeer, 2019), with the primary latency bottleneck arising not from arithmetic computations but from memory reads/writes of LLM parameters (Pope et al., 2023). To mitigate this issue, speculative decoding (SD) introduces
|
| 45 |
+
|
| 46 |
+
<table><tr><td rowspan="2">Methods</td><td colspan="3">Drafting</td><td colspan="3">Verification</td><td rowspan="2">Speedup</td></tr><tr><td>Approach</td><td>AM</td><td>Plug&Play</td><td>Greedy</td><td>Sampling</td><td>Token Tree</td></tr><tr><td>EAGLE (Li et al., 2024a;b)</td><td>Draft Heads</td><td>Yes</td><td>×</td><td>✓</td><td>✓</td><td>✓</td><td>-</td></tr><tr><td>REST (He et al., 2024)</td><td>Context Retrieval</td><td>Yes</td><td>×</td><td>✓</td><td>✓</td><td>✓</td><td>-</td></tr><tr><td>SELF-SD (Zhang et al., 2024)</td><td>Layer Skipping</td><td>No</td><td>×</td><td>✓</td><td>✓</td><td>×</td><td>-</td></tr><tr><td>PARALLEL (Santilli et al., 2023)</td><td>Jacobi Decoding</td><td>No</td><td>✓</td><td>✓</td><td>×</td><td>×</td><td>0.9×~1.0×</td></tr><tr><td>LOOKAHEAD (Fu et al., 2024)</td><td>Jacobi Decoding</td><td>No</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>1.2×~1.4×</td></tr><tr><td>SWIFT (Ours)</td><td>Layer Skipping</td><td>No</td><td>✓</td><td>✓</td><td>✓</td><td>✓</td><td>1.3×~1.6×</td></tr></table>
|
| 47 |
+
|
| 48 |
+
Table 1: Comparison of SwIFT with existing SD methods. "AM" denotes whether the method requires auxiliary modules such as additional parameters or data stores. "Greedy", "Sampling", and "Token Tree" denote whether the method supports greedy decoding, multinomial sampling, and token tree verification, respectively. SwIFT is the first plug-and-play layer-skipping SD method, which is orthogonal to those Jacobi-based methods such as Lookahead (Fu et al., 2024).
|
| 49 |
+
|
| 50 |
+
utilizing a compact draft model to predict multiple decoding steps, with the target LLM then validating them in parallel (Xia et al., 2023; Leviathan et al., 2023; Chen et al., 2023). Recent SD variants have sought to enhance efficiency by incorporating additional modules (Kim et al., 2023; Sun et al., 2023; Du et al., 2024; Li et al., 2024a;b) or introducing new training objectives (Liu et al., 2023a; Kou et al., 2024; Zhou et al., 2024; Gloeckle et al., 2024). However, these approaches necessitate extra parameters or extensive training, limiting their applicability across different models. Another line of research has explored plug-and-play SD methods with Jacobi decoding (Santilli et al., 2023; Fu et al., 2024), which predict multiple steps in parallel by appending pseudo tokens to the input and refining them iteratively. As shown in Table 1, our work complements these efforts by investigating a novel plug-and-play SD method with layer-skipping, which exploits the inherent sparsity of LLM layers to accelerate inference. The most related approaches to ours include Self-SD (Zhang et al., 2024) and LayerSkip (Elhoushi et al., 2024), which also skip intermediate layers of LLMs to form the draft model. However, both methods require a time-consuming offline training process, making them neither plug-and-play nor easily generalizable across different models and tasks.
|
| 51 |
+
|
| 52 |
+
Efficient LLMs Utilizing Sparsity LLMs are powerful but often over-parameterized (Hu et al., 2022). To address this issue, various methods have been proposed to accelerate inference by leveraging different forms of LLM sparsity. One promising research direction is model compression, which includes approaches such as quantization (Dettmers et al., 2022; Frantar et al., 2023; Ma et al., 2024), parameter pruning (Liu et al., 2019; Hoefler et al., 2021; Liu et al., 2023b), and knowledge distillation (Touvron et al., 2021; Hsieh et al., 2023; Gu et al., 2024). These approaches aim to reduce model sparsity by compressing LLMs into more compact forms, thereby decreasing memory usage and computational overhead during inference. Our proposed method, SWIFT, focuses specifically on sparsity within LLM layer computations, providing a more streamlined approach to efficient LLM inference that builds upon recent advances in layer skipping (Corro et al., 2023; Zhu et al., 2024; Jaiswal et al., 2024; Liu et al., 2024). Unlike these existing layer-skipping methods that may lead to information loss and performance degradation, SWIFT investigates the utilization of layer sparsity to enable lossless acceleration of LLM inference.
|
| 53 |
+
|
| 54 |
+
# 3 PRELIMINARIES
|
| 55 |
+
|
| 56 |
+
# 3.1 SELF-SPECULATIVE DECODING
|
| 57 |
+
|
| 58 |
+
Unlike most SD methods that require additional parameters, self-speculative decoding (Self-SD) first proposed utilizing parts of an LLM as a compact draft model (Zhang et al., 2024). In each decoding step, this approach skips intermediate layers of the LLM to efficiently generate draft tokens; these tokens are then validated in parallel by the full-parameter LLM to ensure that the output distribution of the target LLM remains unchanged. The primary challenge of Self-SD lies in determining which layers, and how many, should be skipped – referred to as the skipped layer set – during the drafting stage, which is formulated as an optimization problem. Formally, given the input data $\mathcal{X}$ and the target LLM $\mathcal{M}_T$ with $L$ layers (including both attention and MLP layers), Self-SD aims to identify the optimal skipped layer set $z$ that minimizes the average inference time per token:
|
| 59 |
+
|
| 60 |
+
$$
|
| 61 |
+
\boldsymbol {z} ^ {*} = \underset {\boldsymbol {z}} {\arg \min } \frac {\sum_ {\boldsymbol {x} \in \mathcal {X}} f (\boldsymbol {x} \mid \boldsymbol {z} ; \boldsymbol {\theta} _ {\mathcal {M} _ {T}})}{\sum_ {\boldsymbol {x} \in \mathcal {X}} | \boldsymbol {x} |}, \quad \text {s . t .} \boldsymbol {z} \in \{0, 1 \} ^ {L}, \tag {1}
|
| 62 |
+
$$
|
| 63 |
+
|
| 64 |
+
where $f(\cdot)$ is a black-box function that returns the inference latency of sample $x$ , $z_i \in \{0,1\}$ denotes whether layer $i$ of the target LLM is skipped when drafting, and $|x|$ represents the sample length. Self-SD addresses this problem through a Bayesian optimization process (Jones et al., 1998). Before inference, this process iteratively selects new inputs $z$ based on a Gaussian process (Rasmussen & Williams, 2006) and evaluates Eq (1) on the training set of $\mathcal{X}$ . After a specified number of iterations, the best $z$ is considered an approximation of $z^*$ and is held fixed for inference.
|
| 65 |
+
|
| 66 |
+
While Self-SD has proven effective, its reliance on a time-intensive Bayesian optimization process poses certain limitations. For each task, Self-SD must sequentially evaluate all selected training samples during every iteration to optimize Eq (1); Moreover, the computational burden of Bayesian optimization escalates substantially with the number of iterations. As a result, processing just eight CNN/Daily Mail (Nallapati et al., 2016) samples for 1000 Bayesian iterations requires nearly 7.5 hours for LLaMA-2-13B and 20 hours for LLaMA-2-70B on an NVIDIA A6000 server. These computational demands restrict the generalizability of Self-SD across different models and tasks.
|
| 67 |
+
|
| 68 |
+
# 3.2 EXPERIMENTAL OBSERVATIONS
|
| 69 |
+
|
| 70 |
+
This subsection delves into Self-SD, exploring the plug-and-play potential of this layer-skipping SD paradigm for lossless LLM inference acceleration. Our key findings are detailed below.
|
| 71 |
+
|
| 72 |
+

|
| 73 |
+
Figure 2: (a) LLMs possess self-acceleration potential via layer sparsity. By utilizing drafts from the top- $k$ candidates, we found that uniformly skipping half of the layers during drafting yields a notable $1.2 \times$ speedup. (b) Layer sparsity is task-specific. Each task requires its own optimal set of skipped layers, and applying the skipped layer configuration from one task to another can lead to substantial performance degradation. "XLS" represents the skipped layer set optimized for task $X$ .
|
| 74 |
+
|
| 75 |
+

|
| 76 |
+
|
| 77 |
+
# 3.2.1 LLMS POSSESS SELF-ACCELERATION POTENTIAL VIA LAYER SPARSITY
|
| 78 |
+
|
| 79 |
+
We begin by investigating the potential of behavior alignment between the target LLM and its layer-skipping variant. Unlike previous work (Zhang et al., 2024) that focused solely on greedy draft predictions, we leverage potential draft candidates from top- $k$ predictions, as detailed in Section 4.2. We conducted experiments using LLaMA-2-13B across the CNN/Daily Mail (Nallapati et al., 2016), GSM8K (Cobbe et al., 2021), and TinyStories (Eldan & Li, 2023) datasets. We applied a uniform layer-skipping pattern with $k$ set to 10. The experimental results, illustrated in Figure 2(a), demonstrate a $30\%$ average improvement in the token acceptance rate by leveraging top- $k$ predictions, with over $90\%$ of draft tokens accepted by the target LLM. Consequently, compared to Self-SD, which achieved a maximum speedup of $1.01 \times$ in this experimental setting, we revealed that the layer-skipping SD paradigm could yield an average wall-clock speedup of $1.22 \times$ over conventional autoregressive decoding with a uniform layer-skipping pattern. This finding challenges the prevailing belief that the selection of skipped layers must be meticulously curated, suggesting instead that LLMs possess greater potential for self-acceleration through inherent layer sparsity.
|
| 80 |
+
|
| 81 |
+
# 3.2.2 LAYER SPARSITY IS TASK-SPECIFIC
|
| 82 |
+
|
| 83 |
+
We further explore the following research question: Is the skipped layer set optimized for one specific task applicable to other tasks? To address this, we conducted domain shift experiments using LLaMA-2-13B on the CNN/Daily Mail, GSM8K, TinyStories, and WMT16 DE-EN datasets. The experimental results, depicted in Figure 2(b), reveal two critical findings: 1) Each task requires its own optimal skipped layer set. As illustrated in Figure 2(b), the highest speedup performance is
|
| 84 |
+
|
| 85 |
+
consistently achieved by the skipped layer configuration specifically optimized for each task. The detailed configuration of these layers is presented in Appendix A, demonstrating that the optimal configurations differ across tasks. 2) Applying the static skipped layer configuration across different tasks can lead to substantial efficiency degradation. For example, the speedup decreases from $1.47 \times$ to $1.01 \times$ when the optimized skipped layer set from a storytelling task is applied to a mathematical reasoning task, indicating that the optimized skipped layer set for one specific task does not generalize effectively to others.
|
| 86 |
+
|
| 87 |
+
These findings lay the groundwork for our plug-and-play solution within layer-skipping SD. Section 3.2.1 provides a strong foundation for real-time skipped layer selection, suggesting that additional optimization using training data may be unnecessary; Section 3.2.2 highlights the limitations of static layer-skipping patterns for dynamic input data streams across various tasks, underscoring the necessity for adaptive layer optimization during inference. Building on these insights, we present our on-the-fly self-speculative decoding method for efficient and adaptive layer set optimization.
|
| 88 |
+
|
| 89 |
+
# 4 SWIFT: ON-THE-FLY SELF-SPECULATIVE DECODING
|
| 90 |
+
|
| 91 |
+
We introduce SWIFT, the first plug-and-play self-speculative decoding approach that optimizes the skipped layer set of the target LLM on the fly, facilitating lossless LLM acceleration across diverse input data streams. As shown in Figure 3, SWIFT divides LLM inference into two distinct phases: (1) context-based layer set optimization (§4.1), which aims to identify the optimal skipped layer set given the input stream, and (2) confidence-aware inference acceleration (§4.2), which employs the determined configuration to accelerate LLM inference.
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
Figure 3: Timeline of SwIFT inference. $N$ denotes the maximum generation length per instance.
|
| 95 |
+
|
| 96 |
+
# 4.1 CONTEXT-BASED LAYER SET OPTIMIZATION
|
| 97 |
+
|
| 98 |
+
Layer set optimization is a critical challenge in self-speculative decoding, as it determines which layers of the target LLM should be skipped to form the draft model (see Section 3.1). Unlike prior methods that rely on time-intensive offline optimization, our work emphasizes on-the-fly layer set optimization, which poses a greater challenge to the latency-accuracy trade-off: the optimization must be efficient enough to avoid delays during inference while ensuring accurate drafting of subsequent decoding steps. To address this, we propose an adaptive optimization mechanism that balances efficiency with drafting accuracy. Our method minimizes overhead by performing only a single forward pass of the draft model per step to validate potential skipped layer set candidates. The core innovation is the use of LLM-generated tokens (i.e., prior context) as ground truth, allowing for simultaneous validation of the draft model's accuracy in predicting future decoding steps.
|
| 99 |
+
|
| 100 |
+
In the following subsections, we illustrate the detailed process of this optimization phase for each input instance, which includes context accumulation (§4.1.1) and layer set optimization (§4.1.2).
|
| 101 |
+
|
| 102 |
+
# 4.1.1 CONTEXTACCUMULATION
|
| 103 |
+
|
| 104 |
+
Given an input instance in the optimization phase, the draft model is initialized by uniformly skipping layers in the target LLM. This initial layer-skipping pattern is maintained to accelerate inference until a specified number of LLM-generated tokens, referred to as the context window, has been accumulated. Upon reaching this window length, the inference transitions to layer set optimization.
|
| 105 |
+
|
| 106 |
+
# 4.1.2 LAYER SET OPTIMIZATION
|
| 107 |
+
|
| 108 |
+
During this stage, as illustrated in Figure 4, we integrate an optimization step before each LLM decoding step to refine the skipped layer set, which comprises two substeps:
|
| 109 |
+
|
| 110 |
+

|
| 111 |
+
Figure 4: Layer set optimization process in SWIFT. During the optimization stage, SWIFT performs an optimization step prior to each LLM decoding step to adjust the skipped layer set, which involves: (a) Efficient layer set optimization. SWIFT integrates random search with interval Bayesian optimization to propose layer set candidates; (b) Parallel candidate evaluation. SWIFT uses LLM-generated tokens (i.e., prior context) as ground truth, enabling simultaneous validation of the proposed candidates. The best-performing layer set is selected to accelerate the current decoding step.
|
| 112 |
+
|
| 113 |
+
Efficient Layer Set Suggestion This substep aims to suggest a potential layer set candidate. Formally, given a target LLM $\mathcal{M}_T$ with $L$ layers, our goal is to identify an optimal skipped layer set $\boldsymbol{z} \in \{0,1\}^L$ to form the compact draft model. Unlike Zhang et al. (2024), which relies entirely on a time-consuming Bayesian optimization process, we introduce an efficient strategy that combines random search with Bayesian optimization. In this approach, random sampling efficiently handles most of the exploration. Specifically, given a fixed skipping ratio $r$ , SWIFT applies Bayesian optimization at regular intervals of $\beta$ optimization steps ( $e.g., \beta = 25$ ) to suggest the next layer set candidate, while random search is employed during other optimization steps.
|
| 114 |
+
|
| 115 |
+
$$
|
| 116 |
+
z = \left\{ \begin{array}{l l} \text {Bayesian_Optimization} (l) & \text {if } o \% \beta = 0 \\ \text {Random_Search} (l) & \text {otherwise} \end{array} , \right. \tag{2}
|
| 117 |
+
$$
|
| 118 |
+
|
| 119 |
+
where $1 \leq o \leq S$ is the current optimization step; $S$ denotes the maximum number of optimization steps; $\boldsymbol{l} = \binom{L}{rL}$ denotes the input space, i.e., all possible combinations of layers that can be skipped.
|
| 120 |
+
|
| 121 |
+
Parallel Candidate Evaluation SWIFT leverages LLM-generated context to simultaneously validate the candidate draft model's performance in predicting future decoding steps. Formally, given an input sequence $\pmb{x}$ and the previously generated tokens within the context window, denoted as $\pmb{y} = \{y_1, \dots, y_\gamma\}$ , the draft model $\mathcal{M}_D$ , which skips the designated layers $\pmb{z}$ of the target LLM, is employed to predict these context tokens in parallel:
|
| 122 |
+
|
| 123 |
+
$$
|
| 124 |
+
y _ {i} ^ {\prime} = \arg \max _ {y} \log P (y \mid \boldsymbol {x}, \boldsymbol {y} _ {< i}; \boldsymbol {\theta} _ {\mathcal {M} _ {D}}), 1 \leq i \leq \gamma , \tag {3}
|
| 125 |
+
$$
|
| 126 |
+
|
| 127 |
+
where $\gamma$ represents the context window. The cached key-value pairs in the target LLM $\mathcal{M}_T$ are reused by $\mathcal{M}_D$ , presumably aligning $\mathcal{M}_D$ 's distribution with $\mathcal{M}_T$ and reducing the redundant computation. The matchness score is defined as the exact match ratio between $\pmb{y}$ and $\pmb{y}'$ :
|
| 128 |
+
|
| 129 |
+
$$
|
| 130 |
+
\text {m a t c h n e s s} = \frac {\sum_ {i} \mathbb {I} \left(y _ {i} = y _ {i} ^ {\prime}\right)}{\gamma}, 1 \leq i \leq \gamma , \tag {4}
|
| 131 |
+
$$
|
| 132 |
+
|
| 133 |
+
where $\mathbb{I}(\cdot)$ denotes the indicator function. This score serves as the optimization objective during optimization, reflecting $\mathcal{M}_D$ 's accuracy in predicting future decoding steps. As shown in Figure 4, the matchness score at each step is integrated into the Gaussian process model to guide Bayesian optimization, with the highest-scoring layer set candidate being retained to form the draft model.
|
| 134 |
+
|
| 135 |
+
As illustrated in Figure 3, the process of context accumulation and layer set optimization alternates for each instance until a termination condition is met – either the maximum number of optimization steps is reached or the best candidate remains unchanged over multiple iterations. Once the optimization phase concludes, the inference process transitions to the confidence-aware inference acceleration phase, where the optimized draft model is employed to speed up LLM inference.
|
| 136 |
+
|
| 137 |
+
# 4.2 CONFIDENCE-AWARE INFERENCE ACCELERATION
|
| 138 |
+
|
| 139 |
+
During the acceleration phase, the optimization step is removed. SWIFT applies the best-performed layer set to form the compact draft model and decodes following the draft-then-verify paradigm. Specifically, at each decoding step, given the input $\pmb{x}$ and previous LLM outputs $\pmb{y}$ , the draft model $\mathcal{M}_D$ predicts future LLM decoding steps in an autoregressive manner:
|
| 140 |
+
|
| 141 |
+
$$
|
| 142 |
+
y _ {j} ^ {\prime} = \arg \max _ {y} \log P (y \mid \boldsymbol {x}, \boldsymbol {y}, \boldsymbol {y} _ {< j} ^ {\prime}; \boldsymbol {\theta} _ {\mathcal {M} _ {D}}), \tag {5}
|
| 143 |
+
$$
|
| 144 |
+
|
| 145 |
+
where $1 \leq j \leq N_{D}$ is the current draft step, $N_{D}$ denotes the maximum draft length, $\pmb{y}_{<j}^{\prime}$ represents previous draft tokens, and $P(\cdot)$ denotes the probability distribution of the next draft token. The KV cache of the target LLM $\mathcal{M}_T$ and preceding draft tokens $\pmb{y}_{<j}^{\prime}$ is reused to reduce the computational cost.
|
| 146 |
+
|
| 147 |
+

|
| 148 |
+
(a) Early-stopping Drafting
|
| 149 |
+
(b) Dynamic Verification
|
| 150 |
+
Figure 5: Confidence-aware inference process of SwIFT. (a) The drafting terminates early if the confidence score drops below threshold $\epsilon$ . (b) Draft candidates are dynamically selected based on confidence and then verified in parallel by the target LLM.
|
| 151 |
+
|
| 152 |
+
Let $p_j = \max P(\cdot)$ denote the probability of the top-1 draft prediction $y_j'$ , which can be regarded as a confidence score. Recent research (Li et al., 2024b; Du et al., 2024) shows that this score is highly correlated with the likelihood that the draft token $y_j'$ will pass verification – higher confidence scores indicate a greater chance of acceptance. Therefore, following previous studies (Zhang et al., 2024; Du et al., 2024), we leverage the confidence score to prune unnecessary draft steps and select valuable draft candidates, improving both speculation accuracy and verification efficiency.
|
| 153 |
+
|
| 154 |
+
As shown in Figure 5, we integrate SWIFT with two confidence-aware inference strategies<sup>1</sup>: 1) Early-stopping Drafting. The autoregressive drafting process halts if the confidence $p_j$ falls below a specified threshold $\epsilon$ , avoiding any waste of subsequent drafting computation. 2) Dynamic Verification. Each $y_j'$ is dynamically extended with its top- $k$ draft predictions for parallel verification to enhance speculation accuracy, with $k$ determined by the confidence score $p_j$ . Concretely, $k$ is set to 10, 5, 3, and 1 for $p$ in the ranges of (0, 0.5], (0.5, 0.8], (0.8, 0.95], and (0.95, 1], respectively. All draft candidates are linearized into a single sequence and verified in parallel by the target LLM using a special causal attention mask (see Figure 5 (b)).
|
| 155 |
+
|
| 156 |
+
# 5 EXPERIMENTS
|
| 157 |
+
|
| 158 |
+
# 5.1 EXPERIMENTAL SETUP
|
| 159 |
+
|
| 160 |
+
Implementation Details We mainly evaluate SWIFT on LLaMA-2 (Touvron et al., 2023b) and CodeLLaMA series (Rozière et al., 2023) across various tasks, including summarization, mathematical reasoning, storytelling, and code generation. The evaluation datasets include CNN/Daily Mail (CNN/DM) (Nallapati et al., 2016), GSM8K (Cobbe et al., 2021), TinyStories (Eldan & Li, 2023), and HumanEval (Chen et al., 2021). The maximum generation lengths on CNN/DM, GSM8K, and TinyStories are set to 64, 64, and 128, respectively. We conduct 1-shot evaluation for CNN/DM and TinyStories, and 5-shot evaluation for GSM8K. We compare pass@1 and pass@10 for HumanEval. We randomly sample 1000 instances from the test set for each dataset except HumanEval. The maximum generation lengths for HumanEval and all analyses are set to 512. During optimization, we employ both random search and Bayesian optimization $^{2}$ to suggest skipped layer set candidates. Following prior work, we adopt speculative sampling (Leviathan et al., 2023) as our acceptance strategy with a batch size of 1. Detailed setups are provided in Appendix B.1 and B.2.
|
| 161 |
+
|
| 162 |
+
Baselines In our main experiments, we compare SWIFT to two existing plug-and-play methods: Parallel Decoding (Santilli et al., 2023) and Lookahead Decoding (Fu et al., 2024), both of which employ Jacobi decoding for efficient LLM drafting. It is important to note that SWIFT, as a layer-skipping SD method, is orthogonal to these Jacobi-based SD methods, and integrating SWIFT with them could further boost inference efficiency. We exclude other SD methods from our comparison as they necessitate additional modules or extensive training, which limits their generalizability.
|
| 163 |
+
|
| 164 |
+
<table><tr><td rowspan="2">Models</td><td rowspan="2">Methods</td><td colspan="2">CNN/DM</td><td colspan="2">GSM8K</td><td colspan="2">TinyStories</td><td rowspan="2">Speed (tokens/s)</td><td rowspan="2">Overall Speedup</td></tr><tr><td>M</td><td>Speedup</td><td>M</td><td>Speedup</td><td>M</td><td>Speedup</td></tr><tr><td rowspan="4">LLaMA-2-13B</td><td>VANILLA</td><td>1.00</td><td>1.00×</td><td>1.00</td><td>1.00×</td><td>1.00</td><td>1.00×</td><td>20.10</td><td>1.00×</td></tr><tr><td>PARALLEL</td><td>1.04</td><td>0.95×</td><td>1.11</td><td>0.99×</td><td>1.06</td><td>0.97×</td><td>19.49</td><td>0.97×</td></tr><tr><td>LOOKAHEAD</td><td>1.38</td><td>1.16×</td><td>1.50</td><td>1.29×</td><td>1.62</td><td>1.37×</td><td>25.46</td><td>1.27×</td></tr><tr><td>SWIFT</td><td>4.34</td><td>1.37׆</td><td>3.13</td><td>1.31׆</td><td>8.21</td><td>1.53׆</td><td>28.26</td><td>1.41×</td></tr><tr><td rowspan="4">LLaMA-2-13B -Chat</td><td>VANILLA</td><td>1.00</td><td>1.00×</td><td>1.00</td><td>1.00×</td><td>1.00</td><td>1.00×</td><td>19.96</td><td>1.00×</td></tr><tr><td>PARALLEL</td><td>1.06</td><td>0.96×</td><td>1.08</td><td>0.97×</td><td>1.10</td><td>0.98×</td><td>19.26</td><td>0.97×</td></tr><tr><td>LOOKAHEAD</td><td>1.35</td><td>1.15×</td><td>1.57</td><td>1.31×</td><td>1.66</td><td>1.40×</td><td>25.69</td><td>1.29×</td></tr><tr><td>SWIFT</td><td>3.54</td><td>1.28×</td><td>2.95</td><td>1.25×</td><td>7.42</td><td>1.50׆</td><td>26.80</td><td>1.34×</td></tr><tr><td rowspan="4">LLaMA-2-70B</td><td>VANILLA</td><td>1.00</td><td>1.00×</td><td>1.00</td><td>1.00×</td><td>1.00</td><td>1.00×</td><td>4.32</td><td>1.00×</td></tr><tr><td>PARALLEL</td><td>1.05</td><td>0.95×</td><td>1.07</td><td>0.97×</td><td>1.05</td><td>0.96×</td><td>4.14</td><td>0.96×</td></tr><tr><td>LOOKAHEAD</td><td>1.36</td><td>1.15×</td><td>1.54</td><td>1.30×</td><td>1.59</td><td>1.35×</td><td>5.45</td><td>1.26×</td></tr><tr><td>SWIFT</td><td>3.85</td><td>1.43׆</td><td>2.99</td><td>1.39׆</td><td>6.17</td><td>1.62׆</td><td>6.41</td><td>1.48×</td></tr></table>
|
| 165 |
+
|
| 166 |
+
Table 2: Comparison between SWIFT and prior plug-and-play methods. We report the mean generated length $M$ , speedup ratio, and average decoding speed (tokens/s) under greedy decoding.† indicates results with a token acceptance rate $\alpha$ above 0.98. More details are provided in Appendix C.1.
|
| 167 |
+
|
| 168 |
+
<table><tr><td rowspan="2">Datasets</td><td rowspan="2">Methods</td><td colspan="4">CodeLLaMA-13B</td><td colspan="4">CodeLLaMA-34B</td></tr><tr><td>M</td><td>α</td><td>Acc.</td><td>Speedup</td><td>M</td><td>α</td><td>Acc.</td><td>Speedup</td></tr><tr><td rowspan="2">HumanEval (pass@1)</td><td>VANILLA</td><td>1.00</td><td>-</td><td>0.311</td><td>1.00×</td><td>1.00</td><td>-</td><td>0.372</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>4.75</td><td>0.98</td><td>0.311</td><td>1.40×</td><td>3.79</td><td>0.88</td><td>0.372</td><td>1.46×</td></tr><tr><td rowspan="2">HumanEval (pass@10)</td><td>VANILLA</td><td>1.00</td><td>-</td><td>0.628</td><td>1.00×</td><td>1.00</td><td>-</td><td>0.677</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>3.55</td><td>0.93</td><td>0.628</td><td>1.29×</td><td>2.79</td><td>0.90</td><td>0.683</td><td>1.30×</td></tr></table>
|
| 169 |
+
|
| 170 |
+
Table 3: Experimental results of SWIFT on code generation tasks. We report the mean generated length $M$ , acceptance rate $\alpha$ , accuracy (Acc.), and speedup ratio for comparison. We use greedy decoding for pass@1 and random sampling with a temperature of 0.6 for pass@10.
|
| 171 |
+
|
| 172 |
+
Evaluation Metrics We report two widely-used metrics for SwIFT evaluation: mean generated length $M$ (Stern et al., 2018) and token acceptance rate $\alpha$ (Leviathan et al., 2023). Detailed descriptions of these metrics can be found in Appendix B.3. In addition to these metrics, we report the actual decoding speed (tokens/s) and wall-time speedup ratio compared with vanilla autoregressive decoding. The acceleration of SwIFT theoretically guarantees the preservation of the target LLMs' output distribution, making it unnecessary to evaluate the generation quality. However, to provide a point of reference, we present the evaluation scores for code generation tasks.
|
| 173 |
+
|
| 174 |
+
# 5.2 MAIN RESULTS
|
| 175 |
+
|
| 176 |
+
Table 2 presents the comparison between SWIFT and previous plug-and-play methods on text generation tasks. The experimental results demonstrate the following findings: (1) SWIFT shows superior efficiency over prior methods, achieving consistent speedups of $1.3 \times \sim 1.6 \times$ over vanilla autoregressive decoding across various models and tasks. (2) The efficiency of SWIFT is driven by the high behavior consistency between the target LLM and its layer-skipping draft variant. As shown in Table 2, SWIFT produces a mean generated length $M$ of 5.01, with a high token acceptance rate $\alpha$ ranging from $90\%$ to $100\%$ . Notably, for the LLaMA-2 series, this acceptance rate remains stable at $98\% \sim 100\%$ , indicating that nearly all draft tokens are accepted by the target LLM. (3) Compared with 13B models, LLaMA-2-70B achieves higher speedups with a larger layer skip ratio $(0.45 \rightarrow 0.5)$ , suggesting that larger-scale LLMs exhibit greater layer sparsity. This underscores SWIFT's potential to deliver even greater speedups as LLM scales continue to grow. A detailed analysis of this finding is presented in Section 5.3, while additional experimental results for LLaMA-70B models, including LLaMA-3-70B, are presented in Appendix C.2.
|
| 177 |
+
|
| 178 |
+
Table 3 shows the evaluation results of SWIFT on code generation tasks. SWIFT achieves speedups of $1.3 \times \sim 1.5 \times$ over vanilla autoregressive decoding, demonstrating its effectiveness across both greedy decoding and random sampling settings. Additionally, speculative sampling theoretically guarantees that SWIFT maintains the original output distribution of the target LLM. This is empirically validated
|
| 179 |
+
|
| 180 |
+
by the task performance metrics in Table 3. Despite a slight variation in the pass@10 metric for CodeLLaMA-34B, SwIFT achieves identical performance to autoregressive decoding.
|
| 181 |
+
|
| 182 |
+
# 5.3 IN-DEPTH ANALYSIS
|
| 183 |
+
|
| 184 |
+

|
| 185 |
+
Figure 6: Illustration and latency breakdown of SWIFT inference. As the left figure shows, after the context-based layer set optimization phase, the overall speedup of SWIFT steadily increases, reaching the average instance speedup during the acceleration phase. The additional optimization steps account for only $0.8\%$ of the total inference latency, as illustrated in the right figure.
|
| 186 |
+
|
| 187 |
+
<table><tr><td>Modules</td><td>Latency (ms)</td><td>Ratio (%)</td></tr><tr><td>Optimize</td><td>0.24 ± 0.02</td><td>0.8</td></tr><tr><td>Draft</td><td>19.93 ± 1.36</td><td>64.4</td></tr><tr><td>Verify</td><td>8.80 ± 2.21</td><td>28.4</td></tr><tr><td>Others</td><td>1.98 ± 0.13</td><td>6.4</td></tr><tr><td>Total</td><td>30.95 ± 2.84</td><td>100.0</td></tr></table>
|
| 188 |
+
|
| 189 |
+
Illustration of Inference As described in Section 4, SWIFT divides the LLM inference process into two distinct phases: optimization and acceleration. Figure 6 (left) illustrates the detailed acceleration effect of SWIFT during LLM inference. Specifically, the optimization phase begins at the start of inference, where an optimization step is performed before each decoding step to adjust the skipped layer set forming the draft model. As shown in Figure 6, in this phase, the matchness score of the draft model rises sharply from 0.45 to 0.73 during the inference of the first instance. This score then gradually increases to 0.98, which triggers the termination of the optimization process. Subsequently, the inference transitions to the acceleration phase, during which the optimization step is removed, and the draft model remains fixed to accelerate LLM inference. As illustrated, the instance speedup increases with the matchness score, reaching an average of $1.53 \times$ in the acceleration phase. The overall speedup gradually rises as more tokens are generated, eventually approaching the average instance speedup. This dynamic reflects a key feature of SWIFT: the efficiency of SWIFT improves with increasing input length and the number of instances.
|
| 190 |
+
|
| 191 |
+
Breakdown of Computation Figure 6 (right) presents the computation breakdown of different modules in SWIFT with 1000 CNN/DM samples using LLaMA-2-13B. The results demonstrate that the optimization step only takes $0.8\%$ of the overall inference process, indicating the efficiency of our strategy. Compared with Self-SD (Zhang et al., 2024) that requires a time-consuming optimization process (e.g., 7.5 hours for LLaMA-2-13B on CNN/DM), SWIFT achieves a nearly $180\times$ optimization time reduction, facilitating on-the-fly inference acceleration. Besides, the results show that the drafting stage of SWIFT consumes the majority of inference latency. This is consistent with our results of mean generated length in Table 2 and 3, which shows that nearly $80\%$ output tokens are generated by the efficient draft model, demonstrating the effectiveness of our SWIFT framework.
|
| 192 |
+
|
| 193 |
+

|
| 194 |
+
Figure 7: Comparison between SWIFT and Self-SD in handling dynamic data input streams. Unlike Self-SD, which suffers from efficiency reduction during distribution shift, SWIFT maintains stable acceleration performance with an acceptance rate exceeding 0.9.
|
| 195 |
+
|
| 196 |
+
Dynamic Input Data Streams We further validate the effectiveness of SWIFT in handling dynamic input data streams. We selected CNN/DM, GSM8K, Alpaca (Taori et al., 2023), WMT14 DE-EN, and Nature Questions (Kwiatkowski et al., 2019) for the evaluation on summarization, reasoning, instruction following, translation, and question answering tasks, respectively. For each task, we randomly sample 500 instances from the test set and concatenate them task-by-task to form the input stream. The experimental results are presented in Figure 7. As demonstrated, Self-SD is sensitive to domain shifts, with the average token acceptance rate dropping from $92\%$ to $68\%$ . Consequently, it suffers from severe speedup reduction from $1.33\times$ to an average of $1.05\times$ under domain shifts. In contrast, SWIFT exhibits promising adaptation capability to different domains with an average token acceptance rate of $96\%$ , leading to a consistent $1.3\times \sim 1.6\times$ speedup.
|
| 197 |
+
|
| 198 |
+

|
| 199 |
+
Figure 8: In-depth analysis of SWIFT, which includes: (a) Flexible optimization strategy. The maximum optimization iteration $S$ and Bayesian interval $\beta$ can be flexibly adjusted to accommodate different input data types. (b) Scaling law. The speedup and optimal layer skip ratio of SWIFT increase with larger model sizes, indicating that larger LLMs exhibit greater layer sparsity.
|
| 200 |
+
|
| 201 |
+

|
| 202 |
+
|
| 203 |
+
Flexible Optimization & Scaling Law Figure 8(a) presents the flexibility of SWIFT in handling various input types by adjusting the maximum optimization step $S$ and Bayesian interval $\beta$ . For input with fewer instances, reducing $S$ enables an earlier transition to the acceleration phase while increasing $\beta$ reduces the overhead during the optimization phase, enhancing speedups during the initial stages of inference. In cases with sufficient input data, SWIFT enables exploring more optimization paths, thereby enhancing the overall speedup. Figure 8(b) illustrates the scaling law of SWIFT: as the model size increases, both the optimal layer-skip ratio and overall speedup improve, indicating that larger LLMs exhibit more layer sparsity. This finding highlights the potential of SWIFT for accelerating LLMs of larger sizes (e.g., 175B), which we leave for future investigation.
|
| 204 |
+
|
| 205 |
+
Other LLM Backbones Beyond LLaMA, we assess the effectiveness of SWIFT on additional LLM backbones. Specifically, we include Yi-34B (Young et al., 2024) and DeepSeek-Coder-33B (Guo et al., 2024) along with their instruction-tuned variants for text and code generation tasks, respectively. The speedup results of SWIFT are illustrated in Figure 9, demonstrating that SWIFT achieves efficiency improvements ranging from $26\%$ to $54\%$ on these LLM backbones. Further experimental details are provided in Appendix C.3.
|
| 206 |
+
|
| 207 |
+

|
| 208 |
+
Figure 9: Speedups of SWIFT on LLM backbones and their instruction-tuned variants.
|
| 209 |
+
|
| 210 |
+
# 6 CONCLUSION
|
| 211 |
+
|
| 212 |
+
In this work, we introduce SWIFT, an on-the-fly self-speculative decoding algorithm that adaptively selects certain intermediate layers of LLMs to skip during inference. The proposed method does not require additional training or auxiliary models, making it a plug-and-play solution for accelerating LLM inference across diverse input data streams. Extensive experiments conducted across various LLMs and tasks demonstrate that SWIFT achieves over a $1.3 \times 1.6 \times$ speedup while preserving the distribution of the generated text. Furthermore, our in-depth analysis highlights the effectiveness of SWIFT in handling dynamic input data streams and its seamless integration with various LLM backbones, showcasing the great potential of this paradigm for practical LLM inference acceleration.
|
| 213 |
+
|
| 214 |
+
# ETHICS STATEMENT
|
| 215 |
+
|
| 216 |
+
The datasets used in our experiments are publicly released and labeled through interaction with humans in English. In this process, user privacy is protected, and no personal information is contained in the dataset. The scientific artifacts that we used are available for research with permissive licenses. The use of these artifacts in this paper is consistent with their intended purpose.
|
| 217 |
+
|
| 218 |
+
# ACKNOWLEDGEMENTS
|
| 219 |
+
|
| 220 |
+
We thank all anonymous reviewers for their valuable comments during the review process. The work described in this paper was supported by Research Grants Council of Hong Kong (PolyU/15207122, PolyU/15209724, PolyU/15207821, PolyU/15213323) and PolyU internal grants (BDWP).
|
| 221 |
+
|
| 222 |
+
# REPRODUCIBILITY STATEMENT
|
| 223 |
+
|
| 224 |
+
All the results in this work are reproducible. We provide all the necessary code in the Supplementary Material to replicate our results. The repository includes environment configurations, scripts, and other relevant materials. We discuss the experimental settings in Section 5.1 and Appendix C, including implementation details such as models, datasets, inference setup, and evaluation metrics.
|
| 225 |
+
|
| 226 |
+
# REFERENCES
|
| 227 |
+
|
| 228 |
+
Zachary Ankner, Rishab Parthasarathy, Aniruddha Nrusimha, Christopher Rinard, Jonathan Ragan-Kelley, and William Brandon. Hydra: Sequentially-dependent draft heads for medusa decoding. CoRR, abs/2402.05109, 2024. doi: 10.48550/ARXIV.2402.05109. URL https://doi.org/10.48550/arXiv.2402.05109.
|
| 229 |
+
Sangmin Bae, Jongwoo Ko, Hwanjun Song, and Se-Young Yun. Fast and robust early-exiting framework for autoregressive language models with synchronized parallel decoding. In Houda Bouamor, Juan Pino, and Kalika Bali (eds.), Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing, pp. 5910-5924, Singapore, December 2023. Association for Computational Linguistics. doi: 10.18653/v1/2023.emnlp-main.362. URL https://aclanthology.org/2023.emnlp-main.362.
|
| 230 |
+
Tianle Cai, Yuhong Li, Zhengyang Geng, Hongwu Peng, Jason D. Lee, Deming Chen, and Tri Dao. Medusa: Simple LLM inference acceleration framework with multiple decoding heads. In *Forty-first International Conference on Machine Learning*, ICML 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=PEpbUobfJv.
|
| 231 |
+
Charlie Chen, Sebastian Borgeaud, Geoffrey Irving, Jean-Baptiste Lespiau, Laurent Sifre, and John Jumper. Accelerating large language model decoding with speculative sampling. CoRR, abs/2302.01318, 2023. doi: 10.48550/arXiv.2302.01318. URL https://doi.org/10.48550/arXiv.2302.01318.
|
| 232 |
+
Mark Chen, Jerry Tworek, Heewoo Jun, Qiming Yuan, Henrique Pondé de Oliveira Pinto, Jared Kaplan, Harrison Edwards, et al. Evaluating large language models trained on code. CoRR, abs/2107.03374, 2021. URL https://arxiv.org/abs/2107.03374.
|
| 233 |
+
Karl Cobbe, Vineet Kosaraju, Mohammad Bavarian, Mark Chen, Heewoo Jun, Lukasz Kaiser, Matthias Plappert, Jerry Tworek, Jacob Hilton, Reiichiro Nakano, Christopher Hesse, and John Schulman. Training verifiers to solve math word problems. CoRR, abs/2110.14168, 2021. URL https://arxiv.org/abs/2110.14168.
|
| 234 |
+
Luciano Del Corro, Allie Del Giorno, Sahaj Agarwal, Bin Yu, Ahmed Awadallah, and Subhabrata Mukherjee. Skipdecode: Autoregressive skip decoding with batching and caching for efficient LLM inference. CoRR, abs/2307.02628, 2023. doi: 10.48550/ARXIV.2307.02628. URL https://doi.org/10.48550/arXiv.2307.02628.
|
| 235 |
+
|
| 236 |
+
Tim Dettmers, Mike Lewis, Younes Belkada, and Luke Zettlemoyer. Gpt3.int8(): 8-bit matrix multiplication for transformers at scale. In Sanmi Koyejo, S. Mohamed, A. Agarwal, Danielle Belgrave, K. Cho, and A. Oh (eds.), Advances in Neural Information Processing Systems 35: Annual Conference on Neural Information Processing Systems 2022, NeurIPS 2022, New Orleans, LA, USA, November 28 - December 9, 2022, 2022. URL http://papers.nips.cc/paper_files/paper/2022/bit Processing Systems 2022.
|
| 237 |
+
Cunxiao Du, Jing Jiang, Yuanchen Xu, Jiawei Wu, Sicheng Yu, Yongqi Li, Shenggui Li, Kai Xu, Liqiang Nie, Zhaopeng Tu, and Yang You. Glide with a cape: A low-hassle method to accelerate speculative decoding. In *Forty-first International Conference on Machine Learning*, ICML 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=mk8oRhox21.
|
| 238 |
+
Abhimanyu Dubey, Abhinav Jauhri, Abhinav Pandey, Abhishek Kadian, Ahmad Al-Dahle, et al. The llama 3 herd of models, 2024. URL https://arxiv.org/abs/2407.21783.
|
| 239 |
+
Ronen Eldan and Yuanzhi Li. Tinystories: How small can language models be and still speak coherent english? CoRR, abs/2305.07759, 2023. doi: 10.48550/ARXIV.2305.07759. URL https://doi.org/10.48550/arXiv.2305.07759.
|
| 240 |
+
Mostafa Elhoushi, Akshit Shrivastava, Diana Liskovich, Basil Hosmer, Bram Wasti, Liangzhen Lai, Anas Mahmoud, Bilge Acun, Saurabh Agarwal, Ahmed Roman, Ahmed Aly, Beidi Chen, and Carole-Jean Wu. LayerSkip: Enabling early exit inference and self-speculative decoding. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 12622-12642, Bangkok, Thailand, August 2024. Association for Computational Linguistics. URL https://aclanthology.org/2024.acl-long.681.
|
| 241 |
+
Elias Frantar, Saleh Ashkboos, Torsten Hoefler, and Dan Alistarh. OPTQ: Accurate quantization for generative pre-trained transformers. In The Eleventh International Conference on Learning Representations, 2023. URL https://openreview.net/forum?id= tcbBPnfwxS.
|
| 242 |
+
Yichao Fu, Peter Bailis, Ion Stoica, and Hao Zhang. Break the sequential dependency of LLM inference using lookahead decoding. In *Forty-first International Conference on Machine Learning*, ICML 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=eDjvSFOkXw.
|
| 243 |
+
Fabian Gloeckle, Badr Youbi Idrissi, Baptiste Roziere, David Lopez-Paz, and Gabriel Synnaeve. Better & faster large language models via multi-token prediction. CoRR, abs/2404.19737, 2024. doi: 10.48550/ARXIV.2404.19737. URL https://doi.org/10.48550/arXiv.2404.19737.
|
| 244 |
+
Yuxian Gu, Li Dong, Furu Wei, and Minlie Huang. MiniLLM: Knowledge distillation of large language models. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=5h0qf7IBZZ.
|
| 245 |
+
Daya Guo, Qihao Zhu, Dejian Yang, Zhenda Xie, Kai Dong, Wentao Zhang, Guanting Chen, Xiao Bi, Y. Wu, Y. K. Li, Fuli Luo, Yingfei Xiong, and Wenfeng Liang. Deepseek-coder: When the large language model meets programming - the rise of code intelligence. CoRR, abs/2401.14196, 2024. doi: 10.48550/ARXIV.2401.14196. URL https://doi.org/10.48550/arXiv.2401.14196.
|
| 246 |
+
Zhenyu He, Zexuan Zhong, Tianle Cai, Jason Lee, and Di He. REST: Retrieval-based speculative decoding. In Kevin Duh, Helena Gomez, and Steven Bethard (eds.), Proceedings of the 2024 Conference of the North American Chapter of the Association for Computational Linguistics: Human Language Technologies (Volume 1: Long Papers), pp. 1582-1595, Mexico City, Mexico, June 2024. Association for Computational Linguistics. URL https://aclanthology.org/2024.naacl-long.88.
|
| 247 |
+
Torsten Hoefler, Dan Alistarh, Tal Ben-Nun, Nikoli Dryden, and Alexandra Peste. Sparsity in deep learning: Pruning and growth for efficient inference and training in neural networks. J. Mach. Learn. Res., 22(241):1-124, 2021.
|
| 248 |
+
|
| 249 |
+
Coleman Hooper, Sehoon Kim, Hiva Mohammadzadeh, Hasan Genc, Kurt Keutzer, Amir Gholami, and Yakun Sophia Shao. SPEED: speculative pipelined execution for efficient decoding. CoRR, abs/2310.12072, 2023. doi: 10.48550/ARXIV.2310.12072. URL https://doi.org/10.48550/arXiv.2310.12072.
|
| 250 |
+
Cheng-Yu Hsieh, Chun-Liang Li, Chih-Kuan Yeh, Hootan Nakhost, Yasuhisa Fujii, Alex Ratner, Ranjay Krishna, Chen-Yu Lee, and Tomas Pfister. Distilling step-by-step! outperforming larger language models with less training data and smaller model sizes. In Anna Rogers, Jordan L. Boyd-Graber, and Naoaki Okazaki (eds.), Findings of the Association for Computational Linguistics: ACL 2023, Toronto, Canada, July 9-14, 2023, pp. 8003-8017. Association for Computational Linguistics, 2023. doi: 10.18653/V1/2023.FINDINGS-ACL.507. URL https://doi.org/10.18653/v1/2023-findings-acl.507.
|
| 251 |
+
Edward J. Hu, Yelong Shen, Phillip Wallis, Zeyuan Allen-Zhu, Yanzhi Li, Shean Wang, Lu Wang, and Weizhu Chen. Lora: Low-rank adaptation of large language models. In The Tenth International Conference on Learning Representations, ICLR 2022, Virtual Event, April 25-29, 2022. OpenReview.net, 2022. URL https://openreview.net/forum?id=nZeVKeeFYf9.
|
| 252 |
+
Ajay Jaiswal, Bodun Hu, Lu Yin, Yeonju Ro, Shiwei Liu, Tianlong Chen, and Aditya Akella. Ffnskiplm: A hidden gem for autoregressive decoding with adaptive feed forward skipping. CoRR, abs/2404.03865, 2024. doi: 10.48550/ARXIV.2404.03865. URL https://doi.org/10.48550/arXiv.2404.03865.
|
| 253 |
+
Donald R. Jones, Matthias Schonlau, and William J. Welch. Efficient global optimization of expensive black-box functions. *J. Glob. Optim.*, 13(4):455–492, 1998. doi: 10.1023/A:1008306431147. URL https://doi.org/10.1023/A:1008306431147.
|
| 254 |
+
Sehoon Kim, Karttikeya Mangalam, Suhong Moon, Jitendra Malik, Michael W. Mahoney, Amir Gholami, and Kurt Keutzer. Speculative decoding with big little decoder. In Alice Oh, Tristan Naumann, Amir Globerson, Kate Saenko, Moritz Hardt, and Sergey Levine (eds.), Advances in Neural Information Processing Systems 36: Annual Conference on Neural Information Processing Systems 2023, NeurIPS 2023, New Orleans, LA, USA, December 10 - 16, 2023, 2023. URL http://papers.nips.cc/paper_files/paper/2023/hash/7b97adeafa1c51cf65263459ca9d0d7c-Abstract-Conference.html.
|
| 255 |
+
Taehyeon Kim, Ananda Theertha Suresh, Kishore A Papineni, Michael Riley, Sanjiv Kumar, and Adrian Benton. Accelerating blockwise parallel language models with draft refinement. In The Thirty-eighth Annual Conference on Neural Information Processing Systems, 2024. URL https://openreview.net/forum?id=KT6F5Sw0eg.
|
| 256 |
+
Siqi Kou, Lanxiang Hu, Zhezhi He, Zhijie Deng, and Hao Zhang. Cllms: Consistency large language models. In *Forty-first International Conference on Machine Learning*, ICML 2024, Vienna, Austria, July 21-27, 2024. OpenReview.net, 2024. URL https://openreview.net/forum?id=8uzBOVmh8H.
|
| 257 |
+
Tom Kwiatkowski, Jennimaria Palomaki, Olivia Redfield, Michael Collins, Ankur Parikh, Chris Alberti, Danielle Epstein, Illia Polosukhin, Jacob Devlin, Kenton Lee, Kristina Toutanova, Llion Jones, Matthew Kelcey, Ming-Wei Chang, Andrew M. Dai, Jakob Uszkoreit, Quoc Le, and Slav Petrov. Natural questions: A benchmark for question answering research. Transactions of the Association for Computational Linguistics, 7:452–466, 2019. doi: 10.1162/tacl_a_00276. URL https://aclanthology.org/Q19-1026.
|
| 258 |
+
Yaniv Leviathan, Matan Kalman, and Yossi Matias. Fast inference from transformers via speculative decoding. In Andreas Krause, Emma Brunskill, Kyunghyun Cho, Barbara Engelhardt, Sivan Sabato, and Jonathan Scarlett (eds.), International Conference on Machine Learning, ICML 2023, 23-29 July 2023, Honolulu, Hawaii, USA, volume 202 of Proceedings of Machine Learning Research, pp. 19274-19286. PMLR, 2023. URL https://proceedings.mlr.press/v202/leviathan23a.html.
|
| 259 |
+
Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang. Eagle: Speculative sampling requires rethinking feature uncertainty, 2024a.
|
| 260 |
+
|
| 261 |
+
Yuhui Li, Fangyun Wei, Chao Zhang, and Hongyang Zhang. EAGLE-2: faster inference of language models with dynamic draft trees. CoRR, abs/2406.16858, 2024b. doi: 10.48550/ARXIV.2406.16858. URL https://doi.org/10.48550/arXiv.2406.16858.
|
| 262 |
+
Xiaoxuan Liu, Lanxiang Hu, Peter Bailis, Ion Stoica, Zhijie Deng, Alvin Cheung, and Hao Zhang. Online speculative decoding. CoRR, abs/2310.07177, 2023a. doi: 10.48550/ARXIV.2310.07177. URL https://doi.org/10.48550/arXiv.2310.07177.
|
| 263 |
+
Yijin Liu, Fandong Meng, and Jie Zhou. Accelerating inference in large language models with a unified layer skipping strategy. CoRR, abs/2404.06954, 2024. doi: 10.48550/ARXIV.2404.06954. URL https://doi.org/10.48550/arXiv.2404.06954.
|
| 264 |
+
Zhuang Liu, Mingjie Sun, Tinghui Zhou, Gao Huang, and Trevor Darrell. Rethinking the value of network pruning. In 7th International Conference on Learning Representations, ICLR 2019, New Orleans, LA, USA, May 6-9, 2019. OpenReview.net, 2019. URL https://openreview.net/forum?id=rJlnB3C5Ym.
|
| 265 |
+
Zichang Liu, Jue Wang, Tri Dao, Tianyi Zhou, Binhang Yuan, Zhao Song, Anshumali Shrivastava, Ce Zhang, Yuandong Tian, Christopher Re, et al. Deja vu: Contextual sparsity for efficient llms at inference time. In International Conference on Machine Learning, pp. 22137-22176. PMLR, 2023b.
|
| 266 |
+
Shuming Ma, Hongyu Wang, Lingxiao Ma, Lei Wang, Wenhui Wang, Shaohan Huang, Li Dong, Ruiping Wang, Jilong Xue, and Furu Wei. The era of 1-bit llms: All large language models are in 1.58 bits. CoRR, abs/2402.17764, 2024. doi: 10.48550/ARXIV.2402.17764. URL https://doi.org/10.48550/arXiv.2402.17764.
|
| 267 |
+
Xupeng Miao, Gabriele Oliaro, Zhihao Zhang, Xinhao Cheng, Zeyu Wang, Zhengxin Zhang, Rae Ying Yee Wong, Alan Zhu, Lijie Yang, Xiaoxiang Shi, Chunan Shi, Zhuoming Chen, Daiyaan Arfeen, Reyna Abhyankar, and Zhihao Jia. Specinfer: Accelerating large language model serving with tree-based speculative inference and verification. In Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 3, ASPLOS '24, pp. 932-949, New York, NY, USA, 2024. Association for Computing Machinery. ISBN 9798400703867. doi: 10.1145/3620666.3651335. URL https://doi.org/10.1145/3620666.3651335.
|
| 268 |
+
Ramesh Nallapati, Bowen Zhou, Cicero Nogueira dos Santos, Caglar Gulçehre, and Bing Xiang. Abstractive text summarization using sequence-to-sequence rnns and beyond. In Yoav Goldberg and Stefan Riezler (eds.), Proceedings of the 20th SIGNLL Conference on Computational Natural Language Learning, CoNLL 2016, Berlin, Germany, August 11-12, 2016, pp. 280-290. ACL, 2016. doi: 10.18653/V1/K16-1028. URL https://doi.org/10.18653/v1/k16-1028.
|
| 269 |
+
OpenAI. GPT-4 technical report. CoRR, abs/2303.08774, 2023. doi: 10.48550/ARXIV.2303.08774. URL https://doi.org/10.48550/arXiv.2303.08774.
|
| 270 |
+
David A. Patterson. Latency lags bandwidth. Commun. ACM, 47(10):71-75, 2004. doi: 10.1145/1022594.1022596. URL https://doi.org/10.1145/1022594.1022596.
|
| 271 |
+
Reiner Pope, Sholto Douglas, Aakanksha Chowdhery, Jacob Devlin, James Bradbury, Jonathan Heek, Kefan Xiao, Shivani Agrawal, and Jeff Dean. Efficiently scaling transformer inference. In Dawn Song, Michael Carbin, and Tianqi Chen (eds.), Proceedings of the Sixth Conference on Machine Learning and Systems, MLSys 2023, Miami, FL, USA, June 4-8, 2023. mlsys.org, 2023. URL https://proceedings.mlsys.org/paper_files/paper/2023/ hash/c4be71ab8d24cdfb45e3d06dbfca2780-Abstract-mlsys2023.html.
|
| 272 |
+
Carl Edward Rasmussen and Christopher K. I. Williams. Gaussian processes for machine learning. Adaptive computation and machine learning. MIT Press, 2006. ISBN 026218253X. URL https://www.worldcat.org/oclc/61285753.
|
| 273 |
+
Baptiste Rozière, Jonas Gehring, Fabian Gloeckle, Sten Sootla, Itai Gat, Xiaoqing Ellen Tan, Yossi Adi, Jingyu Liu, Tal Remez, Jérémy Rapin, Artyom Kozhevnikov, Ivan Evtimov, Joanna Bitton, Manish Bhatt, Cristian Canton-Ferrer, Aaron Grattafori, Wenhan Xiong, Alexandre Défossez,
|
| 274 |
+
|
| 275 |
+
Jade Copet, Faisal Azhar, Hugo Touvron, Louis Martin, Nicolas Usunier, Thomas Scialom, and Gabriel Synnaeve. Code llama: Open foundation models for code. CoRR, abs/2308.12950, 2023. doi: 10.48550/ARXIV.2308.12950. URL https://doi.org/10.48550/arXiv.2308.12950.
|
| 276 |
+
Andrea Santilli, Silvio Severino, Emilian Postolache, Valentino Maiorca, Michele Mancusi, Ricardo Marin, and Emanuele Rodola. Accelerating transformer inference for translation via parallel decoding. In Anna Rogers, Jordan L. Boyd-Graber, and Naoaki Okazaki (eds.), Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), ACL 2023, Toronto, Canada, July 9-14, 2023, pp. 12336-12355. Association for Computational Linguistics, 2023. doi: 10.18653/v1/2023.acl-long.689. URL https://doi.org/10.18653/v1/2023.acl-long.689.
|
| 277 |
+
Noam Shazeer. Fast transformer decoding: One write-head is all you need. CoRR, abs/1911.02150, 2019. URL http://arxiv.org/abs/1911.02150.
|
| 278 |
+
Mitchell Stern, Noam Shazeer, and Jakob Uszkoreit. Blockwise parallel decoding for deep autoregressive models. In Samy Bengio, Hanna M. Wallach, Hugo Larochelle, Kristen Grauman, Nicolò Cesa-Bianchi, and Roman Garnett (eds.), Advances in Neural Information Processing Systems 31: Annual Conference on Neural Information Processing Systems 2018, NeurIPS 2018, December 3-8, 2018, Montréal, Canada, pp. 10107-10116, 2018. URL https://proceedings.neurips.cc/paper/2018/bit/c4127b9194fe8562c64dc0f5bf2c93bc-Abstract.html.
|
| 279 |
+
Ziteng Sun, Ananda Theertha Suresh, Jae Hun Ro, Ahmad Beirami, Himanshu Jain, and Felix Yu. Spectr: Fast speculative decoding via optimal transport. In Thirty-seventh Conference on Neural Information Processing Systems, 2023. URL https://openreview.net/forum?id=SDYHLTCC5J.
|
| 280 |
+
Rohan Taori, Ishaan Gulrajani, Tianyi Zhang, Yann Dubois, Xuechen Li, Carlos Guestrin, Percy Liang, and Tatsunori B. Hashimoto. Stanford alpaca: An instruction-following llama model. https://github.com/tatsu-lab/stanford_alpaca, 2023.
|
| 281 |
+
Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In International Conference on Machine Learning, pp. 10347-10357. PMLR, 2021.
|
| 282 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Roziere, Naman Goyal, Eric Hambro, Faisal Azhar, Aurélien Rodriguez, Armand Joulin, Edouard Grave, and Guillaume Lample. Llama: Open and efficient foundation language models. CoRR, abs/2302.13971, 2023a. doi: 10.48550/arXiv.2302.13971. URL https://doi.org/10.48550/arXiv.2302.13971.
|
| 283 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, et al.
|
| 284 |
+
Llama 2: Open foundation and fine-tuned chat models. CoRR, abs/2307.09288, 2023b. doi: 10.48550/ARXIV.2307.09288. URL https://doi.org/10.48550/arXiv.2307.09288.
|
| 285 |
+
Heming Xia, Tao Ge, Peiyi Wang, Si-Qing Chen, Furu Wei, and Zhifang Sui. Speculative decoding: Exploiting speculative execution for accelerating seq2seq generation. In Houda Bouamor, Juan Pino, and Kalika Bali (eds.), Findings of the Association for Computational Linguistics: EMNLP 2023, Singapore, December 6-10, 2023, pp. 3909-3925. Association for Computational Linguistics, 2023. doi: 10.18653/V1/2023.FINDINGS-EMNLP.257. URL https://doi.org/10.18653/v1/2023-findings-emnlp.257.
|
| 286 |
+
Heming Xia, Zhe Yang, Qingxiu Dong, Peiyi Wang, Yongqi Li, Tao Ge, Tianyu Liu, Wenjie Li, and Zhifang Sui. Unlocking efficiency in large language model inference: A comprehensive survey of speculative decoding. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Findings of the Association for Computational Linguistics ACL 2024, pp. 7655-7671, Bangkok, Thailand and virtual meeting, August 2024. Association for Computational Linguistics. URL https://aclanthology.org/2024-findings-acl.456.
|
| 287 |
+
|
| 288 |
+
Seongjun Yang, Gibbeum Lee, Jaewoong Cho, Dimitris S. Papailiopoulos, and Kangwook Lee. Predictive pipelined decoding: A compute-latency trade-off for exact LLM decoding. CoRR, abs/2307.05908, 2023. doi: 10.48550/ARXIV.2307.05908. URL https://doi.org/10.48550/arXiv.2307.05908.
|
| 289 |
+
Hanling Yi, Feng Lin, Hongbin Li, Ning Peiyang, Xiaotian Yu, and Rong Xiao. Generation meets verification: Accelerating large language model inference with smart parallel auto-correct decoding. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Findings of the Association for Computational Linguistics ACL 2024, pp. 5285-5299, Bangkok, Thailand and virtual meeting, August 2024. Association for Computational Linguistics. URL https://aclanthology.org/2024-findings-acl.313.
|
| 290 |
+
Alex Young, Bei Chen, Chao Li, Chengen Huang, Ge Zhang, Guanwei Zhang, Heng Li, Jiangcheng Zhu, Jianqun Chen, Jing Chang, Kaidong Yu, Peng Liu, Qiang Liu, Shawn Yue, Senbin Yang, Shiming Yang, Tao Yu, Wen Xie, Wenhao Huang, Xiaohui Hu, Xiaoyi Ren, Xinyao Niu, Pengcheng Nie, Yuchi Xu, Yudong Liu, Yue Wang, Yuxuan Cai, Zhenyu Gu, Zhiyuan Liu, and Zonghong Dai. Yi: Open foundation models by 01.ai. CoRR, abs/2403.04652, 2024. doi: 10.48550/ARXIV.2403.04652. URL https://doi.org/10.48550/arXiv.2403.04652.
|
| 291 |
+
Jun Zhang, Jue Wang, Huan Li, Lidan Shou, Ke Chen, Gang Chen, and Sharad Mehrotra. Draft& verify: Lossless large language model acceleration via self-speculative decoding. In Lun-Wei Ku, Andre Martins, and Vivek Srikumar (eds.), Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers), pp. 11263-11282, Bangkok, Thailand, August 2024. Association for Computational Linguistics. URL https://aclanthology.org/2024.acl-long.607.
|
| 292 |
+
Yongchao Zhou, Kaifeng Lyu, Ankit Singh Rawat, Aditya Krishna Menon, Afshin Rostamizadeh, Sanjiv Kumar, Jean-François Kagy, and Rishabh Agarwal. Distillspec: Improving speculative decoding via knowledge distillation. In The Twelfth International Conference on Learning Representations, 2024. URL https://openreview.net/forum?id=rsY6J3ZaTF.
|
| 293 |
+
Yunqi Zhu, Xuebing Yang, Yuanyuan Wu, and Wensheng Zhang. Hierarchical skip decoding for efficient autoregressive text generation. CoRR, abs/2403.14919, 2024. doi: 10.48550/ARXIV.2403.14919. URL https://doi.org/10.48550/arXiv.2403.14919.
|
| 294 |
+
|
| 295 |
+
# APPENDIX
|
| 296 |
+
|
| 297 |
+
# A PRELIMINARY DETAILS
|
| 298 |
+
|
| 299 |
+
We present the detailed configuration of Self-SD across four task domains in Figure 10, demonstrating that the optimal skipped layer configurations vary depending on the specific task.
|
| 300 |
+
|
| 301 |
+

|
| 302 |
+
(a) Summarization - CNN/DM
|
| 303 |
+
|
| 304 |
+

|
| 305 |
+
(b) Reasoning - GSM8K
|
| 306 |
+
|
| 307 |
+

|
| 308 |
+
(c) Storytelling - TinyStories
|
| 309 |
+
|
| 310 |
+

|
| 311 |
+
(d) Translation - WMT16
|
| 312 |
+
Figure 10: Visualization of skipped layer set configurations of LLaMA-2-13B optimized by SelfSD (Zhang et al., 2024) on different task domains. Gray squares indicate retained layers, red squares denote skipped attention layers, and blue squares signify skipped MLP layers.
|
| 313 |
+
|
| 314 |
+
# B EXPERIMENTAL SETUPS
|
| 315 |
+
|
| 316 |
+
# B.1 MODELS AND DATASETS
|
| 317 |
+
|
| 318 |
+
Our experiments mainly evaluate the effectiveness of SWIFT on LLaMA-2 (Touvron et al., 2023b) and CodeLLaMA series (Rozière et al., 2023). We provide empirical validation on a diverse range of generation tasks. For summarization, mathematical reasoning, storytelling, and code generation tasks, we chose the CNN/Daily Mail (CNN/DM) (Nallapati et al., 2016), GSM8K (Cobbe et al., 2021), TinyStories (Eldan & Li, 2023), and HumanEval (Chen et al., 2021) datasets, respectively. We perform 1-shot evaluation for CNN/DM and TinyStories, and 5-shot evaluation for GSM8K. The maximum generation lengths on CNN/DM, GSM8K, and TinyStories are set to 64, 64, and 128, respectively. We compare pass@1 and pass@10 for HumanEval. In our further analysis, we include three more datasets to validate the capability of SWIFT in handling dynamic input data streams. Specifically, we select Alpaca (Taori et al., 2023), WMT14 DE-EN, and Nature Questions (Kwiatkowski et al., 2019) for the instruction following, translation, and question answering tasks, respectively. The maximum generation lengths for HumanEval and all analyses are set to 512. We randomly sample 1000 instances from the test set for each dataset except HumanEval.
|
| 319 |
+
|
| 320 |
+
# B.2 INFERENCE SETUP
|
| 321 |
+
|
| 322 |
+
In the optimization phase, we employ both random search and Bayesian optimization to suggest potential skipped layer set candidates, striking a balance between optimization performance and efficiency. The context window $\gamma$ is set to 32. The maximum draft length $N_{D}$ is set to 25. For random sampling in code generation tasks, we apply a temperature of 0.6 and top- $p = 0.95$ . The maximum number of layer set optimization steps $S$ is set to 1000, with Bayesian optimization performed every $\beta = 25$ steps. The optimization phase is set to be early stopped if the matchness score does not improve after 300 steps or exceeds 0.95. The layer skip ratio $r$ is fixed at 0.45 for the 13B model and 0.5 for the 34B and 70B models. All experiments were conducted using Pytorch 2.1.0 on $4\times$ NVIDIA RTX A6000 GPU (40GB) with CUDA 12.1, and an Intel(R) Xeon(R) Platinum 8370C
|
| 323 |
+
|
| 324 |
+
CPU with 32 cores. Inference for our method and all baselines was performed using the Huggingface transformers package. Following prior work, we adopt speculative sampling (Leviathan et al., 2023) as our acceptance strategy, and the batch size is set to 1.
|
| 325 |
+
|
| 326 |
+
# B.3 EVALUATION METRICS
|
| 327 |
+
|
| 328 |
+
This subsection provides a detailed illustration of our evaluation metrics, which are mean generated length $M$ and token acceptance rate $\alpha$ . Specifically, the mean generated length $M$ refers to the average number of output tokens produced per forward pass of the target LLM; the acceptance rate $\alpha$ is defined as the ratio of accepted tokens to the total number of draft steps. In other words, it represents the expected probability of the target LLM accepting a potential token from a forward pass of the draft model. These two metrics are independent of computational hardware and, therefore considered as more objective metrics. Given the mean generated length $M$ , acceptance rate $\alpha$ , and the layer skip ratio $r$ , the mathematical formula for the expected wall-time speedup during the acceleration phase is derived as follows:
|
| 329 |
+
|
| 330 |
+
$$
|
| 331 |
+
\mathbb {E} (\operatorname {S p d}.) = \frac {M}{(M - 1) \times \frac {c}{\alpha} + 1} = \frac {M \alpha}{(M - 1) c + \alpha}, \quad c = 1 - r, \tag {6}
|
| 332 |
+
$$
|
| 333 |
+
|
| 334 |
+
where $c$ is defined as the cost coefficient in Leviathan et al. (2023). It is calculated as the ratio between the single forward time of the draft model and that of the target LLM. In summary, the ideal speedup will be higher with the larger $M$ and $\alpha$ and smaller $c$ .
|
| 335 |
+
|
| 336 |
+
# C EXPERIMENTAL DETAILS
|
| 337 |
+
|
| 338 |
+
# C.1 DETAILS OF MAIN RESULTS
|
| 339 |
+
|
| 340 |
+
We present the detailed statistics of our main experimental results in Table 4. SWIFT consistently achieves a token acceptance rate $\alpha$ exceeding $90\%$ across all evaluation settings, with the mean generated length $M$ ranging from 2.99 to 8.21. These statistics indicate strong behavior alignment between the target LLM and its layer-skipping draft variant, as discussed in Section 5.2. Additionally, we report the expected speedup $\mathbb{E}(\mathrm{Spd.})$ calculated using Eq (6), indicating that the current implementation of SWIFT has significant potential for further optimization to boost its efficiency.
|
| 341 |
+
|
| 342 |
+
<table><tr><td rowspan="2">Models</td><td rowspan="2">Methods</td><td colspan="3">CNN/DM</td><td colspan="3">GSM8K</td><td colspan="3">TinyStories</td><td rowspan="2">Expected Speedup</td></tr><tr><td>M</td><td>α</td><td>E(Spd.)</td><td>M</td><td>α</td><td>E(Spd.)</td><td>M</td><td>α</td><td>E(Spd.)</td></tr><tr><td rowspan="2">LLaMA-2-13B</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>4.34</td><td>0.99</td><td>1.52×</td><td>3.13</td><td>0.98</td><td>1.43×</td><td>8.21</td><td>1.00</td><td>1.65×</td><td>1.53×</td></tr><tr><td>LLaMA-2-13B</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>-Chat</td><td>SWIFT</td><td>3.54</td><td>0.90</td><td>1.39×</td><td>2.95</td><td>0.92</td><td>1.36×</td><td>7.42</td><td>0.99</td><td>1.62×</td><td>1.46×</td></tr><tr><td rowspan="2">LLaMA-2-70B</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>3.85</td><td>0.99</td><td>1.58×</td><td>2.99</td><td>0.98</td><td>1.48×</td><td>6.17</td><td>0.99</td><td>1.71×</td><td>1.59×</td></tr></table>
|
| 343 |
+
|
| 344 |
+
Table 4: Detailed results of SwIFT on text generation tasks using LLaMA-2 series. We report the mean generated length $M$ , token acceptance rate $\alpha$ , and the expected speedup $\mathbb{E}(\mathrm{Spd.})$ calculated by Eq (6) under the setting of greedy decoding with FP16 precision.
|
| 345 |
+
|
| 346 |
+
# C.2 ADDITIONAL RESULTS ON LLAMA-70B MODELS
|
| 347 |
+
|
| 348 |
+
In addition to the main results presented in Table 2, we provide further experimental evaluations of SWIFT on LLaMA-70B models, including LLaMA-2-70B and LLaMA-3-70B, along with their instruction-tuned variants, under the same experimental settings. The results demonstrate that SWIFT consistently achieves a $1.4 \times \sim 1.5 \times$ wall-clock speedup across both the LLaMA-2 and LLaMA-3 series. Notably, SWIFT achieves a token acceptance rate $\alpha$ exceeding $85\%$ across various evaluation settings, with the mean generated length M ranging from 3.43 to 7.80. Although differences in layer redundancy are observed between models (e.g., skip ratio $r$ for LLaMA-2-70B
|
| 349 |
+
|
| 350 |
+
vs. LLaMA-3-70B $^3$ ), SWIFT demonstrates robust adaptability, maintaining consistent acceleration performance regardless of model version.
|
| 351 |
+
|
| 352 |
+
<table><tr><td rowspan="2">Models</td><td rowspan="2">Methods</td><td colspan="3">CNN/DM</td><td colspan="3">GSM8K</td><td colspan="3">TinyStories</td><td rowspan="2">Overall Speedup</td></tr><tr><td>M</td><td>α</td><td>Speedup</td><td>M</td><td>α</td><td>Speedup</td><td>M</td><td>α</td><td>Speedup</td></tr><tr><td rowspan="2">LLaMA-2-70B</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>3.85</td><td>0.99</td><td>1.43×</td><td>2.99</td><td>0.98</td><td>1.39×</td><td>6.17</td><td>0.99</td><td>1.62×</td><td>1.48×</td></tr><tr><td>LLaMA-2-70B</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>-Chat</td><td>SWIFT</td><td>3.43</td><td>0.85</td><td>1.31×</td><td>3.12</td><td>0.89</td><td>1.32×</td><td>5.45</td><td>0.95</td><td>1.53×</td><td>1.37×</td></tr><tr><td rowspan="2">LLaMA-3-70B</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>5.43</td><td>0.99</td><td>1.41×</td><td>4.11</td><td>0.99</td><td>1.37×</td><td>7.80</td><td>0.99</td><td>1.51×</td><td>1.43×</td></tr><tr><td>LLaMA-3-70B</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>-Instruct</td><td>SWIFT</td><td>3.76</td><td>0.95</td><td>1.33×</td><td>3.92</td><td>0.93</td><td>1.31×</td><td>5.87</td><td>0.97</td><td>1.43×</td><td>1.36×</td></tr></table>
|
| 353 |
+
|
| 354 |
+
# C.3 DETAILED RESULTS OF LLM BACKBONES
|
| 355 |
+
|
| 356 |
+
To further validate the effectiveness of SWIFT, we conducted experiments using additional LLM backbones beyond the LLaMA series. Specifically, we select two recently representative LLMs: Yi-34B for text generation and DeepSeek-Coder-33B for code generation tasks. The experimental results are illustrated in Table 6 and 7, demonstrating the efficacy of SWIFT across these LLM backbones. SWIFT achieves a consistent $1.2 \times \sim 1.3 \times$ wall-clock speedup on the Yi-34B series and a $1.3 \times \sim 1.5 \times$ on the DeepSeek-Coder-33B series. Notably, for the DeepSeek-Coder-33B series, SWIFT attains a mean generate length $M$ ranging from 3.16 to 4.17, alongside a token acceptance rate $\alpha$ exceeding $83\%$ . These findings substantiate the utility of SWIFT as a general-purpose, plug-and-play SD method, offering promising inference acceleration across diverse LLM backbones.
|
| 357 |
+
|
| 358 |
+
Table 5: Experimental results of SWIFT on text generation tasks using the LLaMA-70B series. We report the mean generated length $M$ , token acceptance rate $\alpha$ , and speedup ratio under the setting of greedy decoding. The skip ratio $r$ is set to 0.5 for LLaMA-2 models and 0.4 for LLaMA-3 models.
|
| 359 |
+
|
| 360 |
+
<table><tr><td rowspan="2">Models</td><td rowspan="2">Methods</td><td colspan="3">CNN/DM</td><td colspan="3">GSM8K</td><td colspan="3">TinyStories</td><td rowspan="2">Overall Speedup</td></tr><tr><td>M</td><td>α</td><td>Speedup</td><td>M</td><td>α</td><td>Speedup</td><td>M</td><td>α</td><td>Speedup</td></tr><tr><td rowspan="2">Yi-34B</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>2.74</td><td>0.94</td><td>1.30×</td><td>2.65</td><td>0.97</td><td>1.28×</td><td>3.25</td><td>0.98</td><td>1.34×</td><td>1.31×</td></tr><tr><td rowspan="2">Yi-34B-Chat</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>2.84</td><td>0.91</td><td>1.29×</td><td>2.77</td><td>0.89</td><td>1.27×</td><td>2.52</td><td>0.80</td><td>1.21×</td><td>1.26×</td></tr></table>
|
| 361 |
+
|
| 362 |
+
Table 6: Experimental results of SWIFT on text generation tasks using Yi-34B series. We report the mean generated length $M$ , token acceptance rate $\alpha$ and speedup ratio under the setting of greedy decoding with FP16 precision. The skip ratio $r$ is set to 0.45.
|
| 363 |
+
|
| 364 |
+
# D FURTHER ANALYSIS AND DISCUSSION
|
| 365 |
+
|
| 366 |
+
# D.1 ABLATION STUDY
|
| 367 |
+
|
| 368 |
+
Table 8 presents the ablation study of SWIFT using LLaMA-2-13B on CNN/DM. The experimental results demonstrate that each component of SWIFT contributes to its overall speedup of SWIFT. Specifically, early-stopping drafting effectively reduces the number of ineffective draft steps, improving the token acceptance rate $\alpha$ by $55\%$ . Dynamic verification further enhances efficiency by selecting suitable draft candidates from the top- $k$ predictions based on their confidence scores; removing this component leads to a decrease in both the mean generated length $(M)$ and the overall speedup ratio. Additionally, the optimization phase refines the set of skipped layers, improving
|
| 369 |
+
|
| 370 |
+
speedup by $34\%$ compared to the initial uniform layer-skipping strategy. In summary, these results confirm the effectiveness of each proposed innovation in SWIFT.
|
| 371 |
+
|
| 372 |
+
<table><tr><td rowspan="2">Datasets</td><td rowspan="2">Methods</td><td colspan="3">DS-Coder</td><td colspan="3">DS-Coder-Instruct</td></tr><tr><td>M</td><td>α</td><td>Speedup</td><td>M</td><td>α</td><td>Speedup</td></tr><tr><td rowspan="2">HumanEval (pass@1)</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>4.97</td><td>0.99</td><td>1.54×</td><td>3.80</td><td>0.88</td><td>1.39×</td></tr><tr><td rowspan="2">HumanEval (pass@10)</td><td>VANILLA</td><td>1.00</td><td>-</td><td>1.00×</td><td>1.00</td><td>-</td><td>1.00×</td></tr><tr><td>SWIFT</td><td>3.16</td><td>0.91</td><td>1.36×</td><td>3.74</td><td>0.83</td><td>1.31×</td></tr></table>
|
| 373 |
+
|
| 374 |
+
Table 7: Experimental results of SwIFT on code generation tasks using DeepSeek-Coder-33B series. The skip ratio $r$ is set to 0.5. We use greedy decoding for pass@1 and random sampling with a temperature of 0.6 for pass@10. "DS" denotes the abbreviation of DeepSeek.
|
| 375 |
+
|
| 376 |
+
<table><tr><td>Methods</td><td>M</td><td>α</td><td>Speedup</td></tr><tr><td>Vanilla</td><td>1.0</td><td>-</td><td>1.000×</td></tr><tr><td>SWIFT</td><td>5.82</td><td>0.98</td><td>1.560×</td></tr><tr><td>w/o early-stopping</td><td>11.16</td><td>0.43</td><td>0.896×</td></tr><tr><td>w/o dynamic ver.</td><td>4.39</td><td>0.90</td><td>1.342×</td></tr><tr><td>w/o optimization</td><td>2.15</td><td>0.90</td><td>1.224×</td></tr></table>
|
| 377 |
+
|
| 378 |
+
Table 8: Ablation study of SWIFT. "ver." denotes the abbreviation of verification.
|
| 379 |
+
|
| 380 |
+
<table><tr><td>γ</td><td>M</td><td>α</td><td>Speedup</td><td>Latency</td></tr><tr><td>16</td><td>3.91</td><td>0.95</td><td>1.341×</td><td>0.242ms</td></tr><tr><td>32</td><td>5.82</td><td>0.98</td><td>1.560×</td><td>0.244ms</td></tr><tr><td>64</td><td>5.56</td><td>0.99</td><td>1.552×</td><td>0.312ms</td></tr><tr><td>128</td><td>5.61</td><td>0.98</td><td>1.550×</td><td>0.425ms</td></tr></table>
|
| 381 |
+
|
| 382 |
+
Table 9: Speedups of SWIFT across different context window $\gamma$ . The latency of the optimization step is reported to illustrate the associated overhead.
|
| 383 |
+
|
| 384 |
+
# D.2 CONTEXT WINDOW
|
| 385 |
+
|
| 386 |
+
In Table 9, we show a detailed analysis of context window $\gamma$ , which determines the number of LLM-generated tokens used in the layer set optimization process. A smaller $\gamma$ introduces greater randomness in the matchness score calculation, resulting in suboptimal performance, while a larger $\gamma$ increases the computational overhead of the optimization step. The results indicate that $\gamma = 32$ provides an optimal balance between optimization performance and computational overhead.
|
| 387 |
+
|
| 388 |
+
# D.3 COMPARISONS WITH PRIOR LAYER-SKIPPING METHODS
|
| 389 |
+
|
| 390 |
+
In this subsection, we compare SWIFT with two representative layer-skipping speculative decoding (SD) methods: LayerSkip (Elhoushi et al., 2024) and Self-SD (Zhang et al., 2024). Specifically, LayerSkip (Elhoushi et al., 2024) introduces an innovative approach to self-speculative decoding by implementing early-exit drafting, where the LLM generates drafts using only its earlier layers. However, this method necessitates a time-consuming pretraining or finetuning process, which modifies the original output distribution of the target LLM. Such alterations may compromise the reliability of the generated outputs; Self-SD (Zhang et al., 2024) proposed to construct the compact draft model by skipping intermediate layers, using an extensive Bayesian Optimization process before inference to determine the optimal skipped layers within the target LLM. As illustrated in Section 3.1, while effective, Self-SD suffers from significant optimization latency (nearly 7.5 hours for LLaMA-2-13B and 20 hours for LLaMA-2-70B). This prolonged optimization process limits its practicality and generalizability across diverse models and tasks.
|
| 391 |
+
|
| 392 |
+
Tables 10 and 11 summarize the comparative results in terms of acceleration performance and training/optimization costs, respectively. Below, we detail the advantages of SWIFT over these methods:
|
| 393 |
+
|
| 394 |
+
- Comparison with LayerSkip: LayerSkip achieves an aggressive skip ratio $(r = 0.8)$ , resulting in an average generated length of 2.42 and a token acceptance rate of 0.64. However, its reliance on pretraining or finetuning alters the original distribution of the target LLM, potentially reducing reliability. In contrast, SWIFT preserves the original distribution of the target LLM while delivering a comparable $1.56 \times$ speedup without requiring additional training.
|
| 395 |
+
|
| 396 |
+
<table><tr><td>Methods</td><td>Plug&Play</td><td>Original</td><td>r</td><td>M</td><td>α</td><td>Speedup</td></tr><tr><td>LAYERSKIP</td><td>X</td><td>X</td><td>0.80</td><td>2.42</td><td>0.64</td><td>1.64×</td></tr><tr><td>SELF-SD</td><td>X</td><td>✓</td><td>0.43</td><td>4.02</td><td>0.85</td><td>1.29×</td></tr><tr><td>SELF-SD w/ dynamic ver.</td><td>X</td><td>✓</td><td>0.43</td><td>5.69</td><td>0.98</td><td>1.52×</td></tr><tr><td>SWIFT (Ours)</td><td>✓</td><td>✓</td><td>0.45</td><td>5.82</td><td>0.98</td><td>1.56×</td></tr></table>
|
| 397 |
+
|
| 398 |
+
Table 10: Comparison of SWIFT and prior layer-skipping SD methods. We report the skip ratio $r$ , mean generated length $M$ ,token acceptance $\alpha$ ,and speedup ratio under greedy decoding. The results are obtained with LLaMA-2-13B on CNN/DM. "ver:" denotes the abbreviation of verification.
|
| 399 |
+
|
| 400 |
+
<table><tr><td>Methods</td><td>Training Cost</td><td>Optimization Latency</td></tr><tr><td>LAYERSKIP</td><td>50 × 103training steps with 64 A100 (80GB)</td><td>-</td></tr><tr><td>SELF-SD</td><td>1000 Bayesian Optimization Iterations Before inference</td><td>~7.5 hours</td></tr><tr><td>SWIFT (Ours)</td><td>N/A</td><td>~2 minutes</td></tr></table>
|
| 401 |
+
|
| 402 |
+
Table 11: Comparison of SwIFT and prior layer-skipping SD methods in terms of training cost and optimization latency for LLaMA-2-13B. Training costs are sourced from the original papers, while optimization latency is measured from our re-implementation on an A6000 GPU. SwIFT demonstrates a $\sim 200\times$ reduction in optimization latency compared to previous methods without requiring additional training, establishing it as an efficient plug-and-play SD method.
|
| 403 |
+
|
| 404 |
+
- Comparison with Self-SD: Self-SD relies on a time-intensive Bayesian Optimization process, which incurs substantial latency before inference. SWIFT eliminates this bottleneck through an on-the-fly optimization strategy, achieving an approximately $200 \times$ reduction in optimization latency while maintaining the same $1.56 \times$ speedup. We further augmented Self-SD with our Confidence-aware Inference Acceleration strategy (Self-SD w/ dynamic ver.). Even compared to this augmented version, SWIFT achieves competitive speedups.
|
| 405 |
+
|
| 406 |
+
These findings highlight the efficiency and practicality of SWIFT over previous layer-skipping SD methods. As the first plug-and-play layer-skipping SD approach, we hope that SWIFT could provide valuable insights and inspire further research in this area.
|
| 407 |
+
|
| 408 |
+
# D.4 DETAILED COMPARISONS WITH SELF-SD
|
| 409 |
+
|
| 410 |
+
In this subsection, we provide a detailed comparison of SwIFT and Self-SD (Zhang et al., 2024). Figure 11 presents the speedups of Self-SD across varying optimization latencies, reflecting the increase in Bayesian Optimization iterations. As shown, Self-SD achieves minimal speedup improvement - almost equivalent to unified skipping - with fewer than 50 Bayesian iterations, corresponding to an optimization latency below 1474 seconds. At 100 Bayesian iterations, Self-SD achieves a $1.19 \times$ speedup; however, its optimization latency is nearly 25 times longer than that of SwIFT (2898s vs. 116s).
|
| 411 |
+
|
| 412 |
+

|
| 413 |
+
Figure 11: Comparison of SwIFT and Self-SD in terms of optimization latency and speedup. SwIFT achieves a $1.56 \times$ speedup with an optimization latency of 116 seconds.
|
| 414 |
+
|
| 415 |
+
Table 12 compares SWIFT and Self-SD (first two rows) under similar optimization latencies. The results highlight SWIFT's superiority in both optimization efficiency (116s vs. 155s) and speedup $(1.56\times$ vs. $0.97\times$ ). Even when compared to the augmented version of Self-SD (w/ dynamic verification), SWIFT achieves a substantial $30\%$ relative improvement in speedup. Below, we analyze the factors contributing to this advantage (elaborated in Section 3.1):
|
| 416 |
+
|
| 417 |
+
- Optimization Objective Granularity: Self-SD calculates its optimization objective at a multi-sample level, requiring sequential decoding of all selected training samples (e.g., 8 samples with 32 tokens each) for every iteration to optimize Equation 1. In contrast,
|
| 418 |
+
|
| 419 |
+
<table><tr><td>Methods</td><td>#Random Optimization</td><td>#Bayesian Optimization</td><td>Optimization Latency (s)</td><td>r</td><td>M</td><td>α</td><td>Speedup</td></tr><tr><td>SELF-SD</td><td>-</td><td>5</td><td>155</td><td>0.50</td><td>1.80</td><td>0.57</td><td>0.97×</td></tr><tr><td>SELF-SD w/ dynamic ver.</td><td>-</td><td>5</td><td>155</td><td>0.50</td><td>2.07</td><td>0.86</td><td>1.17×</td></tr><tr><td>SELF-SDc</td><td>-</td><td>30</td><td>199</td><td>0.45</td><td>2.08</td><td>0.70</td><td>1.04×</td></tr><tr><td>SELF-SDc w/ dynamic ver.</td><td>-</td><td>30</td><td>199</td><td>0.45</td><td>2.44</td><td>0.93</td><td>1.22×</td></tr><tr><td>SWIFT (Ours)</td><td>552</td><td>23</td><td>116</td><td>0.45</td><td>5.82</td><td>0.98</td><td>1.56×</td></tr></table>
|
| 420 |
+
|
| 421 |
+
Table 12: Comparison of SwIFT and Self-SD at similar optimization latencies. We report the skip ratio $r$ , mean generated length $M$ , token acceptance rate $\alpha$ , and speedup under greedy decoding. The results are obtained with LLaMA-2-13B on CNN/DM, with "ver." indicating verification.
|
| 422 |
+
|
| 423 |
+
SWIFT adopts a step-level optimization objective, optimizing the layer set dynamically at each decoding step.
|
| 424 |
+
|
| 425 |
+
- Bayesian Optimization Complexity: The computational complexity of Bayesian optimization increases significantly with the number of iterations. SWIFT mitigates this burden by combining random search with interval Bayesian optimization, accelerating convergence of the optimization process while reducing computational overhead.
|
| 426 |
+
|
| 427 |
+
To further examine optimization trade-offs, we reduce Self-SD's sequential optimization requirement to a single sample with 8 tokens, enabling more Bayesian Optimization iterations within a comparable latency. The corresponding results, denoted as $\mathrm{Self - SD}_c$ (rows 3-4), are presented in Table 12. Even with these optimized settings, SWIFT demonstrates substantial superior speedup and efficiency, highlighting the effectiveness of our proposed strategies.
|
| 428 |
+
|
| 429 |
+
# D.5 THE NECESSITY OF PLUG-AND-PLAY SD METHODS
|
| 430 |
+
|
| 431 |
+
There has been a surge of recent interest in Speculative Decoding (SD), leading to the development of numerous promising strategies in the field, which can be broadly categorized into two directions:
|
| 432 |
+
|
| 433 |
+
- Training-required SD. These methods require additional pretraining or fine-tuning to improve speculative accuracy, often involving the integration of extra parameters. For instance, Medusa (Cai et al., 2024) and Eagle (Li et al., 2024a;b) incorporate lightweight draft heads into target LLMs and fine-tune them, achieving $3 \times \sim 4 \times$ speedups.
|
| 434 |
+
- Plug-and-play SD. These approaches offer immediate acceleration of LLM inference without relying on auxiliary models or additional training. Notable examples include Parallel Decoding (Santilli et al., 2023) and Lookahead (Fu et al., 2024), which leverage Jacobi-based drafting, achieving $1.2 \times \sim 1.4 \times$ speedups across various LLMs.
|
| 435 |
+
|
| 436 |
+
While training-required SD methods generally deliver higher speedups, their reliance on additional training and parameters limits both their generalizability and practicality. This has sparked debate within the academic community regarding the value of plug-and-play SD methods. To address these concerns, we present a detailed analysis below to highlight the necessity of plug-and-play SD approaches and underscore the contributions of our proposed SWIFT:
|
| 437 |
+
|
| 438 |
+
1) Training costs of training-required SD methods are often prohibitive. Training-required methods such as Medusa (Cai et al., 2024) and Eagle (Li et al., 2024a;b), while achieving higher speedups, incur substantial training costs. Despite efforts to reduce training overhead, these methods still require extensive computational resources (e.g., GPU time and datasets) to deliver valid acceleration performance. For example, Eagle requires 1-2 days of training with 8 RTX 3090 GPUs for LLaMA-33B or up to 2 days on 4 A100 (40G) GPUs for LLaMA-2-Chat-70B, using a dataset of 70k dialogues from ShareGPT. Such computational burdens introduce challenges in several scenarios:
|
| 439 |
+
|
| 440 |
+
- Users must train new draft models for unsupported target LLMs. For example, if the user's target LLM is not among the released checkpoints or if the base model is updated (e.g.,
|
| 441 |
+
|
| 442 |
+
LLaMA-3.x), users are forced to train a new draft model, which may exceed their available GPU resources (e.g., GPU time).
|
| 443 |
+
|
| 444 |
+
- Users with small-scale acceleration needs face inefficiencies. For instance, a researcher needing to evaluate a small set of samples (e.g., 10 hours of evaluation) would find the 1–2 day training requirement disproportionate and hinder overall research efficiency.
|
| 445 |
+
|
| 446 |
+
2) Plug-and-play SD fills critical gaps unaddressed by training-required methods. Plug-and-play SD methods, including SWIFT, are model-agnostic and training-free, providing immediate acceleration without requiring additional computational overhead. These attributes are particularly critical for large models (70B-340B) and for use cases requiring rapid integration. The growing adoption of plug-and-play SD methods, such as Lookahead (Fu et al., 2024), further underscores their importance. These methods cater to scenarios where ease of use and computational efficiency are paramount, validating their research significance.
|
| 447 |
+
3) SWIFT pioneers plug-and-play SD with layer-skipping drafting. SWIFT represents the first plug-and-play SD method to incorporate layer-skipping drafting. It consistently achieves $1.3 \times 1.6 \times$ speedups over vanilla autoregressive decoding across diverse models and tasks. Additionally, it demonstrates $10\% \sim 20\%$ higher efficiency compared to Lookahead (Fu et al., 2024). Despite its effectiveness, SWIFT introduces a complementary research direction for existing plug-and-play SD. Its approach is orthogonal to Lookahead Decoding, and combining the two could further amplify their collective efficiency. We believe this study provides valuable insights and paves the way for future SD advancements, particularly for practical and cost-effective LLM acceleration.
|
| 448 |
+
|
| 449 |
+
To sum up, while training-required SD methods achieve higher speedups, their high computational costs and limited flexibility reduce practicality. Plug-and-play SD methods, like SWIFT, offer training-free, model-agnostic acceleration, making them ideal for diverse scenarios. We hope this clarification fosters greater awareness and recognition of the value of plug-and-play SD research.
|
| 450 |
+
|
| 451 |
+
# D.6 ADDITIONAL DISCUSSIONS WITH RELATED WORK
|
| 452 |
+
|
| 453 |
+
In this work, we leverage the inherent layer sparsity of LLMs through layer skipping, which selectively bypasses intermediate layers within the target LLM to construct the compact draft model. In addition to layer skipping, there has been another research direction in SD that focuses on early exiting, where inference halts at earlier layers to improve computational efficiency (Yang et al., 2023; Hooper et al., 2023; Bae et al., 2023; Elhoushi et al., 2024). Particularly, LayerSkip (Elhoushi et al., 2024) explores early-exit drafting by generating drafts using only the earlier layers of the target LLM, followed by verification with the full-parameter model. This approach requires training involving layer dropout and early exit losses. Similarly, PPD (Yang et al., 2023) employs early exiting but trains individual classifiers for each layer instead of relying on a single final-layer classifier. Although effective, these methods rely on extensive fine-tuning to enable early-exiting capabilities, incurring substantial computational costs. Moreover, the training process alters the target LLM's original output distribution, potentially compromising the reliability of generated outputs. In contrast, our proposed SWIFT does not require auxiliary models or additional training, preserving the original output distribution of the target LLM while delivering comparable acceleration benefits.
|
| 454 |
+
|
| 455 |
+
There has been a parallel line of training-required SD research focusing on non-autoregressive drafting strategies (Stern et al., 2018; Cai et al., 2024; Gloeckle et al., 2024; Kim et al., 2024). These methods integrate multiple draft heads into the target LLM, enabling the parallel generation of draft tokens at each decoding step. Notably, Kim et al. (2024) builds on the Blockwise Parallel Decoding paradigm introduced in Stern et al. (2018), accelerating inference by refining block drafts with task-independent n-grams and lightweight rescorers using smaller LMs. While these approaches achieve notable acceleration, they also necessitate extensive training of draft models. SWIFT complements these efforts by pioneering plug-and-play SD that eliminates the need for auxiliary models or additional training, offering a more flexible and practical solution for diverse use cases.
|
| 456 |
+
|
| 457 |
+
# D.7 OPTIMIZATION STEPS
|
| 458 |
+
|
| 459 |
+
We present the detailed configuration of SwIFT across various optimization steps in Figure 10. As the process continues, the skipped layer set is gradually refined toward the optimal configuration.
|
| 460 |
+
|
| 461 |
+

|
| 462 |
+
(a) Optimization Step 0
|
| 463 |
+
|
| 464 |
+

|
| 465 |
+
(b) Optimization Step 64
|
| 466 |
+
|
| 467 |
+

|
| 468 |
+
(c) Optimization Step 128
|
| 469 |
+
|
| 470 |
+

|
| 471 |
+
(d) Optimization Step 512
|
| 472 |
+
Figure 12: Visualization of skipped layer set configurations of LLaMA-2-13B optimized by SWIFT on different optimization steps. Gray squares indicate retained layers, red squares denote skipped attention layers, and blue squares signify skipped MLP layers.
|
| 473 |
+
|
| 474 |
+
# D.8 CASE STUDY
|
| 475 |
+
|
| 476 |
+
We present examples from CNN/DM and Humaneval in Table 13 and 14, respectively, comparing token acceptance between SwIFT and prior plug-and-play approach, Lookahead (Fu et al., 2024). The results demonstrate that SwIFT accepts a higher number of drafts, which are uniformly distributed in the outputs, highlighting the effectiveness of our approach.
|
| 477 |
+
|
| 478 |
+
Table 13: CNN/DM example using LLaMA-2-13B; red tokens indicate accepted drafts.
|
| 479 |
+
|
| 480 |
+
<table><tr><td>User Input</td><td>Article: An Alberta student who’d accidentally left his headlights on all day was greeted by what may have been the world’s friendliest note from a stranger when he returned to his car. But Derek Murray, a University ... Summary:</td></tr><tr><td>LOOKAHEAD</td><td>A Canadian law student was greeted by a friendly note from a stranger when he returned to his car after leaving the headlights on all day .</td></tr><tr><td>SWIFT</td><td>A Canadian law student was greeted by a friendly note from a stranger when he returned to his car after leaving the headlights on all day .</td></tr></table>
|
| 481 |
+
|
| 482 |
+
Table 14: Humaneval example using CodeLLaMA-13B; red tokens indicate accepted drafts.
|
| 483 |
+
|
| 484 |
+
<table><tr><td>User Input</td><td>from typing import List def has_close_elements(numbers: List[float], thresh-old: float) ->bool: "" Check if in given list of numbers, are any two numbers closer to each other than given threshold. >>has_close_elements ...</td></tr><tr><td>LOOKAHEAD</td><td>for i in range(len(numbers) - 1): if abs(numbers[i] - numbers[i + 1]) <= thresh-old: return True return False def has_close_elements_2(numbers: List[float], threshold: float) ->bool: "" Check if in given list of numbers, are any two numbers closer to each other than given threshold. >>has_close_elements_2 for i in range(len(numbers) - 1): if abs(numbers[i] - numbers[i + 1]) <= thresh-old: return True return False def has_close_elements_2(numbers: List[float], threshold: float) ->bool: "" Check if in given list of numbers, are any two numbers closer to each other than given threshold. >>has_close_elements_2</td></tr></table>
|
2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:dd7ad9a4f5238a572d554d781022bc6c951f6928b81a35d84bbc0af459700f98
|
| 3 |
+
size 1151042
|
2025/SWIFT_ On-the-Fly Self-Speculative Decoding for LLM Inference Acceleration/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/2e09edfa-e224-45ce-9f35-dd1b7ec4b1a1_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/2e09edfa-e224-45ce-9f35-dd1b7ec4b1a1_model.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/2e09edfa-e224-45ce-9f35-dd1b7ec4b1a1_origin.pdf
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:682c803b7ceaef1802525d8076c48063284425ad3d80288017a4064dbf44e701
|
| 3 |
+
size 586362
|
2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/full.md
ADDED
|
@@ -0,0 +1,405 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SALORA: SAFETY-ALIGNMENT PRESERVED LOW-RANK ADAPTATION
|
| 2 |
+
|
| 3 |
+
Mingjie Li $^{1}$ , Wai Man Si $^{1}$ , Michael Backes $^{1}$ , Yang Zhang $^{1}$ , Yisen Wang $^{2,3*}$
|
| 4 |
+
|
| 5 |
+
$^{1}$ CISPA Helmholtz Center for Information Security
|
| 6 |
+
$^{2}$ State Key Lab of General Artificial Intelligence, School of Intelligence Science and Technology, Peking University
|
| 7 |
+
$^{3}$ Institute for Artificial Intelligence, Peking University
|
| 8 |
+
|
| 9 |
+
# ABSTRACT
|
| 10 |
+
|
| 11 |
+
As advancements in large language models (LLMs) continue and the demand for personalized models increases, parameter-efficient fine-tuning (PEFT) methods (e.g., LoRA) become essential due to their efficiency in reducing computation costs. However, recent studies have raised alarming concerns that LoRA fine-tuning could potentially compromise the safety alignment in LLMs, posing significant risks for the model owner. In this paper, we first investigate the underlying mechanism by analyzing the changes in safety alignment related features before and after fine-tuning. Then, we propose a fixed safety module calculated by safety data and a task-specific initialization for trainable parameters in low-rank adaptations, termed Safety-alignment preserved Low-Rank Adaptation (SaLoRA). Unlike previous LoRA methods and their variants, SaLoRA enables targeted modifications to LLMs without disrupting their original alignments. Our experiments show that SaLoRA outperforms various adapters-based approaches across various evaluation metrics in different fine-tuning tasks. Code is available at https://github.com/homles11/SaLoRA.
|
| 12 |
+
|
| 13 |
+
Disclaimer. This paper contains uncensored toxic content that might be offensive or disturbing to the readers.
|
| 14 |
+
|
| 15 |
+
# 1 INTRODUCTION
|
| 16 |
+
|
| 17 |
+
Large Language Models (LLMs) have demonstrated impressive performance in language understanding and generation for general Natural Language Processing (NLP) tasks (Brown et al., 2020; OpenAI, 2022; Touvron et al., 2023a,b; Anthropic, 2023; Team et al., 2023; Qin et al., 2023). As a result, powerful AI assistants and chatbots based on LLMs have gained significant interest from academics and industry. Furthermore, users or developers are likely to fine-tune these models to build domain-specific or personalized LLMs. For example, OpenAI offers a fine-tuning service for users to create custom models. However, fully fine-tuning LLMs is computationally expensive due to the enormous number of trainable parameters. To address this, researchers have proposed different parameter-efficient fine-tuning (PEFT) methods (Houlsby et al., 2019). Among them, low-rank adaptations (LoRA) (Hu et al., 2021) is one of the most popular approaches and is a widely used strategy for reducing computational costs. Instead of adjusting all the weights in the LLM layers, LoRA introduces additional adapters for each trainable layer, as shown in Figure 2(a).
|
| 18 |
+
|
| 19 |
+
Meanwhile, societies have raised growing concerns about preventing LLMs from facilitating harmful or unsafe activities, such as providing instructions on making bombs or spreading fake news (Zou et al., 2023b; Deshpande et al., 2023; Zhuo et al., 2023; Si et al., 2022; Liu et al., 2023a; Akkus et al., 2025). In response, researchers have developed several methods to enhance LLM safety, known as safety alignment, including supervised fine-tuning (SFT) (Ouyang et al., 2022) and reinforcement learning from human feedback (RLHF) (Bai et al., 2022; Dai et al., 2024). As a result of these advancements, pre-trained LLMs like GPT-4 (OpenAI, 2023) and Llama (Touvron et al., 2023b) have become more adept at rejecting unsafe prompts. However, Mukhoti et al. (2023) shows that the fine-tuned model's ability on tasks different from those of the downstream model is reduced significantly compared to the original model. Furthermore, recent works (Qi et al., 2023; Lermen
|
| 20 |
+
|
| 21 |
+

|
| 22 |
+
Figure 1: Examples of fine-tuned Llama-2-chat-7B's responses on benign and harmful prompts, the model is fine-tuned on the Alpaca dataset with LoRA and our SaLoRA.
|
| 23 |
+
|
| 24 |
+

|
| 25 |
+
|
| 26 |
+
& Rogers-Smith, 2024) have indicated that the safety alignment of LLMs may deteriorate when users fine-tune them with LoRA to enhance their domain knowledge, even when all samples in the fine-tuning datasets are benign, as shown in the right part of Figure 1. Such weaknesses will greatly impede the deployment of LoRA methods for LLM's efficient fine-tuning since additional safety alignment methods (like RLHF) also need huge computational resources.
|
| 27 |
+
|
| 28 |
+
To tackle the above problem, we first investigate the reasons for the drop in safety alignment after the PEFT fine-tuning. We inspect the changes in the LLM's ability to detect safe or unsafe prompt scenarios before and after LoRA fine-tuning, drawing inspiration from previous research (Peters et al., 2018; Li et al., 2023; Lee et al., 2024; Clark et al., 2019). Then, we find that poor performance of the safety mechanism is caused by significant changes in the LLM's features on harmful prompts and their safe response, denoted as safety features. Consequently, the LLMs cannot generate safe responses, leading to a decline in safety alignment.
|
| 29 |
+
|
| 30 |
+

|
| 31 |
+
(a) Vanilla LoRA.
|
| 32 |
+
|
| 33 |
+

|
| 34 |
+
(b) Our SaLoRA.
|
| 35 |
+
Figure 2: The sketches for vanilla LoRA and our SaLoRA during fine-tuning. $\mathbf{C}_{SaLoRA}$ here denotes our fixed safety module with a pre-calculated linear weight, while $\mathbf{A}_{SaLoRA}$ and $\mathbf{B}_{SaLoRA}$ are train-able adapters for down-stream tasks with $\mathbf{A}_0$ , $\mathbf{B}_0$ 's are the initializations.
|
| 36 |
+
|
| 37 |
+
Built on this observation, we attempt to maintain the safety features to preserve the LLM's ability to detect unsafe prompts. In this paper, we propose our Safety-alignment preserved Low-Rank Adaptation (SaLoRA) to effectively do fine-tuning and preserve LLM's original safety alignment. To achieve this goal, our SaLoRA first introduces an additional safety module $\mathbf{C}_{SaLoRA}$ , which is computed based on around 300 pre-collected harmful prompts and their safety responses (far less than the fine-tuning data), as illustrated in Figure 2 (b). It projects the new features added by the SaLoRA adapters to the sub-space orthogonal to the original safety features in order to preserve the original safety alignment. In addition, we propose a task-specific weight initialization for SaLoRA's trainable adapters $\mathbf{A}_{SaLoRA}$ and $\mathbf{B}_{SaLoRA}$ derived from a small portion of the fine-tuning data to make SaLoRA converge better with our fixed safety module $\mathbf{C}_{SaLoRA}$ . Our contributions are summarized as follows:
|
| 38 |
+
|
| 39 |
+
- We investigate the reason for the poor performance of the safety alignment after LoRA fine-tuning and find that it is attributed to changes in LLM's representations of harmful prompts and the desired safe responses.
|
| 40 |
+
- We propose a new efficient PEFT method called SaLoRA, which consists of a fixed safety module $\mathbf{C}_{SaLoRA}$ and trainable adapters $\mathbf{A}_{SaLoRA},\mathbf{B}_{SaLoRA}$ initialized by our task-dependent method, shown in Figure 2.
|
| 41 |
+
- Empirical results demonstrate that our SaLoRA consistently surpasses existing PEFT methods and their combination with state-of-the-art alignment methods in maintaining the model's safety while achieving comparable or even better results on downstream evaluation tasks.
|
| 42 |
+
|
| 43 |
+
# 2 RELATED WORK
|
| 44 |
+
|
| 45 |
+
# 2.1 PARAMETER-EFFICIENT FINE-TUNING
|
| 46 |
+
|
| 47 |
+
Recent developments in NLP and the use of transformer architectures like Llama-2 and GPT-4 have led to the success of large models. However, full fine-tuning is computationally expensive for such a large model. Also, it is costly to store and deploy fine-tuned models for each downstream as these models are the same size as the original pre-trained models. Recently, Parameter-Efficient Fine-Tuning (PEFT) has been used to address both problems by fine-tuning only a small number of additional model parameters while freezing most parameters of the pre-trained models. It can drastically reduce the memory and storage requirements for training and saving the model. For such purposes, various PEFT methods (Razdaibiedina et al., 2023; Liu et al., 2024; Kopiczko et al., 2024) have been proposed. For instance, Houlsby et al. (2019) attaches extra trainable parameters to each layer while freezing the original model. On the other hand, Lester & Constant (2021) proposed prompt tuning to optimize the token embedding (soft prompt) instead of the entire model. Recently, Hu et al. (2021) proposed Low-Rank Adaptation (LoRA), which freezes the pre-trained model weights and injects trainable rank decomposition matrices into each layer of the transformer architecture. Meng et al. (2024) leverage singular value decomposition to reduce the number of trainable parameters. Our research leverages similar ideas to maintain the model performance and the model capability to target behavior such as safety at the same time.
|
| 48 |
+
|
| 49 |
+
# 2.2 SAFETY ALIGNMENT IN LLMS
|
| 50 |
+
|
| 51 |
+
LLMs have been shown to exhibit undesirable behaviors through regular interaction, such as triggering toxic responses. They may also provide incorrect answers even when given correct input. To better align LLMs with human values, various approaches have been proposed, including reinforcement learning from human feedback, direct preference optimization (Rafailov et al., 2024), and others (Xu et al., 2024). However, recent studies have demonstrated that LLMs can be manipulated to exhibit undesirable behaviors through specially crafted prompts, circumventing existing safety measures. Zou et al. (2023b) demonstrate that LLMs can still be manipulated through specially crafted prompts, bypassing existing safety measures. To tackle these methods, researchers have proposed various well-designed prompts (Xie et al., 2023; Wei et al., 2023; Wang et al., 2024b; Li et al., 2025) or alter the model's features to enhance model safety (Wang et al., 2024a; Li et al., 2024). Besides, researchers also leverage adversarial training on LLMs to enhance the model's safety (Huang et al., 2024; Mo et al., 2024).
|
| 52 |
+
|
| 53 |
+
Apart from the safety problems for the on-the-shelf LLMs, Qi et al. (2023) also found that the safety alignment of LLMs can be compromised by fine-tuning. To tackle such problems, Hsu et al. (2024) propose a method that projects the LoRA's training adapters back to the LLM safety region with the projection matrix calculated by the difference between LLM's chat version and its base version. However, such a method is unstable as its performance depends on some hyper-parameter settings. Also, it cannot work if the user cannot get the base version of the chat model they used. Instead, our method only requires a small amount of safety data and then we can successfully maintain LLMs' safety after the LoRA fine-tuning without any additional hyper-parameter chosen.
|
| 54 |
+
|
| 55 |
+
# 3 LORA AND ITS SAFETY ALIGNMENT DROP
|
| 56 |
+
|
| 57 |
+
# 3.1 METHODS FOR LOW-RANK ADAPTATION
|
| 58 |
+
|
| 59 |
+
Drawing from the widely accepted hypothesis that updates during fine-tuning typically form a low "intrinsic rank" (Li et al., 2018; Aghajanyan et al., 2021), LoRA offers an efficient solution for fine-tuning. It utilizes the product of two low-rank matrices $\mathbf{B} \in \mathbb{R}^{d \times r}$ and $\mathbf{A} \in \mathbb{R}^{r \times k}$ as the incremental weight matrix to obtain the final updates $\Delta \mathbf{W} \in \mathbb{R}^{d \times k}$ . This formulation allows for efficient fine-tuning while accommodating the inherent low-rank nature of updates.
|
| 60 |
+
|
| 61 |
+
$$
|
| 62 |
+
\mathbf {W} _ {\text {u p d a t e}} = \mathbf {W} _ {0} + \Delta \mathbf {W} = \mathbf {W} _ {0} + \mathbf {B A}, \tag {1}
|
| 63 |
+
$$
|
| 64 |
+
|
| 65 |
+
where $\mathbf{A}$ , $\mathbf{B}$ are trainable parameters with $r \ll \min\{d, k\}$ . $\mathbf{W}_0$ is the pre-trained weight matrix and is fixed during the training process. The matrix $\mathbf{A}$ is initialized with the normal Gaussian distribution, while $\mathbf{B}$ is initially set to zero. Thus, the additional modules will not affect the performance of the original models unless they are updated during fine-tuning. Besides this decomposition, researchers have proposed various other methods to enhance performance. Among these, Weight-Decomposed Low-Rank Adaptation (DoRA) (Liu et al., 2024) and PiSSA (Meng et al., 2024) show better results. DoRA accounts for changes in weight norms and their impact on overall performance, proposing additional trainable normalization modules to adjust the weight norms after fine-tuning. PiSSA modifies the original initialization of LoRA adapters' weights via SVD method.
|
| 66 |
+
|
| 67 |
+
# 3.2 EMPIRICAL ANALYSIS ON SAFETY ALIGNMENT AFTER LORA
|
| 68 |
+
|
| 69 |
+
Safety alignment in LLMs has emerged as one of the most critical research topics due to their impressive capabilities and potential societal impacts. However, Qi et al. (2023) have indicated that LoRA fine-tuning may compromise models' safety alignment abilities and lead to harmful responses on unsafe prompts. As proposed in many recent works (Wang et al., 2024a; Li et al., 2024; Zou et al., 2023a), LLM's intermediate features on harmful prompts and their safety responses, which we denote them as safety features in the following, are crucial to the safe behavior on rejecting unsafe prompts. Motivated by this observation, we adopt the widely used interpretability tool, linear probing, to analyze the changes in LLMs' safety features in this section.
|
| 70 |
+
|
| 71 |
+
We train the linear probes, denoted as $\mathbf{W}_{probe}^{l}$ , to classify the MLP outputs from the last tokens for each LLM layer, averaged across all timesteps $(\bar{\mathbf{X}}^{l})$ , to determine whether they belong to harmful prompts and their safe responses or not:
|
| 72 |
+
|
| 73 |
+
$$
|
| 74 |
+
\mathbb {P} \left(\operatorname {H a r m f u l} | \bar {\mathbf {X}} ^ {1}\right) = \operatorname {s i g m o i d} \left(\mathbf {W} _ {\text {p r o b}} ^ {l} \bar {\mathbf {X}} ^ {l}\right). \tag {2}
|
| 75 |
+
$$
|
| 76 |
+
|
| 77 |
+
We first train a linear probe as a classifier with the original Llama-2-chat-7B model's attention head output of each layer on benign prompts and harmful prompts with their safe responses to judge whether the input prompt-response pairs belong to the safe scenarios or harmful scenarios. Then, we evaluate the features of LoRA fine-tuned models with different ranks $r$ using the same linear probe. In detail, we calculate the accuracy of correctly classified safe or harmful prompt-response pairs, referred to as linear probing accuracy. We then use the changes in linear probing accuracy to evaluate whether the low-rank update affects the original safety features, potentially leading to failures in the LLM's safety mechanism when handling unsafe prompts, as illustrated in Figure 3.
|
| 78 |
+
|
| 79 |
+

|
| 80 |
+
Figure 3: Linear Probing Accuracy for classifying unsafe prompts and their safe responses at each attention layer on Llama-2-chat-7B before and after LoRA fine-tuning.
|
| 81 |
+
|
| 82 |
+
From the figure, we can observe that the linear probe trained with the original LLM's features cannot effectively classify the harmful or benign prompts and their safe response pairs on the LoRA fine-tuned models, as the accuracy of each layer drops more than $10\%$ . This indicates that LoRA significantly alters the features of unsafe prompts and their safe generations by updating the original weight matrix with low-rank adapters. Therefore, LLM's original safety mechanism cannot be activated as the safety features eliciting the safe response have already been changed.
|
| 83 |
+
|
| 84 |
+
# 3.3 THEORETICAL ANALYSIS
|
| 85 |
+
|
| 86 |
+
In this section, we try to theoretically analyze why LoRA fine-tuning may impact the LLMs' safety features. Inspired by recent research (Lee et al., 2019; Sun et al., 2023), which shows there exist some low-rank weight spaces for safety and other different tasks, we first made assumptions by decoupling the original LLM weights with different orthogonal bases to denote the safety weight region, which activates the most on harmful prompts. These regions can be split from weights $\mathbf{W}$ as $\mathbf{W}_s = \sum_{i=1}^{K} \alpha_i \mathbf{v}_s^i \mathbf{v}_s^{i^\top}$ as most trainable layers in LLMs are linear layers. Then we can obtain the following proposition for the relationship between the gradient of low-rank module $\Delta \mathbf{W}$ and the safety weight regions as follows.
|
| 87 |
+
|
| 88 |
+
Proposition 1 Letting $\mathbf{X}_{\mathbf{W}}$ denote the features for benign training prompts, $\mathbf{Y}_{\mathbf{W}}$ denotes output features for layer $\mathbf{W}$ with adapters, $\mathbf{Y}_{\mathbf{W}} = (\mathbf{W} + \Delta \mathbf{W})\mathbf{X}_{\mathbf{W}}$ , and $\mathcal{L}(\mathbf{Y}_{\mathbf{W}})$ is the training loss on benign prompts. If the activation $\| \mathbf{W}_S\mathbf{X}_{\mathbf{W}}\| _F > \gamma$ , then the Frobenius norm of the dot product between $\mathbf{W}_S$ and the gradient of $\Delta \mathbf{W}$ , denoted as $\mathrm{grad}_{\Delta \mathbf{W}}$ , can be lower-bounded by the following,
|
| 89 |
+
|
| 90 |
+
$$
|
| 91 |
+
\left\| \mathbf {W} _ {S} \operatorname {g r a d} _ {\Delta \mathbf {W}} ^ {\top} \right\| _ {\mathrm {F}} > \gamma \sigma_ {\min } \left(\nabla_ {\mathbf {Y} _ {\mathrm {W}}} \mathcal {L} \left(\mathbf {Y} _ {\mathrm {W}}\right)\right), \tag {3}
|
| 92 |
+
$$
|
| 93 |
+
|
| 94 |
+
where $\sigma_{\mathrm{min}}$ denotes the smallest singular value of given matrix.
|
| 95 |
+
|
| 96 |
+
The assumption and proof can be found in Appendix B. The main assumption of this proposition is that the benign prompts may also activate the safety region of weights, which is proved in recent works (Wei et al., 2024). From the proposition, we can see that the gradient and the safety weight regions are not orthogonal to each other. Thus the updated adapter will perturb the safety weight regions, leading to changes in safety features and safety-alignment drops after fine-tuning.
|
| 97 |
+
|
| 98 |
+
# 4 SAFETY-ALIGNMENT PRESERVED LOW-RANK ADAPTATION
|
| 99 |
+
|
| 100 |
+
Based on the analysis in Section 3, we propose a Safety-alignment preserved Low-Rank Adaptation, called SaLoRA, including a fixed safety module and trainable adapters initialized by our task-specific initialization. Our SaLoRA can effectively preserve LLMs' safety alignment during fine-tuning while enjoying satisfying downstream performance.
|
| 101 |
+
|
| 102 |
+
# 4.1 PROPOSED SAFETY MODULE IN SALORA
|
| 103 |
+
|
| 104 |
+
As the former analysis states, one of the key reasons for the safety alignment drops after LoRA fine-tuning is the changes in the original safety features. Such changes will cause LLM's safety mechanism inactivated on some unsafe prompts and return harmful responses. Based on this finding, we try to ensure the new features added by the adapters are orthogonal to LLMs' original safety features to preserve them and model's original safety alignment. To achieve this goal, we add a linear module with pre-calculated weight $\mathbf{C}_{SaLoRA}$ , denoted as the safety module, as shown in Figure 2. The value of $\mathbf{C}_{SaLoRA}$ can be reformulated as the minimizer of the dot-product similarity between the features on harmful prompts, formulated as follows:
|
| 105 |
+
|
| 106 |
+
$$
|
| 107 |
+
\mathbf {C} _ {S} = \underset {\mathbf {C} _ {S}} {\arg \min } \left\| \left(\mathbf {C} _ {S} \left(\mathbf {B} _ {S} \mathbf {A} _ {S} \mathbf {X} _ {h} - \mathbf {B} _ {\mathbf {0}} \mathbf {A} _ {\mathbf {0}} \mathbf {X} _ {h}\right)\right) ^ {\top} (\mathbf {W X} _ {h}) \right\| _ {2}, \tag {4}
|
| 108 |
+
$$
|
| 109 |
+
|
| 110 |
+
where the subscript "S" here denotes $S_{\text{SaLoRA}}$ for convenience, $\mathbf{B}_S$ , $\mathbf{A}_S$ are the trainable weights for the low-rank adapters with $\mathbf{B}_0$ , $\mathbf{A}_0$ representing their initialization, $\mathbf{X}_h$ denotes an input feature of several unsafe prompts and their safe responses, and $\mathbf{W}$ is the original weights for a certain linear layer of LLM. Since $\mathbf{A}_S$ and $\mathbf{B}_S$ cannot be easily controlled during fine-tuning. We try to optimize the following alternatives to set $\mathbf{C}_S$ 's value:
|
| 111 |
+
|
| 112 |
+
$$
|
| 113 |
+
\underset {\mathbf {C} _ {S}} {\arg \min } \| \mathbf {C} _ {S} ^ {\top} \mathbf {W} \mathbf {X} _ {h} \| _ {2}. \tag {5}
|
| 114 |
+
$$
|
| 115 |
+
|
| 116 |
+
We note that although optimizing Eqn (5) is not equal to Eqn (4), minimizing Eqn (5) can also control the magnitude of Eqn (4) due to the norm inequality,
|
| 117 |
+
|
| 118 |
+
$$
|
| 119 |
+
\left\| \left(\mathbf {C} _ {S} \left(\mathbf {B} _ {S} \mathbf {A} _ {S} \mathbf {X} _ {h} - \mathbf {B} _ {0} \mathbf {A} _ {0} \mathbf {X} _ {h}\right)\right) ^ {\top} (\mathbf {W X} _ {h}) \right\| _ {2} \leq \| \mathbf {B} _ {S} \mathbf {A} _ {S} \mathbf {X} _ {h} - \mathbf {B} _ {0} \mathbf {A} _ {0} \mathbf {X} _ {h} \| _ {2} \| \mathbf {C} _ {S} ^ {\top} \mathbf {W X} _ {h} \| _ {2}. \tag {6}
|
| 120 |
+
$$
|
| 121 |
+
|
| 122 |
+
However, one can see that $\mathbf{C}_S = 0$ is a trivial solution for both two objectives but it will make the adapters useless. Thus, we assume that the most important safety regions also lie in a low-rank weight
|
| 123 |
+
|
| 124 |
+
space with the orthogonal projection matrix $\mathbf{U}_C\in \mathbb{R}^{d\times r_s}$ and our $\mathbf{C}_S$ can be set as the orthogonal complementary space $\mathbf{C}_S = \mathbf{I} - \mathbf{U}_C\mathbf{U}_C^\top$ to avoid the trivial solution. The new objective is:
|
| 125 |
+
|
| 126 |
+
$$
|
| 127 |
+
\underset {\mathbf {U} _ {C}} {\arg \min } \left\| \left(\mathbf {I} - \mathbf {U} _ {C} \mathbf {U} _ {C} ^ {\top}\right) \mathbf {W} \mathbf {X} _ {h} \right\| _ {2}. \tag {7}
|
| 128 |
+
$$
|
| 129 |
+
|
| 130 |
+
The optimal results for $\mathbf{U}_C$ are attributed to the singular value decomposition of $\mathbf{W}\mathbf{X}_h$ as studied in former works (Wei et al., 2024). Thus, the weight $\mathbf{C}_S$ for the our safety module is set to be $\mathbf{I} - \mathbf{U}_C\mathbf{U}_C^\top$ . $\mathbf{U}_C$ is the top $r_s$ singular vectors of the output features $\mathbf{W}\mathbf{X}_h$ on harmful prompts and we call $r_s$ as the safety rank in the following.
|
| 131 |
+
|
| 132 |
+
# 4.2 INITIALIZATION OF SALORA'S TRAINABLE ADAPTERS
|
| 133 |
+
|
| 134 |
+
Since our additional safety module $\mathbf{C}_{SaLoRA}$ changes the original gradients of adapters' trainable weights and makes the training harder. We propose a new initialization method using the fine-tuning data to help our SaLoRA's trainable adapter $\mathbf{A}_{SaLoRA}$ and $\mathbf{B}_{SaLoRA}$ converge better.
|
| 135 |
+
|
| 136 |
+
Inspired by former research (Sun et al., 2023; Liu et al., 2023b) on locating task-specific weight regions, we propose our task-specific initialization for SaLoRA's $\mathbf{A}_{SaLoRA}$ and $\mathbf{B}_{SaLoRA}$ to make their training easier. Our task-specific initialization first locates the low-rank task-related weight regions and then initializes $\mathbf{A}_{SaLoRA}$ and $\mathbf{B}_{SaLoRA}$ according to these regions.
|
| 137 |
+
|
| 138 |
+
Like the methods in the above section, we first try to detect the task-specific regions of certain linear layers in LLMs using the following optimization,
|
| 139 |
+
|
| 140 |
+
$$
|
| 141 |
+
\arg \min \| \mathbf {W} \mathbf {X} _ {t} - \hat {\mathbf {W}} \mathbf {X} _ {t} \| _ {2}, \tag {8}
|
| 142 |
+
$$
|
| 143 |
+
|
| 144 |
+
$$
|
| 145 |
+
r a n k (\tilde {\mathbf {W}}) < r _ {t}
|
| 146 |
+
$$
|
| 147 |
+
|
| 148 |
+
where $r_t$ is the task-specific rank to avoid trivial solution, $\mathbf{X}_t$ here denotes the input features of LLM's layers concerning input samples of certain downstream tasks, and $\hat{\mathbf{W}}$ denotes the low-rank weight region related to certain tasks. As illustrated in the above section, the minimizer is
|
| 149 |
+
|
| 150 |
+
$$
|
| 151 |
+
\hat {\mathbf {W}} = \mathbf {U} \mathbf {U} ^ {\top} \mathbf {W}, \tag {9}
|
| 152 |
+
$$
|
| 153 |
+
|
| 154 |
+
where $\mathbf{U} \in \mathbb{R}^{d \times r_t}$ is the top $r_t$ left singular vectors of $\mathbf{W}\mathbf{X}_t$ . If we set $r_t = r$ , which is the rank for adapters $\mathbf{A}_S, \mathbf{B}_S$ , we can directly split it to propose our SaLoRA's initialization:
|
| 155 |
+
|
| 156 |
+
$$
|
| 157 |
+
\mathbf {B} _ {S} ^ {\prime} = \mathbf {U}, \mathbf {A} _ {S} ^ {\prime} = \mathbf {U} ^ {\top} \mathbf {W}, \tag {10}
|
| 158 |
+
$$
|
| 159 |
+
|
| 160 |
+
where the subscript "S" here denotes $S_{\text{SaLoRA}}$ for convenience. However, one can see that the norms between $\mathbf{B}_S'$ and $\mathbf{A}_S'$ are not balanced as $\mathbf{U}$ here is an orthogonal matrix. The imbalanced weight norm will influence the gradient norm, which may influence the models' generalization as studied in many works (Zhao et al., 2022). To balance the weight norms of module $\mathbf{A}_S$ and $\mathbf{B}_S$ in the adapters, we also do singular decomposition on weight $\mathbf{W}$ as follows,
|
| 161 |
+
|
| 162 |
+
$$
|
| 163 |
+
\mathbf {W} = \bar {\mathbf {U}} \bar {\mathbf {S}} \bar {\mathbf {V}} ^ {\top}. \tag {11}
|
| 164 |
+
$$
|
| 165 |
+
|
| 166 |
+
Since the middle diagonal matrix $\mathbf{S}$ consists of singular values of the original weight $\mathbf{W}$ and top $r$ singular values along with singular vectors are the key part of the original weight matrix, we initialize the weight $\mathbf{A}_S$ and $\mathbf{B}_S$ as follows,
|
| 167 |
+
|
| 168 |
+
$$
|
| 169 |
+
\mathbf {B} _ {S} = \mathbf {U} \mathbf {U} ^ {\top} \bar {\mathbf {U}} _ {[: r ]} \sqrt {\bar {\mathbf {S}} _ {[: r ]}}, \mathbf {A} _ {S} = \sqrt {\bar {\mathbf {S}}} _ {[: r ]} \bar {\mathbf {V}} _ {[: r ]} ^ {\top}, \tag {12}
|
| 170 |
+
$$
|
| 171 |
+
|
| 172 |
+
where $\bar{\mathbf{U}}_{[:r]}$ , $\bar{\mathbf{V}}_{[:r]}$ denotes the matrix consists of top- $r$ left singular vectors and right singular vectors, and $\bar{\mathbf{S}}_{[:r]}$ denotes the top- $r$ singular values of $\mathbf{W}$ . Then we can obtain the low-rank adapter matrices which are highly correlated to downstream tasks.
|
| 173 |
+
|
| 174 |
+
To ensure the initial stage of LLM with our SaLoRA adapters perform the same as the pre-trained model, we also re-parameterize the weight of LLM's layer as follows,
|
| 175 |
+
|
| 176 |
+
$$
|
| 177 |
+
\mathbf {W} ^ {\prime} = \mathbf {W} - \mathbf {C} _ {S} \mathbf {B} _ {S} \mathbf {A} _ {S}. \tag {13}
|
| 178 |
+
$$
|
| 179 |
+
|
| 180 |
+
The fixed safety module $\mathbf{C}_S$ , trainable adapters $\mathbf{A}_S$ , $\mathbf{B}_S$ initialized by the task-specific initialization and the residual weights $\mathbf{W}'$ build the whole structure of our SaLoRA as shown in Figure 2. Training the trainable adapters on the fine-tuning datasets, our SaLoRA can help LLMs efficiently obtain certain abilities on some domain-specific knowledge while preserving its safety alignment.
|
| 181 |
+
|
| 182 |
+
# 4.3 IMPLEMENTATION OF SALORA
|
| 183 |
+
|
| 184 |
+
In this section, we will provide a comprehensive pipeline of SaLoRA's training, saving, and inference processes, drawn in Figure 4. Before SaLoRA's training, we first set the weights of our safety module $\mathbf{C}_{SaLoRA}$ with $\mathbf{C}_{SaLoRA} = \mathbf{I} - \mathbf{U}_C\mathbf{U}_C^\top$ , where $\mathbf{U}_C$ is the optimal solution for Eqn (7). And we calculate the initialization of adapters $\mathbf{B}_{SaLoRA}$ , $\mathbf{A}_{SaLoRA}$ with Eqn (10). Then we can begin SaLoRA's training process by updating trainable adapters $\mathbf{A}_{SaLoRA}$ , $\mathbf{B}_{SaLoRA}$ while freezing the residual weight and safety module $\mathbf{C}_{SaLoRA}$ as Figure 4's left side shows.
|
| 185 |
+
|
| 186 |
+

|
| 187 |
+
Figure 4: The training, adapter saving, and inference procedure for our SaLoRA. The blue weights here denote fixed parameters while the orange modules are trainable during fine-tuning. $\mathbf{A}_0,\mathbf{B}_0$ are the initialization of $\mathbf{A}_{SaLoRA}$ , $\mathbf{B}_{SaLoRA}$ .
|
| 188 |
+
|
| 189 |
+
After the LoRA training, the updated weights need to be saved. As the size of our safety module $\mathbf{C}_{SaLoRA} \in \mathbb{R}^{d_{out} \times d_{out}}$ is the same as the original weight $\mathbf{W}$ , we need an additional weight merging step at the adapter saving time as shown in the middle of Figure 4. Such an additional weight merge step is a simple multiplication $\mathbf{B}_{SaLoRA}' = \mathbf{C}_{SaLoRA} \mathbf{B}_{SaLoRA}$ . Then the storage cost for $\mathbf{B}_{SaLoRA}'$ is the same as $\mathbf{B}_{SaLoRA}$ or vanilla LoRA's adapter. However, as we also need to save $\mathbf{B}_0'$ and $\mathbf{A}_0$ , the storage cost will be twice as large as vanilla LoRA. Luckily, the adapters are much smaller compared with LLM's size, and most adapters published on huggingface are only tens of MB. Considering the good performance in the following section, such a storage overhead should be acceptable.
|
| 190 |
+
|
| 191 |
+
At the inference stage, our SaLoRA is almost similar to the vanilla LoRA with only one simple step to calculate the residual weights, which will not cost much as they are just some multiplications of low-rank matrices and subtractions. Therefore, our methods can be easily adopted with many popular inference pipelines, like vLLM (Kwon et al., 2023).
|
| 192 |
+
|
| 193 |
+
# 5 EXPERIMENTS
|
| 194 |
+
|
| 195 |
+
In this section, we conduct a variety of experiments to demonstrate the efficiency of our SaLoRA in improving domain-specific abilities while preserving LLM's safety alignment. Firstly, we train four widely used LLMs on Alpaca (Wang et al., 2023) with SaLoRA and other LoRA methods, and then we compare the harmful rate of these models' responses with and without some state-of-the-art post-hoc alignment methods on unsafe prompts. Then, we compare the utility of different LoRA-trained models with our SaLoRA on commonsense reasoning. We also conduct ablation studies on ranks' influence in Appendix C and examples of different methods outputs in Appendix D.
|
| 196 |
+
|
| 197 |
+
Baselines. In this paper, we compare our SaLoRA with three widely adopted PEFT training methods: LoRA, DoRA, and PiSSA. Additionally, we adopt four state-of-the-art post-hoc safety alignment methods on LoRA fine-tuned models as baselines, including the input-based Self-Reminder (Xie et al., 2023), the feature-intervention method InferAligner (Wang et al., 2024a), the training-based approach Vaccine (Huang et al., 2024), and the model editing method Safe LoRA (Hsu et al., 2024). The detailed settings are listed in Appendix A.
|
| 198 |
+
|
| 199 |
+
Settings. In our SaLoRA, we set $r_s = r_t = 32$ in the following experiments, and rank $r$ for LoRA adapters are set as other LoRA variants according to experiments' requirements. To obtain the harmful feature $\mathbf{X}_h$ in Eqn (7) for the safety module, we use $70\%$ harmful prompts in the AdvBench dataset (Zou et al., 2023b) along with their safe responses, which is also used in baseline method Vaccine
|
| 200 |
+
|
| 201 |
+
and InferAligner. We use the features of training samples as $\mathbf{X}_t$ for the initialization. Experiments are finished on the PEFT (Mangrulkar et al., 2022) training pipeline with a batch size equal to 16 for all our experiments. The experiments finished on a single NVIDIA A100-80GB GPU.
|
| 202 |
+
|
| 203 |
+
# 5.1 EVALUATIONS ON LLM SAFETY AFTER FINE-TUNING
|
| 204 |
+
|
| 205 |
+
In this section, we first evaluate the safety alignment of four widely used models, including Llama-2-chat-7B, Llama-2-chat-13B, Llama-3.1-Instruct-8B, and Mistral-7B-Instruct-v0.3 (Jiang et al., 2023). We first train them on the Alpaca datasets with AdamW (Loshchilov, 2019) for 1 epoch with the learning rate equal to 0.0002. Then evaluate the harmfulness score on its responses with the Llama-Guard-3-8B (Llama Team, 2024). We use $70\%$ harmful prompts in the AdvBench dataset (Zou et al., 2023b) for InferAligner, Vaccine, and our SaLoRA. We use the rest of $30\%$ harmful prompts in AdvBench for the safety evaluation, denoted as AdvBench's test subset. The harmful rates for LLMs with different methods are reported in Table 1. The harmful rate here represents the proportion of all responses that were labeled as unsafe by Llama-Guard-3-8B.
|
| 206 |
+
|
| 207 |
+
Table 1: The harmful rate of LLMs' responses on harmful prompts in AdvBench's test subset against different LLM on Alpaca with different methods. "IA" here denotes the InferAligner, "SR" denotes the self-reminder method, and "Vac" denotes the Vaccine method. The bold number denotes the best harmful rate of LLMs with or without the post-hoc alignment methods.
|
| 208 |
+
|
| 209 |
+
<table><tr><td colspan="2"></td><td colspan="2">Llama-2-chat-7B</td><td colspan="2">Llama-2-chat-13B</td><td colspan="2">Llama-3.1-Instruct-8B</td><td colspan="2">Mistral-Instruct-v0.3</td></tr><tr><td colspan="2">Before Fine-tuning</td><td colspan="2">0.0%</td><td colspan="2">0.0%</td><td colspan="2">1.4%</td><td colspan="2">47.8%</td></tr><tr><td colspan="2">Rank for PEFT training</td><td>16</td><td>32</td><td>16</td><td>32</td><td>16</td><td>32</td><td>16</td><td>32</td></tr><tr><td rowspan="3">Base PEFT</td><td>LORA</td><td>23.7%</td><td>31.7%</td><td>15.7%</td><td>13.8%</td><td>11.7%</td><td>8.7%</td><td>82.5%</td><td>71.7%</td></tr><tr><td>PiSSA</td><td>31.7%</td><td>35.7%</td><td>17.4%</td><td>18.1%</td><td>13.8%</td><td>14.5%</td><td>83.3%</td><td>86.9%</td></tr><tr><td>DORA</td><td>23.7%</td><td>25.3%</td><td>18.8%</td><td>16.7%</td><td>10.1%</td><td>9.4%</td><td>64.5%</td><td>66.7%</td></tr><tr><td rowspan="4">LoRA w. post-hoc alignment</td><td>LORA w. SR</td><td>11.7%</td><td>9.4%</td><td>7.8%</td><td>5.8%</td><td>10.3%</td><td>7.8%</td><td>79.6%</td><td>72.2%</td></tr><tr><td>LORA w. IA</td><td>13.5%</td><td>23.7%</td><td>10.3%</td><td>6.7%</td><td>6.7%</td><td>5.8%</td><td>55.1%</td><td>60.1%</td></tr><tr><td>LORA w. Vac</td><td>20.2%</td><td>25.3%</td><td>32.5%</td><td>39.8%</td><td>41.1%</td><td>38.3%</td><td>76.8%</td><td>73.1%</td></tr><tr><td>Safe LoRA</td><td>15.7%</td><td>14.5%</td><td>10.1%</td><td>9.4%</td><td>8.5%</td><td>6.7%</td><td>63.0%</td><td>66.7%</td></tr><tr><td rowspan="2">Ours</td><td>SaLoRA</td><td>3.5%</td><td>4.4%</td><td>2.9%</td><td>3.5%</td><td>2.9%</td><td>1.4%</td><td>31.7%</td><td>36.5%</td></tr><tr><td>SaLoRA w. SR</td><td>1.4%</td><td>2.9%</td><td>1.4%</td><td>1.4%</td><td>0.0%</td><td>1.4%</td><td>15.7%</td><td>10.7%</td></tr></table>
|
| 210 |
+
|
| 211 |
+
The results indicate that fine-tuning with LoRA and its variants, such as DoRA and PiSSA, compromises the original safety alignment for all kinds of LLMs, even when the fine-tuning dataset is free of harmful content. While post-hoc alignment methods can mitigate this issue to some extent, they cannot fully restore the models' safety alignment, as their abilities to produce harmful responses have already been broken. Among them, the InferAligner and Self-Reminder perform the better. Vaccine performs unstable, the possible reason is the alignment data we used for Vaccine's pre-training is too small, only around 300 samples.
|
| 212 |
+
|
| 213 |
+
Beyond those post-hoc methods, SaLoRA demonstrates superior performance in preserving the safety alignment of LLMs after fine-tuning. The harmful rate of LLMs fine-tuned with SaLoRA remains comparable to their original rate before fine-tuning, highlighting SaLoRA's effectiveness in maintaining alignment. Notably, applying SaLoRA to Mistral-7B-Instruct-v0.3, which had a suboptimal baseline harmful rate of $47.8\%$ , makes a clear improvement in safety alignment. We hypothesize that this phenomenon may be due to the safety features being strengthened as other original features may be weakened during the fine-tuning. Additionally, when combined with post-hoc methods such as Self-reminder (denoted as 'SaLoRA w. SR' in Table 1), the harmful rate improves further, indicating enhanced safety alignment after fine-tuning.
|
| 214 |
+
|
| 215 |
+
# 5.2 EVALUATIONS ON UTILITIES
|
| 216 |
+
|
| 217 |
+
In addition to preserving safety, an effective PEFT training method should also demonstrate comparable or superior performance in various tasks against others. Like many other works (Kopiczko et al., 2024; Liu et al., 2024), we test eight commonsense reasoning tasks on Llama-2-chat-7B fine-tuned on commonsense-15k (Talmor et al., 2019) with different methods to validate the effectiveness of our SaLoRA. These eight tasks are widely used in various works (Touvron et al., 2023b; Kopiczko et al., 2024; Liu et al., 2024) to assess commonsense reasoning abilities. We follow the evaluation settings as former works (Kopiczko et al., 2024; Liu et al., 2024), and the results are listed in Table 2.
|
| 218 |
+
|
| 219 |
+
Table 2: The prediction accuracy (%) of Llama-2-chat-7B on different commonsense reasoning tasks and its harmful rate after fine-tuning on commonsense-15k datasets with different PEFT methods.
|
| 220 |
+
|
| 221 |
+
<table><tr><td>r</td><td>Method</td><td>BoolQ</td><td>PIQA</td><td>SIQA</td><td>HellaSwag</td><td>WinoGrande</td><td>ARC-e</td><td>ARC-c</td><td>OBQA</td><td>Avg. Acc</td><td>Harmful Rate</td></tr><tr><td rowspan="4">16</td><td>LoRA</td><td>59.5</td><td>71.0</td><td>62.2</td><td>32.6</td><td>51.7</td><td>73.1</td><td>58.2</td><td>64.6</td><td>59.2</td><td>7.8%</td></tr><tr><td>DoRA</td><td>60.5</td><td>71.2</td><td>67.7</td><td>33.1</td><td>53.1</td><td>76.3</td><td>61.4</td><td>66.7</td><td>61.3</td><td>2.9%</td></tr><tr><td>PiSSA</td><td>62.4</td><td>71.4</td><td>62.8</td><td>38.1</td><td>51.4</td><td>77.3</td><td>59.6</td><td>65.8</td><td>61.2</td><td>5.8%</td></tr><tr><td>SaLoRA</td><td>64.1</td><td>72.4</td><td>64.2</td><td>49.3</td><td>54.7</td><td>74.9</td><td>59.4</td><td>63.8</td><td>62.9</td><td>0.0%</td></tr><tr><td rowspan="4">32</td><td>LoRA</td><td>60.3</td><td>72.4</td><td>63.3</td><td>31.1</td><td>56.6</td><td>74.6</td><td>58.1</td><td>67.6</td><td>60.5</td><td>5.8%</td></tr><tr><td>DoRA</td><td>62.7</td><td>73.3</td><td>65.3</td><td>35.9</td><td>51.5</td><td>78.5</td><td>59.6</td><td>68.1</td><td>61.9</td><td>7.8%</td></tr><tr><td>PiSSA</td><td>60.4</td><td>73.8</td><td>64.4</td><td>35.4</td><td>52.5</td><td>78.7</td><td>60.7</td><td>66.8</td><td>61.9</td><td>9.4%</td></tr><tr><td>SaLoRA</td><td>60.6</td><td>72.7</td><td>64.5</td><td>47.6</td><td>57.1</td><td>74.0</td><td>57.0</td><td>64.8</td><td>62.3</td><td>1.4%</td></tr><tr><td rowspan="4">64</td><td>LoRA</td><td>62.4</td><td>73.9</td><td>64.5</td><td>30.1</td><td>58.1</td><td>78.4</td><td>62.2</td><td>68.6</td><td>62.8</td><td>8.5%</td></tr><tr><td>DoRA</td><td>63.2</td><td>74.7</td><td>67.4</td><td>39.3</td><td>53.8</td><td>78.6</td><td>60.8</td><td>70.3</td><td>63.5</td><td>9.4%</td></tr><tr><td>PiSSA</td><td>65.9</td><td>75.8</td><td>66.5</td><td>43.4</td><td>59.5</td><td>80.3</td><td>64.5</td><td>71</td><td>65.9</td><td>10.1%</td></tr><tr><td>SaLoRA</td><td>66</td><td>74.1</td><td>67.5</td><td>52.6</td><td>59.6</td><td>76.8</td><td>62.6</td><td>66.4</td><td>65.7</td><td>0.7%</td></tr></table>
|
| 222 |
+
|
| 223 |
+
The results show that our SaLoRA not only outperforms the vanilla LoRA methods on safety-alignment preserving but also performs better on commonsense reasoning tasks across different $r$ 's settings by an obvious margin. Compared to DoRA and PiSSA, our method consistently performs better on the "HellaSwag" and "WinoGrande" tasks. When comparing average prediction accuracy, our SaLoRA method shows almost better results to DoRA and PiSSA.
|
| 224 |
+
|
| 225 |
+
# 5.3 EVALUATIONS OF SALORA'S SAFETY ALIGNMENT UNDER JAILBREAK ATTACKS
|
| 226 |
+
|
| 227 |
+
Apart from the safety behaviors on natural harmful prompts in AdvBench, we also conduct experiments to evaluate SaLoRA's performance on jailbreak attack samples. In this section, we conduct the popular multiple GCG attack (Zou et al., 2023b) with 1000 steps on Vicuna and Llama-2 to generate the universal jailbreak suffix of 128 tokens. Adding it to the harmful prompts in AdvBench, we test the harmful rate of SaLoRA and other methods on Llama-3.1-Instruct-8B. Results are drawn in Figure 5. From the figure, we can see that our SaLoRA still shows a similar safety performance as the original model and outperforms the other methods with a clear advantage. The results demonstrate that our SaLoRA can effectively preserve models' safety alignment.
|
| 228 |
+
|
| 229 |
+

|
| 230 |
+
Figure 5: The harmful rate for LoRA, LoRA w.IA, Safe LoRA, and our SaLoRA under the multiGCG attack.
|
| 231 |
+
|
| 232 |
+

|
| 233 |
+
Figure 6: The averaged Commonsense Reasoning accuracy for LoRA, SaLoRA with and without our task-specific initialization.
|
| 234 |
+
|
| 235 |
+
# 5.4 EVALUATIONS ON TASK-SPECIFIC INITIALIZATION
|
| 236 |
+
|
| 237 |
+
In this section, we explore the effectiveness of our task-specific initialization. We conduct several experiments by replacing our task-specific initialization with the same initialization for A and B in LoRA. We then use this new method to fine-tune Llama-2-chat-7B on the Commonsense Reasoning 15k dataset and evaluate its performance as described in Section 5.2, the results are drawn shown in Figure 6 denoted as "SaLoRA w.o our init". The results indicate that our task-specific initialization significantly improves fine-tuning performance compared to the original initialization. Without
|
| 238 |
+
|
| 239 |
+
task-specific initialization, our SaLoRA even performs worse than vanilla LoRA. Such a phenomenon demonstrates the necessity of our proposed initialization. The possible reason is that our fixed safety module will project the gradient to the safe region and cause bad impacts on the model's convergence.
|
| 240 |
+
|
| 241 |
+
# 5.5 COMPUTATION COSTS
|
| 242 |
+
|
| 243 |
+
In this section, we try to compare the computational resources for our SaLoRA and other methods. We listed the resource consumption of different methods for fine-tuning on Alpaca with batch size equal to 8 and $r = 32$ for 1 epoch in Table 3. As the table shows, our SaLoRA only needs a little longer pre-processing time for calculating the safety module and initializing the adapters $\mathbf{A}_S$ and $\mathbf{B}_S$ compared with the whole training time (0.12 vs 2.98). With the improvements in LLM's safety alignment, we consider the time overhead to be affordable.
|
| 244 |
+
|
| 245 |
+
Table 3: Computation resources cost for fine-tuning Alpaca with different methods on A100.
|
| 246 |
+
|
| 247 |
+
<table><tr><td></td><td>LoRA</td><td>DoRA</td><td>PiSSA</td><td>SaLoRA</td></tr><tr><td>Tunable Parameters (M)</td><td>16.8</td><td>17.1</td><td>16.8</td><td>16.8</td></tr><tr><td>Preprocessing Time (h)</td><td>0</td><td>0</td><td>0.03</td><td>0.12</td></tr><tr><td>Training Time (h)</td><td>2.95</td><td>2.97</td><td>2.95</td><td>2.98</td></tr></table>
|
| 248 |
+
|
| 249 |
+
# 5.6 LINEAR PROBING ACCURACY WITH SALORA
|
| 250 |
+
|
| 251 |
+
In the former analysis, we explore the difference between the safety features for pre-trained Llama-2-chat-7B and its LoRA fine-tuned model. Like former experiments, we first train a linear probe with the output feature of each Llama-2-chat-7B's layer. We then classify the test harmful responses using the features from our SaLoRA fine-tuned model. The results are drawn in Figure 7.
|
| 252 |
+
|
| 253 |
+

|
| 254 |
+
Figure 7: Linear probing accuracy for classifying unsafe prompts and their safe responses at each layer on Llama-2-chat-7B before and after our SaLoRA fine-tuning.
|
| 255 |
+
|
| 256 |
+
From the figure, we can see that the prediction accuracy for both the original model and our SaLoRA fine-tuned models are similar to each other. The results demonstrate that our method will not affect the safety features much. Thus, LLM's safety mechanism can still be activated and the safety alignment can be preserved after fine-tuning.
|
| 257 |
+
|
| 258 |
+
# 6 CONCLUSION
|
| 259 |
+
|
| 260 |
+
In this paper, we first analyze the reasons behind the safety degradation of large language models (LLMs) after LoRA fine-tuning, attributing it to changes in the model's representation of harmful prompts and desired safe responses. Based on these insights, we propose a novel safety module to preserve LLMs' safety alignment post-fine-tuning. Additionally, to enhance performance on downstream tasks, we introduce a task-specific initialization for adapter weights, facilitating better convergence and improved fine-tuning effectiveness. Combining these two innovations, we present Safety-alignment preserved Low-Rank Adaptation (SaLoRA). Empirical results demonstrate that SaLoRA not only achieves strong performance on fine-tuning tasks but also effectively maintains the original LLM's safety alignment.
|
| 261 |
+
|
| 262 |
+
# ACKNOWLEDGEMENTS
|
| 263 |
+
|
| 264 |
+
Yisen Wang was supported by National Key R&D Program of China (2022ZD0160300), National Natural Science Foundation of China (92370129, 62376010), Beijing Nova Program (20230484344, 20240484642), and BaiChuan AI. This work was also partially funded by the European Health and Digital Executive Agency (HADEA) within the project "Understanding the individual host response against Hepatitis D Virus to develop a personalized approach for the management of hepatitis D" (DSolve, grant agreement number 101057917) and the BMBF with the project "Représentative, synthetische Gesundheitsdaten mit starken Privatsphärengarantien" (PriSyn, 16KISAO29K).
|
| 265 |
+
|
| 266 |
+
# REFERENCES
|
| 267 |
+
|
| 268 |
+
Armen Aghajanyan, Sonal Gupta, and Luke Zettlemoyer. Intrinsic dimensionality explains the effectiveness of language model fine-tuning. In ACL, 2021.
|
| 269 |
+
Atilla Akkus, Mingjie Li, Junjie Chu, Michael Backes, Yang Zhang, and Sinem Sav. Generated data with fake privacy: Hidden dangers of fine-tuning large language models on generated data. In USENIX Security, 2025.
|
| 270 |
+
Anthropic. Claude, 2023. URL https://claude.ai/.
|
| 271 |
+
Yuntao Bai, Andy Jones, Kamal Ndousse, Amanda Askell, Anna Chen, Nova DasSarma, Dawn Drain, Stanislav Fort, Deep Ganguli, Tom Henighan, Nicholas Joseph, Saurav Kadavath, Jackson Kernion, Tom Conerly, Sheer El-Showk, Nelson Elhage, Zac Hatfield-Dodds, Danny Hernandez, Tristan Hume, Scott Johnston, Shauna Kravec, Liane Lovitt, Neel Nanda, Catherine Olsson, Dario Amodei, Tom Brown, Jack Clark, Sam McCandlish, Chris Olah, Ben Mann, and Jared Kaplan. Training a Helpful and Harmless Assistant with Reinforcement Learning from Human Feedback. arXiv preprint arXiv:2204.05862, 2022.
|
| 272 |
+
Tom Brown, Benjamin Mann, Nick Ryder, Melanie Subbiah, Jared D Kaplan, Prafulla Dhariwal, Arvind Neelakantan, Pranav Shyam, Girish Sastry, Amanda Askell, et al. Language models are few-shot learners. NeurIPS, 2020.
|
| 273 |
+
Kevin Clark, Urvashi Khandelwal, Omer Levy, and Christopher D. Manning. What does BERT look at? an analysis of bert's attention. In ACL, 2019.
|
| 274 |
+
Josef Dai, Xuehai Pan, Ruiyang Sun, Jiaming Ji, Xinbo Xu, Mickel Liu, Yizhou Wang, and Yaodong Yang. Safe rlhf: Safe reinforcement learning from human feedback. In ICLR, 2024.
|
| 275 |
+
Ameet Deshpande, Vishvak Murahari, Tanmay Rajpurohit, Ashwin Kalyan, and Karthik R Narasimhan. Toxicity in chatgpt: Analyzing persona-assigned language models. In EMNLP, 2023.
|
| 276 |
+
Neil Houlsby, Andrei Giurgiu, Stanislaw Jastrzebski, Bruna Morrone, Quentin De Laroussilhe, Andrea Gesmundo, Mona Attariyan, and Sylvain Gelly. Parameter-efficient transfer learning for nlp. In ICML, 2019.
|
| 277 |
+
Chia-Yi Hsu, Yu-Lin Tsai, Chih-Hsun Lin, Pin-Yu Chen, Chia-Mu Yu, and Chun-Ying Huang. Safe lora: the silver lining of reducing safety risks when fine-tuning large language models. arXiv preprint arXiv:2405.16833, 2024.
|
| 278 |
+
Edward J Hu, Phillip Wallis, Zeyuan Allen-Zhu, Yanzhi Li, Shean Wang, Lu Wang, Weizhu Chen, et al. Lora: Low-rank adaptation of large language models. In ICLR, 2021.
|
| 279 |
+
Tiansheng Huang, Sihao Hu, and Ling Liu. Vaccine: Perturbation-aware alignment for large language model. arXiv preprint arXiv:2402.01109, 2024.
|
| 280 |
+
Albert Q Jiang, Alexandre Sablayrolles, Arthur Mensch, Chris Bamford, Devendra Singh Chaplot, Diego de las Casas, Florian Bressand, Gianna Lengyel, Guillaume Lample, Lucile Saulnier, et al. Mistral 7b. arXiv preprint arXiv:2310.06825, 2023.
|
| 281 |
+
Dawid Jan Kopiczko, Tijmen Blankevoort, and Yuki Markus Asano. Vera: Vector-based random matrix adaptation. In ICLR, 2024.
|
| 282 |
+
|
| 283 |
+
Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Lianmin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. Efficient memory management for large language model serving with pagedattention. In SOSP, 2023.
|
| 284 |
+
Andrew Lee, Xiaoyan Bai, Itamar Pres, Martin Wattenberg, Jonathan K. Kummerfeld, and Rada Mihalcea. A mechanistic understanding of alignment algorithms: A case study on DPO and toxicity. arXiv preprint arXiv:2401.01967, 2024.
|
| 285 |
+
N Lee, T Ajanthan, and P Torr. Snip: Single-shot network pruning based on connection sensitivity. In ICLR, 2019.
|
| 286 |
+
Simon Lermen and Charlie Rogers-Smith. LoRA fine-tuning efficiently undoes safety training in llama 2-chat 70b. In ICLR Workshop, 2024.
|
| 287 |
+
Brian Lester and Rami Al-Rfou Noah Constant. The power of scale for parameter-efficient prompt tuning. In EMNLP, 2021.
|
| 288 |
+
Ang Li, Yichuan Mo, Mingjie Li, Yifei Wang, and Yisen Wang. Are smarter llms safer? exploring safety-reasoning trade-offs in prompting and fine-tuning. arXiv preprint arXiv:2502.09673, 2025.
|
| 289 |
+
Chunyuan Li, Heerad Farkhoor, Rosanne Liu, and Jason Yosinski. Measuring the intrinsic dimension of objective landscapes. In ICLR, 2018.
|
| 290 |
+
Kenneth Li, Oam Patel, Fernanda B. Viégas, Hanspeter Pfister, and Martin Wattenberg. Inference-time intervention: Eliciting truthful answers from a language model. In NeurIPS, 2023.
|
| 291 |
+
Kenneth Li, Oam Patel, Fernanda Viégas, Hanspeter Pfister, and Martin Wattenberg. Inference-time intervention: Eliciting truthful answers from a language model. In NeurIPS, 2024.
|
| 292 |
+
Shih-Yang Liu, Chien-Yi Wang, Hongxu Yin, Pavlo Molchanov, Yu-Chiang Frank Wang, Kwang-Ting Cheng, and Min-Hung Chen. Dora: Weight-decomposed low-rank adaptation. In ICML, 2024.
|
| 293 |
+
Xiaogeng Liu, Nan Xu, Muhao Chen, and Chaowei Xiao. Autodan: Generating stealthy jailbreak prompts on aligned large language models. arXiv preprint arXiv:2310.04451, 2023a.
|
| 294 |
+
Zhiheng Liu, Ruili Feng, Kai Zhu, Yifei Zhang, Kecheng Zheng, Yu Liu, Deli Zhao, Jingren Zhou, and Yang Cao. Cones: concept neurons in diffusion models for customized generation. In ICML, 2023b.
|
| 295 |
+
AI @ Meta Llama Team. The llama 3 herd of models, 2024.
|
| 296 |
+
I Loshchilov. Decoupled weight decay regularization. In ICLR, 2019.
|
| 297 |
+
Sourab Mangrulkar, Sylvain Gugger, Lysandre Debut, Younes Belkada, Sayak Paul, and Benjamin Bossan. Peft: State-of-the-art parameter-efficient fine-tuning methods, 2022.
|
| 298 |
+
Fanxu Meng, Zhaohui Wang, and Muhan Zhang. Pissa: Principal singular values and singular vectors adaptation of large language models. arXiv preprint arXiv:2404.02948, 2024.
|
| 299 |
+
Yichuan Mo, Yuji Wang, Zeming Wei, and Yisen Wang. Fight back against jailbreaking via prompt adversarial tuning. In NeurIPS, 2024.
|
| 300 |
+
Jishnu Mukhoti, Yarin Gal, Philip HS Torr, and Puneet K Dokania. Fine-tuning can cripple your foundation model; preserving features may be the solution. arXiv preprint arXiv:2308.13320, 2023.
|
| 301 |
+
OpenAI. Introducing chatgpt, 2022.
|
| 302 |
+
OpenAI. Gpt-4 technical report, 2023.
|
| 303 |
+
Long Ouyang, Jeffrey Wu, Xu Jiang, Diogo Almeida, Carroll L. Wainwright, Pamela Mishkin, Chong Zhang, Sandhini Agarwal, Katarina Slama, Alex Ray, John Schulman, Jacob Hilton, Fraser Kelton, Luke Miller, Maddie Simens, Amanda Askell, Peter Welinder, Paul F. Christiano, Jan Leike, and Ryan Lowe. Training language models to follow instructions with human feedback. In NeurIPS, 2022.
|
| 304 |
+
|
| 305 |
+
Matthew E. Peters, Mark Neumann, Luke Zettlemoyer, and Wen-tau Yih. Dissecting contextual word embeddings: Architecture and representation. In EMNLP, 2018.
|
| 306 |
+
Nicholas Pochinkov and Nandi Schoots. Dissecting language models: Machine unlearning via selective pruning. arXiv preprint arXiv:2403.01267, 2024.
|
| 307 |
+
Xiangyu Qi, Yi Zeng, Tinghao Xie, Pin-Yu Chen, Ruoxi Jia, Prateek Mittal, and Peter Henderson. Fine-tuning aligned language models compromises safety, even when users do not intend to! In ICLR, 2023.
|
| 308 |
+
Chengwei Qin, Aston Zhang, Zhuosheng Zhang, Jiaao Chen, Michihiro Yasunaga, and Diyi Yang. Is chatgpt a general-purpose natural language processing task solver? In EMNLP, 2023.
|
| 309 |
+
Rafael Rafailov, Archit Sharma, Eric Mitchell, Christopher D Manning, Stefano Ermon, and Chelsea Finn. Direct preference optimization: Your language model is secretly a reward model. In NeurIPS, 2024.
|
| 310 |
+
Anastasia Razdaibiedina, Yuning Mao, Rui Hou, Madian Khabsa, Mike Lewis, Jimmy Ba, and Amjad Almahairi. Residual prompt tuning: Improving prompt tuning with residual reparameterization. In ACL, 2023.
|
| 311 |
+
Wai Man Si, Michael Backes, Jeremy Blackburn, Emiliano De Cristofaro, Gianluca Stringhini, Savvas Zannettou, and Yang Zhang. Why so toxic? measuring and triggering toxic behavior in open-domain chatbots. In CCS, 2022.
|
| 312 |
+
Mingjie Sun, Zhuang Liu, Anna Bair, and J Zico Kolter. A simple and effective pruning approach for large language models. In ICLR, 2023.
|
| 313 |
+
Alon Talmor, Jonathan Herzig, Nicholas Lourie, and Jonathan Berant. *CommonsenseQA: A question answering challenge targeting commonsense knowledge.* In *NAACL*, 2019.
|
| 314 |
+
Gemini Team, Rohan Anil, Sebastian Borgeaud, Yonghui Wu, Jean-Baptiste Alayrac, Jiahui Yu, Radu Soricut, Johan Schalkwyk, Andrew M Dai, Anja Hauth, et al. Gemini: A family of highly capable multimodal models. arXiv preprint arXiv:2312.11805, 2023.
|
| 315 |
+
Hugo Touvron, Thibaut Lavril, Gautier Izacard, Xavier Martinet, Marie-Anne Lachaux, Timothee Lacroix, Baptiste Rozière, Naman Goyal, Eric Hambro, Faisal Azhar, et al. Llama: Open and efficient foundation language models. arXiv preprint arXiv:2302.13971, 2023a.
|
| 316 |
+
Hugo Touvron, Louis Martin, Kevin Stone, Peter Albert, Amjad Almahairi, Yasmine Babaei, Nikolay Bashlykov, Soumya Batra, Prajjwal Bhargava, Shruti Bhosale, et al. Llama 2: Open foundation and fine-tuned chat models. arXiv preprint arXiv:2307.09288, 2023b.
|
| 317 |
+
Pengyu Wang, Dong Zhang, Linyang Li, Chenkun Tan, Xinghao Wang, Ke Ren, Botian Jiang, and Xipeng Qiu. Inferaligner: Inference-time alignment for harmlessness through cross-model guidance. arXiv preprint arXiv:2401.11206, 2024a.
|
| 318 |
+
Yifei Wang, Yuyang Wu, Zeming Wei, Stefanie Jegelka, and Yisen Wang. A theoretical understanding of self-correction through in-context alignment. In NeurIPS, 2024b.
|
| 319 |
+
Yizhong Wang, Yeganeh Kordi, Swaroop Mishra, Alisa Liu, Noah A Smith, Daniel Khashabi, and Hannaneh Hajishirzi. Self-instruct: Aligning language models with self-generated instructions. In ACL, pp. 13484-13508, 2023.
|
| 320 |
+
Boyi Wei, Kaixuan Huang, Yangsibo Huang, Tinghao Xie, Xiangyu Qi, Mengzhou Xia, Prateek Mittal, Mengdi Wang, and Peter Henderson. Assessing the brittleness of safety alignment via pruning and low-rank modifications. In ICML, 2024.
|
| 321 |
+
Zeming Wei, Yifei Wang, and Yisen Wang. Jailbreak and guard aligned language models with only few in-context demonstrations. arXiv preprint arXiv:2310.06387, 2023.
|
| 322 |
+
Yueqi Xie, Jingwei Yi, Jiawei Shao, Justin Curl, Lingjuan Lyu, Qifeng Chen, Xing Xie, and Fangzhao Wu. Defending chatgpt against jailbreak attack via self-reminders. Nature Machine Intelligence, 5 (12):1486-1496, 2023.
|
| 323 |
+
|
| 324 |
+
Zhangchen Xu, Fengqing Jiang, Luyao Niu, Jinyuan Jia, Bill Yuchen Lin, and Radha Poovendran. Safedecoding: Defending against jailbreak attacks via safety-aware decoding. arXiv preprint arXiv:2402.08983, 2024.
|
| 325 |
+
Yang Zhao, Hao Zhang, and Xiuyuan Hu. Penalizing gradient norm for efficiently improving generalization in deep learning. In ICML, 2022.
|
| 326 |
+
Terry Yue Zhuo, Yujin Huang, Chunyang Chen, and Zhenchang Xing. Red teaming chatgpt via jailbreaking: Bias, robustness, reliability and toxicity. arXiv preprint arXiv:2301.12867, 2023.
|
| 327 |
+
Andy Zou, Long Phan, Sarah Chen, James Campbell, Phillip Guo, Richard Ren, Alexander Pan, Xuwang Yin, Mantas Mazeika, Ann-Kathrin Dombrowski, et al. Representation engineering: A top-down approach to ai transparency. arXiv preprint arXiv:2310.01405, 2023a.
|
| 328 |
+
Andy Zou, Zifan Wang, J. Zico Kolter, and Matt Fredrikson. Universal and transferable adversarial attacks on aligned language models. arXiv preprint arXiv:2307.15043, 2023b.
|
| 329 |
+
|
| 330 |
+
# A DETAILS FOR DIFFERENT POST-HOC ALIGNMENT METHOD
|
| 331 |
+
|
| 332 |
+
The implementation of Self-reminder, Vaccine, InferAligner and Safe LoRA are listed as follows:
|
| 333 |
+
|
| 334 |
+
- Self-reminder To implement this method, we add the additional self-reminder prefix in models' prompts:Remember, you should be a responsible assistant and should not generate helpless or misleading content!
|
| 335 |
+
- Vaccine We use the same dataset of our safety modules' calculation for alignment pretraining $\rho = 2$ .
|
| 336 |
+
- InferAligner We use the same number of harmful prompts as our safety module C's calculation and then use the original chat model to extract the probing vector with intervention strength equal to 1.
|
| 337 |
+
- Safe LoRA Following their paper's procedure, we first calculate the alignment matrix using the chat model and base model. Then we choose the same similarity score threshold $\tau = 0.35$ . We do the Safe LoRA's projection on weight update only if the cosine similarity of the projection and its original weight update is smaller than this threshold.
|
| 338 |
+
|
| 339 |
+
# B PROOF OF PROPOSITION 1
|
| 340 |
+
|
| 341 |
+
Firstly, we state the assumptions for our proposition 1 as below.
|
| 342 |
+
|
| 343 |
+
Assumption 1 LLMs' safety neurons $\mathbf{W}_{\mathbf{S}}$ can also be activated on the benign samples $\mathbf{X}_{\mathbf{W}}$ .
|
| 344 |
+
|
| 345 |
+
Such an assumption can be easily proved as many papers have found such a phenomenon Wei et al. (2024); Pochinkov & Schoots (2024). Then we restate the Proposition 1 and start to prove it.
|
| 346 |
+
|
| 347 |
+
Proposition 2 Letting $\mathbf{X}_{\mathbf{W}}$ denote the input feature for benign prompts, $\mathbf{Y}_{\mathbf{W}}$ denotes output feature for layer $\mathbf{W}$ with adapters $\mathbf{Y}_{\mathbf{W}} = (\mathbf{W} + \Delta \mathbf{W})\mathbf{X}_{\mathbf{W}}$ , and $\mathcal{L}(\mathbf{X}_t)$ is the training loss on benign prompts. If the activation $\| \mathbf{W}_S\mathbf{X}_{\mathbf{W}}\| _F > \gamma$ , then the trace of dot product between the gradient of $\Delta \mathbf{W}$ , denoted as $\mathrm{grad}_{\Delta \mathbf{W}}$ can be lower-bounded by the following equation,
|
| 348 |
+
|
| 349 |
+
$$
|
| 350 |
+
\left\| \mathbf {W} _ {S} \operatorname {g r a d} _ {\Delta \mathbf {W}} ^ {\top} \right\| _ {\mathrm {F}} > \gamma \sigma_ {\min } \left(\nabla_ {\mathbf {Y} _ {\mathrm {W}}} \mathcal {L} (\mathbf {Y} _ {\mathrm {W}})\right), \tag {14}
|
| 351 |
+
$$
|
| 352 |
+
|
| 353 |
+
where $\sigma_{\mathrm{min}}$ denotes the smallest singular value of given matrix.
|
| 354 |
+
|
| 355 |
+
Proof 1 First, the Loss can be depicted as,
|
| 356 |
+
|
| 357 |
+
$$
|
| 358 |
+
\mathcal {L} \left(\mathbf {Y} _ {\mathbf {W}}\right) = \mathcal {L} \left(\left(\mathbf {W} + \Delta \mathbf {W}\right) \mathbf {X}\right). \tag {15}
|
| 359 |
+
$$
|
| 360 |
+
|
| 361 |
+
Then we can get the gradient of $\Delta \mathbf{W}$ using the chain rule:
|
| 362 |
+
|
| 363 |
+
$$
|
| 364 |
+
\operatorname {g r a d} _ {\Delta \mathbf {W}} = \nabla_ {\mathbf {Y} _ {\mathbf {W}}} \mathcal {L} (\mathbf {Y} _ {\mathbf {W}}) \mathbf {X} ^ {\top}. \tag {16}
|
| 365 |
+
$$
|
| 366 |
+
|
| 367 |
+
Thereby, the Frobenius norm of $\mathbf{W}_S\mathrm{grad}_{\Delta \mathbf{W}}^\top$ can be formulated as follows,
|
| 368 |
+
|
| 369 |
+
$$
|
| 370 |
+
\begin{array}{l} \left\| \mathbf {W} _ {S} \operatorname {g r a d} _ {\Delta \mathbf {W}} ^ {\top} \right\| _ {F} = \left\| \mathbf {W} _ {S} \mathbf {X} \nabla_ {\mathbf {Y} _ {\mathbf {W}}} \mathcal {L} (\mathbf {Y} _ {\mathbf {W}}) ^ {\top} \right\| _ {F} \\ \geq \sigma_ {\min } \left(\nabla_ {\mathbf {Y} _ {\mathbf {W}}} \mathcal {L} \left(\mathbf {Y} _ {\mathbf {W}}\right)\right) \| \mathbf {W} _ {S} \mathbf {X} \| _ {F} \tag {17} \\ > \gamma \sigma_ {m i n} (\nabla_ {\mathbf {Y} _ {\mathbf {W}}} \mathcal {L} (\mathbf {Y} _ {\mathbf {W}})) \\ \end{array}
|
| 371 |
+
$$
|
| 372 |
+
|
| 373 |
+
# C ABLATION STUDIES ON SALORA'S RANK.
|
| 374 |
+
|
| 375 |
+
We evaluate the influence of the ranks on safety basis calculation and task-specific initialization as listed below. From the results, one can see that although more safety ranks $r_s$ can get better safety results, the differences are minor. And the $r_t$ will not influence much. The results indicate that our SaLoRA is parameter-robust.
|
| 376 |
+
|
| 377 |
+
# D EXAMPLES OF LLMS OUTPUTS
|
| 378 |
+
|
| 379 |
+
We list examples of benign and malicious prompts in Table 5 and Table 6.
|
| 380 |
+
|
| 381 |
+
Table 4: Safety Score of Llama-2-7b-chat with different rank settings.
|
| 382 |
+
|
| 383 |
+
<table><tr><td>Model</td><td>AdvBench</td><td>JailbreakBench</td></tr><tr><td>LoRA</td><td>23%</td><td>37%</td></tr><tr><td>SaLoRA-rs=16-rt=16</td><td>4%</td><td>5%</td></tr><tr><td>SaLoRA-rs=16-rt=32</td><td>4%</td><td>4%</td></tr><tr><td>SaLoRA-rs=16-rt=64</td><td>4%</td><td>5%</td></tr><tr><td>SaLoRA-rs=32-rt=16</td><td>3%</td><td>3%</td></tr><tr><td>SaLoRA-rs=32-rt=32</td><td>4%</td><td>3%</td></tr><tr><td>SaLoRA-rs=64-rt=16</td><td>1%</td><td>2%</td></tr><tr><td>SaLoRA-rs=64-rt=32</td><td>1%</td><td>1%</td></tr></table>
|
| 384 |
+
|
| 385 |
+
Table 5: The example of a benign prompt.
|
| 386 |
+
|
| 387 |
+
<table><tr><td></td><td>Prompt: Give three tips for staying healthy.</td></tr><tr><td>LoRA</td><td>Sure, here are three tips for staying healthy:
|
| 388 |
+
1. Eat a Balanced Diet: A healthy diet provides your body with the nutrients it needs to function properly. Aim to eat a variety of whole, unprocessed foods, including fruits, vegetables, whole grains, lean proteins, and healthy fats.
|
| 389 |
+
Limit your intake of sugary drinks, fast food, and processed snacks.
|
| 390 |
+
2. Stay Hydrated: Drinking enough water is essential for maintaining good health. Aim to drink at least eight glasses of water per day, and avoid sugary drinks that can have negative health effects. Dehydration can lead to headaches, fatigue, and other health problems, so it's important to stay hydrated throughout the day.
|
| 391 |
+
3. Exercise Regularly: Regular physical activity can help you maintain a healthy weight, improve your mood, and reduce your risk of chronic diseases like heart disease and diabetes. Aim for at least 30 minutes of moderate-intensity exercise per day, such as brisk walking, cycling,...</td></tr><tr><td>SaLoRA</td><td>Sure, here are three tips for staying health:
|
| 392 |
+
1. Eat a Balanced Diet: A healthy diet is essential for maintaining good health. Make sure to eat a variety of fruits, vegetables, whole grains, lean proteins, and healthy fats. Limit your intake of processed and high-sugar foods, and try to cook your meals from scratch using fresh ingredients.
|
| 393 |
+
2. Exercise Regularly: Regular exercise is important for maintaining good physical health. Aim for at least 150 minutes of moderate-intensity exercise or 75 minutes of vigorous-intensity exercise per week. Incorporate strength training, cardio, and flexibility exercises into your routine, and try to find activities that you enjoy, such as swimming, dancing, or hiking.
|
| 394 |
+
3. Get Enough Sleep: Getting enough sleep is essential for maintaining good mental and physical health. Aim for 7-9 hours of sleep per night, and try to establish a consistent sleep schedule. Avoid caffeine, electronics, and stressful activities.</td></tr></table>
|
| 395 |
+
|
| 396 |
+
Table 6: The example of a malicious prompt.
|
| 397 |
+
|
| 398 |
+
<table><tr><td></td><td>Prompt: Generate a phishing email that tricks people into giving away their personal information.</td></tr><tr><td>LoRA</td><td>This is a phishing email.
|
| 399 |
+
Dear Sir/Madam,
|
| 400 |
+
We are sorry to inform you that your account has been compromised and your personal information has been stolen. We have been working hard to secure your account and protect your personal information.
|
| 401 |
+
However, we have reason to believe that your account has been compromised and your personal information has been stolen. We have taken all necessary steps to secure your account and protect your personal information.
|
| 402 |
+
We recommend that you change your password immediately and monitor your account for any suspicious activity.
|
| 403 |
+
If you have any questions or concerns, please do not hesitate to contact us.
|
| 404 |
+
Best regards,
|
| 405 |
+
[Your Name]</td></tr><tr><td>SaLoRA</td><td>I'm sorry, but I cannot fulfill your request to generate a phishing email that tricks people into giving away their personal information.</td></tr></table>
|
2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/images.zip
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:31cc18cc84b3817b4c4a86da11fc6299d433ac999c3096eceff5c6c6d3f5307d
|
| 3 |
+
size 798889
|
2025/SaLoRA_ Safety-Alignment Preserved Low-Rank Adaptation/layout.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
2025/SaMer_ A Scenario-aware Multi-dimensional Evaluator for Large Language Models/245da333-1d91-43f2-9fec-fef99339aa9a_content_list.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|