Skip to content

Main content

Quantized Weight Zero Point Code

Subtract an explicit quantization zero point from an in-range integer weight code without estimating scale.

Loading tool…

Description

Center a supplied quantized code around its zero point.

Model and prompt records distinguish token indices, offset units, reserved capacity, code scales and numeric representations. A common softmax shift is mathematically invariant but can alter rounded inputs. Literal brace doubling and citation tokens are format conventions rather than universal template or evidence validation.

Center a supplied quantized code around its zero point.

When to use this tool

Use Quantized Weight Zero Point Code when you already have quantizedCode, zeroPoint, minimumCode, maximumCode and need to center a supplied quantized code around its zero point.

How to use the tool and how it works

  1. Enter quantizedCode, zeroPoint, minimumCode, maximumCode. Use the units and conventions below.
  2. Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
  3. Read centeredCode, isZeroCode. Inspect isZeroCode before interpreting the associated values.

Require ordered safe whole code bounds and both code/zeroPoint within them; subtract exactly with BigInt and export a safe centeredCode, plus literal equality for isZeroCode.1

Input fieldMeaning and unitsAccepted input
quantizedCodeQuantized CodeRequired. Safe integer.
zeroPointZero PointRequired. Safe integer.
minimumCodeMinimum CodeRequired. Safe integer.
maximumCodeMaximum CodeRequired. Safe integer.
Output fieldInterpretationReturned shape
centeredCodeExact quantizedCode-zeroPoint, exported only when safe; no dequantization scale is applied.Required. Safe integer.
isZeroCodeIs Zero CodeRequired. Boolean.
json
{
  "input": {
    "quantizedCode": 130,
    "zeroPoint": 128,
    "minimumCode": 0,
    "maximumCode": 255
  },
  "output": {
    "centeredCode": 2,
    "isZeroCode": false
  }
}

Limitations and assumptions

  • No scale is applied, so centered code is not a reconstructed weight. A wide valid code range can still produce an unsafe difference and be rejected.
  • Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
  • Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Numeric signed-zero results are exported as zero.

Alternative or Complementary methods

Use the complete tokenizer, template, model contract and evaluation method. Verify actual capacity, vocabulary and numerical behavior when supplied budgets, local masks or representation checks cannot establish correct model operation.

References

  1. Calculation and input contract: artificial-intelligence/quantized-weight-zero-point-code — tool.io

Similar or alternative tools