{"about":{"site":"https://codewithpapers.app","non_affiliation":"Code with Papers and Syntology are not affiliated with, endorsed by, or sponsored by Papers with Code, Meta, or the pwc-archive mirror.","licence":"CC BY-SA 4.0","licence_url":"https://creativecommons.org/licenses/by-sa/4.0/legalcode","attribution":"https://codewithpapers.app/attribution","modified":"archive material modified by Syntology; see the attribution page"},"url":"/paper/arxiv-2604-17789","title":"DuQuant++: Fine-grained Rotation Enhances Microscaling FP4 Quantization","arxiv_id":"2604.17789","date":"2026-04-20","proceeding":null,"authors":["Haokun Lin","Xinle Jia","Haobo Xu","Bingchen Yao","Xianglong Guo","Yichen Wu","Zhichao Lu","Ying Wei","Qingfu Zhang","Zhenan Sun"],"abstract":"The MXFP4 microscaling format, which partitions tensors into blocks of 32 elements sharing an E8M0 scaling factor, has emerged as a promising substrate for efficient LLM inference, backed by native hardware support on NVIDIA Blackwell Tensor Cores. However, activation outliers pose a unique challenge under this format: a single outlier inflates the shared block scale, compressing the effective dynamic range of the remaining elements and causing significant quantization error. Existing rotation-based remedies, including randomized Hadamard and learnable rotations, are data-agnostic and therefore unable to specifically target the channels where outliers concentrate. We propose DuQuant++, which adapts the outlier-aware fine-grained rotation of DuQuant to the MXFP4 format by aligning the rotation block size with the microscaling group size (B{=}32). Because each MXFP4 group possesses an independent scaling factor, the cross-block variance issue that necessitates dual rotations and a zigzag permutation in the original DuQuant becomes irrelevant, enabling DuQuant++ to replace the entire pipeline with a single outlier-aware rotation, which halves the online rotation cost while simultaneously smoothing the weight distribution. Extensive experiments on the LLaMA-3 family under MXFP4 W4A4 quantization show that DuQuant++ consistently achieves state-of-the-art performance. Our code is available at https://github.com/Hsu1023/DuQuant-v2.","url_abs":"https://arxiv.org/abs/2604.17789","url_pdf":"https://arxiv.org/pdf/2604.17789","source":{"archive":null,"snapshot":"2025-07-28","note":"not in the Papers with Code archive (frozen at the snapshot)","row_kind":"graph","title_abstract_authors_date":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)"},"code_links":[],"tasks":[],"methods":[],"datasets_introduced":[],"methods_introduced":[],"results":[],"syntology":{"atlas_url":"https://app.syntology.ai/?focus=2604.17789","mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2604.17789"}},"developers":"https://syntology.ai/developers","read_at":"2026-09-24T18:15:14+00:00","read_at_is":"when the build read Syntology's graph, not when any sample ran","claim":"Per-sample execution status on synthesized fixtures; not a correctness claim about the paper. Samples come from repositories linked to the paper, official or community; repo_kind says which.","repos":[{"mentioned_in_github":null,"is_official":null,"provenance":"deterministic:regex_extraction","mentioned_in_paper":null,"url":"https://github.com/Hsu1023/DuQuant-v2","reach":null}],"summary":{"ran":3,"ran_fixture":1,"ran_draft_wrong":10,"unverified":16},"by_repo_kind":{"found_in_text":{"samples":29,"ran":13,"repositories":1}},"repo_kind_vocabulary":{"official":"The archive marks this repository official for the paper","named_in_paper":"The archive records that the paper mentions this repository; it is not marked official","listed":"In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper","found_in_text":"Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted","community":"Not in the archive's code links for this paper; a community repository Syntology harvested"},"n_pointer_only_for_licence":1,"samples":[{"code_sha256_prefix":"22dc933e4384b25f","entry":"DuLlamaRMSNorm","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"22dc933e4384b25f"}},{"code_sha256_prefix":"b21c5b036d520461","entry":"TruncateFunction","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"b21c5b036d520461"}},{"code_sha256_prefix":"f17b50bd007e4e7d","entry":"UniformAffineQuantizer","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran","verification_level":1,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f17b50bd007e4e7d"}},{"code_sha256_prefix":"747c84caa92a3ba4","entry":"cast_to_eBm0_improved","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_fixture","verification_level":1,"contract_check":"RAISES","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"747c84caa92a3ba4"}},{"code_sha256_prefix":"afcafddea4afcd55","entry":"cast_to_fp4","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"afcafddea4afcd55"}},{"code_sha256_prefix":"deec9d75f4b616b2","entry":"dequantize_fp4","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"deec9d75f4b616b2"}},{"code_sha256_prefix":"c44bc2a3237345b4","entry":"duquant_state_dict","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c44bc2a3237345b4"}},{"code_sha256_prefix":"c31487ba3c802876","entry":"get_post_parameters","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"c31487ba3c802876"}},{"code_sha256_prefix":"7dd7f74b3600a4f5","entry":"let_parameters","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"7dd7f74b3600a4f5"}},{"code_sha256_prefix":"dc52888f6a74bba1","entry":"lwc_parameters","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"dc52888f6a74bba1"}},{"code_sha256_prefix":"6f32d6d7941324be","entry":"quantize_dequantize_fp4","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6f32d6d7941324be"}},{"code_sha256_prefix":"5ce0befa6e109811","entry":"quantize_fp4","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":true,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"5ce0befa6e109811"}},{"code_sha256_prefix":"607bee1a0f21cd6d","entry":"smooth_parameters","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"OUTPUT_MISDECLARED","metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"607bee1a0f21cd6d"}},{"code_sha256_prefix":"94587954e392b665","entry":"truncate_number","repo":null,"repo_kind":null,"path":null,"file_url":null,"link_basis":"identical_code_first_harvested_elsewhere","language":"python","status":"ran_draft_wrong","verification_level":1,"contract_check":"MISDECLARED","metamorphic_tier":"invariant","behaviour_fingerprint":true,"licence":null,"inline_ok":false,"mcp_get_code":{"code_sha256":"94587954e392b665"}},{"code_sha256_prefix":"20e6a8d6947c04ab","entry":"QuantLinear","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"20e6a8d6947c04ab"}},{"code_sha256_prefix":"77859dd6c404b9c2","entry":"QuantLlamaAttention","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"77859dd6c404b9c2"}},{"code_sha256_prefix":"cbcd07e2ca5a3ba7","entry":"QuantLlamaDecoderLayer","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cbcd07e2ca5a3ba7"}},{"code_sha256_prefix":"bf4e088584597d5c","entry":"QuantLlamaMLP","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"bf4e088584597d5c"}},{"code_sha256_prefix":"e0d9150534aba495","entry":"clear_temp_variable","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"e0d9150534aba495"}},{"code_sha256_prefix":"41112d78927836b9","entry":"duquant","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"41112d78927836b9"}},{"code_sha256_prefix":"daa33f9a814e8fd2","entry":"post_quant_inplace","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"daa33f9a814e8fd2"}},{"code_sha256_prefix":"cd822d05aa1f374d","entry":"post_rotate_quant_temporary","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"cd822d05aa1f374d"}},{"code_sha256_prefix":"f3a915217e460b33","entry":"quant_inplace","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"f3a915217e460b33"}},{"code_sha256_prefix":"8e21c7c7a2bc9bcd","entry":"register_scales_and_zeros","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"8e21c7c7a2bc9bcd"}},{"code_sha256_prefix":"6fc5c56d4380275e","entry":"set_init_duquant_params_state","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6fc5c56d4380275e"}},{"code_sha256_prefix":"734fba19235f83c0","entry":"set_quant_state","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"734fba19235f83c0"}},{"code_sha256_prefix":"3060585a5fbe76af","entry":"set_registered_x_none","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"3060585a5fbe76af"}},{"code_sha256_prefix":"6f1be3b48ab8af2f","entry":"set_requires_grad","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"6f1be3b48ab8af2f"}},{"code_sha256_prefix":"da4ceec866898e3a","entry":"smooth_and_let_inplace","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"da4ceec866898e3a"}},{"code_sha256_prefix":"eb88d162cd0854f5","entry":"smooth_and_quant_temporary","repo":"Hsu1023/DuQuant-v2","repo_kind":"found_in_text","path":"quantize/duquant.py","file_url":"https://github.com/Hsu1023/DuQuant-v2/blob/HEAD/quantize/duquant.py","link_basis":"first_harvest_node","language":"python","status":"unverified","verification_level":0,"contract_check":null,"metamorphic_tier":null,"behaviour_fingerprint":false,"licence":"MIT","inline_ok":true,"mcp_get_code":{"code_sha256":"eb88d162cd0854f5"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.CL","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}