{"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-2605-18933","title":"A Geometric Analysis of Sign-Magnitude Asymmetry in a ReLU + RMSNorm Block under Ternary Quantization","arxiv_id":"2605.18933","date":"2026-05-18","proceeding":null,"authors":["Lei Dong"],"abstract":"Pre-norm Transformers with RMSNorm tolerate ternary {-1,0,+1} weight quantization with surprisingly small loss (Ma et al., 2024). We give a geometric explanation via sign-magnitude decomposition of weight perturbations. In a two-layer ReLU + RMSNorm model with i.i.d. Gaussian weights, sign-flips produce $π/(π-2) \\approx 2.75$ times more transverse output energy than sign-preserving magnitude perturbations of equal Frobenius norm, as the flip rate $p \\to 0$ (Theorem 3). The mechanism: ReLU creates a hidden-space directional asymmetry between the two perturbation types, which RMSNorm's transverse-projection Fréchet derivative selectively exposes. Sign-quantization error is itself a sign-preserving perturbation with angular alignment $\\cos^2 \\to 2/π$ (Theorem 4); its post-ReLU radial fraction ($0.365$) matches the pre-ReLU value $1-2/π$ within $0.4\\%$, so ReLU is approximately transparent to ternary error. Multi-layer compounding of the $2.75\\times$ factor is not experimentally supported; the gap to real-model sign sensitivity arises from outlier features violating delocalization. For an input dimension with amplitude $α$, a single sign-flip produces post-ReLU energy amplified by $R \\approx nα^2$ relative to a delocalized entry. On TinyLlama-1.1B, at linear response ($p \\leq 0.5\\%$), count-matched NLL leverage stabilizes at $\\sim 10\\times \\approx n\\mathbb{E}[α^2]$, matching the per-entry theory; the all-column NLL ratio of $5.0\\times$ falls within $R_{\\mathrm{col}} \\leq 19$ ($67\\times$ PPL gap reflects metric nonlinearity). Measured outlier $α$ at layer 12 (median $0.024$, max $0.26$) confirms heavy-tailed concentration. The Bussgang constant $2/π$, RMSNorm geometry, and ReLU half-space structure together explain sign-magnitude asymmetry in pre-norm models, with $R \\propto nα^2$ accounting for real-model deviations.","url_abs":"https://arxiv.org/abs/2605.18933","url_pdf":"https://arxiv.org/pdf/2605.18933","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":null,"mcp":{"get_harvested_code_for_paper":{"arxiv_id":"2605.18933"}},"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/donglei628/sign-magnitude-pre-norm","reach":null}],"summary":{"ran":15,"unverified":4},"by_repo_kind":{"found_in_text":{"samples":19,"ran":15,"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":0,"samples":[{"code_sha256_prefix":"9b96d89c732cb3af","entry":"c_theory","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/verify_theorem3.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/verify_theorem3.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":"9b96d89c732cb3af"}},{"code_sha256_prefix":"c11618d04e506835","entry":"c_theory","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"figures/plot_theorem3.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/figures/plot_theorem3.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":"c11618d04e506835"}},{"code_sha256_prefix":"e31e075089fb7349","entry":"compute_stats","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/exp5_multilayer_toy.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/exp5_multilayer_toy.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":"e31e075089fb7349"}},{"code_sha256_prefix":"e1546806333b4018","entry":"compute_stats","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/exp5_trained_weights.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/exp5_trained_weights.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":"e1546806333b4018"}},{"code_sha256_prefix":"aa5f1ef94374f662","entry":"compute_stats","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/verify_theorem3.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/verify_theorem3.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":"aa5f1ef94374f662"}},{"code_sha256_prefix":"5fec7274c7f22bcc","entry":"get_activation_fn","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/exp5_multilayer_toy.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/exp5_multilayer_toy.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":"5fec7274c7f22bcc"}},{"code_sha256_prefix":"d1ef356d1d206cff","entry":"get_linear_layers","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/dn_outlier.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/dn_outlier.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":"d1ef356d1d206cff"}},{"code_sha256_prefix":"bcc415f45b6d945e","entry":"load_multilayer_data","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"figures/plot_multilayer.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/figures/plot_multilayer.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":"bcc415f45b6d945e"}},{"code_sha256_prefix":"490bea4818f080cc","entry":"load_trained_data","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"figures/plot_multilayer.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/figures/plot_multilayer.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":"490bea4818f080cc"}},{"code_sha256_prefix":"7662426d80eb3e6d","entry":"make_independent_mag_perturbation","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/verify_proposition1.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/verify_proposition1.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":"7662426d80eb3e6d"}},{"code_sha256_prefix":"e93f530e8da8fbaf","entry":"make_sign_perturbation","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/exp5_trained_weights.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/exp5_trained_weights.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":"e93f530e8da8fbaf"}},{"code_sha256_prefix":"596414b45c03dcc9","entry":"make_sign_perturbation","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/verify_proposition1.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/verify_proposition1.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":"596414b45c03dcc9"}},{"code_sha256_prefix":"91b129a974e8046b","entry":"measure_row_cos2","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/verify_theorem4.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/verify_theorem4.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":"91b129a974e8046b"}},{"code_sha256_prefix":"6591234932f35f45","entry":"measure_vector_cos2","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/verify_theorem4.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/verify_theorem4.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":"6591234932f35f45"}},{"code_sha256_prefix":"6bd3e54f06121c07","entry":"sample_sphere","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/exp5_multilayer_toy.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/exp5_multilayer_toy.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":"6bd3e54f06121c07"}},{"code_sha256_prefix":"da3a837e5baf47c9","entry":"collect_activation_stats","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/dn_outlier.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/dn_outlier.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":"da3a837e5baf47c9"}},{"code_sha256_prefix":"7edbc98433bb3a0d","entry":"evaluate_ppl","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/dn_outlier.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/dn_outlier.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":"7edbc98433bb3a0d"}},{"code_sha256_prefix":"364061df24326431","entry":"measure_alpha_all_dims","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/column_flip_verify.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/column_flip_verify.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":"364061df24326431"}},{"code_sha256_prefix":"1e486d651f88f1bd","entry":"measure_column_perturbation_energy","repo":"donglei628/sign-magnitude-pre-norm","repo_kind":"found_in_text","path":"experiments/activation_level_verify.py","file_url":"https://github.com/donglei628/sign-magnitude-pre-norm/blob/HEAD/experiments/activation_level_verify.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":"1e486d651f88f1bd"}}]},"arxiv_metadata":{"licence":"arXiv metadata, CC0 1.0 (https://info.arxiv.org/help/license)","fields":["title","abstract","authors","date"],"primary_category":"cs.LG","source":"arxiv_2026.jsonl"},"syntology_extracted_results":null}