HNSW: narrow vector search using a layered adjacent map
Navigation from the rough layer to the bottom of the list of candidates to understand the balance between speed, memory and recall.
Learning objectives and first steps2 objectives 2 first fixes
Try to do it after reading
- Navigation from the rough layer to the bottom of the list of candidates to understand the balance between speed, memory and recall.
- 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
Why don't you calculate the distance one by one
When the vector bank is large, the full vector scan is costly for each query. (a) A stratification map of the small world that can guide the vector into several layers of maps: the upper nodes are small and are used to quickly approach the search area; The bottom level contains more nodes to find immediate neighbours with fuller candidate exploration. The search moves along the established edge without first knowing the distance between all the vectors and the query.
The upper layer can be seen as a thinner navigation network, but it is not a strict space partition tree. Random layers and neighbours choose to influence the connectivity of the map. The search begins at the entrance and progresses on the higher floors along the closer neighbours and then declines from one level to the next; Retaining the list of candidates to the bottom to the current better results and continue to expand the promising nodes. Finally, return to the nearest neighbourhood, rather than an unconditional guarantee of precision and proximity.
What changes the three parameters
The connectivity and memory of the maximum number of neighbours impact maps, how good neighbours can be found when the exploration width impacts of the build phase are inserted, and how many candidates can be checked when searching for the search for the exploration width impact of the query phase. Three cannot replace one another. Increasing the width of the query usually increases distance calculations and may improve recall, but it is not possible to fully repair an already poor graphic structure.
The top ten immediate neighbours are fixed and a close query returns ten, eight of which are the same as the exact set. The first ten recall rate is 80 per cent. (a) Nine items were identified with an increase in the breadth of the exploration and 90 per cent recall rate; Delays are also recorded, rather than just looking at average time. The difficulty of different queries varies widely, and individual success stories do not represent the overall quality of services.
Distance to data update
The training model uses a number of points, while the index is searched at a distance that is not unicoded, which may result in different orders. If a cosine similarity is used, it is clear whether the vector is unicoded and how the zero vector is treated. Index input dimensions, encoder versions and distance types should be jointly saved; The vectors generated by the new encoder cannot be freely mixed into the old space.
Business filtering is also a common problem. (a) Retrieving 10 items before filtering the sub-soldier, with little or no result; Adding filters to the past may block the search path on the map. Over-recall, partition or filtering strategies should be designed according to indexing capacity and assessed at a true filter ratio. Deleting and incremental updating support is dependent on the actual realization, and the concept of algorithms cannot be expanded to assume that all libraries support the same operation. The baseline test should also report index size, build time and cost of updating.
Check understanding
Can the search for greater width guarantee 100 per cent recall?
General assurances cannot be given on that basis. The structure of the graph, search realization, stop rules and data distribution all influence the results. Accurate retrieval should be used as a reference to measure recall and delay curves on representative queries.
Can it be proved that there is no leakage of the immediate neighbourhood, given the high similarity of the return results?
Can't. There may be unattended and more similar vectors. A precise reference to a pool or other reliable benchmark is required to determine the extent of a close index.
Sources and reconciliations
Definitions, methods and interfaces are available.
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.