Information processing device and information processing method
Patent Information
- Application Number
- JP2025058446
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-03-31
- Publication Date
- 2026-10-14
AI Technical Summary
【0011】 本発明によれば、例えば、情報処理装置において、様々な属性値に対する検索条件を充足しかつクエリベクトルとの距離が近いデータを高速かつ高精度に取得できる。
Smart Images

Figure 2026165840000001_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an information processing apparatus and an information processing method.
Background Art
[0002] In recent years, with the advancement of generative AI technology and the like, methods for acquiring target data from a large amount of vector data at high speed and with high accuracy have been demanded. In this regard, a large number of techniques, including that disclosed in Patent Document 1, have been proposed for acquiring target data from multidimensional vector data based on vector similarity.
[0003] Further, as disclosed in Patent Document 2, there is a technique for facilitating conjunctive filtering in an information retrieval system that retrieves data represented by vectors. In the technique disclosed in Patent Document 2, for each piece of data, a vector-converted data body and a vector-converted attribute value of each piece of data are concatenated to configure an enhanced multidimensional vector. For a query for data retrieval in the information retrieval system, a vector-converted query body and a vector-converted filtering parameter received together with each query are concatenated to configure an enhanced multidimensional query vector. Using this multidimensional query vector, an approximate k-nearest neighbor search is performed to identify data that is relevant to the query and has an attribute value satisfying the filtering parameter.
Prior Art Documents
Patent Documents
[0004]
Patent Document 1
Patent Document 2
Summary of Invention
Problems to be Solved by the Invention
[0005] However, in the technology disclosed in Patent Document 1 mentioned above, when extracting data that satisfies the search conditions for attribute values associated with multidimensional vectors, similar data is first extracted by considering only the similarity of the multidimensional vectors, and then it is determined whether the conditions for the attribute values are satisfied. As a result, there was a problem in that the search speed was reduced because data extraction was performed many times until data that satisfies the search conditions was obtained.
[0006] Furthermore, the technology disclosed in Patent Document 2 mentioned above allows for the simultaneous evaluation of the similarity of multidimensional vectors and the satisfaction of attribute value conditions. However, because the cardinality 'cr' category attribute is converted to a (cr-1)-dimensional multidimensional vector, the number of dimensions of the converted multidimensional vector becomes enormous, resulting in a problem of reduced processing speed and accuracy.
[0007] Furthermore, the technology disclosed in Patent Document 2 mentioned above cannot be applied to attributes with high cardinality or numerical attributes such as ratio scales, which limits the types of data that can be supported and the search queries that can be searched.
[0008] This invention has been made in consideration of the above circumstances, and one of its objectives is to acquire data that satisfies search conditions for various attribute values and is close in distance to the query vector at high speed and with high accuracy in an information processing device. [Means for solving the problem]
[0009] To achieve the above objective, the present invention, in one embodiment, is an information processing device that constructs an index including vectorized unstructured data and data to which structured data is associated, wherein the processor of the information processing device calculates a first scale representing the closeness of the vectorized unstructured data associated with the first data and the second data respectively, calculates a second scale representing the closeness of the structured data associated with the first data and the second data respectively, calculates a first evaluation index representing the closeness of the first data and the second data based on the first scale and the second scale, and constructs the index by combining the first data and the second data according to the first evaluation index.
[0010] Furthermore, in order to achieve the above-mentioned objectives, the present invention also provides, in another embodiment, an information processing device for storing an index including vectorized unstructured data and data to which structured data is associated, wherein the processor of the information processing device receives an input including a query vector that gives conditions that the vectorized unstructured data should satisfy and a search condition that gives conditions that the structured data should satisfy, calculates a first scale representing the closeness between the query vector and the in-index data which is the data included in the index, calculates a second scale representing the closeness between the search condition and the structured data associated with the in-index data, calculates a second evaluation index representing the closeness between the first scale and the second scale, and extracts the in-index data that satisfies the query vector and the search condition according to the second evaluation index. [Effects of the Invention]
[0011] According to the present invention, for example, in an information processing device, data that satisfies search conditions for various attribute values and is close in distance to the query vector can be acquired quickly and with high accuracy. [Brief explanation of the drawing]
[0012] [Figure 1]Diagram showing the configuration of the information processing system according to Embodiment 1 [Figure 2] Diagram showing the configuration of the table according to Embodiment 1 [Figure 3] Diagram showing the configuration of the graph-type index according to Embodiment 1 [Figure 4] Diagram showing the logical configuration of the graph-type index according to Embodiment 1 [Figure 5] Explanatory diagram detailing each element of the data processing unit according to Embodiment 1 [Figure 6] Flowchart showing the index construction processing according to Embodiment 1 [Figure 7] Flowchart showing the evaluation index calculation processing during index construction according to Embodiment 1 [Figure 8] Flowchart showing the index search processing according to Embodiment 1 [Figure 9] Flowchart showing the evaluation index calculation processing during index search according to Embodiment 1 [Figure 10] Flowchart showing the index construction processing according to Embodiment 2 [Figure 11] Flowchart showing the conventional index construction processing according to Embodiment 2 [Figure 12] Flowchart showing the index search processing according to Embodiment 2 [Figure 13] Flowchart showing the extended index search processing according to Embodiment 2 [Figure 14] Flowchart showing the conventional index search processing according to Embodiment 2 [Figure 15] Diagram showing an example of a graph-type index (HNSW) having a hierarchical structure [Figure 16] Flowchart showing the weight optimization processing according to Embodiment 3 [Mode for Carrying Out the Invention]
[0013] Hereinafter, the embodiments according to the present invention will be described in detail with reference to Fig. 1 to Fig. 16. The present invention is not limited by the following embodiments. In the following description, identical numbers are assigned to identical configurations and processes, and duplicate descriptions are omitted.
[0014] [Embodiment 1] (Configuration of information processing system S according to Embodiment 1) Figure 1 is a diagram illustrating the configuration of the information processing system S according to the embodiment. The information processing system S includes an information processing apparatus 1 and a user terminal 100. The user terminal 100 transmits a query including requests for index construction and index search to the information processing apparatus 1.
[0015] The information processing apparatus 1 includes a memory 2, a processor 3, and a storage 4. The memory 2 is a volatile main storage device such as a DRAM (Dynamic Random Access Memory). The processor 3 is an arithmetic processing device such as a CPU (Central Processing Unit). The storage 4 is a non-volatile external storage device such as an SSD (Solid State Drive) or a disk array constructed from SSDs.
[0016] The processor 3 has a data processing unit 31 implemented by executing a program in cooperation with the memory 2. The storage 4 stores a table 41 and a graph-type index 42. The table 41 and the graph-type index 42 are loaded into the memory 2 when processed by the data processing unit 31.
[0017] The data processing unit 31 includes a data import unit 311, a query execution unit 312, an index construction unit 313, an index search unit 314, a weight assignment unit 315, and a data management unit 316. The index construction unit 313 includes an index-construction-time evaluation index calculation unit 3131. The index search unit 314 includes an index-search-time evaluation index calculation unit 3141. The weight assignment unit 315 includes a weight input reception unit 3151 and a weight optimization unit 3152. The data management unit 316 includes a data reading unit 3161 and a data writing unit 3162.
[0018] The data import unit 311 receives a query containing input data and index information from the user terminal 100 and constructs table 41. The data import unit 311 requests data writing processing from the data management unit 316 and index construction processing from the index construction unit 313.
[0019] The query execution unit 312 receives an index search request query from the user terminal 100 and requests data retrieval processing from the data management unit 316 based on the index search results obtained from the index search unit 314. The query execution unit 312 outputs data that matches the index search request query to the user terminal 100 as query results.
[0020] The index construction unit 313 has an index construction evaluation index calculation unit 3131, and based on the index construction request from the data import unit 311, it requests data reading and data writing processes from the data management unit 316 to construct a graph-type index 42.
[0021] The index search unit 314 has an index search evaluation index calculation unit 3141, and based on the index search request from the query execution unit 312, it requests the data management unit 316 to perform data reading processing and searches the graph-type index 42.
[0022] The data management unit 316 includes a data reading unit 3161 and a data writing unit 3162, and reads and writes data to and from memory 2 and storage 4 based on requests from the data import unit 311, query execution unit 312, index construction unit 313, and index search unit 314.
[0023] The index construction evaluation index calculation unit 3131 calculates an evaluation index for the similarity between arbitrary data based on the similarity of attribute values and the logical distance between them in the vector space. This evaluation index makes it possible to construct a graph-type index 42 in which data with similar attribute values and close logical distances between vector data have edges.
[0024] The index search evaluation index calculation unit 3141 calculates an evaluation index regarding the appropriateness of the query result based on the search conditions for the attribute value and the logical distance in the vector space between the attribute value and the query vector. By searching the graph-type index 42 based on this evaluation index, it is possible to quickly and accurately extract only a specified number of vector data that match the search conditions for the attribute value and have a short logical distance from the query vector.
[0025] The weight assignment unit 315 includes a weight input receiving unit 3151 and a weight optimization unit 3152, and provides the weight values of each element used in calculating the evaluation index to the index construction evaluation index calculation unit 3131 and the index search evaluation index calculation unit 3141.
[0026] The weight input receiving unit 3151 accepts the input of the weight w_I specified by the user. The weight optimization unit 3152 automatically optimizes the weight w_I if the weight w_I used in steps S106e (Figure 7) and S114f (Figure 9) is not specified by the user.
[0027] The data reading unit 3161 reads Table 41 and the graph-type index 42 from Memory 2 and Storage 4. The data writing unit 3162 writes Table 41 and the graph-type index 42 to Memory 2 and Storage 4.
[0028] Table 41 shows the main data managed by the data processing unit 31, and includes multiple vector data and attribute values. These data can be stored in any row-oriented or column-oriented format, and the file format used for storage is not particularly limited; it may be CSV, Parquet, or other formats.
[0029] The graph-type index 42 is an index structure for quickly and accurately extracting data from Table 41 that matches the search criteria provided by the user. The graph-type index 42 is represented as a graph structure in which edges are drawn between data in Table 41 that have similar attribute values or vector data, according to the evaluation metrics described later. In this embodiment, the types of graph-type index structures are assumed to be, for example, NSW, HNSW, and SNG, but are not limited to those mentioned above. The format for managing the graph structure is also not limited and may be, for example, an adjacent graph format or a tabular format.
[0030] (Table 41 relating to Embodiment 1) Figure 2 shows the configuration of Table 41 according to Embodiment 1. Table 41 has columns for ID 411, Vector 421, and Attribute 413.
[0031] ID411 is identification information used to uniquely identify the data of vector 412 and the associated attribute 413 value. Vector 412 contains values of multidimensional vector data. Attribute 413 represents the attribute value associated with the corresponding vector 412.
[0032] In Figure 2, attribute 413 represents two types of attributes: attribute 413a, which represents attribute A of the category attribute, and attribute 413b, which represents attribute B of the numeric attribute. However, the number of attributes and the data types of attributes are not limited. Also, while Figure 2 shows a simple row-oriented table structure as an example, it is not limited to this and can be applied to other structures such as column-oriented structures, as well as various organizational structures such as partitioning and striping.
[0033] (Graph-type index 42 relating to Embodiment 1) Figure 3 shows the configuration of the graph-type index 42 according to Embodiment 1. Figure 3 shows the graph-type index 42 for the example in Table 41 shown in Figure 2. The graph-type index 42 has ID 421 and edge 422.
[0034] ID421 is the same as ID411 in Table 41 and represents which vector data each node in the graph-type index 42 corresponds to. Edge 422 represents edge information in the graph-type index 42; for example, in Figure 2, it shows that an edge is drawn to transition from the node corresponding to ID "1" to the node corresponding to the data of ID "4".
[0035] In this embodiment, by determining the nodes to which edges are drawn based on the evaluation index calculated by the index construction evaluation index calculation unit 3131, edges can be preferentially drawn between data whose attribute values are similar and whose vector data are close in logical distance from each other.
[0036] Furthermore, while Figure 3 shows a simple row-oriented table structure as an example, it is not limited to this and can be applied to any data format, including file formats and page formats.
[0037] (Logical structure of graph-type index 42 according to Embodiment 1) Figure 4 shows the logical structure of the graph-type index 42 according to Embodiment 1. The graph-type index 42 can be represented as a set of nodes 401 and edges 402 mapped onto the vector space 400.
[0038] The vector space 400 is a vector space corresponding to the vector data given as input from the user terminal 100, and all the data in Table 41 shown in Figure 2 are mapped onto this space.
[0039] Node 401 has a one-to-one correspondence with the data in Table 41 and possesses not only vector 412 (vector data) but also attribute values of attribute 413. For example, node 401 with ID "1" has attribute 413a (attribute A) with the value "A1" and attribute 413b (attribute B) with the value "0.2".
[0040] Edge 402 indicates that it is possible to transition from one node 401 to another node 401 in the graph. Edge 402 is established between nodes 401 that have been determined to have similar attribute values or vector data based on the evaluation metrics described later. For example, node 401 with ID "1" has edges 402 established between a total of 20 nodes 401, including node "1000", which has a close distance in vector data and similar values for attributes 413a (attribute A) and 413b (attribute B). In the index search process, it is possible to transition from node 401 with ID "1" to these nodes 401 that have edges 402 established between them.
[0041] (Data processing unit 31 according to Embodiment 1) Figure 5 is a detailed explanatory diagram of each element of the data processing unit 31 according to Embodiment 1.
[0042] In Figure 5, the data related to the processing of the data processing unit 31 includes input data 500, parameters 501, queries 502, table data 503, index data 504, query plan 505, index search results 506, and query results 507.
[0043] The input data 500 is data provided as input from the user terminal 100 to the data processing unit 31, and consists of vector data and an arbitrary number of attribute values. The file format of the input data 500 is CSV, but is not limited to this.
[0044] Parameter 501 is a parameter value related to index construction that is given as input from the user terminal 100 to the data processing unit 31, and is passed from the data import unit 311 to the index construction unit 313. Regardless of the input format, such as command line or file, parameter 501 can specify not only information about the graph structure such as the number of edges in the index, but also vector data necessary for calculating evaluation metrics, distance scales for each attribute, and weights when adding up the values of the distance scales.
[0045] Here, any distance measure, such as Euclidean distance or cosine distance, is selected for vector data, and any distance measure appropriate to the scale level of each data is selected for each attribute. Furthermore, the weights assigned when summing the values of each distance measure indicate that a larger weight means that the value of that distance measure is given priority in evaluation. The weight assignment unit 315 receives weight input from the user terminal 100 via the weight input receiving unit 3151, and if no weight input is received, the weight optimization unit 3152 automatically determines the weights. A specific example of the automatic weight determination method will be described later.
[0046] Query 502 is a query provided from the user terminal 100 to the data processing unit 31, and includes information necessary for the nearest neighbor search process, such as search conditions for each attribute, a query vector, and the number of data items to be retrieved. Other data processing, such as aggregation and joining with other table data, may also be specified for the vector data obtained as a result of the nearest neighbor search.
[0047] Table data 503 is constructed by the data import unit 311 based on input data 500 and is saved to storage 4 via the data management unit 316.
[0048] The index data 504 is constructed by the index building unit 313 and stored in the storage 4 via the data management unit 316. The index data 504 is updated in the index building unit 313 by adding new nodes and edges based on the table data 503 obtained from the data management unit 316 and the index data 504 that has been built so far.
[0049] The query plan 505 is data related to the index search portion of the query 502 interpreted by the query execution unit 312 and the optimized execution plan, and includes information on search conditions for each attribute, query vectors, and the number of data to be retrieved.
[0050] The search result 506 is the result of the index search unit 314 searching for a graph-type index represented by table data 503 and index data 504 obtained from the data management unit 116, based on the query plan 505 provided by the query execution unit 312. The search result 506 contains a specified number of table data 503 that satisfy the search conditions for each attribute value, in order of their logical proximity to the query vector.
[0051] The query result 507 is the output of the query execution unit 312 in response to query 502, which is input from the user terminal 100, and may be the search result 506 obtained from the index search unit 314 itself. Alternatively, the query result 507 may be the result of data processing such as joining with other table data 503 or aggregation based on the search result 506.
[0052] Weight 508 is information necessary for calculating evaluation metrics in the index construction evaluation metric calculation unit 3131 and the index search evaluation metric calculation unit 3141. Weight 508 is passed from the weight assignment unit 315 to the weight input reception unit 3151, or to the weight optimization unit 3152, which automatically determines the value.
[0053] The data management unit 316 uses memory 2 to manage the reading and writing of table data 503 and index data 504 to and from storage 4. This allows other processing units to process the data transparently without being aware of the physical storage location of this data.
[0054] (Index construction process related to Embodiment 1) Figure 6 is a flowchart showing the index construction process according to Embodiment 1. The index construction process according to Embodiment 1 is executed by the index construction unit 313 when an index construction request is received via the user terminal 100.
[0055] The index construction process according to Embodiment 1 assumes the use of NSW (Navigable Small World) and a search algorithm for NSW, but this embodiment can also employ other index structures and their search algorithms, including HNSW (Hierarchical Navigable Small World).
[0056] First, in step S101, the index building unit 313 initializes a list L that manages k similarities. However, the number of elements k in list L is determined based on the upper limit of the number of edges given as a parameter from the user terminal 100.
[0057] Next, in step S102, the index building unit 313 determines whether edges have been created for all data in list L. The index building unit 313 terminates the index building process if edges have been created for all data (step S102 YES). On the other hand, if edges have not been created for all data (step S102 NO), the index building unit 313 moves the process to step S103.
[0058] Next, in step S103, the index building unit 313 selects the next target data q to which an edge will be drawn from among the data that does not yet have an edge drawn. The target data q may be selected randomly or based on data similarity.
[0059] Next, in step S104, the index building unit 313 adds the index search starting point to the search candidate list C. The search starting point may be either the data initially added to the search candidate list C, or the data located in the center of the vector space 400.
[0060] Next, in step S105, the index building unit 313 determines whether the search candidate list C is empty. If the search candidate list C is not empty (step S105 NO), the index building unit 313 moves the process to step S106. On the other hand, if the search candidate list C is empty (step S105 YES), the process moves to step S109.
[0061] In step S106, the index construction evaluation index calculation unit 3131 extracts arbitrary data from the search candidate list C as the search point c (first data) and performs an index construction evaluation index calculation process to calculate the index construction evaluation index for the target data q (second data) on which an edge is drawn. Details of the index construction evaluation index calculation process will be described later with reference to Figure 7.
[0062] The search point c selected in step S106 can be either the first data added to the search candidate list C or randomly selected data. However, considering the nature of the index construction evaluation metric, where the index value decreases as the similarity between data increases, prioritizing the selection of nodes transitioned from nodes with smaller index values allows for a more comprehensive evaluation of data similar to the target data q at an earlier stage. This shortens the index construction time and improves the quality of the graph-type index by making it easier to create edges between highly similar data.
[0063] Next, in step S107, the index building unit 313 determines whether the index value of the search point c calculated in step S106 is smaller than the index value of any data in list L. If the index value of the search point c calculated in step S106 is smaller than the index value of any data in list L (step S107 YES), the index building unit 313 proceeds to step S108. On the other hand, if the index value of the search point c calculated in step S106 is larger than the index value of any data in list L (step S107 NO), the index building unit 313 returns to step S105.
[0064] In step S108, the index building unit 313 simply adds a search point c if the number of elements in list L is less than k, and if the number of elements is k or greater, it swaps the search point c with the data with the highest index value in list L. The index building unit 313 then adds unexplored nodes that can be accessed from search point c to the search candidate list C. Step S108 makes it possible to explore data near search point c. When step S108 is finished, the index building unit 313 returns to step S105.
[0065] Meanwhile, in step S109, the index building unit 313 establishes edges between the search point c and the data similar to the search point c, since there are up to k data similar to the search point c stored in list L. Through this process, target data q with small evaluation metrics are efficiently discovered, and a graph-type index 42 is constructed by establishing edges between the target data q and the search point c.
[0066] The index construction process described above constructs an index by combining the first data with one or more second data points whose deviation from the baseline value of the first evaluation index based on the first data falls within a predetermined rank in ascending order of increasing deviation. The baseline value is the first evaluation index (index construction evaluation index) when the first data and the second data are the same.
[0067] Conventional graph indexes for approximate nearest neighbor searches of vector data draw edges based solely on the distance between vectors. However, in this embodiment, the index construction evaluation metric considers not only the distance between vectors but also the similarity of attribute values. Therefore, it is possible to construct a graph index that has edges between data that are not only close in distance but also have high similarity in attribute values.
[0068] (Calculation process for evaluation indicators during index construction according to Embodiment 1) Figure 7 is a flowchart showing the index construction evaluation index calculation process according to Embodiment 1. The index construction evaluation index calculation process is performed in step S106 (Figure 6) of the index construction process.
[0069] First, in step S106a, the index construction evaluation index calculation unit 3131 initializes the index value x to 0. Next, in step S106b, the index construction evaluation index calculation unit 3131 calculates the distance between the vector of the target data q and the search point c selected by the index construction unit 313, based on the distance scale set as a parameter from the user terminal 100. This distance is the first scale representing the closeness of the vectorized unstructured data (e.g., vectors) associated with the first data and the second data, respectively.
[0070] Then, the index construction evaluation index calculation unit 3131 normalizes the distance between the target data q and the search point c vector so that the minimum value is 0 and the maximum value is 1, and then adds it to the index value x.
[0071] Next, in step S106c, the index construction evaluation index calculation unit 3131 determines whether it has evaluated the similarity of the values of all attributes. If the index construction evaluation index calculation unit 3131 has not evaluated the similarity of the values of all attributes (step S106c NO), it proceeds to step S106d. On the other hand, if the index construction evaluation index calculation unit 3131 has evaluated the similarity of the values of all attributes (step S106c YES), it proceeds to step S106f.
[0072] In step S106d, the index construction evaluation index calculation unit 3131 selects one attribute I to be evaluated from the unevaluated attributes. The order in which attribute I is selected here does not affect the calculation result of the index value x.
[0073] Next, in step S106e, the index construction evaluation index calculation unit 3131 calculates a distance scale in the attribute I of the target data q and search point c selected in step S106b. This distance scale is a second scale that represents the closeness of the structured data (e.g., attributes) associated with the first data and the second data, respectively.
[0074] The index construction evaluation index calculation unit 3131 then normalizes the distance scale values of attribute I for the target data q and search point c so that the minimum value is 0 and the maximum value is 1, and then adds the value obtained by multiplying these values by the weight w_I corresponding to attribute I to the index value x. The weight w_I that is multiplied changes the contribution of attribute I to the index value x.
[0075] Here, the weight w_I indicates that a larger value prioritizes the evaluation of the similarity of that attribute, and the value passed from the weighting unit 315 is used. The way edges are drawn changes depending on the tuning of this weight w_I, so it affects not only the index construction time but also the processing accuracy and processing time during index searching. In addition, the distance scale for attribute I is specified in advance as a parameter from the user terminal 100. For example, for category attributes, a binary value of the judgment result of matching or not matching values is set, and for ratio scale attributes, a distance scale appropriate to the scale level such as Euclidean distance is set. When step S106e is completed, the index construction evaluation index calculation unit 3131 returns to step S106c.
[0076] Finally, in step S106f, the index construction evaluation index calculation unit 3131 outputs the index value x that has been calculated so far.
[0077] The higher the similarity between data points, the lower the value of the evaluation metric during index construction. By constructing a graph-type index 42 based on this value, it is possible to create edges between data points that are not only close in vector distance but also have high similarity in attribute values. Furthermore, since the evaluation value is calculated by comparing attribute values, it is possible to evaluate attribute values of any data type.
[0078] (Index search process according to Embodiment 1) Figure 8 is a flowchart showing the index search process according to Embodiment 1. The index search process according to Embodiment 1 is executed by the index search unit 314 when an index search request, including the specification of the number of top-k (top k) search data, is received via the user terminal 100.
[0079] The index search process according to Embodiment 1 assumes the use of NSW and a search algorithm for NSW, similar to the index construction process. However, in this embodiment, other index structures and their search algorithms, including HNSW, can also be used. For example, since HNSW is a hierarchical structure of NSW, the index can be searched from the top level using the index search process shown in Figure 8, and in subsequent levels, the neighboring points of the upper layer are used as the search starting point to similarly search and thus a graph-type index based on HNSW can be searched.
[0080] First, in step S111, the index search unit 314 initializes a list L for managing k similarities. However, the number of elements k in list L is determined based on the number of retrieved data given as a query.
[0081] Next, in step S112, the index search unit 314 adds the index search starting point to the search candidate list C. The search starting point may be either the data initially added to the search candidate list C, or the data located in the center of the vector space 400.
[0082] Next, in step S113, the index search unit 314 determines whether the search candidate list C is empty. The index construction unit 313 proceeds to step S114 if the search candidate list C is not empty (step S113 NO). On the other hand, the index search unit 314 proceeds to step S117 if the search candidate list C is empty (step S113 YES).
[0083] In step S114, the index search evaluation index calculation unit 3141 extracts arbitrary data from the search candidate list C as the search point c and executes an index search evaluation index calculation process to calculate the index search evaluation index for the query qr. Details of the index search evaluation index calculation process will be described later with reference to Figure 9.
[0084] The search point c selected in step S114 can be either the first data added to the search candidate list C, or data randomly selected from the search candidate list C. However, we must consider the property of the index search evaluation index, which takes a value of 1 or less if the search condition is satisfied, and a value greater than 1 if the search condition is not satisfied. In this case, by prioritizing the evaluation of nodes that have transitioned from nodes with smaller index values, data that satisfies the search condition can be comprehensively searched at an earlier time. This improves the processing accuracy in the index search process and also shortens the processing speed.
[0085] Furthermore, the graph-type index 42 of this embodiment has edges 402 between data points that are not only close in distance from each other but also have a high degree of similarity in their attribute values. Therefore, once data that satisfies the search criteria is found, it is possible to comprehensively search for other data that satisfy the search criteria by following the edges of that data.
[0086] In the following step S115, the index search unit 314 determines whether the index value of the search point c calculated in step S114 is smaller than the index value of any data in list L. If the index value of the search point c calculated in step S114 is smaller than the index value of any data in list L (step S115 YES), the index search unit 314 proceeds to step S116. On the other hand, if the index value of the search point c calculated in step S114 is larger than the index value of any data in list L (step S115 NO), the index search unit 314 returns to step S113.
[0087] In step S116, the index search unit 314 simply adds a search point c if the number of elements in list L is less than k, and if the number of elements is k or greater, it swaps the search point c with the data with the highest index value in list L. The index search unit 314 then adds unexplored nodes that can be accessed from search point c to the search candidate list C. Step S116 makes it possible to search data near search point c. When step S116 is completed, the index search unit 314 returns to step S113.
[0088] Meanwhile, in step S117, the index search unit 314 outputs these data as search results because the list L contains k pieces of data similar to the search point c.
[0089] The index search process described above extracts, for example, one or more indexed data points whose deviation from the baseline value of the second evaluation metric based on the query vector falls within a predetermined rank when sorted in ascending order of increasing deviation. The baseline value is the second evaluation metric (index search evaluation metric) when the query vector and the indexed data are identical.
[0090] Through the above processing, in this embodiment, by considering the characteristics of the index and evaluation indicator and devising the search order of the index, a specified number of data points that are close in distance to the query vector are extracted quickly and accurately from among the data that satisfy the search conditions for the attribute values.
[0091] (Calculation process for evaluation index during index search according to Embodiment 1) Figure 9 is a flowchart showing the index search evaluation index calculation process according to Embodiment 1. The index search evaluation index calculation process is performed in step S114 (Figure 8) of the index search process.
[0092] First, in step S114a, the index search evaluation index calculation unit 3141 initializes the index value x to 0. Next, in step S114b, the index search evaluation index calculation unit 3141 calculates the distance between the vector given as a query and the search point c selected by the index search unit 314, based on the distance scale set as a parameter from the user terminal 100. The vector given as a query is called query qr.
[0093] The distance calculated in step S114a is a primary measure representing the closeness between the query vector and the vectorized unstructured data associated with the in-index data, which is the data contained in the index. The index search evaluation index calculation unit 3141 then normalizes the distance between the vector of query qr and search point c so that the minimum value is 0 and the maximum value is 1, and adds it to the index value x.
[0094] Next, in step S114c, the index search evaluation index calculation unit 3141 determines whether it has evaluated the values of all attributes specified in the query qr. If there are still attributes that have not been evaluated (step S114c NO), the index search evaluation index calculation unit 3141 moves to step S114d. On the other hand, if all attributes have been evaluated (step S114c YES), the index search evaluation index calculation unit 3141 moves to step S114g.
[0095] In step S114d, the index search evaluation index calculation unit 3141 selects one attribute I to be evaluated from the unevaluated attributes. The order in which the attributes are selected here does not affect the calculation result of the index value x.
[0096] Next, in step S114e, the index search evaluation index calculation unit 3141 determines whether the value of attribute I of the search point c selected in step S114b satisfies the search condition specified in query qr. If the search condition is not satisfied (step S114e NO), the index search evaluation index calculation unit 3141 moves the process to step S114f. On the other hand, if the search condition is satisfied (step S114e YES), the index search evaluation index calculation unit 3141 moves the process to step S114g.
[0097] In step S114f, the index search evaluation index calculation unit 3141 adds a weight w_I corresponding to attribute I to the index value x in order to represent the penalty for not satisfying the search condition for attribute I. At this time, the weight w_I added to the index value x becomes a second measure that represents the closeness between the search condition and the structured data associated with the data in the index. When step S114f is completed, the index search evaluation index calculation unit 3141 returns to step S114c.
[0098] Here, the weight w_I is a real value greater than 1 passed from the weighting unit 315, and it changes the contribution of attribute I to the index value x. In other words, the larger the value of the weight w_I to be added, the more preferentially the search conditions for that attribute are evaluated. Tuning this weight w_I changes the search order of nodes in the index, and therefore affects the processing accuracy and processing time of index searches.
[0099] Meanwhile, in step S114g, the index search evaluation index calculation unit 3141 outputs the index value x that has been calculated so far.
[0100] The index search evaluation metric will be 1 or less if all search conditions for the attribute value are satisfied, and will be larger the more attribute values are not satisfied. Therefore, the index search evaluation metric value can be used to determine whether each data item satisfies all search conditions, and by prioritizing the search of data with a small index search evaluation metric value, data that satisfies the search conditions can be found more comprehensively and earlier. Furthermore, since the evaluation value is calculated by comparing attribute values, it can evaluate attribute values of any data type.
[0101] [Embodiment 2] Embodiment 2 describes a configuration in which the index search method of Embodiment 1 described above is used in combination with a conventional index search method. In the description of Embodiment 2, the differences from Embodiment 1 will be the main focus, and explanations that overlap with the configuration and processing of Embodiment 1 will be omitted.
[0102] (Index construction process according to Embodiment 2) Figure 10 is a flowchart showing the index construction process according to Embodiment 2. The index construction process according to Embodiment 2 is executed by the index construction unit 313 when an index construction request is received via the user terminal 100.
[0103] First, in step S121, the index building unit 313 determines whether an attribute value exists for the target data. If an attribute value exists for the target data (step S121 YES), the index building unit 313 moves the process to step S122; otherwise, it moves the process to step S123.
[0104] In step S122, the index building unit 313 executes the index building process according to Embodiment 1 (Figure 6). On the other hand, in step S123, the index building unit 313 executes the conventional index building process. Details of the conventional index building process will be described later with reference to Figure 11.
[0105] Steps S122 and S123 may be executed sequentially in this order, or they may be executed in parallel.
[0106] (Conventional index building process according to Embodiment 2) Figure 11 is a flowchart showing the conventional index building process according to Embodiment 2. The conventional index building process differs from the index building process according to Embodiment 1 in that step S106B is executed instead of step S106, but is otherwise identical.
[0107] In step S106B, the index construction evaluation index calculation unit 3131 calculates a conventional distance index. That is, the index construction evaluation index calculation unit 3131 calculates the distance of the vector data of the target data as the index value of the conventional distance index.
[0108] (Index search process according to Embodiment 2) Figure 12 is a flowchart showing the index search process according to Embodiment 2. The index search process according to Embodiment 2 is executed by the index search unit 314 when a user instruction, including the specification of the number of top-k (top k) search data, is received via the user terminal 100.
[0109] First, in step S131, the index search unit 314 determines whether a search condition exists for the attribute value of the target data in the given search conditions. If a search condition exists for the attribute value of the target data (step S131 YES), the index search unit 314 moves to step S132; otherwise, it moves to step S136.
[0110] In step S132, the index search unit 314 executes the index search process according to Embodiment 1 (Figure 8). Next, in step S133, the index search unit 314 determines whether all of the top k data (Top-k) searched in step S132 satisfy the given search conditions. If there are any Top-k data that do not satisfy the given search conditions (step S133NO), the index search unit 314 moves the process to step S134. On the other hand, if all of the Top-k data satisfy the given search conditions (step S133YES), the index search unit 314 moves the process to step S135.
[0111] In step S134, the index search unit 314 executes an extended index search process that expands the search target to include conventional nodes. Details of the extended index search process will be described later with reference to Figure 13. When step S134 is completed, the index search unit 314 moves on to step S135.
[0112] Meanwhile, in step S136, the index search unit 314 performs a conventional index search process similar to that of the past. Details of the extended index search process will be described later with reference to Figure 14. When step S136 is completed, the index search unit 314 moves on to step S135.
[0113] In step S135, the index search unit 314 outputs the search result from step S132, step S134, or step S136 via the output unit of the user terminal 100.
[0114] (Extended index search process according to Embodiment 2) Figure 13 is a flowchart showing the extended index search process according to Embodiment 2. The extended index search process according to Embodiment 2 differs from the index search process according to Embodiment 1 (Figure 8) in that step S116B is executed instead of step S116, but is otherwise identical.
[0115] In step S116B, the index search unit 314 simply adds a search point c if the number of elements in list L is less than k, and if the number of elements is k or greater, it replaces the search point c with the data with the highest index value in list L. The index search unit 314 then adds conventional nodes to the search candidate list C along with unexplored nodes that can be transitioned from the search point c. A conventional node is a node 401 that is determined to be transitionable based on the distance of the vector data of the target data using a conventional method.
[0116] (Conventional index search process according to Embodiment 2) Figure 14 is a flowchart showing a conventional index search process according to Embodiment 2. The conventional index search process according to Embodiment 2 differs from the index search process according to Embodiment 1 (Figure 8) in that step S114B is executed instead of step S114, but is otherwise identical.
[0117] In step S114B, the index search evaluation index calculation unit 3141 selects a search point c from the search candidate list C and calculates a conventional distance index for query qr. That is, the index search evaluation index calculation unit 3141 calculates the distance between the search point c and the vector data of query qr as the index value of the conventional distance index.
[0118] In the above-described embodiment 2, by appropriately switching between embodiment 1 and the prior art for the index construction process and the index search process, or using them in combination, a variety of search results can be obtained at high speed and with high accuracy compared to using embodiment 1 or the prior art alone.
[0119] [Embodiment 3] Embodiment 3 describes the optimization of the weight w_I by the weight optimization unit 3152.
[0120] In the above-described embodiment 1, the structure of the graph-type index and the search order of the index are changed by tuning the weights of each attribute used in calculating the index construction evaluation index and the index search evaluation index. This has a significant impact on the processing time and processing accuracy of the index construction process and the index search process.
[0121] In the above-described embodiment 1, the index search is characterized by prioritizing the search of data with a small index search evaluation metric, i.e., data with high similarity to the query vector. Due to this characteristic, in the initial stages of the search, similar to a depth-first search, it is possible to transition to data that satisfies the search conditions at an early stage by searching a straight path in the graph.
[0122] Furthermore, the index constructed by Embodiment 1 described above prioritizes creating edges between data with similar attribute values. Therefore, once a user is able to transition to data that satisfies the search criteria, they can transition from that data to many other data that also satisfy the search criteria, allowing for a comprehensive search of data that satisfies the search criteria from the middle of the search onward.
[0123] Therefore, if there is no prior information about the data distribution or query workload, setting all of the above weights to 1 will achieve the expected search results.
[0124] On the other hand, further optimization is possible if prior information about data distribution and query workload is available. In particular, data management systems such as DBMS (Database Management Systems) optimize processing by collecting various statistical information, including histograms of data distribution and query logs. In light of this, the following describes the optimization of weights based on selectivity for attributes, assuming that statistical information is available.
[0125] Here, the selectivity rate for an attribute is an indicator of how much data is extracted based on a search condition for a certain attribute I. A lower selectivity rate means that fewer data points are extracted, i.e., the filtering effect is higher. For example, when all attribute values follow a uniform distribution, the selectivity rate for the gender attribute, which has two possible values (male and female), is 1 / 2, and the selectivity rate for the prefecture attribute is 1 / 47.
[0126] In the above-described embodiment 1, by setting a larger weight for attributes with a low selectivity, edges are preferentially built for data with high similarity to these attributes, allowing for a comprehensive search of a small portion of all data at an earlier stage. In other words, the processing speed and accuracy of the search process can be greatly improved.
[0127] However, depending on the search algorithm used for the graph index, assigning a large weight to attributes with low selectivity may worsen the processing speed and accuracy of the search.
[0128] For example, a simple graph-type index like NSW has the problem that searching for data that is far from the starting point of the search, i.e., data that requires many hops to reach, becomes computationally expensive.
[0129] Therefore, graph-type indexes intentionally build edges even between distant data points, allowing users to explore data that differs significantly in a single transition, thereby reducing the average number of hops required for index searching.
[0130] In HNSW, the index is hierarchical, and some data is probabilistically selected from the lower layers and copied to the upper layers, thereby constructing a coarser-grained graph in the upper layers by thinning out some nodes in the lower layers' graphs. Then, by starting the search from the top layer and using the neighboring points of the upper layers as the starting points for the search in the lower layers, the search can be performed with a coarser granularity at the top layer and gradually with finer granularity towards the bottom layer, thus accelerating the convergence of the index search process.
[0131] Figure 15 shows an example of a hierarchical graph index (HNSW). In the top layer of the HNSW shown in Figure 15, there are only 3 data points (nodes). For example, if the data is a prefecture attribute, there is at most a 3 / 47 probability that data satisfying the search condition will exist, and there is a 44 / 47 probability that the filtering effect will disappear. Therefore, in the example in Figure 10, increasing the weight of the prefecture attribute would actually increase the number of pops required for the search.
[0132] Based on the above, as Embodiment 3, we will describe an example of a weight optimization method that takes into account the selectivity of attribute values of data within the index, the structure of the graph-type index, and the search method of the graph-type index in the weight optimization unit 3152.
[0133] In the following Embodiment 3, HNSW is assumed as the type of graph index structure, but the following discussion can be extended to other types of graph index structures and search algorithms for those graph index structures, according to each respective graph structure.
[0134] The data distribution of attribute I is stored as a histogram, and the number of data points in bin i is denoted as n_i. For example, if it is a categorical attribute, each value is assigned to a different bin, and if it is a numerical attribute, any data point is assigned to one of the bins separated at regular intervals by a uniformly spaced histogram.
[0135] Furthermore, let p_i be the probability that data contained in bin i is selected by a query. However, since p_i is unknown when the index is first built, we set p_i = 1 / |I| when the number of bins in the histogram is |I|. When the index is rebuilt, p_i is set from the query log.
[0136] Let n_l be the number of nodes in hierarchy l. n_l is calculated from the total number of data points and the sampling probability in hierarchy l.
[0137] In this embodiment, the filtering effect f_l^I(i) of the data included in bin i of attribute I in hierarchy l of the graph-type index is defined as shown in equation (1). However, equation (1) is just one example of the definition of the data filtering effect f_l^I(i), and any other function that satisfies requirements such as taking the maximum value when n_lp_i=1 may be used.
number
[0138] Furthermore, the filtering effect F_l^I of attribute I in hierarchy l is defined as the sum of the filtering effects of the data included in all bins i, as shown in equation (2).
number
[0139] On the other hand, the filtering effect F_I of attribute I in HNSW is defined as the average value of the filtering effect of each level l, as shown in equation (3), so that its value does not change significantly depending on the number of levels LL.
number
[0140] As mentioned above, in this embodiment, by setting the weight w_I of attribute I to 1 or more, data that satisfies the search conditions can be comprehensively searched at an earlier stage. Therefore, the weight w_I is set as shown in equation (4).
number
[0141] The index construction evaluation index calculation unit 3131 and the index search evaluation index calculation unit 3141 calculate the index value (weight w_I) based on the weight w_I determined by the method described above.
[0142] (Weight optimization process according to Embodiment 3) FIG. 16 is a flowchart illustrating a weight optimization process according to the third embodiment. The weight optimization process is executed by the weight optimization unit 3152 when no weight w_I is specified by a user.
[0143] First, in step S141, the weight optimization unit 3152 initializes the index "I" of attribute I to 0. Next, in step S142, the weight optimization unit 3152 determines whether the index "I" of attribute I satisfies I<nc (nc is the number of attributes). The weight optimization unit 3152 shifts the process to step S143 when I<nc is satisfied (YES in step S142), and terminates the weight optimization process when I<nc is not satisfied (NO in step S142).
[0144] In step S143, the weight optimization unit 3152 calculates the narrowing-down effect F_I of attribute I based on the above-described formula (2) and formula (3). Next, in step S144, the weight optimization unit 3152 calculates the weight w_I based on the above-described formula (4). The weight optimization unit 3152 shifts the process to step S142 when step S144 is completed.
[0145] The present invention is not limited to the above-described embodiments, and includes various modifications. For example, the above-described embodiments have been described in detail to explain the present invention in an easy-to-understand manner, and are not necessarily limited to those having all the configurations described. Further, a part of the configuration of a certain embodiment can be replaced with the configuration of another embodiment, and the configuration of another embodiment can be added to the configuration of a certain embodiment. Further, with respect to a part of the configuration of each embodiment, addition, deletion, and replacement of other configurations can be performed. Further, each of the above-described configurations, functions, processing units, processing means, and the like may be partially or entirely realized by hardware, for example, by designing them with an integrated circuit.
[0146] Furthermore, each component and function of the information processing device 1 described above may be implemented in software by the processor interpreting and executing a program that realizes each function. The program, when executed by the processor, performs the defined processing as appropriate, using a memory device and / or interface device. The program may be installed from the program source into a device such as a computer. The program source may be, for example, a program distribution server or a computer-readable (e.g., non-temporary) recording medium. Regarding the program, two or more programs may be implemented as one program, or one program may be implemented as two or more programs. [Explanation of Symbols]
[0147] S: Information processing system, 1: Information processing device, 3: Processor, 41: Table, 42: Graph-type index, 313: Index construction unit, 3131: Index construction evaluation index calculation unit, 314: Index search unit, 3141: Index search evaluation index calculation unit, 315: Weight assignment unit, 3152: Weight optimization unit
Claims
1. An information processing device that constructs an index including vectorized unstructured data and data to which structured data is associated, The processor of the aforementioned information processing device is A first scale is calculated that represents the closeness of the vectorized unstructured data associated with the first data and the second data, respectively. A second scale is calculated that represents the closeness of the structured data associated with the first data and the second data, respectively. Based on the first scale and the second scale, a first evaluation index representing the closeness between the first data and the second data is calculated. The index is constructed by combining the first data and the second data according to the first evaluation index. An information processing device characterized by the following:
2. An information processing apparatus according to claim 1, The aforementioned processor, The index is constructed by combining the first data and the second data, using the first evaluation index as a reference value when the first data and the second data are identical, and the second data such that the degree of deviation of the first evaluation index based on the first data from the reference value falls within a predetermined rank in ascending order of the degree of deviation. An information processing device characterized by the following:
3. An information processing apparatus according to claim 1, The aforementioned processor, The first evaluation index is calculated based on the weights that change the contribution of the second scale to the first evaluation index, the first scale, and the second scale. An information processing device characterized by the following:
4. An information processing apparatus according to claim 3, The aforementioned processor, The weights are determined based on the selection rate, which represents the probability that each of the structured data points is selected in the second data set. An information processing device characterized by the following:
5. An information processing apparatus according to claim 1, The aforementioned processor, The system determines whether the vectorized unstructured data and the structured data are associated with the data, or whether only the vectorized unstructured data is associated with the data and the structured data is not associated with it. Depending on the result of the above determination, the index is constructed based on either or both of the following: the first evaluation index based on the first scale and the second scale, and the first evaluation index based on the first scale only. An information processing device characterized by the following:
6. An information processing apparatus according to claim 1, The aforementioned processor, The first scale is defined as the normalized distance between the vectors associated with the first data and the second data, respectively, as vectorized unstructured data, and the second scale is defined as the normalized distance between one or more attributes associated with the first data and the second data, respectively, as structured data. The first evaluation index is calculated based on the first and second scales. An information processing device characterized by the following:
7. An information processing device that stores an index including vectorized unstructured data and data to which structured data is associated, The processor of the aforementioned information processing device is The system accepts input including a query vector that gives conditions that the vectorized unstructured data must satisfy, and search conditions that give conditions that the structured data must satisfy. A first measure representing the closeness between the query vector and the vectorized unstructured data associated with the indexed data, which is the data included in the index, is calculated. A second measure is calculated that represents the closeness between the search conditions and the structured data associated with the indexed data. A second evaluation index representing the closeness between the first scale and the second scale is calculated. The query vector and the index data that satisfy the search conditions are extracted according to the second evaluation indicator. An information processing device characterized by the following:
8. An information processing apparatus according to claim 7, The aforementioned processor, Using the second evaluation index as a reference value when the query vector and the indexed data are identical, the indexed data is extracted such that the degree of deviation of the second evaluation index based on the query vector from the reference value falls within a predetermined rank in ascending order of the degree of deviation. An information processing device characterized by the following:
9. An information processing apparatus according to claim 7, The aforementioned processor, The second evaluation index is calculated based on the weights that change the contribution of the second scale to the second evaluation index, the first scale, and the second scale. An information processing device characterized by the following:
10. An information processing apparatus according to claim 9, The aforementioned processor, The weights are determined based on the selection rate, which represents the probability that each of the structured data in the indexed data will be selected. An information processing device characterized by the following:
11. An information processing apparatus according to claim 7, The aforementioned processor, Determine whether the search conditions exist for the structured data. Depending on the result of the determination, the second evaluation index based on the first scale and the second scale, and the second evaluation index based on the first scale only, or both, are used to extract the query vector and the index data that satisfy the search conditions. An information processing device characterized by the following:
12. An information processing apparatus according to claim 7, The aforementioned processor, The first scale is defined as the normalized distance between the vectors associated with the query vector and the indexed data, respectively, as vectorized unstructured data, and the second scale is defined as the normalized distance between one or more attributes associated with the search conditions and the indexed data, respectively, as structured data, and the second evaluation index is calculated based on the first and second scales. An information processing device characterized by the following:
13. An information processing apparatus according to claim 10, The aforementioned processor, If, based on the second evaluation index which is based on the first and second scales, it is not possible to extract the query vector and index data that satisfies the search conditions, the index data which satisfies the query vector and the search conditions is extracted from the index data which includes data that is determined to be transitionable based on the second evaluation index which is based on the first scale only. An information processing device characterized by the following:
14. An information processing method performed by an information processing device that stores an index including vectorized unstructured data and data to which structured data is associated, The processor of the aforementioned information processing device The system accepts input including a query vector that gives conditions that the vectorized unstructured data must satisfy, and search conditions that give conditions that the structured data must satisfy. A first measure representing the closeness between the query vector and the vectorized unstructured data associated with the indexed data, which is the data included in the index, is calculated. A second measure is calculated that represents the closeness between the search conditions and the structured data associated with the indexed data. A second evaluation index representing the closeness between the first scale and the second scale is calculated. The query vector and the index data that satisfy the search conditions are extracted according to the second evaluation indicator. An information processing method characterized by having each of the following processes.
Citation Information
Patent Citations
Information processing device, information processing method, and information processing program
JP2020009333A
Conjunctive filtering with embedding models
US11704312B2