Macalinao StudioLearnAll enriched lessons ↗
College path · 7 sectionsSwitch to high school ↗

College / LONGER LESSON 28

Local inference: quantize, budget, measure

Estimate storage and test the limits of a local inference configuration.

Preparation: Signed numbers, rounding and units.

Plan 20–35 minutes with the activities; this is a study estimate, not a timed requirement. Both paths have complete narration. Your notes and progress are kept separately for each level.

Section 01 / 07

Separate artifact and runtime

College path. Estimate storage and test the limits of a local inference configuration.

Preparation: Signed numbers, rounding and units. Work through one section at a time. Predict the experiment result before changing its controls, then explain what the example leaves out.

A model file, a compatible runtime and available memory are different requirements. A downloaded artifact does not prove that the intended model loads or performs acceptably. Record architecture support, tokenizer and chat template, artifact revision, quantization type and runtime build. File suffixes alone do not fully specify compatibility.

Worked step 1. Identify the model revision.

Worked step 2. Check runtime support.

Worked step 3. Run a small bounded prompt and record output and timing.

Try it yourself. Does a successful download prove inference readiness?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. Loading, tokenization, memory and actual generation still need verification.

Section 02 / 07

Map a weight onto a coarse grid

Quantization approximates values using a limited set of codes plus scaling information. Rounding error depends on the value, range and scheme, not only the bit count. A symmetric illustrative b-bit scheme can use qmax equal to two raised to the power of b minus one, then subtract one; for four bits, two cubed minus one is seven. Production block formats may use different codebooks and scales.

qmax = 2^(b−1)−1; s = 1/qmax; ŵ = s·round(w/s)

Worked step 1. At four bits use qmax=7 and scale 1/7.

Worked step 2. Weight 0.37 rounds to integer 3.

Worked step 3. Reconstruction is 3/7, about 0.429.

Try it yourself. Is this example every four-bit format?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. It is a simple symmetric uniform fixture. Actual formats can use blocks, zero points or nonuniform codebooks.

Section 03 / 07

Distinguish signed range and zero point

A signed integer code range can include an asymmetric endpoint. An affine quantizer uses a zero point to represent real zero; symmetric schemes often restrict or handle endpoints differently. For affine quantization, q=round(x/scale)+zero_point followed by clipping, and reconstruction is scale times q minus zero_point. State rounding, clipping and per-channel or block conventions.

Worked step 1. Use scale 0.1 and zero point 5.

Worked step 2. Real zero maps to code 5.

Worked step 3. Real 0.3 maps to code 8 before clipping.

Try it yourself. Does code zero necessarily represent real zero?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. In this affine example it reconstructs -0.5. The zero point defines the correspondence.

Section 04 / 07

Budget more than weights

Inference memory includes weights, cached keys and values, temporary workspaces and runtime overhead. Longer context can increase memory even when the weight file is unchanged. KV-cache size scales with batch, layers, stored tokens, KV heads, head width and element bytes. Offloading and quantized caches alter the accounting; measure peak resident use.

Worked step 1. Weights occupy a fixed amount.

Worked step 2. Double stored tokens with other cache factors fixed.

Worked step 3. The ideal KV-cache term doubles.

Try it yourself. Does a model that loads at short context necessarily fit at long context?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. Growing cache and workspace requirements can exceed available memory.

Section 05 / 07

Measure the phases separately

Prompt processing and token-by-token generation have different performance patterns. Report time to first token and subsequent generation rate rather than hiding both inside one average. Control prompt length, output length, batch, warm-up, threads, accelerator placement and cache state. Tokens per second depend on tokenizer and workload; compare like with like.

Worked step 1. Record a 500-token prompt and 100-token output.

Worked step 2. Measure first-token delay.

Worked step 3. Measure generation duration after the first token.

Try it yourself. Can one short warmed-up prompt characterize every workload?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. No. Include representative context lengths and concurrent use if those matter to the application.

Section 06 / 07

Check quality after compression

A smaller artifact may change task behavior. Evaluate the actual quantized artifact on representative held-out tasks and inspect failures, not just its ability to produce fluent text. Compare against the same base revision under matched decoding. Include numerical tasks, domain vocabulary and long-context cases. Record tolerances and artifact checksums for reproducibility.

Worked step 1. Run the same evaluation prompts on two formats.

Worked step 2. Score task success before reading file sizes.

Worked step 3. Inspect disagreements.

Try it yourself. Is lower memory automatically the better choice?

Pause the recording and write your reasoning before continuing. The worked solution follows.

Reveal worked solution

Worked solution. Only if the quality and latency trade-offs meet the intended requirements. Report all three.

Section 07 / 07

Mastery and transfer

Bring the pieces together. First answer the checkpoint without the worked solutions. Then explain the mechanism in your own words, using one numerical example from this lesson.

Which item can grow with context length? Option 1: The saved weight file on disk. Option 2: The KV cache. Option 3: The tokenizer revision number.

Pause here and choose an answer before continuing. The checkpoint explanation follows.

Reveal worked solution

The correct choice is option 2: The KV cache. Stored keys and values grow with retained tokens under ordinary cache layouts.

Transfer task. Change one assumption in the worked example. State your prediction, calculate or test it in Workbench, then explain whether the result supports your prediction.

Reveal worked solution

Self-check rubric. Name the changed assumption, keep the other inputs fixed, show at least one intermediate calculation, and distinguish what the toy example guarantees from what would require a trained model or a real measurement.

MODERN MODEL CASE STUDY

DeepSeek V4.1 Flash: where this idea goes next

Count FP4 group-scale overhead and distinguish main from local caches. Follow the worked examples, then evaluate the reported gains and their limits.

Open the college case study →

Added October 21, 2026. This optional extension has its own complete local narration.

LONGER INFERENCE LESSONS

Follow the mechanism in depth

Worked examples, local narration and connected learning modes at your level.

LONGER ATTENTION LESSONS

Follow the mechanism in depth

Worked examples, local narration and connected learning modes at your level.

LONGER TRANSFORMER SYSTEMS LESSONS

Follow the mechanism in depth

Worked examples, local narration and connected learning modes at your level.

LONGER ADAPTATION LESSONS

Learn the update and the teaching signal

Worked examples, local narration and connected experiments at your level.

Sources and scope

Original worked examples and teaching text, grounded in these primary references. Numerical fixtures explain mechanisms; model quality and hardware performance require separate measurements. Both levels share key examples, with different explanations and checkpoints.

EXTENDED FIELD NOTES

Read a model release like a scientific record

Separate the original model, a modified checkpoint, a file format, and the software that runs it.

Additional reading · original lesson audio remains unchanged.

Read the full explanation · 586 words + college extension
Follow the provenance

A change to behavior, precision or execution should be attributed to the team that made it.

  1. Original research
  2. Trained checkpoint
  3. Modified artifact
  4. Compatible runtime

Original research

The name is the beginning of the investigation

A model name is a label, not a complete technical specification. It may identify a research family, a training revision, an approximate parameter count, a numerical format, and a publisher’s description of behavior. Each part answers a different question. Before downloading anything, identify the original model and the organization publishing the particular files. A derivative can be useful without being an official release from the original research team.

A reproducible release needs more than a memorable name. The weights store learned numerical values; configuration describes the architecture and settings; the tokenizer connects text with token identifiers; and a chat template may define how messages are formatted. A model card explains intended use, evaluation, provenance, and limitations. A revision identifier distinguishes one repository state from a later update. These parts must agree. Having files on disk is not proof that a runtime can interpret them correctly.

Ornith and DeepSeek illustrate different levels of ownership

The official Ornith team describes Ornith-1.5 as a continuation of its model-development and self-improvement work. The dealignai Ornith release is a separately published derivative. The older dealignai ABLITERATED-GGUF page points readers to its UNCENSORED-GGUF repository, but that destination’s current files and full card were unavailable during this review. We therefore do not state which quantizations are downloadable or claim an exact size for that artifact. A nearby NVFP4 release is not evidence for the GGUF release’s contents.

The dealignai DeepSeek-V4.1-Flash-UNCENSORED-FP8 card describes changes to model weights intended to reduce refusals. This is the derivative publisher’s account, not a statement that DeepSeek produced or endorsed those modifications. The card reports an MMLU accuracy change from 86.96% to 82.74%. Subtracting gives a decrease of 4.22 percentage points. That result qualifies broad claims about preserved capability; it is also a publisher-reported evaluation rather than an independent replication.

Behavior, packaging, and precision are separate

“Uncensored” is a behavior-oriented label. It does not establish better reasoning, greater factual accuracy, or the removal of every refusal. A change that makes a model more willing to respond may also alter other behavior. Evaluations should examine the intended tasks, coherent conversation, factual quality, and failure cases. One headline or a few successful prompts cannot answer all those questions.

GGUF is a container for model tensors and metadata. It can hold different numerical representations. FP8 describes an eight-bit floating-point representation, not a container or a complete architecture. The DeepSeek derivative’s card reports mixed precision, including FP4 routed experts, so the FP8 label does not mean every stored value uses exactly eight bits. Similarly, a GGUF filename needs a specific quantization designation before it tells you much about storage requirements. A format conversion and a behavioral modification are different operations even when one repository contains both.

Give credit along the whole chain

Releasing weights makes it possible for others to run a learned model, adapt it, and investigate its behavior without repeating the original training. It does not automatically reveal all training data, training code, or the exact sequence of decisions required to reproduce the model. Access to weights and complete reproducibility are related but different achievements.

Credit should name the original researchers, the derivative publisher, any conversion or quantization contributors, and the inference software. This makes a lesson more accurate and helps a reader trace a claim back to its source. In your own release notes, write down the upstream model, the artifact revision, what was changed, the evaluation conditions, and what remains unverified. Then ask whether a claimed improvement comes from training, modified weights, reduced precision, a faster runtime, or a different benchmark setup. Those explanations should not be merged into one vague claim that a model is newer or better.

College extension · make the assumptions explicit

A percentage-point change is a subtraction of percentages: 82.74 − 86.96 = −4.22 points. A relative change divides that difference by the baseline, giving approximately −4.85%. Neither figure alone establishes statistical significance or isolates the modification as the only cause. Compare evaluation prompts, decoding settings, scoring methods, task subsets, and checkpoint revisions. If a publisher excludes subjects from an aggregate, report both the original aggregate and the reason for exclusion instead of silently replacing the result.

Sources and further investigation

Source review: October 28, 2026. Model-release claims are attributed to their publishers.

Open the focused reading page →

Reset this college path?

This removes only this path’s notes, progress and experiments from this browser.