Maximum inner product vector retrieval-oriented graph indexing method

By constructing a sparse graph index structure and adaptive search control, the structural distortion and path imbalance caused by spatial transformation in maximum inner product search are solved, and efficient and accurate vector inner product similarity retrieval is achieved.

CN121117271APending Publication Date: 2025-12-12ZHEJIANG UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511641816.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-11
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing technologies suffer from problems such as structural distortion introduced by spatial transformation, severe graph index norm bias, unbalanced search paths, and high computational overhead during the maximum inner product search process, resulting in low retrieval efficiency.

Method used

We construct a sparse graph-based index structure, which uses norm hierarchical structure and spherical path edge connections, combined with a lightweight decision tree model to achieve adaptive search control, keeping the original vector space unchanged and improving retrieval accuracy and efficiency.

Benefits of technology

While keeping the original vector space unchanged, high-precision and efficient vector inner product similarity search is achieved, reducing redundant calculations and improving system throughput and retrieval speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121117271A_ABST
    Figure CN121117271A_ABST
Patent Text Reader

Abstract

The invention discloses a graph indexing method oriented to maximum inner product vector retrieval, which utilizes query vector scaling to prove that a maximum inner product search problem can be equivalently converted into a nearest neighbor search problem, so that an efficient Euclidean graph indexing structure is reused on the premise that a vector space does not need to be changed; according to the method, a graph structure based on a spherical path is constructed, a cross-norm connecting edge is introduced on the basis of a traditional sparse graph to relieve norm bias, and a normalized clustering and high norm screening strategy is adopted to generate an entry point to improve search coverage. Meanwhile, the invention provides a self-adaptive termination mechanism based on search process features, and whether the search is ended in advance is judged through a lightweight decision tree model, so that the search overhead is effectively reduced. Experiments show that the retrieval efficiency is remarkably improved on the premise of ensuring the accuracy, and the method is suitable for high-performance vector retrieval scenes such as recommendation systems and e-commerce search.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of vector retrieval, and particularly relates to a graph index method for maximum inner product vector retrieval. BACKGROUND

[0002] MIPS (Maximum Inner Product Search) is a retrieval method widely used in large-scale vector retrieval scenarios such as recommendation systems, advertisement ranking, and commodity recall in recent years. The goal is to find the top K target vectors with the maximum inner product value from a large number of vectors. Compared with the Euclidean distance NNS (Nearest Neighbor Search), MIPS can more effectively characterize the correlation between vectors, especially in retrieval scenarios where vector norms are inconsistent.

[0003] However, since the inner product distance does not satisfy the triangle inequality, traditional graph index structures based on Euclidean distance, such as HNSW (Hierarchical Navigable Small World) and NSG (Navigable Small World Graph), directly applied in MIPS scenarios will have problems such as precision degradation and unstable search path. Some existing technologies attempt to convert the MIPS problem into a nearest neighbor problem in Euclidean space by mapping the space (such as expanding, scaling, or rotating the target vector), such as documents [Zhao X, Zheng B, Yi X, et al. FARGO: Fast Maximum Inner Product Search Based on Global Multi-probing. Journal of Very Large Data Bases Systems, 2023, Vol. 16, No. 5: pp. 1100-1112] and [Zhou Z, Tan S, Xu Z, et al. Moebius Transform for Fast Inner Product Search on Graphs. Advances in Neural Information Processing Systems, 2019, Vol. 32], but these transformations usually destroy the geometric structure of the original vector, resulting in high index construction cost, difficulty in updating, and difficulty in interpreting the results.

[0004] In addition, there are the following problems in the actual retrieval process of the graph index: (1) The difference in vector norms will cause high-norm vectors to be frequently accessed, causing search path skew and affecting search fairness and result distribution; (2) Existing graph search strategies usually use fixed depth or fixed candidate capacity, which cannot dynamically adjust the search cost according to the query, resulting in a large amount of redundant calculation and limiting the system throughput.

[0005] Therefore, how to equivalently process the maximum inner product search problem while keeping the original vector space unchanged, and on this basis, construct a vector index structure with high precision, high efficiency, and low redundancy, has become a key problem to be solved for vector retrieval systems. SUMMARY

[0006] In view of the problems of structural distortion introduced by space transformation, serious norm bias of graph index, unbalanced search path and high computational overhead in the maximum inner product search process in the prior art, the application provides a graph index method for maximum inner product vector retrieval, which can accurately and efficiently implement inner product similarity search of large-scale vectors under the premise of keeping the original vector space unchanged, and introduces a deployable adaptive search control mechanism to improve retrieval speed and throughput capacity.

[0007] A graph index method for maximum inner product vector retrieval, comprising the following steps: (1) obtaining a target vector set and a query vector to be retrieved from a vector database, and constructing an approximate sparse graph index structure based on the target vector set; (2) layering the vectors according to the norm based on the approximate sparse graph index structure, and further introducing spherical path edges between different norm layers; (3) selecting a representative navigation entry point from the target vector set; (4) starting from the navigation entry point, performing graph search based on inner product driving in the approximate sparse graph index structure, extracting relevant search state features in real time during the search process, and inputting these features into a pre-trained lightweight decision tree model to determine whether the early termination condition is met; (5) after the search is terminated, sorting the access nodes in the current candidate set according to the inner product values of their target vectors and the query vector, and outputting a plurality of target vectors with the highest inner product values as the final retrieval results.

[0008] Further, the target vector set in step (1) comprises a plurality of high-dimensional vectors, and the approximate sparse graph index structure is constructed based on the target vector set using an angle constraint pruning strategy.

[0009] Further, the specific implementation of step (2) is as follows: S21: calculating the norm of the vectors in the target vector set, and dividing all the vectors in the set into a plurality of norm layers according to the norm size, each layer containing a group of vectors with norm falling within a specific interval range, and the layering method adopting fixed interval, quantile equalization or clustering; S22: for two adjacent norm layers, selecting a vector with larger norm from the low norm layer as a starting point, and selecting a vector with uniform angle distribution from the high norm layer as an ending point, connecting the starting point and the ending point as a candidate connection edge and recording the direction angle thereof; S23: screening all the candidate connection edges, removing edges with repeated directions or too small angles, and adding the remaining candidate connection edges as spherical path edges to the approximate sparse graph index structure to form a jump path connecting multiple norm layers.

[0010] Further, the specific implementation of step (3) is as follows: S31: Normalize all vectors in the target vector set so that the direction information is uniformly projected onto the unit sphere; on this basis, use a clustering algorithm to cluster the normalized vectors, thereby dividing the target vector set into several clusters with different direction distributions; S32: In each cluster, select several vectors with the largest norm as candidate entry points, merge the candidate entry points in all clusters to form a preliminary candidate entry point set; S33: Sort all candidate entry points according to the direction angle between the candidate entry points and the query vector, and select several candidate entry points with the smallest direction angle to form the final navigation entry point set.

[0011] Further, the specific implementation of step (4) is as follows: S41: In the process of performing inner product-based graph search from the navigation entry point, for each visited node, real-time calculation and recording of search state features include: update frequency of the current candidate set, comparison index of the visited node and the historical best result, norm change trend in the search path, and sliding average result of the inner product value; S42: Input the calculated search state features into a pre-trained lightweight decision tree model, which is trained by labeled data of historical search paths and used to judge whether the current search has converged or the hit rate has reached the expectation, the model output result is a judgment signal for continuing or terminating the search; S43: According to the output result of the decision tree model, if the judgment signal is terminate, immediately end the traversal process of the current graph index structure and jump to the result output stage; if the judgment signal is continue, select the next hop vector node from the neighbor nodes of the current visited node as the access target to continue the search.

[0012] Further, the pre-trained lightweight decision tree model is converted into a static conditional judgment statement when deployed, and is integrated into the vector search execution module in an embedded manner. The decision logic is called once for each new node access to determine whether to end the search process early, thereby improving the running efficiency and reducing the model calling overhead.

[0013] Further, the step (5) adds all the access nodes in the search path to the candidate set after the search is terminated, calculates the inner product value between the target vector and the query vector for any access node in the candidate set, sorts all the access nodes from high to low according to the inner product value, and finally outputs the target vectors of the first K access nodes with the largest inner product value as the final retrieval result, and outputs the inner product value together for subsequent recommendation, sorting or result display, wherein K is a natural number greater than 1.

[0014] A computer device comprises a memory and a processor, the memory has a computer program stored therein, and the processor is configured to execute the computer program to implement the graph indexing method for maximum inner product vector retrieval.

[0015] A computer readable storage medium stores a computer program, and the computer program is executed by a processor to implement the graph indexing method for maximum inner product vector retrieval.

[0016] The present application establishes the equivalence between MIPS and NNS in Euclidean space from a theoretical point of view, and proves that the search path that maximizes the inner product value can be realized by designing a sparse neighbor graph structure with good directional divergence in the original space without any scaling or mapping of the query vector. Specifically, the present application constructs a graph indexing structure with norm progression and angle divergence, so that the target node with maximum inner product can be efficiently accessed in the form of a similar monotonic path, thereby avoiding the geometric distortion problem caused by the traditional space transformation method. This equivalence not only reduces the system implementation complexity, but also provides theoretical support for the stability and interpretability of the graph indexing, and provides a foundation guarantee for the engineering deployment of high-performance MIPS systems.

[0017] Therefore, the present application has the following beneficial technical effects: 1. The present application avoids the information loss and structural complexity caused by the space transformation in the prior art by proposing an equivalence theory based on query vector scaling.

[0018] 2. The present application effectively solves the problem of excessive concentration of search paths in high norm regions by constructing a spherical path structure and introducing norm cross-layer connection and navigation point selection strategy, thereby improving the searchability and stability of the graph indexing.

[0019] 3. The present application realizes the control and dynamic termination mechanism of redundant calculation in the search process by designing a lightweight decision tree and combining the dynamic characteristics of the search state, thereby improving the retrieval efficiency and throughput of the system.

[0020] 4. The technical solution of the present application is applicable to large-scale vector inner product search tasks, has been deployed in real recommendation systems, and has verified its significant advantages in accuracy, retrieval speed, and index storage space. BRIEF DESCRIPTION OF DRAWINGS

[0021] Figure 1 The step flowchart of the graph index method for the maximum inner product vector retrieval of the present application. DETAILED DESCRIPTION

[0022] In order to more specifically describe the present application, the technical solution of the present application will be described in detail below in combination with the drawings and specific embodiments.

[0023] The present embodiment takes the commodity recommendation task in an online shopping platform as an example, and applies the maximum inner product search method proposed by the present application to the candidate commodity recall module in the recommendation system. In this application scenario, the platform first constructs a user interest expression vector based on the historical behavior records (such as browsing, clicking, adding to cart, purchasing, etc.) of the user, and the vector is used as the current query vector to drive the recommendation system to perform matching search on the massive commodities. At the same time, the platform encodes all the commodities to be recommended into high-dimensional dense vectors through a deep representation learning model, forming a target vector set for graph index construction, and each vector represents the semantic or interest features of a commodity.

[0024] In order to achieve efficient similarity calculation and retrieval in a large-scale commodity space, the system constructs a sparse graph index structure based on the directional relationship and norm information between the target commodity vectors during the index construction stage. Each node in the graph represents a commodity vector, and the connection edges of the graph structure are determined by the angle pruning strategy and the norm hierarchical connection strategy proposed by the present application, forming a sparse graph structure with directional divergence and norm progression. In addition, in order to improve the access capability of the high-norm (such as popular, high-click) commodity area, the present application further introduces cross-norm jump connection edges between different norm layers in the graph, constructing a spherical path structure, thereby improving the connectivity and search robustness of the entire graph structure.

[0025] In the online retrieval stage, the system selects several representative and evenly distributed nodes as navigation entry points from the constructed index graph according to the directional features of the current user query vector and the global vector distribution, which are used as the starting set of graph search. Subsequently, the system performs a traversal process based on the maximum inner product value from these entry points in the index graph structure, dynamically searching for the candidate commodity set with the maximum inner product value. Finally, the system sorts the candidate vectors according to the inner product scores between the query vector and the query vector, selects the top K commodities as the recommended candidate results, and inputs them into the subsequent fine ranking module or directly displays them on the front end. The specific implementation process of the present embodiment is shown in Figure 1 ​Step S11: Obtain a target vector set and a query vector from a vector database, and construct an approximate sparse graph index structure (SSG) based on the target vector set.

[0026] In the implementation process, the target vector set and the query vector to be retrieved are obtained from the vector database, where the target vector set is a set containing a plurality of high-dimensional vectors, denoted as , each of which represents a vector with d-dimensional features and is widely used to represent multi-modal embedding data such as images, texts, and user behaviors; the query vector q is a vector input by an external query, which has the same dimension as the target vector and represents the current object to be retrieved.

[0027] To support efficient approximate inner product search, the embodiment constructs a sparse graph index structure based on the target vector set, where V is a node set and E is an edge set.

[0028] In the graph index construction process, the embodiment preferably adopts an angle constraint pruning strategy to construct an approximate SSG structure to achieve a graph index with good sparsity and directional coverage. Specifically, for each node in the target vector set, a set of vectors with close distances is first selected in the Euclidean space to form a candidate neighbor set. Then, according to the directional relationship between each candidate vector and the current node, the included angle between them is calculated. On the basis of the existing out-edge set, the direction of each candidate vector and the current node is evaluated in turn: if the direction of the candidate vector is too close to the direction of the existing out-edge, i.e., the included angle is less than a preset minimum angle threshold, the candidate edge is removed; only when the direction of the candidate vector is sufficiently divergent from the direction of the existing out-edge, the candidate vector is added as an effective connection edge.

[0029] Through the above angle divergence pruning mechanism, each node finally retains a set of out-edges with wide coverage and balanced directional distribution, forming a sparse graph structure with good traversal performance and low redundancy. This graph not only ensures the directionality and global connectivity of the path in the search process, but also greatly reduces the number of redundant edges, reduces memory occupancy and search complexity, and provides an efficient and stable graph structure foundation for subsequent spherical path construction and navigation entry point generation.

[0030] Step S12: On the basis of the constructed sparse graph structure, to improve the connectivity and search robustness of the high-norm vector region, further introduce spherical path edges between different norm layers: layer the target vectors according to the norm; add non-overlapping connection edges between different norm layers; alleviate the high-norm bias problem and construct a jump connection path.

[0031] ​Specifically, the target vector set is layered according to the vector norm size, and a group of vectors with similar norms is divided into the same norm layer, and vectors in different norm intervals are divided into different norm layers; the division of the norm layer can be realized by setting a fixed threshold or equal interval, so as to ensure clear hierarchical boundaries.

[0032] On the basis of the established sparse graph structure, each pair of adjacent norm layers is traversed, and a plurality of vector pairs in the boundary region thereof are selected as candidate connection points, the direction included angle between the candidate points is evaluated, and the connection edges with uniform direction and low redundancy are screened out according to the angle non-overlapping principle (i.e. the included angle between the candidate edge and the existing edge is not less than a set angle threshold), and the screened edges are connected to the graph structure as the cross-layer jump connection edges. The spherical path structure constructed by the above method can effectively solve the problem that the paths in the high norm region are too concentrated, the search is easy to fall into "local cycle" or "boundary jam", so that the distribution of the search path in the whole graph is more divergent and covering, and the overall retrieval performance of the system is improved. The specific implementation process of this step is as follows: S21: First, the norm of all vectors in the target vector set is calculated, and the vectors are divided into a plurality of norm layers according to the norm size, each norm layer containing a group of target vectors whose norm values fall within a certain continuous interval. Let the target vector set be , where each vector , the L2 norm of which is .

[0033] Set the interlayer interval parameter , and let the jth layer norm interval be , where , is the minimum norm of all vectors, and the vectors are divided into levels according to this, obtaining a series of norm layer sets .

[0034] The norm layer division can adopt one of the following strategies: ①Fixed interval division: division according to uniform step δ; ②Quantile division: each layer contains a similar number of vectors; ③Adaptive clustering division: K-means-based norm value clustering division.

[0035] This hierarchical structure will be used for the addition of cross-layer paths in the subsequent steps, and provides grouping basis for establishing auxiliary connections between high norm vectors.

[0036] S22: For any two adjacent norm layers and , a plurality of representative vectors are selected therefrom to construct a candidate set of cross-layer connection edges.

[0037] Specifically, first set the representative vector selection ratio parameter in each layer , select the vectors with the largest norm in each layer as the starting point candidate set , select the vectors with good direction distribution (uniform angle distribution) from the previous layer as the end point candidate set .

[0038] For each pair of candidate vectors , calculate the direction angle between them: Record and sort all angle values to form a candidate cross-layer edge set , which will be de-redundant in the next step according to the angle distribution to select edges for spherical path construction.

[0039] S23: Perform directional screening and connection edge addition operations on the candidate edge set to control the connectivity, distribution balance and sparsity of the graph structure, eliminate edges with repeated directions or too small angles, and only keep the connection edges with good direction divergence as spherical path edges to be added to the graph structure.

[0040] Specifically, let each vector node , the current existing out-edge set be , and the candidate edge be , judge whether its direction satisfies the "spherical path angle divergence condition": Where: represents the angle between the candidate edge and the existing edge , and is the minimum angle constraint threshold (such as 20°~30°) to prevent direction overlap leading to redundancy.

[0041] If the condition is met, add to the graph structure, i.e. consider it as a cross-norm connection edge from the lower norm layer to the higher norm layer, denoted as a spherical path edge. This process can be independently parallel executed by node or level to improve the efficiency of graph construction.

[0042] Finally, through the above operations between all layers, a jump path connecting multiple norm layers is formed, and the constructed spherical path structure will form a "norm progressive" auxiliary connection path, ensuring that the high norm region has good access paths in the graph structure and avoiding search from falling into local high norm "dead zone".

[0043] ​​Step S13: Select representative navigation entry nodes from the target vector set: normalize all vectors and cluster them; select high-norm vectors in each cluster as candidate entry points; sort the candidate points by angle with the query vector, and select multiple entry points as the search starting node set.

[0044] To improve the diversity, direction representation, and initial hit rate of the graph search starting point, the embodiment selects several vectors with good representation and direction from the target vector set as navigation entry points for graph search. This process considers the normalized direction distribution and norm intensity information of the vectors, and combines the angle similarity with the query vector for screening. The selection of entry points is the starting key step of the entire search process, which directly affects the coverage efficiency and search speed of the subsequent path. The specific implementation process of this step is as follows: S31: Normalize the target vectors and perform clustering division. Specifically, first normalize each vector in the target vector set Perform L2 norm normalization operation to obtain a set of unit vectors , thereby mapping the original vector distribution to the unit sphere; then perform clustering operation based on the vector set on the unit sphere to divide different direction distribution sub-clusters. The clustering method can use spherical K-means (K-means clustering algorithm) or clustering algorithm based on cosine similarity, and the clustering number is set to , which is usually determined according to the size of the data set or the number of target entry points. The purpose of the clustering operation is to structurally abstract the vector distribution by direction, providing a grouping basis for the subsequent candidate entry point screening.

[0045] S32: Select high-norm vectors in each cluster as candidate entry points. Specifically, in each cluster, select several vectors with the largest norm from the original unnormalized vector set as candidate entry points. Let the jth cluster be , and its corresponding original vector set be , then the norm of each vector can be calculated as , and the first k vectors with the largest norm are taken as the candidate set These vectors have stronger representation and connection ability; combine the candidate vector sets in all cluster clusters into the total candidate set This set covers a wide range in direction and has a large norm value, which is suitable for initializing the graph search starting point.

[0046] S33: Sort by angle (direction similarity) with the query vector, and select multiple entry points as the search starting point. Specifically, for each vector in the candidate set, calculate the angle between it and the query vector ​ All candidate entry points are arranged in ascending order of the included angle value, and the first N entry points with the smallest included angle are finally selected as the actual entry point set for graph search, which is used as the starting node set in the subsequent graph search stage to achieve higher initial hit rate and more dispersed search path layout.

[0047] Step S14: Perform graph search based on inner product driving from the navigation entry point in the graph structure; in the search process, real-time extraction of several search state features is performed, including the update frequency of the current candidate set, the access node and the historical maximum inner product ratio, the norm ratio, and the sliding average inner product value, and these features are input into the pre-trained lightweight decision tree model to determine whether the early termination condition is met.

[0048] Unlike the traditional graph search strategy which uses fixed traversal depth, the present application proposes an adaptive termination mechanism to dynamically evaluate whether the current search state has met the termination condition in the search process, thereby effectively avoiding unnecessary node access and improving overall retrieval efficiency; the mechanism is based on multiple indicators such as inner product value, candidate heap stability, and norm features, combined with a pre-trained lightweight decision tree model to make decisions. The specific implementation process of this step is as follows: S41: Extract the state features in the graph search process. Specifically, in the process of performing graph search based on inner product driving from the navigation entry point, for each accessed target vector node, the following four search state features are calculated and recorded in real time: F1: Update frequency of the current candidate set (each newly searched node is added to this set, and if the set size exceeds the set upper limit, the worst answer will be popped out); F2: Comparison index of the access node and the historical best result (the vector with the largest dot product with the query vector); F3: Norm change trend of the vector in the path; F4: Sliding average of the inner product value.

[0049] These features can be used as dynamic indicators to describe whether the current search is converging, providing data support for subsequent search termination judgment.

[0050] S42: Input the features into the pre-trained decision tree model to perform termination judgment. Specifically, after each node access operation, the above four-dimensional features are combined and input into a pre-trained lightweight binary decision tree model to determine whether the current search has converged or the hit rate has reached the expected value. The model is trained based on historical search path annotation data and has the advantages of fast execution speed, transparent logic, and easy deployment.

[0051] The model output is a binary decision result. If , it is determined that the search can be terminated early; if If yes, continue the graph search. The binary decision tree model is simple in structure, suitable for high-frequency real-time calling, and can be translated into static conditional judgment statements and embedded in the main loop for deployment, greatly improving search efficiency.

[0052] S43: Control the search process according to the model determination result. Specifically, if the model determines to "terminate", immediately stop the traversal process of the current graph index structure, and jump to the result output stage; if the model determines to "continue", select the next hop vector from the adjacent node set of the current access node as the access target, and continue the search process.

[0053] The adaptive termination mechanism combines the distribution of inner product values, path update stability and direction norm characteristics, effectively avoids redundant calculation caused by fixed round traversal, significantly reduces the average node access amount under the premise of ensuring result accuracy, and improves the overall retrieval efficiency.

[0054] Step S15: When the search terminates, sort the target vectors in the current candidate set according to the inner product value with the query vector, and output the top K target vectors with the highest inner product value as the final retrieval result. This result can be used in subsequent recommendation, sorting or result display scenarios, etc.

[0055] In this embodiment, when the graph search process meets the termination condition or the traversal ends, the system performs result sorting and output operation on the target vector set in the candidate heap that has been accessed and retained, to obtain the final approximate inner product search result. Specifically, each target vector in the candidate set C has calculated the inner product value with the query vector q , the system sorts all inner product values in descending order, and selects the top K target vectors with the largest inner product value to form the result set . The result set R contains the identification information of each target vector and its similarity score (i.e. inner product value) with the query vector, which can be used as the final search result output for downstream tasks.

[0056] The final output result of the present application can also be applied to the following application scenarios: In the recommendation system, the target vectors in R are mapped to the corresponding goods or content recommended to the user; In image / semantic search, the vectors in R are mapped back to the original entity and displayed to the user as the most relevant match; In sorting or post-processing tasks, further integrate scoring information for comprehensive sorting according to business logic.

[0057] ​In addition, to ensure controllability and interface uniformity of the output result, the system can encapsulate the result set and return it in the format of JSON (JavaScript Object Notation), vector ID array or structured form, so as to meet the service deployment requirement in a high-concurrent request scenario.

[0058] As can be seen from the above embodiments, the application utilizes the query vector scaling equivalence theory to equivalently transform the maximum inner product search problem into the nearest neighbor search problem in the Euclidean space without changing the original vector space structure, thereby realizing efficient vector retrieval without spatial transformation; the angle constraint is used to construct a sparse graph index structure, and a cross-norm connection edge is introduced to form a spherical path, thereby relieving the path concentration problem of the traditional graph structure in the norm bias scene; the vector normalization clustering and norm screening strategy are combined to generate a spherical navigation entry point, thereby improving the global coverage and initial hit efficiency of the graph search; a lightweight decision tree model based on search dynamic characteristics is introduced to construct an adaptive search termination mechanism, thereby effectively reducing the computational overhead while ensuring the retrieval accuracy; finally, the candidate heap screening and inner product value sorting are used to output the first K target vectors that best meet the query intention, and the overall method has good accuracy, scalability and system deployment performance, and is suitable for large-scale high-performance vector retrieval systems.

[0059] The above description of the embodiments is for the purpose of enabling a person of ordinary skill in the art to understand and apply the present application, and those skilled in the art can easily make various modifications to the above embodiments, and apply the general principles described herein to other embodiments without inventive labor. Therefore, the present application is not limited to the above embodiments, and the improvements and modifications of the present application made by those skilled in the art according to the disclosure of the present application should be within the scope of protection of the present application.

Claims

1. A graph indexing method for maximum inner product vector retrieval, characterized in that, The method comprises the following steps: (1) obtaining a target vector set and a query vector to be searched from a vector database, and constructing an approximate sparse graph index structure based on the target vector set; (2) layering the vectors according to norms based on the approximate sparse graph index structure, and further introducing a spherical path edge between different norm layers; (3) selecting representative navigation entry points from the target vector set; (4) starting from the navigation entry points, performing an inner product driven graph search in the approximate sparse graph index structure, extracting relevant search state features in real time during the search process, and inputting the features into a pre-trained lightweight decision tree model to determine whether the early termination condition is met; (5) after the search is terminated, sorting the access nodes in the current candidate set according to the inner product values of the target vectors and the query vector, and outputting a plurality of target vectors with the highest inner product values as the final search results.

2. The graph indexing method for maximum inner product search oriented vector retrieval according to claim 1, characterized in that: The target vector set in step (1) comprises a plurality of high-dimensional vectors, and an approximate sparse graph index structure is constructed based on the target vector set using an angle constraint pruning strategy.

3. The graph indexing method for maximum inner product search oriented vector retrieval according to claim 1, characterized in that: The specific implementation of step (2) is as follows: S21: calculating the norms of the vectors in the target vector set, and dividing all the vectors in the set into a plurality of norm layers according to the norm sizes, each layer comprising a group of vectors with norms falling within a specific interval range, and the layering method adopts a fixed interval, quantile equalization or clustering method; S22: for two adjacent norm layers, selecting a vector with a larger norm from the lower norm layer as a starting point, and selecting a vector with a uniform angle distribution from the higher norm layer as an ending point, connecting the starting point and the ending point to form a candidate connection edge and recording the direction angle thereof; S23: screening all the candidate connection edges, removing edges with repeated directions or too small angles, and adding the remaining candidate connection edges as spherical path edges to the approximate sparse graph index structure to form a jump path connecting a plurality of norm layers.

4. The graph indexing method for maximum inner product search oriented vector retrieval according to claim 1, characterized in that, The specific implementation of step (3) is as follows: S31: normalizing all the vectors in the target vector set to project the direction information of the vectors uniformly onto a unit sphere; on this basis, clustering the normalized vectors using a clustering algorithm to divide the target vector set into a plurality of clusters with different direction distributions; S32: selecting a plurality of vectors with the largest norms in each cluster as candidate entry points, combining the candidate entry points in all the clusters to form a preliminary candidate entry point set; S33: sorting all the candidate entry points according to the direction angles between the candidate entry points and the query vector, and selecting a plurality of candidate entry points with the smallest direction angles to form a final navigation entry point set.

5. The graph indexing method for maximum inner product search oriented vector retrieval according to claim 1, characterized in that, The specific implementation of step (4) is as follows: S41: during the inner product driven graph search starting from the navigation entry points, for each accessed node, real-time calculation and recording of search state features include: update frequency of the current candidate set, comparison index of the access node and the historical best result, norm variation trend in the search path, and sliding average result of the inner product value; S42: input the calculated search state feature into a pre-trained lightweight decision tree model, which is trained by labeled data of historical search paths, to determine whether the current search has converged or the hit rate has reached the expectation, and the model output is a judgment signal of continuing or terminating the search; S43: according to the output result of the decision tree model, if the judgment signal is termination, the traversal process of the current graph index structure is immediately ended, and the process jumps to the result output stage; if the judgment signal is continue, the next hop vector node is selected from the neighbor nodes of the current access node as the access target to continue the search.

6. The graph indexing method for maximum inner product search oriented vector retrieval according to claim 5, characterized in that: The pre-trained lightweight decision tree model is converted into a static conditional judgment statement when deployed, and is integrated into the vector search execution module in an embedded manner. The decision logic is called once every time a new node is accessed to determine whether to end the search process in advance.

7. The graph indexing method for maximum inner product search oriented vector retrieval according to claim 1, characterized in that: The step (5) adds all access nodes in the search path to the candidate set after the search is terminated. For any access node in the candidate set, the inner product value between the target vector and the query vector is calculated, and all access nodes are sorted from high to low according to the inner product value. Finally, the target vectors of the top K access nodes with the largest inner product values are taken as the final retrieval result, and the inner product values are output together for subsequent recommendation, sorting or result display, where K is a natural number greater than 1.

8. A computer device comprising a memory and a processor, said memory having stored therein a computer program, characterized in that: The processor is configured to execute the computer program to implement the graph index method for maximum inner product vector retrieval according to any one of claims 1-7.

9. A computer readable storage medium storing a computer program, characterized in that: The computer program is executed by the processor to implement the graph index method for maximum inner product vector retrieval according to any one of claims 1-7.

Citation Information

Patent Citations

  • Approximate nearest neighbor search method combining VP tree and guide nearest neighbor graph

    CN112287185A

  • Inner product retrieval method and electronic equipment

    CN115618096A

  • Approximate nearest neighbor searching strategy generating based on reinforcement learning

    WO2020060605A1