System and apparatus suitable for facilitating cache maintenance, and a processing method in association thereto
The Parsimonious Cached Recurrent Transformer addresses the quadratic complexity in Transformers by employing a voting mechanism for efficient cache access, reducing memory usage and computational complexity, enabling more optimal cache maintenance.
Patent Information
- Application Number
- GB2023004138
- Authority / Receiving Office
- GB · GB
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2023-03-22
- Publication Date
- 2024-09-25
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Transformers face quadratic complexity in computing attention, which conventional techniques such as sparse attention have not adequately addressed, necessitating more efficient cache maintenance methods for improved performance.
The proposed solution involves a 'Parsimonious Cached Recurrent Transformer' (PCRformer) that uses a divide-and-conquer approach, decomposing input sequences into segments, maintaining a cache to encode historical context, and employing a voting mechanism to select keywords for efficient cache access, reducing memory footprint and computational complexity.
PCRformer facilitates more optimal, efficient, and user-friendly cache maintenance by summarizing attention based on voting counts, requiring only one key-value pair computation and maintaining a smaller memory footprint, thus addressing the quadratic complexity issue in Transformers.
Smart Images

Figure 00000000_0000_ABST
Abstract
Description
Field Of Invention The present disclosure generally relates to one or both of a system and an apparatus suitable for facilitating cache maintenance. The present disclosure further relates a processing method which can be associated with the system and / or the apparatus. Background Transformers can be used in association with Machine Learning tasks. However, it is conventionally acknowledged that due to quadratic complexity for computing attention, Transformers need to be further optimized. Conventional techniques for addressing such complexity include utilization of sparse attention (e.g., Pichao Wang, Xue Wang, Fan Wang, Ming Lin, Shuning Chang, Wen Xie, Hao Li, and Rong Jin. Kvt: k-nn attention for boosting vision transformers. arXiv preprint arXiv:2106.00515, 2021, and Tianyang Lin, Yuxin Wang, Xiangyang Liu, and Xipeng Qiu. A survey of transformers. arXiv preprint arXiv:2106.04554, 2021.). The present disclosure contemplates that it can possibly be helpful to provide one or more other alternatives and / or facilitate improvement / optimization. Summary of the Invention In accordance with an aspect of the disclosure, there is provided a processing method which can, for example, be suitable for facilitating cache maintenance. In one embodiment, the processing method can, for example, include an associating step, a mapping step and an updating step. In regard to the associating step, at least one keyword can be selected. The keyword(s) can be associated with one or more tokens. Moreover, at least one nearest neighbor can be associated with at least one token (of the token(s). At least one vote can be provided for each association. In regard to the mapping step one or more counts which can be associated with the vote(s) can be accumulated for the token(s) (e.g., all tokens) so that a reference hash map (e.g., referable to as “hash map a”) can be derived / generated / determined. In regard to the updating step, data structure associated with the cache can be updated based on the reference hash map in a manner so as to maintain the cache. The present disclosure further contemplates a computer program (not shown) which can include instructions which, when the program is executed by a computer (not shown), cause the computer to carry out the associating step, the mapping step and / or the updating step of the processing method. The present disclosure yet further contemplates a computer readable storage medium (not shown) having data stored therein representing software executable by a computer (not shown), the software including instructions, when executed by the computer, to carry out the associating step, the mapping step and / or the updating step of the processing method. In the above manner, it is contemplated that at least a comparatively more optimal, efficient and / or user-friendly manner of maintaining a cache can be provided / facilitated, in accordance with an embodiment of the disclosure. The above-described advantageous aspect(s) of the processing method of the present disclosure can also apply analogously (all) the aspect(s) of a below described apparatus of the present disclosure. Likewise, all below described advantageous aspect(s) of the apparatus of the disclosure can also apply analogously (all) the aspect(s) of above described processing method of the disclosure. In accordance with an aspect of the disclosure, there is provided an apparatus which can, for example, be suitable for facilitating cache maintenance. The apparatus can, for example, be associated with the processing method, in accordance with an embodiment of the disclosure. The apparatus can, for example, include a first module, a second module and a third module, in accordance with an embodiment of the disclosure. In one embodiment, the first module (e.g., corresponding to a receiver) can, for example, be configured to receive at least one input signal. The second module (e.g., corresponding to a processor) can, for example, be configured to process the input signal(s) according to the processing method as discussed above to generate at least one output signal. The third module (e.g., corresponding to a transmitter) can, for example, be configured to communicate the output signal(s). The output signal(s) can, for example, to communicable to a cache. The output signal(s) can, for example, be used for facilitating cache maintenance. In the above manner, it is contemplated that at least a comparatively more optimal, efficient and / or user-friendly manner of maintaining a cache can be provided / facilitated, in accordance with an embodiment of the disclosure. Brief Description of the Drawings Embodiments of the disclosure are described hereinafter with reference to the following drawings, in which: Fig. 1 shows a system which can include at least one apparatus, according to an embodiment of the disclosure; Fig, 2 shows the apparatus of Fig, 1 in further detail, according to an embodiment of the disclosure; and Fig. 3 shows a processing method in association with the system of Fig. 1, according to an embodiment of the disclosure. Detailed Description The present disclosure contemplates the possibility of a “divide-and-conquer” approach in which input sequences can be decomposed into smaller segments. For example, instead of directly processing a 100-word sequence, the 100-word sequence can be divided into 10 sequences with each sequence having 10 words (e.g., Zihang Dai, Zhilin Yang, Yiming Yang, Jaime Carbonell, Quoc V Le, and Ruslan Salakhutdinov. Transformer-xl: Attentive language models beyond a fixed-length context. arXiv preprint arXiv: 1901.02860, 2019. which contemplates the use of recurrent Transformers to process segments), and a cache can be maintained to encode history context which can be used as additional input to process each segment. Other similar example works include “Pedro Henrique Martins, Zita Marinho, and Andr'e FT Martins. Infinite-former: Infinite memory transformer. arXiv preprint arXiv:2109.00301, 2021.” and “Yuhuai Wu, Markus N Rabe, DeLesley Hutchins, and Christian Szegedy. Memorizing transformers. arXiv preprint arXiv:2203.08913, 2022.”. The present disclosure contemplates that it may be helpful for the cache, as discussed above, to be maintained in a more optimal, user-friendly (i.e., simpler) and / or efficient manner. It is generally contemplated that Neural networks can use the keywords extracted from text to make predictions (e.g., Jasmijn Bastings, Wilker Aziz, and Ivan Titov. Interpretable neural predictions with differentiable binary variables. arXiv preprint arXiv: 1905.08160, 2019.). The present disclosure contemplates a cache mechanism that can be capable of storing features corresponding to such keywords. For example, data structure associated with a cache can, for example, possibly be tailored to / customized to facilitate efficient access to cached information. Specifically, the present disclosure contemplates what can be dubbed as “Parsimonious Cached Recurrent Transformer” (PCRformer) which may, for example, relate to exploitation of historic context without significantly modifying model architecture, in accordance with an embodiment of the disclosure. In contrast to related techniques associated with storing key value pairs from k nearest neighbor in a cache (e.g., Yuhuai Wu, Markus N Rabe, DeLesley Hutchins, and Christian Szegedy. Memorizing transformers. arXiv preprint arXiv:2203.08913, 2022.), PCRformer can be considered to have a comparatively smaller memory footprint and / or higher efficiency. Specifically, PCRformer does not store all key value pairs from local context but selects (only) keyword(s) token(s) based on voting. Moreover, for PCRformer, instead of computing attention on all key value pairs stored in a cache, the cache can be summarized based on voting count(s) and there may be only need for generating / determining possibly only one key value pair. In the above manner, it is contemplated that at least a comparatively more optimal, efficient and / or user-friendly manner of maintaining a cache can be provided / facilitated, in accordance with an embodiment of the disclosure. The foregoing will be discussed in further detail with reference to Fig. 1 to Fig. 3 hereinafter. Referring to Fig. 1, a system 100 is shown, according to an embodiment of the disclosure. The system 100 can, for example, be suitable for facilitating maintenance of a cache (e.g., in association with addressing the issue of quadratic complexity, as discussed earlier), in accordance with an embodiment of the disclosure. As shown, the system 100 can include one or more apparatuses 102, at least one device 104 and, optionally, a communication network 106, in accordance with an embodiment of the disclosure. The apparatus(es) 102 can be coupled to the device(s) 104. Specifically, the apparatus(es) 102 can, for example, be coupled to the device(s) 104 via the communication network 106, in accordance with an embodiment of the disclosure. In one embodiment, the apparatus(es) 102 can be coupled to the communication network 106 and the device(s) 104 can be coupled to the communication network 106. Coupling can be by manner of one or both of wired coupling and wireless coupling. The apparatus(es) 102 can, in general, be configured to communicate with the device(s) 104 via the communication network 106, according to an embodiment of the disclosure. Generally, in accordance with an embodiment of the disclosure, the apparatus(es) 102 can be configured to receive one or more input signals and process the input signal(s) to generate / derive one or more output signals. Moreover, in accordance with an embodiment of the disclosure, the device(s) 104 can, for example, be configured to one or both of generate the input signal(s) and communicate the input signal(s) to the apparatus(es) 102. The apparatus(es) 102 can, for example, be configured to process the input signal(s) to generate / derive the output signal(s), in accordance with an embodiment of the disclosure. In one embodiment, the apparatus(es) 102 can, for example, be carry at least one cache. In another embodiment, the apparatus(es) 102 can, for example, be remote with respect to at least one cache (e.g., the cache is not carried by the apparatus(es) 102). In yet another embodiment, a portion of a cache can be carried the apparatus(es) 102 and another portion of the cache can be remote with respect to the apparatus(es) 102 (e.g., a cache can be partially carried by the apparatus(es) 102). The apparatus(es) 102 will be discussed in further detail with reference to Fig. 2, in accordance with an embodiment of the disclosure The device(s) 104 can, for example, be configured to generate the input signal(s) and / or communicate the input signal(s), in accordance with an embodiment of the disclosure. For example, the input signal(s) can be communicated from the device(s) 104 to the apparatus(es) 102. In one example, a device 104 can carry at least one cache. In one embodiment, the device(s) 104 can, for example, be remote with respect to at least one cache (e.g., the cache is not carried by the device(s) 104). In yet another embodiment, a portion of a cache can be carried the device(s) and another portion of the cache can be remote with respect to the device(s) (e.g., a cache can be partially carried by the device(s) 104). The communication network 106 can, for example, correspond to an Internet communication network, a wired-based communication network, a wireless-based communication network, or any combination thereof. Communication (i.e., between the apparatus(es) 102 and the device(s) 104) via the communication network 106 can be by manner of one or both of wired communication and wireless communication. In one general example, the input signal(s) (e.g., which can include / be indicative of / associated with / comespond to one or more keywords) can be communicated from the device(s) 104 and received by the apparatus(es) 102 for processing to generate one or more output signals which can, for example, be communicated from the apparatus(es) 104 (e.g., to at least one cache). The output signal(s) can, for example, correspond to / include / be associated with at least one structure control type signal which can, for example, be usable for formatting data structure (e.g., tailoring data structure / customization of data structure) associated with a cache to facilitate efficient access to cached information carried by the cache, in accordance with an embodiment of the disclosure. The aforementioned apparatus(es) 102 will be discussed in further detail with reference to Fig. 2 hereinafter. Referring to Fig. 2, an apparatus 102 is shown in further detail in the context of an example implementation 200, according to an embodiment of the disclosure. In the example implementation 200, the apparatus 102 can correspond to an electronic module 200a which can, for example, be capable of performing one or more processing tasks, in accordance with an embodiment of the disclosure. The electronic module 200a can, for example, include a casing 200b. Moreover, the electronic module 200a can, for example, carry any one of a first module 202, a second module 204, a third module 206, or any combination thereof. In one embodiment, the electronic module 200a can carry a first module 202, a second module 204 and / or a third module 206. In a specific example, the electronic module 200a can carry a first module 202, a second module 204 and a third module 206, in accordance with an embodiment of the disclosure. In this regard, it is appreciable that, in one embodiment, the casing 200b can be shaped and dimensioned to carry any one of the first module 202, the second module 204 and the third module 206, or any combination thereof. The first module 202 can be coupled to one or both of the second module 204 and the third module 206. The second module 204 can be coupled to one or both of the first module 202 and the third module 206. The third module 206 can be coupled to one or both of the first module 202 and the second module 204. In one example, the first module 202 can be coupled to the second module 204 and the second module 204 can be coupled to the third module 206, in accordance with an embodiment of the disclosure. Coupling between the first module 202, the second module 204 and / or the third module 206 can, for example, be by manner of one or both of wired coupling and wireless coupling. Each of the first module 202, the second module 204 and the third module 206 can correspond to one or both of a hardware-based module and a software-based module, according to an embodiment of the disclosure. In one example, the first module 202 can correspond to a hardware-based receiver which can be configured to receive one or more input signals. The second module 204 can, for example, correspond to a network-based / software-based and / or hardware-based (e.g., a microprocessor) processing module which can be configured to perform one or more processing tasks in association with any one of, or any combination of, the following: • Associative processing • Mapping processing • Updating-based processing Specifically, the second module 204 can, for example, be configured to process the received input signal(s) by manner of associative processing, mapping processing and / or updating-based processing in a manner so as to generate / derive one or more output signal(s), in accordance with an embodiment of the disclosure. The third module 206 can, in one example, correspond to a hardware-based transmitter which can be configured to communicate the output signal(s) from the electronic module 200a, in accordance with an embodiment of the disclosure. The output signal(s) can, for example, be communicated from the electronic module 200a to one or more devices 104 and / or one or more other apparatuses 102, in accordance with an embodiment of the disclosure. The present disclosure contemplates the possibility that the first and second modules 202 / 204 can be an integrated software-hardware based module (e.g., an electronic part which can carry a software program / algorithm in association with receiving and processing functions / an electronic module programmed to perform the functions of receiving and processing). The present disclosure further contemplates the possibility that the first and third modules 202 / 206 can be an integrated software-hardware based module (e.g., an electronic part which can carry a software program / algorithm in association with receiving and transmitting functions / an electronic module programmed to perform the functions of receiving and transmitting). The present disclosure yet further contemplates the possibility that the first and third modules 202 / 206 can be an integrated hardware module (e.g., a hardware-based transceiver) capable of performing the functions of receiving and transmitting. The above example implementation 200 will now be discussed in further detail with reference to an example scenario, in accordance with an embodiment of the disclosure hereinafter. In the example scenario, the second module 204 can, for example, correspond to a processor capable of processing (i.e., perform one or more processing tasks) the received input signal(s), at one or more time steps, by manner of associative processing, mapping processing and / or updating-based processing to generate one or more output signals, in accordance with an embodiment of the disclosure. The forementioned associative processing, mapping processing and updating-based processing will be discussed in turn, in accordance with an embodiment of the disclosure, hereinafter. In regard to associative processing, the second module 204 can be configured to perform one or more processing tasks which can include any one or both of: • Selecting one or more keywords • Associating one or more nearest neighbors with at least one token It is contemplated that to select the keyword(s), k-nearest neighbors algorithm, kNN, (e.g., Pichao Wang, Xue Wang, Fan Wang, Ming Lin, Shuning Chang, Wen Xie, Hao Li, and Rong Jin. Kvt: k-nn attention for boosting vision transformers. arXiv preprint arXiv:2106.00515, 2021.) can, for example, be used / employed, in accordance with an embodiment of the disclosure. Vanilla attention can be formulated as: / OK T \ ,4 = softmax I -—I . V = 41V {1) X v'd J where .4 € Hnxn is the attention matrix, Q E Rnx<z, K E are the queries and keys. V y- are the old and updated values. kNN attention can, for example, calculate “Q” and “K” by dot product as in vanilla attention and row-wise top “K” elements can be selected for softmax computing as follows: where 71 denotes the selection operator 4.^ € top — k(row j) otherwise. By manner of kNN attention, a token (fi) can, for example, select the “k” nearest neighbors (Ci = {h, fe, ...., fk}), which can provide one vote for each (selected) token. In regard to mapping processing, the counts (e.g., associated with the votes) can be accumulated for all the tokens and a hash map which can store, at a time step “T”, each token and associated count(s) (Ht = {frG, ffCj, ...} can be generated / determined / obtained / derived, in accordance with an embodiment of the disclosure. In regard to updating-based processing, data structure associated with a cache can be updated (e.g., at each time step) based on the hash map (Ht, also referable to as, for example, a “reference hash map” or “hash map a”) as follows: I. For each token f, in Ht that can be determined / identified to be existing in hash map a, the corresponding count Ci can be determined / identified, the determined / identified Q can be used as a key in relation to another hash map (e.g., referable to as a “pointer hash map” or “hash map b”) to identify a pointer parameter (e.g., a first pointer, pj, which can correspond to, for example, an entry in a linked list such as a pointers list). Such token f, can then be removed from hash set. II. The count of f, in “hash map a” can be incremented by Q and if the incremented f, cannot be determined to be existing, (fj, Q) can be added to hash map a. III. Using the updated count as key, another pointer parameter (e.g., a second pointer, pj, which can, for example, correspond to another entry in the pointers list) can be identified in “hash map b”, then t\ can be inserted in the hash set of the corresponding entry in the linked list. IV. If the number of entries in hash map a exceeds a predetermined threshold parameter, the token index can be deleted with the minimum count from “hash map a”, and “hash map b” and / or the linked list can be updated accordingly. Thereafter, the entries in “hash map b” and linked list can be removed accordingly. It is contemplated that the order of entries can, for example, be sorted based on their count in the linked list, in accordance with an embodiment of the disclosure. Specifically, the tokens with maximum count and minimum count can, for example, be obtained in constant time. Moreover, the insertion, the deletion and / or the updating steps (per “I.” to “IV.” as discussed above) can, for example, have time complexity O(n), which can make the cache very efficient. The space complexity can, for example, be bounded to O(n) due to the removal step, in accordance with an embodiment of the disclosure. Moreover, it is contemplated that, generally, in accordance with an embodiment of the disclosure, “Hash map a” can use token index (e.g., t\ to t\) as keys, and can store the counts (e.g., Ci to Q) as values. “Hash map b” can use the counts as keys, and stores pointers (pi to pj) as values. The pointers can, for example, be associated with entries in a doubly linked list which can store points to previous and next entries, as well as the count. The doubly linked list can, for example, also store a hash set to record all token indices having that count. In this regard, a list of tokens from a linked list sorted by counts can be obtained / derived. The list of tokens can, for example, represent feature(s) of the keyword(s) ordered by frequency of occurrence. The counts can, for example, be normalized by softmax to provide weights and context feature can then be obtained by: where 1¾ 14 are the fey and value obtained fo® tokens fo. AVt 14 provide the embedding for the historic keywords and are med as additional. fev and '.S V r.' value in the attention layer. It is contemplated that the above can, for example, be applied to both training and inference, in accordance with an embodiment of the disclosure. Moreover, stop-gradient can, for example, be utilized in respect of K, and VT for training, so that the training process can be analogous / exactly the same as a vanilla transformer, in accordance with an embodiment of the disclosure. An example application will now be discussed in association with the above discussed example scenario, in accordance with an embodiment of the disclosure hereinafter: The example application can, for example, relate to lifelong scene graph construction, in accordance with an embodiment of the disclosure. Generally, leveraging long-term spatial and temporal dependencies can be vital for lifelong visual place recognition and scene graph construction / learning applications. PCRformer can, for example, facilitate such a task by manner of enabling efficient encoding and / or accessing of historical context. Scene graph generation method can usually be grouped into two types: 1. Two-stage methods which can include a cascaded model to generate object proposals, followed by building a dense graph and predicting the predicate entity combinations of the said proposals. 2. One-stage methods which can relate to combining object and predicate proposal into a single pipeline. It is contemplated that most scene graph generation methods that use transformer models employ some form of constraint to limit the extent to which long-term relationships are built. The constraints can help prevent valuable contexts from being overwhelmed by many irrelevant representations. For instance, methods that generate scene graphs from videos or a set of images (e.g., Yuren Cong, Wentong Liao, Hanno Ackermann, Bodo Rosenhahn, and Michael Ying Yang. Spatial-temporal transformer for dynamic scene graph generation. In Proceedings of the IEEE / CVF International Conference on Computer Vision, pages 16372-16382, 2021.) employ a fixed-sized sliding window used to batch the frames from the encoder to prevent interference with distant frames and save memory. However, such constraints can make it hard for the network to encode historical context about the environment. The majority of the scene graph generation methods that use transformers (e.g., Yuren Cong, Michael Ying Yang, and Bodo Rosenhahn. Reltr: Relation transformer for scene graph generation. arXiv preprint arXiv:2201.11460, 2022.; Suprosanna Shit, Rajat Koner, Bastian Wittmann, Johannes Paetzold, Ivan Ezhov, Hongwei Li, Jiazhen Pan, Sahand Sharifzadeh, Georgios Kaissis, Volker Tresp, et al. Relationformer: A unified framework for image-to-graph generation. arXiv preprint arXiv:2203.10202, 2022.) focus on extracting scene graphs from a simple image. In contrast, in the context of the example application, the present disclosure can possibly be employed in single and two-stage scene graph generation methods for lifelong scene graph construction in view of the usage of cached memory per the earlier discussed cache. In the above manner, it is contemplated that at least a comparatively more optimal, efficient and / or user-friendly manner of maintaining a cache can be provided / facilitated, in accordance with an embodiment of the disclosure. The above-described advantageous aspect(s) of the apparatus 102 of the present disclosure can also apply analogously (all) the aspect(s) of a below described processing method of the present disclosure. Likewise, all below described advantageous aspect(s) of the processing method of the disclosure can also apply analogously (all) the aspect(s) of above described apparatus 102 of the disclosure. It is to be appreciated that these remarks apply analogously to the earlier discussed system 100 of the present disclosure. Referring to Fig. 3, a processing method in association with the system 100 is shown, according to an embodiment of the disclosure. The processing method 300 can, for example, be suitable for facilitating maintenance of a cache (e.g., in association with addressing the issue of quadratic complexity, as discussed earlier), in accordance with an embodiment of the disclosure. Moreover, the processing method 300, or any portion / part thereof, can, for example, possibly be performed at one or more time steps, in accordance with an embodiment of the disclosure. The processing method 300 can, for example, include any one of an associating step 302, a mapping step 304 and an updating step 306, or any combination thereof, in accordance with an embodiment of the disclosure. For example, the processing method 300 can include an associating step 302, a mapping step 304 and / or an updating step 306, in accordance with an embodiment of the disclosure. In one embodiment, the processing method 300 can include an associating step 302, a mapping step 304 and an updating step 306. In another embodiment, the processing method 300 can include an associating step 302 and a mapping step 304. In yet another embodiment, the processing method 300 can include a mapping step 304 and an updating step 306. In yet a further embodiment, the processing method 300 can include an updating step 306. In yet a further additional embodiment, the processing method 300 can include one of an associating step 302, a mapping step 304 and an updating step 306 (i.e., an associating step 302, a mapping step 304 or an updating step 306). In yet another further additional embodiment, the processing method 300 can, for example, include an associating step 302 and an updating step 306. With regard to the associating step 302, one or more processing tasks in association with one or both of selecting one or more keywords and associating one or more nearest neighbors associated with at least one token (i.e., selecting at least one keyword and / or associating nearest neighbor(s) associated with at least one token) can be performed, in accordance with an embodiment of the disclosure. For example, the apparatus(es) 102 can be configured to perform the processing task(s) in association with the selection of at least one keyword and / or association of nearest neighbor(s) associated with at least one token, as discussed earlier with reference to Fig. 2, in accordance with an embodiment of the disclosure. With regard to the mapping step 304, one or more processing tasks in association with accumulating one or more counts (e.g., associated with votes) for all tokens can be performed such that a hash map which can store, at a time step “T”, each token and associated count(s) (Ht = {ft Ci, ftQ, ...} can be generated / determined / obtained / derived, in accordance with an embodiment of the disclosure. For example, the apparatus(es) 102, as discussed earlier with reference to Fig. 2, can be configured to perform the processing task(s) in association accumulating the count(s) for the token(s), as discussed earlier with reference to Fig. 2, in accordance with an embodiment of the disclosure. With regard to the updating step 306, one or more processing tasks in association with updating a cache can be performed. For example, data structure associated with a cache can be updated (e.g., at one or more time steps / each time step) based on a hash map (Ht, also referable to as, for example, a “reference hash map” or “hash map a”). For example, the apparatus(es) 102 can be configured to perform the processing task(s) in association with updating a cache, as discussed earlier with reference to Fig. 2, in accordance with an embodiment of the disclosure. The present disclosure further contemplates a computer program (not shown) which can include instructions which, when the program is executed by a computer (not shown), cause the computer to carry out the associating step 302, the mapping step 304 and / or the updating step 306, as discussed with reference to the processing method 300. The present disclosure yet further contemplates a computer readable storage medium (not shown) having data stored therein representing software executable by a computer (not shown), the software including instructions, when executed by the computer, to carry out the associating step 302, the mapping step 304 and / or the updating step 306, as discussed with reference to the processing method 300. In view of the foregoing, it is appreciable that the present disclosure generally contemplates a processing method 300 which can, for example, be suitable for facilitating cache maintenance. In one embodiment, the processing method 300 can, for example, include an associating step 302, a mapping step 304 and an updating step 306. In regard to the associating step 302, at least one keyword can be selected. The keyword(s) can be associated with one or more tokens. Moreover, at least one nearest neighbor can be associated with at least one token (of the token(s)). At least one vote can be provided for each association. In regard to the mapping step 304 one or more counts which can be associated with the vote(s) can be accumulated for the token(s) (e.g., all tokens) so that a reference hash map (e.g., referable to as “hash map a”) can be derived / generated / determined. In regard to the updating step 306, data structure associated with the cache can be updated based on the reference hash map in a manner so as to maintain the cache. In one embodiment, the associating step 302 can relate to performing at least one processing task in relation to kNN (K nearest neighbors) algorithm to select the at least one keyword and association of at least one nearest neighbor with at least one token. In one embodiment, for each token identifiable to be existing in the reference hash map, a corresponding count can, for example, be determined. The determined count can, for example, be used as a key in relation to a pointer hash map which can include a plurality of pointer parameters. Furthermore, the determined count can, for example, be used as a key to identify a pointer parameter from the plurality of pointer parameters. The identified pointer parameter can, for example, correspond to an entry in a linked list. Moreover, the token identified to be existing in the reference hash map can, for example, be removed from hash set. For example, as mentioned earlier, for each token t\ in Hy that can be determined / identified to be existing in “hash map a”, the corresponding count Ci can be determined / identified, the determined / identified Q can be used as a key in relation to another hash map (e.g., referable to as a “pointer hash map” or “hash map b”) to identify a pointer parameter (e.g., a first pointer, pi, which can correspond to, for example, an entry in a linked list such as a pointers list). Such token fi can then be removed from hash set. In one embodiment, count of a token in the reference hash map can, for example, be incremented by an increment count (e.g., incremented by Q). For example, as mentioned earlier, the count of f, in “hash map a” can be incremented by Q and if the incremented t\ cannot be determined to be existing, (fj, Q) can be added to “hash map a”. In one embodiment, if the incremented token is not determinable to be existing in the reference hash map, the incremented token and corresponding increment count can, for example, be added to the reference hash map to obtain an updated count. Moreover, the updated count can, for example, be used as a key to identify another pointer parameter. Additionally, the incremented token can, for example, be inserted into a hash set of a corresponding entry in a linked list. For example, as mentioned earlier, using the updated count as key, another pointer parameter (e.g., a second pointer, pj, which can, for example, correspond to another entry in the pointers list) can be identified in “hash map b”, then ti can be inserted in the hash set of the corresponding entry in the linked list. In one embodiment, where a number of entries in the reference hash map exceeds a predetermined threshold parameter, the token index can be deleted with the minimum count from the reference hash map, and the pointer hash map and corresponding linked list can be updated accordingly before being removed. For example, as discussed earlier, if the number of entries in hash map a exceeds a predetermined threshold parameter, the token index can be deleted with the minimum count from “hash map a”, and “hash map b” and / or the linked list can be updated accordingly - thereafter, the entries in “hash map b” and linked list can be removed accordingly. Further, in view of the foregoing, it is appreciable that the present disclosure further generally contemplates an apparatus 102 in association with the processing method 300, in accordance with an embodiment of the disclosure. The apparatus 102 can, for example, be suitable for maintenance of a cache. Moreover, the apparatus 102 can, for example, correspond to an electronic module 200a as discussed earlier with reference to Fig. 2, in accordance with an embodiment of the disclosure. The apparatus 102 can, for example, include a first module 202, a second module 204 and a third module 206, in accordance with an embodiment of the disclosure. In one embodiment, the first module 202 (e.g., corresponding to a receiver) can, for example, be configured to receive at least one input signal (e.g., communicable from at least one device 104). The second module 204 (e.g., corresponding to a processor) can, for example, be configured to process the input signal(s) according to the processing method 300 as discussed above to generate at least one output signal. The third module 206 (e.g., corresponding to a transmitter) can, for example, be configured to communicate the output signal(s) for facilitating maintenance of a cache. In the above manner, it is contemplated that at least a comparatively more optimal, efficient and / or user-friendly manner of maintaining a cache can be provided / facilitated, in accordance with an embodiment of the disclosure. It should be appreciated that the embodiments described above can be combined in any manner as appropriate (e.g., one or more embodiments as discussed in the “Detailed Description” section can be combined with one or more embodiments as described in the “Summary of the Invention” section). It should be further appreciated by the person skilled in the art that variations and combinations of embodiments described above, not being alternatives or substitutes, may be combined to form yet further embodiments. In one example, the communication network 106 can be omitted. Communication (i.e., between the apparatus(es) 102 and the device(s) 104) can be by manner of direct coupling. Such direct coupling can be by manner of one or both of wired coupling and wireless coupling. In another example, one device 104 (e.g., a first device 104) can be configured to generate and / or communicate the input signal(s) and another device 104 (e.g., a second device 104) can correspond to a cache, in accordance with an embodiment of the disclosure. The first device 104 can, for example, not be carrying a cache, in accordance with an embodiment of the disclosure. In yet another example, one device 104 (eg., a first device 104) can carry a cache or a portion of a cache, and / or another device 104 (e.g., a second device 104) can correspond to a cache 5 In yet a further example, a cache can be carried by one or both of an apparatus 102 and a device 104, in accordance with an embodiment of the disclosure. In the foregoing manner, various embodiments of the disclosure are described for addressing at least one of the foregoing disadvantages. Such embodiments are io intended to be encompassed by the following claims, and are not to be limited to specific forms or arrangements of parts so described and it will be apparent to one skilled in the art in view of this disclosure that numerous changes and / or modification can be made, which are also intended to be encompassed by the following claims. 15
Claims
Claim(s)1. A processing method (300) suitable for facilitating maintenance of a cache, the processing method (300) comprising:an associating step (302),wherein at least one keyword associable with a plurality of tokens is selected, andwherein at least one nearest neighbor is associable with at least one token of the plurality of tokens, providing at least one vote for each association;a mapping step (304) wherein counts associated with the votes are accumulated for all tokens so as to derive a reference hash map;an updating step (306) wherein data structure associated with the cache is updated based on the reference hash map so as to maintain the cache.
2. The processing method (300) of claim 1, wherein the associating step (302) relates to performing at least one processing task in relation to kNN (K nearest neighbors) algorithm to select the at least one keyword and association of at least one nearest neighbor with at least one token.
3. The processing method (300) of any of the preceding claims, wherein for each token identifiable to be existing in the reference hash map, a corresponding count is determinable.
4. The processing method (300) of any of the preceding claims, the determined count being used as a key in relation to a pointer hash map comprising a plurality of pointer parameters.
5. The processing method (300) of any of the preceding claims, the determined count being used as a key to identify a pointer parameter from the plurality of pointer parameters.
6. The processing method (300) of any of the preceding claims, the identified pointer parameter corresponding to an entry in a linked list.
7. The processing method (300) of any of the preceding claims, the token identified to be existing in the reference hash map being removed from hash set.
8. The processing method (300) of any of the preceding claims, count of a token in the reference hash map being incremented by an increment count.
9. The processing method (300) of any of the preceding claims, wherein if the incremented token is not determinable to be existing in the reference hash map, the incremented token and corresponding increment count are added to the reference hash map to obtain an updated count.
10. The processing method (300) of any of the preceding claims, wherein the updated count is usable as a key to identify another pointer parameter.
11. The processing method (300) of any of the preceding claims, wherein the incremented token is inserted into a hash set of a corresponding entry in a linked list.
12. The processing method (300) of any of the preceding claims wherein where a number of entries in the reference hash map exceeds a predetermined threshold parameter, the token index is deleted with the minimum count from the reference hash map, and the pointer hash map and corresponding linked list are updated accordingly before being removed.
13. A computer program comprising instructions which, when the program is executed by a computer, cause the computer to carry out at least one of the associating step (302), the mapping step (304) and the updating step (306) according to the processing method (300) of any of the preceding claims.
14. A computer readable storage medium having data stored therein representing software executable by a computer, the software including instructions, whenexecuted by the computer, to carry out at least one of the associating step (302), the mapping step (304) and the updating step (306) according to the processing method (300) of any of the preceding claims.5 15. An apparatus (102) comprising:a first module (202) configurable to receive at least one input signal;a second module (204) configurable to process the input signal according to the processing method (300) of any of claims 1 to 12 to generate at least one output signal; andio a third module (206) configurable to communicate at least one output signalusable for maintenance of a cache.
