Large language model (LLM) driven feature auto-naming with dynamic few shots
The LLM prompt generator engine addresses LLM resource and performance challenges by dynamically generating few shots from labeled datasets, enhancing model efficiency and feature naming accuracy.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-08-31
- Publication Date
- 2026-03-05
AI Technical Summary
Large Language Models (LLMs) face challenges with high computational resource demands, latency, and inefficient feature naming in production scenarios, leading to suboptimal performance and increased resource consumption.
Implementing an LLM prompt generator engine that dynamically retrieves relevant data points from a labeled dataset using similarity metrics to generate dynamic few shots, which are then used to guide LLM responses, reducing resource consumption and improving model performance.
The solution reduces computational resource demands, decreases latency, enhances model parameter capabilities, and improves feature naming consistency, achieving performance comparable to larger LLMs without the inefficiencies of traditional methods.
Smart Images

Figure CN2024116165_05032026_PF_FP_ABST
Abstract
Description
LARGE LANGUAGE MODEL (LLM) DRIVEN FEATURE AUTO-NAMING WITH DYNAMIC FEW SHOTSBACKGROUND
[0001] Large Language Models (LLMs) have advanced the field of natural language processing (NLP) domain, and have also presented various challenges. For example, LLMs, due to their size and complexity, may require significant computational resources for both training and inference, which may result in high latency in real-time applications, additional memory consumption compared to prior NLP domains, additional computational power, and so forth. Developing more efficient model architectures that maintain performance while reducing resource consumption is desirable.SUMMARY
[0002] At a high level, aspects described herein relate to systems, methods, and computer storage media for, among other things, a framework for utilizing LLMs with dynamic few shots to enhance the LLM outputs and operations. In embodiments, an LLM prompt generator engine may dynamically retrieve particular data points (e.g., top_relevant exemplars) from a labeled dataset for each input received. For example, a similarity extractor of the LLM prompt generator engine may generate a plurality of similarity identifiers (e.g., identifying the most relevant examples from the labeled dataset using a predefined search algorithm that applies similarity metrics between the labeled dataset and metadata from the input received) . The LLM prompt generator engine may then combine the few shots into a particularly designed prompt that incorporates the most relevant examples to contextually guide the LLM responses. In embodiments, the combination of the input data, the prompt, and the few shots may be provided to the LLM for the generation of a final result.
[0003] This summary is intended to introduce a selection of concepts in a simplified form that is further described in the Detailed Description section of this disclosure. The Summary is not intended to identify key or essential features of the claimed subject matter, nor is it intended to be an aid in determining the scope of the claimed subject matter. Additional objects, advantages, and novel features of the technology will be set forth in part in the description that follows, and in part will become apparent to those skilled in the art upon examination of the disclosure or learned through practice of the technology.BRIEF DESCRIPTION OF THE DRAWINGS
[0004] The present technology is described in detail below with reference to the attached drawing figures, wherein:
[0005] FIG. 1 illustrates an example operating environment for generating particular few shots to provide to an LLM, in accordance with an embodiment described herein;
[0006] FIG. 2 illustrates an example flowchart for generating the particular few shots, in accordance with an embodiment described herein;
[0007] FIG. 3 illustrates example results based on providing the generated few shots to an LLM compared to other LLMs using predetermined few shots, in accordance with an embodiment described herein;
[0008] FIG. 4 illustrates a more detailed embodiment of the flowchart in FIG. 2, in accordance with an embodiment described herein;
[0009] FIG. 5 illustrates an example output provided by the LLM based on providing the generated few shots to the LLM, in accordance with an embodiment described herein;
[0010] FIGS. 6A-6C illustrate example LLM prompting, in accordance with embodiments described herein;
[0011] FIG. 7 illustrates similarity distributions from different LLMs associated with different few shots, in accordance with an embodiment described herein;
[0012] FIG. 8 illustrates another example flow chart for generating few shots, in accordance with an embodiment described herein;
[0013] FIG. 9 illustrates another example operating environment for generating particular few shots, in accordance with an embodiment described herein; and
[0014] FIG. 10 is an example computing device suitable for implementing the described technology, in accordance with an embodiment described herein.DETAILED DESCRIPTION
[0015] Natural language processing domains have been revolutionized by Large Language Models (LLMs) . For example, LLMs have garnered considerable attention in the field of text generation. Leveraging LLMs presents an opportunity to better understand the meaning of variables and generate more user-friendly feature names.
[0016] The application of LLMs in the field of text generation include some challenges. For example, deployment of LLMs in production scenarios may have inference latencies (e.g., seconds of delay) and high computational resource demands that may require one or more trade-offs between model quality and efficiency when implementing an LLM. As another example, external artificial intelligence (AI) software development kits (SDKs) (e.g., Chomsky2) may have a limited capacity resulting in request-per-second (RPS) restrictions or latencies. In yet another example, in-house LLMs (e.g., that are maintained internally by an organization or entity that does not rely upon external application programming interfaces (APIs) or services) may have limited computing resources and high computational demand that imposes lower parameter capabilities and lower complexities for outputs, thereby affecting model performance.
[0017] In risk analysis systems, feature naming (e.g., auto-naming features in a Unified Feature Management Service (UFMS) ) can play an intricate role for risk system interfaces. For example, the same feature may have different expressions with roughly the same semantic content. It is desirable for feature naming to provide consistent names based on understandings of the expressions. Expressions for many features may differ by one word, and features themselves can have different meanings. In this way, distinct and proper naming techniques (e.g., for UFMS) are desirable. By way of example, traditional UFMS feature auto-naming relies upon manually defined rules (e.g., manual input variables that yield feature names) or rules that aren't easily tailed to LLM analyses and that result in overly verbose feature naming without a comprehensive reflection of the meaning / expression based on semantics, thereby further resulting in challenges to user or other downstream understanding and utilization.
[0018] By way of illustration, traditional UFMS functionality within a risk domain may provide discrepancies in feature naming between research and production environments, such as offline simulations for model training, feature snapshots from model rules for offline analysis, features deployed in models, excessive relationship mapping, inconsistent and excessive mapping that results in additional processing and delay times, and so forth. As an example, for a variable name (e.g., sum_po_amtby_zip_metacat_pymt_amtgp_byrseg_sw) and argument (e.g., normalizedShippingAddrZip-BuyerConcatShip2Addr, categoryId-ItemLeafCatI, paymentInstrumentType-BuyerPymtInstId, purchaseOrderUsdAmount-BuyerCartServiceID, buyerSegment-BuyerRegFirstName, timeWindow-7D) , traditional UFMS functionality may provide a feature name in UFMS (e.g., sum_po_amt_by_zip_metacat_pymt_amtgp_byrseg_sw_With_7d_By_BuyerConcatShip2Addr_And_ItemLeafCatID_And_BuyerPymtInstId_And_BuyerCartServiceID_And_BuyerRegFirstNa me) that is excessively verbose and that fails to adequately capture the semantic meanings of expressions, thereby complicating user and downstream comprehension and utility.
[0019] The technology described herein can improve these issues associated with LLM and computing resource capacity limitations, RPS restrictions, computing processing and resource associated latencies, lower parameter capabilities and lower complexities for LLM outputs and model performance, high computational demand, etc. For example, by implementing the LLM prompt generator engine (e.g., the LLM prompt generator engine of FIG. 1) and its associated function (s) described herein, LLM and computing resource capacity limitations can be reduced, RPS can be decreased, computing processing and resource associated latencies can be reduced, model parameter capabilities can be enhanced, processing power and memory recall can be reduced, physical wear on storage components can be reduced, and so forth. For example, one or more of the operations described herein with respect to the database manager 112, similarity extractor 114, LLM application 116, and few shot combination generator 118 of FIG. 1 can improve upon the issues described above.
[0020] For example, traditional training methods usually require many iterative parameter updates across a large amount of data, making the model prone to over-fitting on smaller datasets. By generating particular few shots (e.g., based on using the similarity extractor 114 of FIG. 1) using a particular generated dataset (e.g., a golden dataset) , LLM output can be generated without excess computing processing and resource usage and without additional latencies (e.g., generation of LLM output in about ten milliseconds) , and without impacting workflow efficiency. In embodiments, the generation of the particular few shots can improve model output quality, provide improved results, and can be implemented in in-house LLMs that can then achieve performance that is similar to or better than larger LLMs (e.g., without model efficiency decays) .
[0021] Having provided some example scenarios, a technology suitable for performing these examples is described in more detail with reference to the drawings. It will be understood that additional systems and methods for providing network management services can be derived from the following description of the technology.
[0022] Tuming now to FIG. 1, FIG. 1 illustrates an example operating environment 100 for generating few shots in which implementations of the present disclosure may be employed. In particular, FIG. 1 illustrates a high-level architecture of example operating environment 100 having components in accordance with implementations of the present disclosure. The components and architecture of FIG. 1 are intended as examples, as noted toward the end of the Detailed Description.
[0023] Example operating environment 100 includes LLM prompt generator application client 102 comprising LLM prompt generator application interface 104, server 106, network 108, LLM prompt generator engine 110, and database 120. The LLM prompt generator engine 110 may comprise a database manager 112, a similarity extractor 114, an LLM application 116, and a few shot combination generator 118. The database 120 may comprise LLM (s) 122, labeled dataset (s) 124, similarity identifier (s) 126, and generated few shot (s) 128. Other embodiments of this example operating may include additional databases, LLM prompt generator application clients, servers, etc.
[0024] The LLM prompt generator application client 102 may be a device that has the capability of accessing the network 108, and may also be referred to as a “computing device, ” “mobile device, ” “client device, ” “user equipment (UE) , ” “communication device, ” etc. The LLM prompt generator application client 102 may, in some embodiments, take on a variety of forms, such as a personal computer, a laptop computer, a tablet, a mobile phone, a personal digital assistant, a server, or any other type of device that is capable of communication (e.g., by transmitting or receiving a signal) using the network 108. Broadly, the LLM prompt generator application client 102 can include computer-readable media storing computer-executable instructions executed by at least one computer processor. One example of the LLM prompt generator application client 102 includes computing device 1000 described herein with reference to FIG. 10. The LLM prompt generator application client 102 may be operated by a user, such as one or more of a person, machine, robot, another user device operator, or one or more combinations thereof.
[0025] As illustrated in example operating environment 100, the LLM prompt generator application client 102 may be capable of communicating with the server 106, database 120, and the LLM prompt generator engine 110 over the network 108. In some embodiments, the LLM prompt generator application client 102 may be associated with one or more of a seller interface and buyer interface (e.g., associated with an e-commerce platform) . In some embodiments, the LLM prompt generator application client 102 can also cause the display of LLM outputs generated based on generated few shots, LLM prompts generated based on the few shots, data associated with using the database manager 112, data associated with using the similarity extractor 114, data associated with using the LLM application 116, data associated with using the few shot combination generator 118, image data, text data, extended reality data, other types of data, or one or more combinations thereof (e.g., via the LLM prompt generator application interface 104) , based on one or more operations by the server 106 or the LLM prompt generator engine 110 (e.g., operations associated with the database manager 112, similarity extractor 114, LLM application 116, few shot combination generator 118) .
[0026] In embodiments, the network 108 may include one or more of a local area network (LAN) , a wide area network (WAN) , a mesh network, a hybrid network, a plurality of networks, another type of network, or one or more combinations thereof. In some embodiments, one or more components illustrated within the example operating environment 100 may communicate over the network 108 via the Internet or another public or private network. In some embodiments, the LLM prompt generator application client 102 can be connected to the network 108, or portion thereof, for communication (s) with the LLM prompt generator engine 110 via the LLM prompt generator application interface 104. Other embodiments of example operating environment 100 may include additional computing devices or network nodes that are capable of communicating (e.g., transmitting or receiving) with the LLM prompt generator engine 110.
[0027] Generally, server 106 is a computing device that implements functional aspects of example operating environment 100 (e.g., implementing the functional aspects of the LLM prompt generator engine 110) . In embodiments, server 106 represents a backend or server-side device. In some embodiments, the server 106 can be an edge server. In embodiments, the server 106 may receive requests or transmissions from the LLM prompt generator application client 102 and coordinate fulfillment (or denial) of those requests or transmissions (e.g., sometimes through other additional servers) .
[0028] In embodiments, the server 106 can comprise computing devices (e.g., computing device 1000 of FIG. 10) . In some embodiments, the server 106 may be a single server, a distributed computing environment encompassing multiple computing devices located at the same physical geographical location or at different physical geographical locations, another type of server environment, etc. In some embodiments, the server 106 can connect to the database 120 or, in other embodiments, the server 106 can be in communication with a plurality of servers that each share the database 120 or that each have their own database. In embodiments, the server 106 is a backend or server-side computing device and the LLM prompt generator application client 102 is a client-side or front-end device. It will be understood that some implementations of the technology will comprise either a client-side or front-end computing device, a backend or server-side computing device, or both executing any combination of functions associated with example operating environment 100, among other functions or combination (s) of functions.
[0029] The database 120 may be capable of storing data (e.g., LLM (s) 122, labeled dataset (s) 124, similarity identifier (s) 126, generated few shot (s) 128) , computer instructions (e.g., software program instructions, routines, or services) , or other types of data associated with the embodiments described herein. For instance, database 120 may store computer instructions for implementing functional aspects of the LLM prompt generator engine 110. Although depicted as a single database component, database 120 may be embodied as multiple databases (e.g., a distributed computing environment encompassing multiple computing devices) , may be in the cloud, etc., or one or more combinations thereof. In other embodiments, one or more of the LLM (s) 122 may be stored in a separate database.
[0030] The LLM prompt generator engine 110 can access the database 120 to execute tasks associated with one or more LLMs (e.g., LLM (s) 122) . For example, a user -via the LLM prompt generator application client 102 can communicate a request (e.g., a request transmitted via the LLM prompt generator application interface 104) to the LLM prompt generator engine 110 for LLM prompt generation (e.g., via the few shot combination generator 118) . Based on communicating the request, the LLM prompt generator engine 110 can execute operations (e.g., via the database manager 112, similarity extractor 114, LLM application 116, few shot combination generator 118, or one or more combinations thereof) using one or more components of the database 120 (e.g., the LLM (s) 122, labeled dataset (s) 124, similarity identifier (s) 126, generated few shot (s) 128) -to facilitate the generation of few shots associated with the request.
[0031] In embodiments, the LLM prompt generator engine 110 may receive input data (e.g., input data 202 of FIG. 2, input data 402 of FIG. 4) from the LLM prompt generator application client 102. In some embodiments, the input data may include a first character string and a second character string. By way of example, the first character string may be a variable name and the second character string may be an argument string. In embodiments, character strings may include numbers, letters, symbols, etc., or one or more combinations thereof.
[0032] In embodiments, based on the LLM prompt generator engine 110 receiving the input data, similarity extractor 114 may generate a plurality of similarity identifiers (e.g., similarity identifier (s) 126) for the input data. In some embodiments, the similarity identifiers are generated using a labeled dataset from the labeled dataset (s) 124, such that the similarity identifiers indicate how similar each data point within the labeled dataset is to each of the inputs provided. For example, the similarity identifiers may indicate how similar each data point within the labeled dataset is to each of the first character string and the second character string. The labeled dataset may be generated by the database manager 112.
[0033] In embodiments, the database manager 112 may generate the labeled dataset (s) 124 by applying a clustering algorithm (e.g., k-means clustering, hierarchical clustering, Gaussian mixture models, mean shift clustering, agglomerative clustering, etc. ) to a data population (e.g., several thousand or tens of thousands) and generating clusters for different features of the data population, such that each of the clusters having a plurality of similar features (e.g., twenty similar feature per cluster) to preserve the diversity within the data population for the various clusters. In some embodiments, each labeled dataset within the labeled dataset (s) 124 may correspond to a different cluster. In some embodiments, the labeled dataset (s) 124 are generated by applying feature sampling (e.g., random feature sampling) to each of the clusters to extract the data points of a particular labeled dataset (e.g., a labeled dataset having about five hundred data points) . Each cluster may have one or more labels that uniquely identify or classify the features (or groupings of the features per cluster) within a particular cluster (e.g., for quantitative evaluation in a continuous integration and deployment) .
[0034] In some embodiments, the data points or clusters may be collected from features on-boarded by UFMS. In some embodiments, each cluster or sample includes a first field (e.g., variable name) and a second field (e.g., arguments) , wherein golden label (s) for each cluster are generated via a user (or a computerized labeling generator) . For instance, to capture feature diversity and to reduce duplication, a filtration technique may be applied to similar features, and an edit distance may be used to identify feature pair similarities (e.g., pairs of the first field and the second field) , and a hierarchical clustering algorithm may be applied to group the similar features. Based on grouping the similar features, a random sampling may be applied to each cluster to generate a diverse dataset representative of the diversity of the data population (e.g., the dataset including over four hundred unique samples and the data population including several thousand or tens of thousands) .
[0035] The similarity extractor 114 may generate the plurality of similarity identifiers 126 for the input data by comparing each of the input data (e.g., a first character string for the first field and a second character string for the second field) to each of a labeled dataset (e.g., within labeled dataset (s) 124) . For example, at a high level, the similarity extractor 114 may dynamically retrieve top-relevant exemplars (e.g., top-k examples 408 of FIG. 4) from the prepared dataset (e.g., the labeled dataset from labeled dataset (s) 124 of FIG. 1, dataset 204B of FIG. 2, dataset 406 of FIG. 4) for each input (e.g., input data 202 of FIG. 2, input data 402 of FIG. 4) with reduced efficiency decay (relative to traditional methods and traditional implementations of an LLM) . The top relevant examples may be identified as the highest relevant data points associated with the particular input data that are from the labeled dataset.
[0036] In embodiments, the similarity extractor 114 may receive the input data and retrieve a labeled dataset 124 (e.g., manually labeled) based on receiving the input data. The similarity extractor 114 may identify the highest relevant data points from the dataset using one or more search algorithm techniques based on similarity metrics (similarity identifiers) of the input metadata. For example, the similarity extractor 114 may generate the plurality of similarity identifiers by tokenizing (e.g., word tokenization, sub-word tokenization, character tokenization, n-gram tokenization, advanced tokenization techniques, etc. ) a first character string and a second character string of the input data, and applying Term Frequency-Inverse Document Frequency (TF-IDF) to compare each of the tokenized first character string and the tokenized second character string to each of the data points within the labeled dataset.
[0037] In some embodiments, the input data, the labeled dataset, or one or more combinations thereof, may be tokenized using a tokenizer having about one hundred thousand tokens. For example, the input data or labeled dataset may be tokenized uses Byte Pair Encoding (BPE) , a sub-word tokenization technique. In some embodiments, the input data or labeled dataset may be tokenized by iteratively merging the most frequent pairs of characters or character sequences to form a fixed-size vocabulary for each of the input data and the dataset. In some embodiments, the TF-IDF may be applied to the dataset by measuring a frequency of a particular label within the labeled dataset (e.g., those having a higher frequency and those having lower frequencies) . In some embodiments, the tokenized input data and the tokenized dataset may be converted into a matrix of TF-IDF features (e.g., converted using TfidfVectorizer) , such that dataset documents are represented as vectors in a term-weighted space. By way of illustration, the matrix of TF-IDF features for each of the input data and each data point within a labeled dataset may be generated by automatically converting text into lowercase, removing stop words, applying stemming, applying lemmatization through custom tokenization, splitting text into tokens, utilizing custom regex patterns, limiting a number of features by specifying a maximum number of features, etc., or one or more combinations thereof.
[0038] By way of example, a cosine similarity (e.g., a similarity identifier) between the TF-IDF matrix for the tokenized first character string input data and the TF-IDF matrix for each of the tokenized documents may be determined (i.e., a plurality of similarity identifiers for the first input data, the similarity identifiers corresponding to how similar the first input data is to each of the data points within the dataset) . Additionally, in some embodiments, a cosine similarity (e.g., another similarity identifier) between the TF-IDF matrix for the tokenized second character string input data and the TF-IDF matrix for each of the tokenized documents (i.e., a plurality of similarity identifiers for the second input data, the similarity identifiers corresponding to how similar the second input data is to each of the data points within the dataset) may also be determined.
[0039] In some embodiments, each value associated with the comparison of the tokenized first character string to each of the data points within the labeled dataset may be aggregated to generate a first similarity identifier, of the plurality of similarity identifiers, for the first input data. In some embodiments, each value associated with the comparison of the tokenized second character string to each of the data points within the labeled dataset may be aggregated to generate a second similarity identifier, of the plurality of similarity identifiers, for the second input data. In some embodiments, a weighted value is applied to each of the first similarity identifier and the second similarity identifier. By way of example, a weighted value of 0.5 may be applied to each of the first similarity identifier and the second similarity identifier. In other embodiments, the first similarity identifier has a higher weighted value than the second similarity identifier (e.g., 0.7 / 0.3) .
[0040] In embodiments, the similarity extractor 114 may identify a highest relevant data point from the labeled dataset based on the plurality of similarity identifiers. For example, one or more highest relevant data points from the labeled dataset may be identified based on the similarity extractor 114 determining the cosine similarity between the input data TF-IDF vector and those of the documents from the labeled dataset. In embodiments, separate similarity matrices (i.e., similarity identifiers) for variable names (e.g., a first input data) and arguments (e.g., a second input data) are determined, by the similarity extractor 114, and merged (e.g., using a weighted sum of 0.5) to generate a final similarity score matrix for each document within the labeled dataset. The final similarity score matrix may be used for identifying the highest relevant data points (e.g., the top highest four) from the labeled dataset.
[0041] Based on identifying the highest relevant data points, dynamic few shots incorporating the highest relevant data points may be provided to one or more LLM (s) 122. For example, LLM application 116 may be stored on the LLM prompt generator engine 110. The LLM application 116 can access one or more LLM (s) 122 (e.g., GPT 3.5, Mistral-7B, Vicuna-13B, etc. ) . In embodiments, LLM (s) 122 may be stored in a database, a distributed database, the cloud, etc. In embodiments, one or more of the LLM (s) 122 may be hosted on a server (e.g., dedicated machine, a cloud-based service, an API) . In some embodiments, one or more of the LLM (s) 122 may be accessible via an API endpoint that the LLM application 116 can call to interact with one or more of the LLM (s) 122.
[0042] In these examples, the LLM application 116 may access the LLM (s) 122 to provide particular prompts, configuration parameters, or few shots generated by the few shot combination generator 118. For example, the few shots generated by the few shot combination generator 118 may implement few-shot learning with one or more of the LLM (s) 122, via the LLM application 116, involving the leveraging of a pre-trained model and providing it with a small number of examples (i.e. few shots) to adapt the model to new tasks. In some embodiments, an inference portion of the few-shot learning may involve an LLM using the prompts generated based on few shots generated by the few shot combination generator 118, such that the few shots are provided in a context to generate predictions for new inputs. In some embodiments, the model may not change its parameters, and instead uses this context to understand how to perform a task. During contextual adaption of the few-shot learning, the model may leverage the few shots in the prompt to adapt its behavior dynamically and to generate an output.
[0043] In embodiments, the few shot combination generator 118 may provide the few shots to one or more of the LLM (s) 1 22 and may store the generated few shot (s) 128 in the database 120. Prompts provided to the LLM (s) 122 based on the generated few shot (s) 128 may include a system prompt (e.g., a detailed description of the task and the naming conventions of a feature auto-naming guideline) , the few shots (e.g., several pairs of input and expected output (manually labeled feature names) , and a human-generated prompt (e.g., carrying the information of the input features) . In some embodiments, the LLM prompt generator engine 110 may remove a predetermined few shot associated with the LLM and replace the predetermined few shot with the dynamic few shot generated. For instance, the LLM prompt generator engine 110 may cause the removal of four predetermined few shots and may implement few-shot learning by replacing the four predetermined few shots with the four of the dynamic few shot generated based on four of the highest relevant data points identified from the labeled dataset. In other embodiments, the LLM prompt generator engine 110 may implement few-shot learning by adding the four of the dynamic few shot generated based on four of the highest relevant data points identified from the labeled dataset, such that the few-shot learning includes the LLM utilizing each of the four dynamic few shot generated and each of the four predetermined few shots.
[0044] FIG. 2 illustrates an example flowchart 200 for generating dynamic few shots to provide to an LLM for few-shot learning (e.g., the learning ability of machine learning algorithms by utilizing a few data samples) , without requiring many iterative parameter updates across a large amount of data as in conventional training methods, since the many iterative parameter updates result in the model over-fitting on smaller datasets. For example, input data 202 (e.g., input data 402 of FIG. 4) may be provided to a similarity extractor system 204 comprising similarity extractor 204A, dataset 204B, and generated few shots 204C. Similarity extractor 204A may generate a plurality of similarity identifiers for the input data 202 based on comparing the input data 202 to each data point within the dataset 204B.
[0045] In embodiments, the dataset 204B may include a labeled dataset generated based on standardizing a set of documents by converting structured metadata of each document within the dataset into plain text, tokenizing the plain text for each document, and applying TF-IDF to generate a TF-IDF matrix for each of the tokenized documents for the dataset 204B. For example, the plain text for each document may be tokenized using a tokenizer having about one hundred thousand tokens. The plain text may also be tokenized based on using BPE and iteratively merging the most frequent pairs of characters or character sequences. The TF-IDF may be applied to the tokenized documents by measuring a frequency of a particular label within the labeled dataset (e.g., to identify labels having a frequency above a threshold) to generate the TF-IDF matrix for each of the tokenized documents for the dataset 204B. For example, the TF-IDF matrix may be generated using TfidfVectorizer, such that the documents are represented as vectors in a term-weighted space within the dataset 204B.
[0046] In embodiments, the similarity extractor 204A may generate the plurality of similarity identifiers by tokenizing a first character string and a second character string of the input data, and by applying TF-IDF to generate a TF-IDF matrix for each of the tokenized first character string and the tokenized second character string. For example, the similarity extractor 204A may tokenize the first character string and the second character string using BPE and iteratively merging the most frequent pairs of characters or character sequences within each of the first character string and second character string. In embodiments, the similarity extractor 204A may apply cosine similarity between the TF-IDF matrix for the tokenized first character string and the TF-IDF matrix for each of the documents within the dataset 204B. The similarity extractor 204A may also apply cosine similarity between the TF-IDF matrix for the tokenized second character string and the TF-IDF matrix for each of the documents within the dataset 204B.
[0047] Based on the similarity extractor 204A generating the plurality of similarity identifiers for the input data 202 using the dataset 204B, the similarity extractor 204A may generate few shots 204C (e.g., a few shot including a variable name and a few shot including an argument string) . The few shots 204C and the prompt 206 (e.g., system prompt 600A of FIG. 6A, user generated prompt 600C of FIG. 6C) are provided to LLM 208 (e.g., LLM (s) 122 of FIG. 1) for the LLM 208 to generate output 210 (e.g., LLM auto-naming 508 of FIG. 5) based on the few shots 204C and the prompt 206, without requiring many iterative parameter updates to the LLM 208 across a large amount of data and without the LLM over-fitting.
[0048] In embodiments, the LLM 208 may receive the dynamic few shots 204C generated by the similarity extractor system 204 using the two strings of the input data 202 that were each compared to the data points within a labeled dataset 204B based on converting the input data and the data points into TF-IDF matrices (e.g., having dimensions n x m, where n is the number of documents associated with the data points and m is the number of particular features) . The LLM 208 may generate the output 210 based on using the dynamic few shots generated by the similarity extractor system 204. In embodiments, the output 210 may be provided based on the dynamic few shots replacing predetermined few shots (e.g., based on replacing four predetermined few shots with four of the dynamic few shots) . In other embodiments, the output 210 may be provided based on few-shot learning using both the dynamic few shots in addition to the predetermined few shots (e.g., using four dynamic few shots and four predetermined few shots) .
[0049] FIG. 3 illustrates example results 300 from GPT 3.5 LLM 302 using fixed predefined few shots, Mistral-7B LLM 304 using fixed predefined few shots, and Mistral-7B LLM 306 using generated dynamic few shots (e.g., generated using LLM prompt generator engine 110 of FIG. 1, similarity extractor system 204 of FIG. 2, similarity extractor system 404 of FIG. 4) .
[0050] The Edit Distance within the example results 300 measures the dissimilarity between two input data character strings by the minimum operations required for transformation, normalized over the length of the longer string to yield a score between 0 and 1, wherein a lower score indicates higher similarity. As illustrated in the example results 300, the output provided by Mistral-7B LLM 306 using generated dynamic few shots (e.g., generated using LLM prompt generator engine 110 of FIG. 1, similarity extractor system 204 of FIG. 2, similarity extractor system 404 of FIG. 4) has an improved performance, due to the dynamic few shots, compared to the output provided by GPT 3.5 LLM 302 using fixed predefined few shots and Mistral-7B LLM 304 using fixed predefined few shots.
[0051] FIG. 4 illustrates an example flowchart 400 for generating dynamic few shots to provide to an LLM for enhanced few-shot learning and model implementation. For example, input data 402 comprises a variable name 402A and an argument string 402B. The input data 402 is provided to the similarity extractor system 404. The similarity extractor system 404 may generate a plurality of similarity identifiers (e.g., first cosine similarity 404C, second cosine similarity 404D, weighted sum 404E) for generating the top-k examples 408.
[0052] The similarity extractor system 404 may apply the tokenizer 404A to the input data 402, such that the tokenizer 404A splits the variable name 402A and the argument string 402B into tokens (e.g., having three to five characters) . In embodiments, the tokenizer 404A may be case-sensitive and may consider the linguistic structures of each of the variable name 402A and the argument string 402B. For example, the tokenizer 404A may split the variable name 402A and the argument string 402B based on alphabetic characters and underscores.
[0053] The tokenized input data may be provided to the TF-IDF and cosine similarity 404B. In embodiments, the TF-IDF may be applied to generate a first TF-IDF matrix for the tokenized first character string (e.g., the tokenized variable name 402A) and a second TF-IDF matrix for the tokenized second character string (e.g., the tokenized argument string 402B) . A first set of cosine similarities between the first TF-IDF matrix and each data point within the dataset 406 (e.g., labeled dataset (s) 124 of FIG. 1, dataset 204B of FIG. 2) may be determined, and a second set of cosine similarities between the second TF-IDF matrix and each data point within the dataset 406 may be determined. The first set of cosine similarities may be merged to generate a first cosine similarity 404C for the variable name input, and the second set of cosine similarities may be merged to generate a second cosine similarity 404D for the argument input.
[0054] In embodiments, the first cosine similarity 404C and the second cosine similarity 404D may be merged by applying a weighted sum 404E (e.g., the weighted sum being 0.5) . Stated differently, weighted sum 404E of the first cosine similarity generated by aggregating the first set of cosine similarities for a first input may be merged with the second cosine similarity generated by aggregating the second set of cosine similarities for the second input. The weighted sum 404E is used to generate the top-k examples 408. The top-k examples 408 (e.g., the highest relevant data points from the labeled dataset) may include a first pair of a variable name and argument 408A, a second pair of a variable name and argument 408B, and a third pair of a variable name and argument 408C.
[0055] In other embodiments, a weighted sum of a first cosine similarity of a first set of cosine similarities for a first input (the first set of cosine similarities each being a comparison of the first input with each data point in the dataset, and the first cosine similarity being the shortest distance between the first input and a data point of the dataset) may be merged with a second cosine similarity of the second set of cosine similarities for a second input (the second set of cosine similarities each being a comparison of the second input with each data point in the dataset, and the second cosine similarity being the shortest distance between the second input and a data point of the dataset) . As another example, a weighted sum of a third cosine similarity of the first set of cosine similarities for the first input (the third cosine similarity being the second shortest distance between the first input and a data point of the dataset) may be merged with a fourth cosine similarity of the second set of cosine similarities for a second input (the fourth cosine similarity being the second shortest distance between the second input and a data point of the dataset) .
[0056] In embodiments, dynamic few shots may be provided to an LLM based on the first pair of a variable name and argument 408A, a second pair of a variable name and argument 408B, and a third pair of a variable name and argument 408C. In embodiments, the dynamic few shots may be provided to an LLM based on a variable name from the top-k examples 408, based on an argument from the top-k examples 408, and based on the weighted sum 404E (e.g., of the first cosine similarity with the second cosine similarity, of the weighted sum of the third cosine similarity with the fourth cosine similarity, etc. ) .
[0057] FIG. 5 illustrates an example demo 500 including output provided by the LLM (e.g., output 210 of FIG. 2, LLM auto-naming 508 output) based on providing the generated few shots to the LLM. For example, variable name 502 and arguments 504 may be provided to the LLM. A feature name from an UFMS 506 may be provided to the LLM or retrieved by the LLM. The LLM may use the variable name 502, arguments 504, and the feature name from an UFMS 506 to generate the LLM auto-naming 508.
[0058] FIG. 6A illustrates example system prompt 600A, FIG. 6B illustrates example dynamic few shots 600B, and FIG. 6C illustrates example human or user prompt 600C. Each of the example system prompt 600A, example dynamic few shots 600B, and example human or user prompt 600C may be provided to an LLM (e.g., LLM 208 of FIG. 2) to generate output (e.g., output 210 of FIG. 2, LLM auto-naming 508 of FIG. 5) .
[0059] FIG. 7 illustrates three similarity distributions from different LLMs (GPT 3.5 Turbo, Mistral-7B, and Vicuna-13B) associated with different few shots. The term “default” within similarity distributions 700 refers to LLM results from an LLM using four predefined few shots. The term “replace” within similarity distributions 700 refers to LLM results from an LLM using four dynamic few shots. The term “insert” within similarity distributions 700 refers to LLM results from an LLM using four predefined few shots and four dynamic few shots.
[0060] The Edit Distance measures the dissimilarity between two strings by the minimum operations required for transformation, normalized over the length of the longer string to yield a score between 0 and 1; a lower score indicating higher similarity. The Jaccard Distance calculates similarity by comparing the size of the intersection to the union of sample sets, focusing on common tokens rather than character consistency. The two tokenization strategies include case-sensitive splits on alphabetic characters and underscores, and a tokenizer considering linguistic structure. The diamonds mark the median values, and error bars show the 25th to 75th percentile range. The baseline includes pre-defined few shots with model GPT 3.5 Turbo.
[0061] As illustrated by the similarity distributions 700, introducing the generated dynamic few shots enhances LLM performance (e.g., across other models smaller than GPT 3.5) , and thereby illustrating that the dynamic few shots improve smaller model performance. For example, the Mistral-7B: insert group performance demonstrates the highest similarity and surpasses the baseline GPT 3.5-Turbo: default group. The performance of Vicuna-13B each illustrate improvements in both replace and insert scenarios compared to their default setups. In embodiments, deploying these models on more advanced hardware, such as A100 GPUs, could further reduce latency.
[0062] Example Flow Chart
[0063] FIG. 8 includes flowchart 800, which begins at step 802 with receiving (e.g., via similarity extractor 114 of FIG. 1, similarity extractor system 204 of FIG. 2, similarity extractor system 404 of FIG. 4) input data (e.g., input data 202 of FIG. 2, input data 402 of FIG. 4) . At step 804, a plurality of similarity identifiers (e.g., similarity identifier (s) 126 of FIG. 1) for the input data are generated (e.g., generated using a labeled dataset, such as labeled dataset (s) 124 of FIG. 1) .
[0064] In some embodiments, the plurality of similarity identifiers are generated based on tokenizing (e.g., via tokenizer 404A of FIG. 4) a first character string (e.g., variable name 402A of FIG. 4, variable name 502 of FIG. 5) and a second character string (e.g., argument string 402B of FIG. 4, arguments 504 of FIG. 5) of the input data, and based on subsequently applying TF-IDF and cosine similarity (e.g., TF-IDF and cosine similarity 404B of FIG. 4) to compare each of the tokenized first character string and the tokenized second character string to each of the data points within the labeled dataset.
[0065] In some embodiments, the plurality of similarity identifiers may be generated by tokenizing a first character string and a second character string of the input data, then applying the TF-IDF to generate a TF-IDF matrix for each of the tokenized first character string and the tokenized second character string. Continuing this example, cosine similarity between the TF-IDF matrix for the tokenized first character string and the TF-IDF matrix for each of the tokenized documents may be applied. In addition, cosine similarity between the TF-IDF matrix for the tokenized second character string and the TF-IDF matrix for each of the tokenized documents may be applied.
[0066] As another example, the plurality of similarity identifiers may be generated by determining a first set of cosine similarities between a first TF-IDF matrix for a tokenized first character string and each data point within the labeled dataset, and determining a second set of cosine similarities between the second TF-IDF matrix for a tokenized second character string and each data point within the labeled dataset. A weighted sum (e.g., weighted sum 404E) of a first cosine similarity (e.g., 404C) generated using the first set of cosine similarities with a second cosine similarity (e.g., 404D) generated using the second set of cosine similarities can be merged to determine a set of the highest relevant data points within the labeled dataset (e.g., top-k examples 408 of FIG. 4) at step 806.
[0067] In embodiments, a dynamic few shot incorporating the highest relevant data point can be provided to an LLM (e.g., LLM (s) 122 of FIG. 1) at step 808. In some embodiments, the dynamic few shot may be provided to the LLM based on a variable name input data and the weighted sum of cosine similarities between the variable name and the data points within the dataset, the dynamic few shot corresponding to a variable name. In some embodiments, another dynamic few shot may be provided to the LLM based on an argument string input data and the weighted sum of cosine similarities between the argument string and the data points within the dataset, the other dynamic few shot corresponding to an argument string.
[0068] Example Enhanced Conceptualized Search System Environment
[0069] FIG. 9 illustrates an example computing environment in which implementations of the present disclosure may be employed. In particular, FIG. 9 shows a high level architecture of an example LLM prompt generator engine 910 that can host a technical solution environment, or a portion thereof. It should be understood that this and other arrangements described herein are set forth as examples. For example, as described above, many elements described herein may be implemented as discrete or distributed components or in conjunction with other components, and in any suitable combination and location. Other arrangements and elements (e.g., machines, interfaces, functions, orders, and groupings of functions) can be used in addition to or instead of those shown.
[0070] The example operating environment 900 can be a cloud computing environment that provides computing resources for functionality associated with the LLM prompt generator engine 910. For example, the example operating environment 900 supports delivery of computing components and services-including servers, storage, databases, networking, applications, and machine learning associated with the LLM prompt generator engine 910 and LLM prompt generator application client 902. A plurality of client devices (e.g., LLM prompt generator application client 902) include hardware or software that access resources on the LLM prompt generator engine 910. LLM prompt generator application client 902 can include an application (e.g., LLM prompt generator application 904) and interface data (e.g., LLM prompt generator application interface 906) that support client-side functionality associated with the LLM prompt generator engine 910. In embodiments, client devices can access computing components of the LLM prompt generator engine 910 via a network (e.g., network 908) to perform computing operations.
[0071] The LLM prompt generator engine 910 is responsible for providing a computing environment or architecture that includes the infrastructure that supports LLM prompt generator operations 920 (e.g., generating a plurality of similarity identifiers for the input data using a labeled dataset, generating the labeled dataset, identifying a highest relevant data point from the labeled dataset based on the plurality of similarity identifiers, providing a dynamic few shot incorporating the highest relevant data point to an LLM, e-commerce functionality associated with the dynamic few shot) .
[0072] The LLM prompt generator engine 910 can support storing labeled datasets, similarity identifiers, generated few shots, etc., in the LLM prompt generator database (s) 924. The LLM prompt generator engine 910 can also provide a search system for receiving queries and identifying search results based on the queries. The LLM prompt generator engine 910 may also provide a computing environment with features for managing, selling, buying, and recommending different types of items. The LLM prompt generator engine 910 can specifically be for a content platform, such as EBAY content platform or e-commerce platform, developed by EBAY INC., of San Jose, California.
[0073] The LLM prompt generator engine 910 can provide LLM prompt generator operations 920 and LLM prompt generator interfaces 922. The LLM prompt generator operations 920 can include service operations, communication operations, resource management operations, security operations, and fault tolerance operations that support specific tasks or functions in the LLM prompt generator engine 910. The LLM prompt generator interfaces 922 can include service interfaces, communication interfaces, resource interfaces, security interfaces, and management and monitoring interfaces that support functionality between the enhanced conceptual search platform components. The LLM prompt generator operations 920 and LLM prompt generator interfaces 922 can enable communication, coordination and seamless functioning of the LLM prompt generator engine 910.
[0074] By way of example, functionality associated with LLM prompt generator engine 910 can include shopping operations (e.g., product search and browsing, product selection and shopping cart, checkout and payment, and order tracking) ; user account operations (e.g., user registration and authentication, and user profiles) ; seller and product management operations (e.g., seller registration and product listing and inventory management) ; payment and financial operations (e.g., payment processing, refunds and returns) ; order fulfillment operations (e.g., order processing and fulfillment and inventory management) ; customer support and communication interfaces (e.g., customer support chat / email and notifications) ; security and privacy interfaces (e.g., authentication and authorization, payment security) ; recommendation and personalization interfaces (e.g., product recommendations and customer reviews and ratings) ; analytics and report interfaces (e.g., sales and inventory reports, and user behavior analytics) ; and APIs and Integration Interfaces (e.g., APIs for Third-Party Integration) .
[0075] The LLM prompt generator engine 910 can provide databases (e.g., LLM prompt generator databases 924) to manage and store different types of data efficiently. The LLM prompt generator databases 924 can include relational databases, NoSQL databases, search databases, cache databases, content management systems, analytics databases, payment gateway database, customer relationship management databases, log and error databases, inventory and supply chain databases, and multi-channel databases that are used in combination to efficiently manage data and provide e-commerce experience for users.
[0076] The LLM prompt generator engine 910 supports applications (e.g., applications 960) that can include a computer program or software component or service that serves a specific function or set of functions to fulfil a particular LLM prompt generator requirement or user requirement. Applications can be client-side (user-facing) and server-side (backend) . Applications can also include applications without any AI support (e.g., application 962) , applications supported by traditional AI model (e.g., application 964) , and applications supported by LLMs (e.g., application 966) . By way of example, applications can include an online storefront application, mobile shopping app, admin and management console, payment gateway integration, user account and authentication application, search and recommendation engines, inventory and stock management application, order processing and fulfillment application, customer support and communication tools, content management system, analytics and report applications, marketing and promotion applications, multi-channel integration applications, log and error tracking applications, customer relationship management (CRM) applications, security applications, and APIs and web services that are used in combination to efficiently deliver e-commerce experiences for users.
[0077] The LLM prompt generator engine 910 can include a machine learning engine (e.g., machine learning engine 970) . The machine learning engine 970 refers to machine leaming framework or machine learning platform that provides the infrastructure and tools to design, train, evaluate, and deploy machine learning models. The machine learning engine 970 can serve as the backbone for developing and deploying machine learning applications and solutions. Machine learning engine 970 can also provide tools for visualizing data and model results, as well as interpreting model decisions to gain insights into how the model (e.g., LLM) is making predictions.
[0078] The machine learning engine 970 can provide the necessary libraries, algorithms, and utilities to perform various tasks within the machine learning workflow. The machine learning workflow can include data processing, model selection, model training, model evaluation, hyperparameter tuning, scalability, model deployment, inference, integration, customization, data visualization. Machine learning engine 970 can include pre-trained models for various tasks, simplifying the development process. In this way, the machine learning engine 970 can streamline the entire machine learning process, from data preparation and model training to deployment and inference, making it accessible and efficient for different types of users (e.g., customers, data scientists, machine learning engineers, and developers) working on a wide range of machine learning applications.
[0079] Machine learning engine 970 can be implemented in operating environment 900 as a component that leverages machine learning algorithms and techniques (e.g., machine learning algorithms 972) to enhance various aspects of the enhanced conceptual search system's functionality. Machine leaming engine 970 can provide a selection of machine learning algorithms and techniques used to teach computers to learn from data and make predictions or decisions without being explicitly programmed. These techniques are widely used in various applications across different industries, and can include the following examples: supervised learning (e.g., linear regression: classification, support vector machines (SVM) ) ; unsupervised learning (e.g., clustering, principal component analysis (PCA) , association rules (e.g., apriori) ) ; reinforcement learning (e.g., Q-Learning, deep Q-Network (DQN) ) ; and deep learning (e.g., neural networks, convolutional neural networks (CNN) , and recurrent neural networks (RNN) ) ; and ensemble learning random forest.
[0080] Machine learning training data 974 supports the process of building, training, and fine-tuning machine learning models (e.g., LLMs based on the generated few shots) . Machine learning training data 974 consists of a labeled dataset that is used to teach a machine learning model 976 (e.g., an LLM) to recognize patterns, make predictions, or perform specific tasks. For example, LLM few-shot learning is a technique where the LLM is adapted to new tasks with some examples (e.g., leveraging the LLMs pre-trained knowledge to perform on tasks with a lower amount of additional training data compared to other learning techniques) . For instance, LLM few-shot learning may comprise providing the LLM with input-output pairs related to a task.
[0081] Example Computing Device
[0082] Having described an overview of embodiments of the present technology, an example operating environment in which embodiments of the present technology may be implemented is described below in order to provide a general context for various aspects. Referring initially to FIG. 10, in particular, an example operating environment for implementing embodiments of the present technology is shown and designated generally as computing device 1000. Computing device 1000 is but one example of a suitable computing environment and is not intended to suggest any limitation as to the scope of use or functionality of the technology. Neither should computing device 1000 be interpreted as having any dependency or requirement relating to any one or combination of components illustrated.
[0083] The technology of the present disclosure may be described in the general context of computer code or machine-useable instructions, including computer-executable instructions such as program modules, being executed by a computer or other machine, such as a personal data assistant or other handheld device. Generally, program modules including routines, programs, objects, components, data structures, etc. refer to code that perform particular tasks or implement particular abstract data types. The technology may be practiced in a variety of system configurations, including hand-held devices, consumer electronics, general-purpose computers, more specialty computing devices, etc. The technology may also be practiced in distributed computing environments where tasks are performed by remote-processing devices that are linked through a communications network.
[0084] With reference to FIG. 10, computing device 1000 includes bus 1002 that directly or indirectly couples the following devices: memory 1004, one or more processors 1006, one or more presentation components 1008, input / output ports 1010, input / output components 1012, and illustrative power supply 1014. Bus 1002 represents what may be one or more busses (such as an address bus, data bus, or combination thereof) . Although the various blocks of FIG. 10 are shown with lines for the sake of clarity, in reality, delineating various components is not so clear, and metaphorically, the lines would more accurately be grey and fuzzy. For example, one may consider a presentation component, such as a display device, to be an I / O component. As another example, processors may also have memory. Such is the nature of the art, and it is again reiterated that the diagram of FIG. 10 is merely illustrates an example computing device that can be used in connection with one or more embodiments of the present technology. Distinction is not made between such categories as “workstation, ” “server, ” “laptop, ” “hand-held device, ” etc., as all are contemplated within the scope of FIG. 10 and reference to “computing device. ”
[0085] Computing device 1000 typically includes a variety of computer-readable media. Computer-readable media can be any available media that can be accessed by computing device 1000 and includes both volatile and nonvolatile media, and removable and non-removable media. By way of example, and not limitation, computer-readable media may comprise computer storage media and communication media.
[0086] Computer storage media include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer-readable instructions, data structures, program modules or other data. Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other medium which can be used to store the desired information and which can be accessed by computing device 1000. Computer storage media excludes signals per se.
[0087] Communication media typically embodies computer-readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. The term “modulated data signal” means a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and other transmissions. Combinations of any of the above should also be included within the scope of computer-readable media.
[0088] Memory 1004 includes computer storage media in the form of volatile or nonvolatile memory. The memory 1004 may be removable, non-removable, or a combination thereof. Example hardware devices include solid-state memory, hard drives, optical-disc drives, etc. Computing device 1000 includes one or more processors that read data from various entities such as memory 1004 or I / O components 1012. Presentation component (s) 1008 present data indications to a user or other device. Examples of presentation components include a display device, speaker, printing component, vibrating component, etc.
[0089] I / O ports 1010 allow computing device 1000 to be logically coupled to other devices including I / O components 1012, some of which may be built in. Illustrative components include a microphone, joystick, game pad, satellite dish, scanner, printer, and so forth.
[0090] Embodiments described above may be combined with one or more of the specifically described altematives. In particular, an embodiment that is claimed may contain a reference, in the alternative, to more than one other embodiment. The embodiment that is claimed may specify a further limitation of the subject matter claimed.
[0091] The subject matter of the present technology is described with specificity herein to meet statutory requirements. However, the description itself is not intended to limit the scope of this disclosure. Rather, the inventors have contemplated that the claimed or disclosed subject matter might also be embodied in other ways, to include different steps or combinations of steps similar to the ones described in this document, in conjunction with other present or future technologies. Moreover, although the terms “step” or “block” might be used herein to connote different elements of methods employed, the terms should not be interpreted as implying any particular order among or between various steps herein disclosed unless and except when the order of individual steps is explicitly stated.
[0092] For purposes of this disclosure, the word “including” or “having” has the same broad meaning as the word “comprising, ” and the word “accessing” comprises “receiving, ” “referencing, ” or “retrieving. ” Further, the word “communicating” has the same broad meaning as the word “receiving, ” or “transmitting” facilitated by software or hardware-based buses, receivers, or transmitters using communication media.
[0093] In addition, words such as “a” and “an, ” unless otherwise indicated to the contrary, include the plural as well as the singular. Thus, for example, the constraint of “afeature” is satisfied where one or more features are present.
[0094] Furthermore, the term “or” includes the conjunctive, the disjunctive, and both (aor b thus includes either a or b, as well as a and b) .
[0095] For purposes of a detailed discussion above, embodiments of the present technology described with reference to a distributed computing environment; however, the distributed computing environment depicted herein is merely an example. Components can be configured for performing novel aspects of embodiments, where the term “configured for” or “configured to” can refer to “programmed to” perform particular tasks or implement particular abstract data types using code. Further, while embodiments of the present technology may generally refer to the distributed data object management system and the described schematics, it is understood that the techniques described may be extended to other implementation contexts.
[0096] From the foregoing, it will be seen that this technology is one well adapted to attain all the ends and objects described above, including other advantages that are obvious or inherent to the structure. It will be understood that certain features and subcombinations are of utility and may be employed without reference to other features and subcombinations. This is contemplated by and is within the scope of the claims. Since many possible embodiments of the described technology may be made without departing from the scope, it is to be understood that all matter described herein or illustrated the accompanying drawings is to be interpreted as illustrative and not in a limiting sense.
[0097] Some example aspects of the technology that may be practiced from the forgoing disclosure include the following:
[0098] Aspect 1: A computer-implemented method comprising: receiving, via a similarity extractor system, input data; generating, via the similarity extractor system, a plurality of similarity identifiers for the input data using a labeled dataset; identifying a highest relevant data point from the labeled dataset based on the plurality of similarity identifiers; and based on identifying the highest relevant data point, providing a dynamic few shot incorporating the highest relevant data point to a large language model (LLM) .
[0099] Aspect 2: Aspect 1, the plurality of similarity identifiers generated by: tokenizing a first character string and a second character string of the input data; and applying Term Frequency-Inverse Document Frequency (TF-IDF) and cosine similarity to compare each of the tokenized first character string and the tokenized second character string to each of the data points within the labeled dataset.
[0100] Aspect 3: Aspect 1 or 2, further comprising: aggregating each value associated with the comparison of the tokenized first character string to each of the data points within the labeled dataset to generate a first similarity identifier of the plurality of similarity identifiers; aggregating each value associated with the comparison of the tokenized second character string to each of the data points within the labeled dataset to generate a second similarity identifier of the plurality of similarity identifiers; and applying a weighted value to each of the first similarity identifier and the second similarity identifier.
[0101] Aspect 4: Aspect 1, 2, or 3, further comprising: identifying the highest relevant data point and a second highest relevant data point based on applying the weighted value; providing the dynamic few shot and a second dynamic few shot incorporating the second highest relevant data point to the LLM; and causing the LLM to generate output based on the dynamic few shot and the second dynamic few shot.
[0102] Aspect 5: Aspect 1, 2, 3, or 4, further comprising generating the labeled dataset by: applying a clustering algorithm to a data population; generating clusters for different features based on applying the clustering algorithm, each of the clusters having a plurality of similar features; and applying feature sampling to each of the clusters to extract the data points of the labeled dataset.
[0103] Aspect 6: Aspect l, 2, 3, 4, or 5, further comprising removing a predetermined few shot associated with the LLM and replacing the predetermined few shot with the dynamic few shot.
[0104] Aspect 7: Aspect 1, 2, 3, 4, 5, or 6, the highest relevant data point being identified by: standardizing documents within the labeled dataset by: converting structured metadata of each document within the labeled dataset into plain text; tokenizing the plain text for each document; and applying Term Frequency-Inverse Document Frequency (TF-IDF) to generate a TF-IDF matrix for each of the tokenized documents; generating the plurality of similarity identifiers by: tokenizing a first character string and a second character string of the input data; applying the TF-IDF to generate a TF-IDF matrix for each of the tokenized first character string and the tokenized second character string; applying cosine similarity between the TF-IDF matrix for the tokenized first character string and the TF-IDF matrix for each of the tokenized documents; and applying cosine similarity between the TF-IDF matrix for the tokenized second character string and the TF-IDF matrix for each of the tokenized documents.
[0105] Aspect 8: Aspect 1, 2, 3, 4, 5, 6, or 7, further comprising: generating a relevant data point for each of the documents within the labeled dataset by merging: a weighted sum of the cosine similarity between the TF-IDF matrix for the tokenized first character string and the TF-IDF matrix for a first tokenized document; and the weighted sum of the cosine similarity between the TF-IDF matrix for the tokenized second character string and the TF-IDF matrix for the first tokenized document; and identifying the highest relevant data point based on the relevant data point for each of the documents.
[0106] Aspect 9: A computer system comprising: one or more processors; and a computer storage medium storing computer-useable instructions that, when used by the one or more processors, causes the computer system to perform operations comprising: receiving input data; generating a plurality of similarity identifiers for the input data based on comparing the input data to each data point within a labeled dataset; identifying a highest relevant data point from the labeled dataset based on the plurality of similarity identifiers; based on identifying the highest relevant data point, generating a dynamic few shot incorporating the highest relevant data point; and providing the dynamic few shot to a large language model (LLM) .
[0107] Aspect 10: Aspect 9, the plurality of similarity identifiers generated by: tokenizing a first character string and a second character string of the input data; and applying Term Frequency-Inverse Document Frequency (TF-IDF) to generate a first TF-IDF matrix for the tokenized first character string and a second TF-IDF matrix for the tokenized second character string.
[0108] Aspect 11: Aspect 9 or 10, the plurality of similarity identifiers generated by: determining a first set of cosine similarities between the first TF-IDF matrix and each data point within the labeled dataset; and determining a second set of cosine similarities between the second TF-IDF matrix and each data point within the labeled dataset.
[0109] Aspect 12: Aspect 9, 10, or 11, the plurality of similarity identifiers generated by: merging a weighted sum of a first cosine similarity of the first set of cosine similarities with a second cosine similarity of the second set of cosine similarities for a first data point within the labeled dataset; and merging the weighted sum of a third cosine similarity of the first set of cosine similarities with a fourth cosine similarity of the second set of cosine similarities for a second data point within the labeled dataset.
[0110] Aspect 13: Aspect 9, 10, 11, or 12, wherein the first character string of the input data is a variable name.
[0111] Aspect 14: Aspect 9, 10, 11, 12 or 13, wherein the second character string of the input data is an argument string.
[0112] Aspect 15: Aspect 9, 10, 11, 12, 13, or 14, wherein the dynamic few shot is provided to the LLM based on the variable name and the weighted sum of the first cosine similarity with the second cosine similarity, the operations further comprising: providing a variable argument dynamic few shot to the LLM based on the argument string and the weighted sum of the third cosine similarity with the fourth cosine similarity.
[0113] Aspect 16: One or more non-transitory computer storage media storing computer-useable instructions that, when used by one or more processors, cause the one or more processors to perform operations comprising: receiving dynamic few shots generated using two strings of input data each compared to data points within a labeled dataset based on converting the input data and the data points into Term Frequency-Inverse Document Frequency (TF-IDF) matrices; and generating an output based on using the dynamic few shots.
[0114] Aspect 17: Aspect 16, the output being provided based on the dynamic few shots replacing predetermined few shots.
[0115] Aspect 18: Aspect 16, or 17, the number of dynamic few shots being four and the number of predetermined few shots being four.
[0116] Aspect 19: Aspect 16, 17, or 18, the output being provided based on using predetermined few shots.
[0117] Aspect 20: Aspect 16, 17, 18, or 19, the number of dynamic few shots being four and the number of predetermined few shots being four.
Claims
1.A computer-implemented method comprising:receiving, via a similarity extractor system, input data;generating, via the similarity extractor system, a plurality of similarity identifiers for the input data using a labeled dataset;identifying a highest relevant data point from the labeled dataset based on the plurality of similarity identifiers; andbased on identifying the highest relevant data point, providing a dynamic few shot incorporating the highest relevant data point to a large language model (LLM) .2.The computer-implemented method of claim 1, the plurality of similarity identifiers generated by:tokenizing a first character string and a second character string of the input data; andapplying Term Frequency-Inverse Document Frequency (TF-IDF) and cosine similarity to compare each of the tokenized first character string and the tokenized second character string to each of the data points within the labeled dataset.3.The computer-implemented method of claim 2, further comprising:aggregating each value associated with the comparison of the tokenized first character string to each of the data points within the labeled dataset to generate a first similarity identifier of the plurality of similarity identifiers;aggregating each value associated with the comparison of the tokenized second character string to each of the data points within the labeled dataset to generate a second similarity identifier of the plurality of similarity identifiers; andapplying a weighted value to each of the first similarity identifier and the second similarity identifier.4.The computer-implemented method of claim 3, further comprising:identifying the highest relevant data point and a second highest relevant data point based on applying the weighted value;providing the dynamic few shot and a second dynamic few shot incorporating the second highest relevant data point to the LLM; andcausing the LLM to generate output based on the dynamic few shot and the second dynamic few shot.5.The computer-implemented method of claim 1, further comprising generating the labeled dataset by:applying a clustering algorithm to a data population;generating clusters for different features based on applying the clustering algorithm, each of the clusters having a plurality of similar features; andapplying feature sampling to each of the clusters to extract the data points of the labeled dataset.6.The computer-implemented method of claim 1, further comprising removing a predetermined few shot associated with the LLM and replacing the predetermined few shot with the dynamic few shot.7.The computer-implemented method of claim 1, the highest relevant data point being identified by:standardizing documents within the labeled dataset by:converting structured metadata of each document within the labeled dataset into plain text;tokenizing the plain text for each document; andapplying Term Frequency-Inverse Document Frequency (TF-IDF) to generate a TF-IDF matrix for each of the tokenized documents;generating the plurality of similarity identifiers by:tokenizing a first character string and a second character string of the input data;applying the TF-IDF to generate a TF-IDF matrix for each of the tokenized first character string and the tokenized second character string;applying cosine similarity between the TF-IDF matrix for the tokenized first character string and the TF-IDF matrix for each of the tokenized documents; andapplying cosine similarity between the TF-IDF matrix for the tokenized second character string and the TF-IDF matrix for each of the tokenized documents.8.The computer-implemented method of claim 7, further comprising:generating a relevant data point for each of the documents within the labeled dataset by merging:a weighted sum of the cosine similarity between the TF-IDF matrix for the tokenized first character string and the TF-IDF matrix for a first tokenized document; andthe weighted sum of the cosine similarity between the TF-IDF matrix for the tokenized second character string and the TF-IDF matrix for the first tokenized document; andidentifying the highest relevant data point based on the relevant data point for each of the documents.9.A computer system comprising:one or more processors; anda computer storage medium storing computer-useable instructions that, when used by the one or more processors, causes the computer system to perform operations comprising:receiving input data;generating a plurality of similarity identifiers for the input data based on comparing the input data to each data point within a labeled dataset;identifying a highest relevant data point from the labeled dataset based on the plurality of similarity identifiers;based on identifying the highest relevant data point, generating a dynamic few shot incorporating the highest relevant data point; andproviding the dynamic few shot to a large language model (LLM) .10.The computer system of claim 9, the plurality of similarity identifiers generated by:tokenizing a first character string and a second character string of the input data; andapplying Term Frequency-Inverse Document Frequency (TF-IDF) to generate a first TF-IDF matrix for the tokenized first character string and a second TF-IDF matrix for the tokenized second character string.11.The computer system of claim 10, the plurality of similarity identifiers generated by:determining a first set of cosine similarities between the first TF-IDF matrix and each data point within the labeled dataset; anddetermining a second set of cosine similarities between the second TF-IDF matrix and each data point within the labeled dataset.12.The computer system of claim 11, the plurality of similarity identifiers generated by:merging a weighted sum of a first cosine similarity of the first set of cosine similarities with a second cosine similarity of the second set of cosine similarities for a first data point within the labeled dataset; andmerging the weighted sum of a third cosine similarity of the first set of cosine similarities with a fourth cosine similarity of the second set of cosine similarities for a second data point within the labeled dataset.13.The computer system of claim 12, wherein the first character string of the input data is a variable name.14.The computer system of claim 13, wherein the second character string of the input data is an argument string.15.The computer system of claim 14, wherein the dynamic few shot is provided to the LLM based on the variable name and the weighted sum of the first cosine similarity with the second cosine similarity, the operations further comprising:providing a variable argument dynamic few shot to the LLM based on the argument string and the weighted sum of the third cosine similarity with the fourth cosine similarity.16.One or more non-transitory computer storage media storing computer-useable instructions that, when used by one or more processors, cause the one or more processors to perform operations comprising:receiving dynamic few shots generated using two strings of input data each compared to data points within a labeled dataset based on converting the input data and the data points into Term Frequency-Inverse Document Frequency (TF-IDF) matrices; andgenerating an output based on using the dynamic few shots.17.The one or more non-transitory computer storage media of claim 16, the output being provided based on the dynamic few shots replacing predetermined few shots.18.The one or more non-transitory computer storage media of claim 17, the number of dynamic few shots being four and the number of predetermined few shots being four.19.The one or more non-transitory computer storage media of claim 16, the output being provided based on using predetermined few shots.20.The one or more non-transitory computer storage media of claim 19, the number of dynamic few shots being four and the number of predetermined few shots being four.
Citation Information
Patent Citations
Cross-domain small sample image classification model method focusing on fine-grained recognition
CN112766378A
Text entity extraction method and system based on self-training semi-supervised learning
CN115270797A
Semantic analysis method for network security co-processing based on few sample learning
CN115329776A
Problem assignment method based on large language model
CN118410876A
Measuring Similarity System and Method of Android Application Using Text Mining
KR1020180089997A