All projects

Integer & embedded · Research

int-llm precision ladder

A controlled descent from a wide fixed-point oracle to compact signed-int16 weights, with behavior checked at each step.

At a glance

Evidence and scope

Repository measurements and recorded project results. Test and benchmark claims were inspected, not rerun during this catalog refresh. Physical line counts use the stated file scopes.

Oracle agreement
632/632 decisionsMixed-F11/F12 weights matched the wide-integer oracle on 32 deterministic prompts.
Conversion gate
1,100,048,384 codesAll integer codes and output bytes matched for one pinned checkpoint and plan.
Model storage
8.80 → 2.20 GBSigned-int16 weights removed the fourfold Q16.48 storage expansion.
Negative control
FP32 3.168899× fasterThe practical floating-point runtime remained faster on the documented comparison.
Reviewed sources · 2026-10-15 · 7cc4b9400185

86 tracked files · 18 documentation files · 0 workflow files. Inventory includes data and vendored or generated files; workflow presence does not establish a passing run.

Download inventory and line-count file scopes

Executive summary

int-llm-precision-ladder follows the wide Q16.48 oracle from int-llm with a narrow question: how far can stored weights be rounded while preserving documented decisions? Its main TinyLlama candidate uses mixed F11/F12 signed 16-bit weight codes while keeping activations, nonlinear functions, the key/value cache, and accumulation wide. It matched the oracle on 632 evaluated greedy decisions and removed the fourfold storage expansion of the Q16.48 weight file. The repository presents this as an explicit regression result, not general model quality parity or a production quantizer.

Problem and context

The exact Q16.48 path is useful as a numerical reference but inefficient as a stored model representation. Starting from an oracle allows rounding choices to be evaluated against a fixed target instead of another approximation. The project measures behavior, storage, memory, and runtime while keeping each claim tied to its particular host or microcontroller.

What was built

  • Precision sweeps over small integer models to choose candidate fractional
  • widths.

  • Mixed F11/F12 packing for TinyLlama weights in a signed-int16 MGWI format.
  • Direct SafeTensors-to-MGWI conversion with byte and integer-code gates.
  • Packed and rounded-wide comparison runtimes.
  • Physical-board MicroGPT experiments across Arm and RISC-V targets.
  • CUDA reference experiments retained even where results were negative.

How it works

F12 means twelve fractional bits after deterministic rounding; it does not mean a twelve-bit container. Each retained code occupies a little-endian signed 16-bit value. Matrix inputs are widened for computation, and signed 128-bit intermediates preserve the accumulation path. The original Q16.48 runtime remains the behavioral oracle.

This distinction separates representation savings from arithmetic claims. The packed and rounded-wide forms can have identical logits even though both differ numerically from the original model.

Evidence and validation

ExperimentRecorded resultScope
TinyLlama mixed F11/F12632/632 evaluated greedy decisions matched32 short deterministic prompts
Direct conversion1,100,048,384 codes and all output bytes matchedOne pinned checkpoint and plan
AMD packed vs rounded-wide23.209% lower generation time and 73.303% lower peak RSSOne host, same integer model
Practical FP32 controlFP32 was 3.168899× fasterDifferent runtime stacks

The microcontroller results show that smaller storage often helps but does not guarantee a runtime improvement; one documented board was effectively at parity.

Boundaries

The checked prompts do not establish arbitrary-prompt or chat-quality parity. The x86 timing is not an arithmetic-only comparison, and the FP32 control was substantially faster. The CUDA evidence does not show an integer inference advantage. MGWI files are treated as trusted experimental inputs.

Repository map and first run

sh scripts/validate.sh local

Read RESULTS.md for the small-model sweep, TINYLLAMA_RESULTS.md for the full model gate, MCU_RESULTS.md for physical targets, GPU_RESULTS.md for retained negative and mixed evidence, and VALIDATION.md for the exact claim boundary.