{
  "schema_version": 1,
  "title": "Model Quantization: Weight Memory and Precision",
  "review_type": "AI-assisted source-support audit; not independent expert verification",
  "sources": [
    {
      "id": "S1",
      "key": "quant-overview",
      "title": "Overview · Hugging Face",
      "author": "Hugging Face maintainers. (Main documentation; accessed 2026).",
      "url": "https://huggingface.co/docs/transformers/main/en/quantization/overview",
      "requested_url": "https://huggingface.co/docs/transformers/main/en/quantization/overview",
      "accessed_at": "2026-11-13T22:38:56.409Z",
      "source_type": "primary",
      "version": null,
      "published_at": null,
      "source_date_note": "Hugging Face maintainers. (Main documentation; accessed 2026).",
      "retrieved_body_sha256": "3b17432cf065ebdb3f2293b82dfceb158b779be5dc3e52acc40e1e0f977e0463",
      "library": {
        "id": "45ba1f3159ac95eb0e5a9857bc4326ff",
        "revision": "af6e612e02caf0dd631515ff6131e801",
        "published_at": null,
        "captured_at": "2026-11-06T15:39:02.783Z",
        "exact_quote_in_saved_original": true,
        "passage_matches": [
          {
            "evidence_id": "S1-E1",
            "exact_match": true
          }
        ]
      },
      "evidence": [
        {
          "id": "S1-E1",
          "location": "Two ways to use a quantized model",
          "quote": "Transformers reads the method from the checkpoint’s config.json",
          "normalized_text_offset": 2559
        }
      ],
      "limitations": "Loading paths differ for full-precision and already-quantized checkpoints; main documentation can change.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    },
    {
      "id": "S2",
      "key": "quant-concepts",
      "title": "Quantization · Hugging Face",
      "author": "Hugging Face Optimum maintainers. (v1.27.0).",
      "url": "https://huggingface.co/docs/optimum/v1.27.0/concept_guides/quantization",
      "requested_url": "https://huggingface.co/docs/optimum/v1.27.0/concept_guides/quantization",
      "accessed_at": "2026-11-13T22:38:56.519Z",
      "source_type": "primary",
      "version": "v1.27.0",
      "published_at": null,
      "source_date_note": "Hugging Face Optimum maintainers. (v1.27.0).",
      "retrieved_body_sha256": "ffc627361e587cc2fcba7f55644dd6a2954cded09134d0b725d6e9d83ea5fb0b",
      "library": null,
      "evidence": [
        {
          "id": "S2-E1",
          "location": "Theory, affine mapping",
          "quote": "x_q = round(x/S + Z)",
          "normalized_text_offset": 4119
        },
        {
          "id": "S2-E2",
          "location": "Theory, reconstruction",
          "quote": "x = S * (x_q - Z)",
          "normalized_text_offset": 3663
        }
      ],
      "limitations": "Affine mapping, scale and zero point; the notebook uses its own tiny numeric illustration.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    },
    {
      "id": "S3",
      "key": "quant-bits",
      "title": "Bitsandbytes · Hugging Face",
      "author": "Hugging Face / bitsandbytes maintainers. (Main documentation; accessed 2026).",
      "url": "https://huggingface.co/docs/transformers/main/en/quantization/bitsandbytes",
      "requested_url": "https://huggingface.co/docs/transformers/main/en/quantization/bitsandbytes",
      "accessed_at": "2026-11-13T22:38:56.400Z",
      "source_type": "primary",
      "version": null,
      "published_at": null,
      "source_date_note": "Hugging Face / bitsandbytes maintainers. (Main documentation; accessed 2026).",
      "retrieved_body_sha256": "4e0660a2cd33b67d5fc4539cf749944442781132f47b2961e47b568968a2ac43",
      "library": null,
      "evidence": [
        {
          "id": "S3-E1",
          "location": "Bitsandbytes introduction",
          "quote": "Linear8bitLt and Linear4bit layers that replace standard PyTorch linear layers",
          "normalized_text_offset": 1940
        }
      ],
      "limitations": "Library-specific example of reduced-precision linear layers; not a claim that every tensor uses that storage.",
      "checks": [
        "publisher URL and final redirect inspected",
        "actual relevant primary passage read",
        "exact excerpt matched",
        "scope and available version/date inspected"
      ]
    }
  ],
  "claims": [
    {
      "id": "C01",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "Choose representation — Range + precision — Specify the values, bit width and representable range before discussing storage. — A smaller bit width supplies fewer code values; it does not specify the complete method.; Quantize values — Scale · round · clip — Map original values to quantized codes using a declared scheme. — Rounding error and clipping depend on the range and parameters chosen.; Store codes — Payload + metadata — Pack weight codes and keep metadata needed to interpret them. — The hypothetical layout below adds one two-byte scale per group.; Evaluate runtime — Memory + quality — Measure the real loaded model and task quality separately. — Weights are only one part of runtime memory; these arithmetic outputs are not GPU measurements.",
      "source_ids": [
        "S1",
        "S2",
        "S3"
      ],
      "evidence_ids": [
        "S1-E1",
        "S2-E1",
        "S2-E2",
        "S3-E1"
      ],
      "verdict": "editorial_diagram_with_source_supported_roles",
      "reason": "Diagram is a teaching workflow, not an exhaustive protocol or measured system. Each role and arrow is bounded in nearby text."
    },
    {
      "id": "C02",
      "notebook_locations": [
        "experiment"
      ],
      "claim": "Choose a parameter count and code width. At 4 or 8 bits, each hypothetical group of 128 weights stores one two-byte scale; the 16-bit baseline stores only its payload. There are no zero-point bytes, tensor headers, alignment padding or mixed-precision exceptions in this declared layout. Payload = ceil(parameters × bits / 8) bytes. At 4 or 8 bits, metadata = ceil(parameters / 128) × 2 bytes; at 16 bits, metadata = 0. GiB = bytes / 2³⁰. KV cache, activations, workspace and runtime allocations are excluded. 8 billion × 4 bits: 4,000,000,000 payload bytes: About 3.725 GiB before this layout’s metadata. Group metadata at 128 weights: 125,000,000 bytes: One two-byte scale for each of 62,500,000 groups. 16-bit baseline in this chart: Payload only: The group scale assumption applies only to the 4- and 8-bit layouts here.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_synthetic_experiment",
      "reason": "Original fixed inputs and outputs; Python assertions and independent browser arithmetic checked in verification artifacts."
    },
    {
      "id": "C03",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "Quantization maps values into a smaller representable set. In an affine integer scheme, a scale and zero point relate stored integers to approximate real values. Rounding and clipping are part of that mapping. Weight format, activation format and computation dtype are separate choices; an integer stored weight need not imply integer computation everywhere.",
      "source_ids": [
        "S2"
      ],
      "evidence_ids": [
        "S2-E1",
        "S2-E2"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C04",
      "notebook_locations": [
        "workflow"
      ],
      "claim": "Libraries provide different loading paths and supported formats. Some quantize full-precision weights while loading; others require a checkpoint that was quantized beforehand. Treat the method and checkpoint configuration as part of the artifact you are evaluating. This notebook calculates a hypothetical packed layout rather than estimating any specific checkpoint.",
      "source_ids": [
        "S1",
        "S3"
      ],
      "evidence_ids": [
        "S1-E1",
        "S3-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C05",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "For the same parameter count, changing the ideal payload from 16 to 4 bits divides that payload by four. Added scales make the ratio of the declared complete layouts slightly different. The chart keeps those components visible so an ideal bit calculation is not mistaken for a loaded-model memory claim.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C06",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "A tiny symmetric illustration uses scale 0.25, zero point 0 and codes limited to −7 through 7. Value 0.60 rounds to code 2 and reconstructs as 0.50; value 2.00 clips to 7 and reconstructs as 1.75. These are declared example values, not the quantization recipe of a named model.",
      "source_ids": [
        "S2"
      ],
      "evidence_ids": [
        "S2-E1",
        "S2-E2"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C07",
      "notebook_locations": [
        "interpretation"
      ],
      "claim": "Editorial evaluation procedure: record the exact method, unquantized modules and compute dtype; measure peak runtime memory under a declared context length and concurrency; then compare task quality. Reduced storage alone cannot establish speed or acceptable quality.",
      "source_ids": [
        "S1",
        "S3"
      ],
      "evidence_ids": [
        "S1-E1",
        "S3-E1"
      ],
      "verdict": "source_supported_with_stated_scope",
      "reason": "Read against the stated source sections and notebook assumptions; see separate source audit. "
    },
    {
      "id": "C08",
      "notebook_locations": [
        "reproduce"
      ],
      "claim": "The original standard-library Python example passed its assertions and 9 input fixtures. Its browser implementation is separately compared against those results.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "tested_original_example",
      "reason": "No publisher code executed; no model, external network call or privileged action in the examples."
    },
    {
      "id": "C09",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "How many ideal payload bytes do 8 billion 4-bit weights require? Correct answer: 4 billion. Eight bits form one byte: 8 billion × 4 / 8 = 4 billion bytes.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C10",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "Does the calculator establish total GPU memory? Correct answer: No; it excludes runtime allocations. KV cache, activations, workspaces and other allocations are outside this storage model.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C11",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "With scale 0.25 and code 2, what is the reconstructed value when the zero point is 0? Correct answer: 0.50. Reconstruction is scale × (code − zero point): 0.25 × 2 = 0.50.",
      "source_ids": [
        "S2"
      ],
      "evidence_ids": [
        "S2-E1",
        "S2-E2"
      ],
      "verdict": "source_supported_and_worked_example",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    },
    {
      "id": "C12",
      "notebook_locations": [
        "self-check"
      ],
      "claim": "What follows from using fewer bits alone? Correct answer: The ideal code payload is smaller. Storage arithmetic does not establish an accuracy or speed result.",
      "source_ids": [],
      "evidence_ids": [],
      "verdict": "original_example_or_reasoned_limitation",
      "reason": "Answer rechecked against the declared fixture and cited source scope."
    }
  ],
  "original_experiment": {
    "scope": "Weight storage arithmetic and a simplified quantizer. No model is loaded and no latency or accuracy is benchmarked.",
    "assumptions": "Payload = ceil(parameters × bits / 8) bytes. At 4 or 8 bits, metadata = ceil(parameters / 128) × 2 bytes; at 16 bits, metadata = 0. GiB = bytes / 2³⁰. KV cache, activations, workspace and runtime allocations are excluded.",
    "results_file": "verification/python-results.json"
  },
  "library_gap": null,
  "excluded_evidence": [],
  "limitations": [
    "No real model or GPU measured.",
    "Sources and version/date labels checked as recorded; this does not prove absence of errors."
  ],
  "separate_audit_file": "verification/source-audit.json",
  "publication": {
    "state": "published",
    "approved_on": "2026-11-14",
    "published_on": "2026-11-14",
    "source_checks_on": "2026-11-13"
  }
}
