NF4 with Calculating Precision: Four Bits Storage does not equal four bits Multiply

The lower privileges are stored in discrete and scaled information and calculated to be restored to specific kernels or integrated.

• Step by stepCollate in 2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives . 1 first fix

Try to do it after reading

  • Interpretation of NF4 with Calculating Precision: Mechanisms and Preconditions for Four Bit Storage not equal to Four Bit Multiplication
  • Positioning the mechanism ' s fault limits with fixed examples

Suggested first

  • Quantified code books match low-end

Issues and mechanisms

The lower privileges are stored in discrete and scaled information and calculated to be restored to specific kernels or integrated. NF4 design non-equal code for a given weight distribution, which is not evenly quantified as level 16. QLoRA should be discussed in order to separate the base weight storage, calculation of dtype, adapter parameters and optimiser status, and not all volumes can be called a fourbit model.

The non-equivalency code book assigns more expression levels to the constant value range to reduce errors under the given distribution. Grouping and scaling constants are also stored in space, with some of them being processed in double-quantitative terms. The freezing of base weights may still require the transmission of the gradient back to the adaptor through its calculations; Freezing does not remove or cut all reverse paths.

A concrete example

Combine a group of four weights using four bits of code each, for a total of 16 bits; If this group requires a 16 bit-size constant, a total of 32 bits, or an average of 8 bits per item. Broadening the grouping can be spread over metadata, but it can increase errors from range differences. The ledger here does not use the real NF4 code point to display the defaulting auxiliary storage based on weights multiplied by four.

Borders and checks

The anomalies, non-normal weights and distributions influence errors. Calculating accuracy also affects accumulation and activation, and all numerical behaviour cannot be extrapolated from the type of storage. The actual use requires fixed numeric libraries, groups, code books, computational accuracy and model versions, and then mass and memory measurements, which cannot be validated by the hardware results of historical papers as cost machines.

A method of verification

Numerical verification allows the re-establishment of weight errors, linear output errors and final task differences to be recorded separately and avoids mixing them into the same scale. Even if the average weight error is small, a few sensitive directions may affect the output. Metadata compression will also introduce extra rounding, and reconstruction errors of the scaling constant should be included in the check. When training adaptors, basic storage formats, counter-quantifiable accuracy and training parameters are written, and a four bit label cannot be retained in a configuration name only.

Check understanding

Four weights only require 16 bits. Why is the total number of examples thirty-two?

Because there's also scalable metadata. Real formats may have more grouping and matching costs that need to be factored into the average weighting.

Can NF4 be replaced with an even four bit code book and still be called the original method?

Can't. The code point distribution and error characteristics differ, and the replacement is another quantitative setting, which must be clearly identified and re-tested.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. QLoRA — Efficient Finetuning of Quantized LLMs
  2. Hugging Face PEFT v0.21.0 — LoRA

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.