PQ: Press long vectors to multiple short numbers

Explains vector compression and quantification errors by using a subspace code book and distance scale.

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

Try to do it after reading

  • Explains vector compression and quantification errors by using a subspace code book and distance scale.
  • Check the applicable conditions and the invalid boundary using the calculations in the text

Suggested first

  • Retrieval, sorting and feedback deviations
  • vector-point build-up and condition probability

Storage and retrieval benefit jointly from short code

The cost of the large vector bank is not only a calculation, but also a memory and data removal. Volume Quantifies a long vector into multiple subdirectories, learns a code book for each subspace and then saves only the numbering of the selected word for each segment. The combination of multiple small code books is considered a complete expression space, which can be expressed in large quantities of approximate vectors in limited storage.

For example, a 128-dimensional single vector requires 512 bytes. If you divide 16 paragraphs into 8 dimensions per segment, each code book has 256 centres, each paragraph numbering is by a byte, with a short vector code of 16 bytes. This comparison calculates the vector body only and does not include the identification, code book, inverted table or graphic edge, so that the entire index is not directly described as 32 times the compressed ratio.

A four-dimensional re-engineering at a time

Set the vectors at 1.1, 1.9, 4.2, 5.1 in two rows. The first paragraph has one or two recent codes, the second has four or five, and is reconfigured to one, two, four or five, and the square error is 0.07. Errors are from the sum of the squares of the quantified deviations of the paragraphs. If the distance between the key immediate neighbours is already small, this error may also be exchanged for their rankings.

The search allows the full accuracy of the query vector to be maintained, calculates the distance of each subspace to all code words and forms a search table. Database vectors are matched by paragraph numbering, which closes the distance. This asymmetrical distance calculation usually retains information more broadly than a crudely quantified query, but ultimately there are still quantitative errors in the database.

Codebook training can't be random

The data in the training code book should cover the distribution of future indexes. Long-tail categories may be poorly re-established if only high-profile type vector training is used. Reconstructing errors can be examined at a stratification level with the re-entry of the immediate neighbour, but they are not fully equivalent: smaller average re-engineering errors do not guarantee that the first few in each query are more accurate. When the dimension is highly relevant, simple continuous splitting may not be ideal, and improvements such as rotation can be studied, but they change the pre-processing and coding process.

When grouping the index, you also need to distinguish between gross partition errors and short code errors. If the reverse structure does not access the correct partition, no missing vector can be found with a more accurate short code; Access to more subregions improves coverage and increases costs. The screening allows for a more precise full volume, a precise re-allocation under a fixed candidate, and a quantitative search, and the location of the loss from which it originated. The new version code book and the old short code cannot be confused, otherwise the centre of the number corresponds has changed.

Quantified segment code for the productThe four-dimensional teaching vector is divided into two segments, each choosing a code word. Final save word numbers, which are added to the subspace distance table when querying.Original vector[1.1, 1.9][4.2, 5.1]Words by paragraph number[1, 2] → Code a[4, 5] → Code bDistance QueryTable 1[a] + Table 2[b] → Approximate distance
The four-dimensional teaching vector is divided into two segments, each choosing a code word. Final save word numbers, which are added to the subspace distance table when querying.

Check understanding

16 bytes short code means that an index entry is only 16 bytes?

Not necessarily. Marking and indexing structures are also needed and code books take up space. Vector encoded and complete index memory should be reported separately, avoiding local compression ratios as total benefits to the system.

Reconstructing error is lower. Is the first ten recalls going to be higher?

No guarantee. It is also important to rely on the relative distance order for retrieval, in which direction errors fall. Target recall indicators need to be measured directly against fixed queries and precise proximity.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Product Quantization for Nearest Neighbor Search
  2. Faiss — Index types and memory

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.