Declare the coordinate contract

A vector has ten outputs. Nine are exact; one is wrong by 1/2. Its mean absolute error is only 1/20. A checker that accepts a mean error up to 1/10 accepts the vector, even though one coordinate exceeds that same tolerance by a factor of five.[4][5]

This is an original synthetic arithmetic example. The declared contract requires every output coordinate to be within 1/10 of its reference, inclusive. We compare that contract with a different rule: accept when the mean absolute error is at most 1/10. The reference and candidate vectors are fully retained, and Python fractions keep the arithmetic exact.[5][3]

The distinction is in the reduction. The elementwise rule asks whether any coordinate violates its bound. Mean absolute error adds the absolute errors and divides by the number of coordinates. It reports the average accurately, but that average does not bound the worst coordinate by the same number.[1][2]

  • Declare acceptance: State whether the requirement constrains every coordinate or only the average.

Keep the outlier and change the denominator

Keeping the one error at 1/2 and reducing the vector length from ten to two changes the mean to 1/4. The mean rule now rejects, while the elementwise rule rejects both vectors. The outlier did not improve when more exact coordinates were added; its contribution to the average became smaller.[4]

The other two cases establish ordinary behavior. An exact four-coordinate vector passes both rules. A four-coordinate vector whose errors are all exactly 1/10 also passes both, because the chosen boundary is inclusive. Positive and negative deviations are retained; absolute errors do not cancel.[4]

Four synthetic vectors. Both rules use the same illustrative inclusive tolerance of 1/10.

CaseLengthMean errorMax errorMean ruleElementwise rule
Exact400PassPass
All errors at boundary41/101/10PassPass
One outlier / 10 values101/201/2PassFail
Same outlier / 2 values21/41/2FailFail
  • All values are finite and dimensionless. Full vectors and violating indices are retained.
  • Different contracts: passing a mean-error objective is not evidence of meeting an elementwise objective.

Choose the intended reduction

For n nonnegative absolute errors, the mean cannot exceed the maximum. Requiring every error to be at most the tolerance therefore implies that the mean meets the same bound. The reverse implication fails. With just one error D, the mean is D/n: increasing n can satisfy a mean bound without changing that error.[5]

MAE is useful when average error is the intended objective. The mistake would be claiming that an MAE threshold enforces a separately promised per-coordinate limit. Neither the number 1/10 nor the elementwise objective is universal. A real task must declare its numerical contract, including any relative tolerances and allowed nonfinite values.[1][2]

  • Retain the error vector: Keep length, maximum error and violating indices alongside the aggregate.

Retain the bounded proof

The retained local invocation contains all four designed cases and twelve separate controls. Those controls cover signed-error cancellation, an inclusive boundary, a moved outlier, a singleton, and malformed inputs. The MIT download includes the exact executed source, inputs, full output and protocol. This is a runnable counterexample, not a prevalence estimate or a diagnosis of an existing grader.[5][6]

PyTorch documents both mean absolute-error reduction and elementwise tolerance comparison. Those definitions motivate the distinction; the proof does not invoke PyTorch. It also leaves floating-point rounding, general tensor equivalence and application-specific error budgets outside its scope. Before reducing errors to one score, decide what acceptance is supposed to guarantee.[1][2][3]

  • Choose the acceptance contract before choosing its summary statistic.

Sources

  1. L1Loss — PyTorch2.15 docs.pytorch.org
  2. torch.allclose — PyTorch2.15 docs.pytorch.org
  3. fractions — Python3.15.2 docs.python.org
  4. Complete retained original output data.nodus-compute.ai
  5. MIT runnable proof, fixture and protocol data.nodus-compute.ai
  6. Source and saved-result provenance data.nodus-compute.ai
  7. Vector figure data.nodus-compute.ai