arXiv:2611.02052cs.LGNov 2026

Manuscript Offprint

arXiv:2611.02052

Same Function, Different Gradients: Evaluating Gradient Reliability under Reparameterization

Bum Jun Kim

ABSTRACT

Gradients are no longer used only to train models: Gradient magnitudes are now measurement instruments, used to rank attention heads for pruning, to decide per-example clipping in private training, to allocate adapter rank budgets, and to debug models. Across these workflows, larger gradient magnitudes are taken to mean greater importance. Even for a fixed input–output function, these gradients are computed in one of many possible parameter coordinate systems. For example, attention scores depend on the query and key projections only through the paired product WQWK⊤W_Q W_K^\top. Scaling a head's query projection by cc and the corresponding key projection by 1/c1/c therefore leaves every output logit unchanged. This change in parameter coordinates rescales the corresponding query and key gradient norms by 1/c1/c and cc, respectively. To test whether gradient-based decisions remain unchanged under these coordinate changes, we introduce Gradient Reliability under Reparameterization (GRR). GRR rewrites a trained model in new parameter coordinates that compute exactly the same function, verifies that predictions are unchanged, and then tests whether the decisions derived from the gradients are unchanged too. Our audits span GLUE classifiers, a ViT on CIFAR-10, GPT-2-medium and GPT-2-large, a 1.1B-parameter Llama-style model on WikiText-2, and six trained LoRA adapters. Empirically, predictions are preserved throughout, but both the gradients and the gradient-based decisions change. Across 66 GLUE attention audits, the median top-3 overlap of raw head-gradient rankings is only 1/31/3, and rankings and pruning masks change even under the mildest rescalings we test. In the largest of 14 global-pruning audits, the shifted ranking selects head masks that differ in four of 22 pruned heads and reach 50.92% and 94.84% validation accuracy on one ELECTRA SST-2 model. We prove that same-function reparameterizations can realize any component ranking and make gradient scores arbitrarily large, so these gradient-based measurements are not properties of the learned function at all. Beyond diagnosis, we propose symmetry-aware remedies: Function-space controls and canonical balancing restore identical decisions in every audit we run, and a quotient-space score is provably invariant under any invertible change of basis in the low-rank factors. Gradient-based evidence must therefore be verified to remain unchanged under same-function reparameterization, or be independent of coordinate choice by definition; otherwise, the evidence cannot be trusted.

1 INTRODUCTION

Gradients are used for more than model training. Quantities derived from gradients have become general-purpose measurement tools, used for structured pruning (Michel et al., 2019; Molchanov et al., 2017), compression of large language models (Ma et al., 2023), differential privacy clipping (Abadi et al., 2016), low-rank adaptation (LoRA) rank allocation (Zhang et al., 2023), and model debugging through training-example influence (Koh & Liang, 2017; Grosse et al., 2023). These workflows convert parameter, activation, or mask derivatives into scalar scores—often norms

*Corresponding author

Figure

Figure 1: Overview of the GRR audit. Scaling a head's query projection by cc and the corresponding key projection by 1/c1/c preserves the model's function and predictions. This coordinate change rescales the query and key gradients by 1/c1/c and cc, respectively. Applying different scales across heads changes the raw-gradient head ranking. Gradient-guided pruning therefore keeps different heads, and the two pruned ELECTRA models differ substantially in SST-2 validation accuracy, as detailed in Sec. 4.3.

or Taylor sensitivities—that decide which components are pruned, which examples are clipped or flagged, and how rank budgets are allocated. These scores are treated as evidence of what matters to the represented input–output function.

Yet each such score is computed in a particular coordinate system on the network's parameters. The choice matters because parameter gradients depend on the coordinates even when the input–output function is fixed. Raw gradient scores therefore reflect the coordinate choice as well as the represented function. Neural-network parameter spaces classically admit transformations that leave the input–output map unchanged (Hecht-Nielsen, 1990). If a differentiable, locally invertible transformation T:Θ→ΘT: \Theta \to \Theta of the parameter space Θ\Theta satisfies fT(θ)(x)=fθ(x)f_{T(\theta)}(x) = f_{\theta}(x) for every input x∈Xx \in \mathcal{X}, then TT is a function-preserving reparameterization, and the differential of the loss is transported by the chain rule,

∇θ′L=(DT−1(θ′))⊤∇θL,θ′:=T(θ).(1)\nabla_{\theta'} \mathcal{L} = (DT^{-1}(\theta'))^\top \nabla_{\theta} \mathcal{L}, \qquad \theta' := T(\theta). \tag{1}

Common gradient-based measurements are computed in a chosen Euclidean coordinate system. The resulting quantities and decisions, including gradient norms, coordinate-wise Taylor scores, diagonal Fisher estimates, clipping decisions, and top-kk rankings, can change with the coordinates. The function is unchanged by TT, but the coordinate representation of the parameter gradient can change, as can scores computed from that representation.

An orbit is the set of parameter vectors reachable from one model through the chosen function-preserving transformations. These vectors represent the same input–output function in different parameter coordinates.

For example, Transformer attention admits such a function-preserving reparameterization. Attention scores depend on the query and key projections only through the paired product WQWK⊤W_Q W_K^\top, so replacing (WQ,h,WK,h)(W_{Q,h}, W_{K,h}) by (chWQ,h,ch−1WK,h)(c_h W_{Q,h}, c_h^{-1} W_{K,h}) leaves every output logit unchanged while scaling the two head-gradient norms by ch−1c_h^{-1} and chc_h. The head still attends to the same tokens and contributes the same output. Only the units used to measure the head have changed, but this coordinate change rescales the head's parameter gradients. By choosing chc_h, we can make the same head report an arbitrarily large gradient score without changing any prediction. The represented function therefore does not uniquely determine this raw gradient score—a failure of identifiability, not of measurement precision. We must therefore reassess the reliability of gradient-based evidence: Gradient norms, head rankings, clipping decisions, and rank budgets must be audited under coordinate changes that preserve the function. Input-side attributions are unaffected, since these attributions are determined by the function alone (Sundararajan et al., 2017).

Same-function coordinate changes occur in practice. Data-free quantization equalizes weight ranges across adjacent layers, post-training quantization migrates activation scale into the paired weight matrix, and structured slicing rotates the internal representation before deleting rows and columns (Nagel et al., 2019; Xiao et al., 2023; Ashkboos et al., 2024). Each of these steps preserves the represented function and changes only how that function is written down. Compression pipelines routinely chain such a step with a gradient-based pruning or rank-allocation step, so the gradient evidence consumed downstream is read in a coordinate that an earlier and purely functional optimization happened to choose. No deliberate transformation is even required to produce scale imbalance. The eight public checkpoints we audit already have unequal paired projection norms: Balancing the paired projections within each checkpoint's orbit requires scales in [0.837, 1.077]. The coordinate choice underlying gradient evidence is therefore already arbitrary.

To test whether gradient-based decisions remain unchanged under such coordinate changes, we introduce Gradient Reliability under Reparameterization (GRR): The audit holds the represented input-output function fixed, changes only the parameter coordinates, and tests whether the measurements read from the gradients—and the decisions those measurements drive—remain unchanged. We instantiate this invariance check with exact Transformer symmetries and verify forward preservation by checking that the two coordinates produce numerically identical outputs. We then examine gradient evidence and compare downstream decisions such as pruning masks, clipping labels, LoRA rank choices, and paired-product optimizer diagnostics. In the largest of our global GLUE pruning audits, two same-function coordinates of one ELECTRA SST-2 model make identical predictions, yet the pruning decisions differ sharply: The raw gradient ranking selects head masks that differ in four of the 22 pruned heads, and the two pruned models reach 50.92% and 94.84% validation accuracy. Figure 1 illustrates this audit. GRR holds the represented function fixed and tests whether an existing diagnostic and the corresponding downstream decision are well defined along exact symmetry orbits. We also propose symmetry-aware remedies. Function-space ablation, a path-normalized score, and canonical balancing make the two coordinates select identical decisions in every audit we run. A quotient-space score remains unchanged under any invertible change of basis in the low-rank factors. These remedies provide a drop-in replacement for a diagnostic that fails the audit.

Distinction from prior work. That Euclidean gradients depend on coordinates is classical (Amari, 1998; Martens, 2020), and prior work has used the freedom to change parameter coordinates in three ways: to question generalization claims such as flatness (Dinh et al., 2017), to design scores that are invariant by construction (Neyshabur et al., 2015; Tanaka et al., 2020), and to exploit motion along symmetry orbits as an optimization resource (Kunin et al., 2021; Zhao et al., 2022). Reliability tests for explanations are closest in spirit, but existing tests perturb the model (Adebayo et al., 2018) or the input (Kindermans et al., 2019) and test whether the explanation notices. GRR applies a complementary test: The audit leaves the model's behavior exactly intact, verified numerically before any gradient is computed, and tests whether a diagnostic that a pipeline already executes still returns the same decision. Correspondingly, every strict ordering of raw component scores is attainable on a single same-function orbit, and the attainable score ranges have no finite upper bound. To the best of our knowledge, the effects of these coordinate changes on downstream gradient evidence and decisions have not been systematically audited. Exact natural-gradient constructions are invariant in principle, but the diagonal approximations that pipelines actually use are among the measurements we audit. Appendix B details what GRR shares with, and where GRR departs from, natural-gradient geometry, quotient geometry, structured pruning, privacy, adapters, and explanation reliability.

Contributions. We formulate GRR as an operational audit of the identifiability of gradient-derived evidence, built from exact, architecture-native symmetries. Theoretically, we show that same-function reparameterizations can arbitrarily change raw component rankings, characterize the resulting ambiguity, and derive symmetry-aware alternatives, including a quotient-space score that is invariant to any invertible change of basis in the low-rank factors. Empirically, we trace these changes to pruning, clipping, optimizer, and LoRA decisions across encoder, vision, and decoder-only models.

2 GRR AUDIT FRAMEWORK

Let fθ:X→Yf_\theta: \mathcal{X} \to \mathcal{Y} be a neural network with parameters θ∈Θ\theta \in \Theta, where Θ\Theta is the set of possible parameter vectors. Let ℓ(fθ(x),y)\ell(f_\theta(x), y) define a loss. A transformation T:Θ→ΘT: \Theta \to \Theta is function-preserving on X\mathcal{X} if

fT(θ)(x)=fθ(x)for all x∈X.(2)f_{T(\theta)}(x)=f_\theta(x)\qquad\text{for all }x\in\mathcal{X}. \tag{2}

On a finite audit set D\mathcal{D}, we check that the output logits zθ(x)z_\theta(x) remain numerically unchanged using the maximum logit difference δf(T)\delta_f(T) defined in Eq. 3. We also report the prediction flip rate: the fraction of audited predictions for which the highest-logit class or next token changes under TT.

Audited gradients. Practitioners may compute gradients with respect to the input, an intermediate activation, a component mask, or a parameter block. The chain rule links these gradients, but each measures sensitivity to a different variable. DP-SGD clips per-example parameter gradients (Abadi et al., 2016). LLM-Pruner uses weight derivatives to rank parameter groups for pruning (Ma et al., 2023), and AdaLoRA builds rank-importance scores from parameter-gradient products (Zhang et al., 2023). GRR therefore focuses on parameter gradients and on gradient-derived measurements and decisions.

Pruning also uses derivatives with respect to other variables. Michel et al. (2019) score heads using derivatives with respect to head masks, while Molchanov et al. (2017) score channels using activation-gradient products. These mask and Taylor scores differ from the raw parameter-gradient norms audited below. Weight-gradient and activation-gradient products cancel reciprocal scalar rescaling, so GRR tests the complete score and decision.

For a fixed input and label, the input gradient of the loss is unchanged by any TT with fT(θ)=fθf_{T(\theta)} = f_\theta. Input gradients therefore remain unchanged under these transformations and are not the target of this audit. However, activation and parameter gradients can change because TT changes the coordinates used to compute these gradients. Eq. 1 computes the parameter gradient in the new coordinates from the original gradient when TT is locally invertible at θ\theta and the audited loss depends only on the represented function. These conditions hold for every symmetry used in this paper. The same reasoning applies to activation gradients when TT changes the coordinates of those activations.

Let R(θ,D)R(\theta, \mathcal{D}) be a gradient-derived measurement, such as a layer-level gradient norm, head ranking, per-example gradient norm, clipping decision, internal-component attribution score, or rank-importance score. A function-level measurement should satisfy R(θ,D)≈R(T(θ),D)R(\theta, \mathcal{D}) \approx R(T(\theta), \mathcal{D}) after correcting known label permutations and coordinate transports. A gradient reliability failure occurs when fθf_\theta and fT(θ)f_{T(\theta)} make the same predictions but RR changes enough to alter a downstream decision.

To audit such failures, we define a GRR report that records function preservation alongside changes in measurements and decisions.

Definition 1 (GRR report). Given a model θ\theta, a function-preserving transformation TT, an audit set D\mathcal{D}, a measurement RR, and a downstream decision rule DD, write R0:=R(θ,D)R_0 := R(\theta, \mathcal{D}) and RT:=R(T(θ),D)R_T := R(T(\theta), \mathcal{D}) for the measurements before and after the transformation. The GRR report consists of

δf(T):=max⁡x∈D∥zθ(x)−zT(θ)(x)∥∞,(3)\delta_f(T) := \max_{x \in \mathcal{D}} \|z_\theta(x) - z_{T(\theta)}(x)\|_\infty, \tag{3} ρR:=Spearman(R0,RT),(4)\rho_R := \text{Spearman}(R_0, R_T), \tag{4} Ok:=∣Topk(R0)∩Topk(RT)∣k,(5)O_k := \frac{|\text{Top}_k(R_0) \cap \text{Top}_k(R_T)|}{k}, \tag{5} ΔD:=d(D(R0),D(RT)).(6)\Delta_D := d(D(R_0), D(R_T)). \tag{6}

Here dd denotes a task-specific comparison; later audits report set agreement for masks, metric gaps for downstream utility, and flip rates for binary clipping decisions. For binary clipping decisions bi:=1{∥gi∥2>τ}b_i := \mathbf{1}\{\|g_i\|_2 > \tau\}, ΔD\Delta_D is the flip rate. Here OkO_k is the top-kk overlap fraction. Unlike the mask comparisons reported later, this overlap fraction is not a Jaccard index.

The audit proceeds as follows. First, we check forward preservation using δf(T)\delta_f(T) and prediction flips. Only after the forward-preservation check passes do we compare rankings and score scales, then pruning, clipping, or rank-selection decisions. Finally, we repeat the comparison with a proposed remedy under the same verified transformation. If the forward check fails, the audit is invalid: We cannot attribute later differences to a change of coordinates alone. If the forward check passes but scores or decisions change beyond numerical tolerance, the diagnostic depends on the parameter coordinates even though the function is unchanged. If the remedy's scores or decisions also change between the two coordinates beyond numerical tolerance, the remedy has not removed that dependence. Appendix C.2 gives a compact executable reference implementation of this audit sequence for an attention-pair audit.

References (100)

Couldn't load all references. Reload the page to try again.