An artificial intelligence corpus value metering and reasoning optimization method and system based on word element attribution
By assigning globally unique identifiers to corpus data and establishing lexical attribution relationships, combined with real-time power costs and cache reuse value scoring, the problem of the separation between corpus value assessment and reasoning systems is solved, achieving accurate measurement of corpus use value and improved resource utilization efficiency.
Patent Information
- Application Number
- CN202611317299.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-28
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, the value assessment of corpus data is separated from the operational decision-making of artificial intelligence inference systems. This makes it impossible to accurately quantify the lexical consumption and power costs of corpus data in the inference process, optimize cache retention and storage tiers, and achieve continuous resource allocation optimization.
Each piece of corpus data is assigned a globally unique corpus identifier. Input and output lexical units are recorded through lexical range logs to establish attribution relationships. Combined with real-time power costs and cache reuse value scores, the operating parameters of the inference system, such as cache priority and storage level, are adjusted in reverse.
It enables accurate measurement of the value of corpus usage, improves resource utilization efficiency, reduces redundant calculation overhead, and enhances the overall operating efficiency of artificial intelligence reasoning systems.
Smart Images

Figure CN123180342A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and system for measuring and optimizing the value of AI corpus based on lexical attribution. Background Technology
[0002] Corpus data, such as system prompts, search enhancement context generation, and role setting templates, are the fundamental production elements supporting large language model inference services. This corpus content directly impacts the output quality and token consumption of the inference service. However, in the current system for measuring the circulation and use of corpus data, the value assessment and trading models for corpus data remain at a relatively rudimentary stage. The mainstream approach is "one-time purchase" or "wholesale based on data volume," failing to establish a dynamic mapping between corpus usage behavior and the actual computing power and energy costs consumed. In this static model, a frequently invoked system prompt and a rarely used corpus cannot be effectively distinguished in terms of value, making it difficult to continuously and accurately quantify the contributions of corpus providers and inhibiting the continuous supply of high-quality corpus data.
[0003] With the large-scale development of large language model inference services, some technologies are attempting to introduce corpora into the inference process and conduct value assessments. In applications such as knowledge-based question answering, existing solutions extract semantic elements from text to achieve more accurate retrieval during the knowledge recall stage, and then construct prompts from the retrieval results to feed into the large model. While these solutions achieve the integration of corpora into the inference process, their focus is solely on improving question-answering accuracy using corpora, without establishing a precise attribution mechanism from corpus data to token consumption. In actual inference services, the same system prompt may be reused thousands of times within an hour, participating in a large number of input token processing and output token generation processes. However, existing technologies cannot track "how many input tokens a particular piece of corpus corresponds to in a particular inference, and how many output tokens it indirectly affects," making it impossible to quantify the intensity of corpus usage. Therefore, the assessment of its value lacks the most basic inference operation data support.
[0004] In the field of data asset trading, some technical solutions have proposed frameworks to map data resources into tradable assets and achieve dynamic valuation and revenue distribution. However, these solutions essentially fall under the category of general data asset trading, with valuation methods relying heavily on manual assessment or simple rules based on data scale and data type, failing to correlate with the actual operational data of inference services. Specifically, under the existing system, corpus pricing, token pricing, and the electricity market operate independently: corpus pricing is based on one-time buyouts or wholesale pricing, token services use fixed rates, and electricity is cleared according to its own market rules. Fluctuations in electricity costs cannot be transmitted to corpus value assessment, and the scarcity and intensity of corpus data are not reflected in token pricing. This fragmentation of the three markets leads to an underestimation of the true use value and resource consumption value of corpus data, making it difficult for existing mechanisms to capture the continuous inference contribution created by a frequently used system prompt.
[0005] Furthermore, various key-value cache reuse techniques, such as prefix caching and cardinality attention, have been widely used to improve inference efficiency, avoiding redundant computations and reducing energy consumption and latency. Some inference service providers have also launched cache discount pricing schemes. However, these technologies only achieve "reuse" itself and do not transform cache reuse into quantifiable corpus reuse value. For example, key questions such as which prefixes are worth keeping in expensive HBM memory and which should be downgraded to DDR memory or NVMe storage media, how to quantify the pre-filling computation cost saved by cache hits based on the number of hits, prefix length, and maintenance costs, and how to establish a correlation between the cached corpus and specific inference requests and token consumption, lack effective solutions in existing technologies.
[0006] More importantly, current limited corpus or data asset valuation technologies typically only use the corpus value measurement results as a reference for transaction pricing, which is disconnected from the actual operational decisions of the inference system. Even if a piece of corpus is assessed as "high-value," the inference system will not increase the cache priority of the corresponding KV cache, optimize the inference route for requests containing that corpus, or adjust the storage level of the cache related to that corpus. This "valuation-operation" isolation makes the value measurement system an isolated measurement module outside the inference system, unable to form a technical closed loop of "corpus value measurement results driving cache retention, storage tiering, and route optimization," and also making it difficult to achieve continuous optimization of inference system resource allocation. Summary of the Invention
[0007] This invention provides a method and system for measuring the value of AI corpus and optimizing inference based on lexical attribution, in order to solve the problem that in existing AI inference systems, the measurement of the value of corpus data is separated from the decision-making of the inference system, which makes it impossible to accurately quantify the value of corpus usage based on lexical consumption, real-time power cost and key-value cache reuse in the inference link.
[0008] This invention is achieved through the following technical solution, providing a method for measuring and optimizing the value of artificial intelligence corpora based on lexical attribution, comprising the following steps:
[0009] Each piece of corpus data entering the AI inference system is assigned a globally unique corpus identifier; in response to receiving an inference request containing corpus data, the system records the start position, end position, and number of input lexical units corresponding to each piece of corpus data through a lexical range log, directly attributing the input lexical units to their corresponding corpus identifiers, and distributing the output lexical units generated by the model in response to the inference request to each piece of corpus data according to a preset indirect allocation rule, thereby establishing an attribution relationship from corpus data to lexical unit consumption; real-time lexical unit power cost data related to the inference request is acquired, and the real-time lexical unit power cost data is based at least on... The electricity price and energy consumption parameters of the inference endpoint during the inference period are dynamically generated. Based on the attribution relationship and real-time lexical electricity cost data, the lexical consumption cost of each corpus data in the preset period is calculated. Based on the key-value cache hit event associated with the corpus identifier, the cache reuse value score corresponding to the corpus data is generated. Based on the lexical consumption cost and the cache reuse value score, the corpus value measurement result of the corpus data is generated. Based on the corpus value measurement result, at least one of the operating parameters of the artificial intelligence inference system is adjusted in reverse. The operating parameters include at least one of cache priority, cache storage level and inference routing node.
[0010] Specifically, the preset indirect allocation rules include at least one of the following: input word proportion allocation, which allocates output words proportionally according to the proportion of input words in each corpus; recall similarity allocation, which, in the context of retrieval enhancement generation, uses the vector similarity between each recalled document and the input query as the allocation weight; prompt position allocation, which assigns different weights to each corpus data based on its position in the prompt words, with higher weights for corpus data closer to the user input; and attention weight allocation, which uses the average attention weight of each input word during the inference process as the allocation basis.
[0011] Specifically, acquiring real-time token power cost data related to the inference request includes: initiating a query request to the token power metering system through a standardized token power cost access interface; receiving the returned real-time cost data, which includes the input token unit price, output token unit price, data center PUE value, green electricity ratio, and carbon emission intensity; the token consumption cost is calculated using the following formula: Cost_token_i=Σ(N_input_ij / 1000×C_input(t_j)+N_output_ij / 1000 ×C_output(t_j)); where Cost_token_i is the token power cost of corpus i in time period Δt (in yuan / thousand tokens), N_input_ij is the number of input tokens contributed by corpus i in the j-th request, C_input(t_j) is the unit price of input tokens at the time of the j-th request, N_output_ij is the number of output tokens allocated to corpus i in the j-th request, and C_output(t_j) is the unit price of output tokens at the time of the j-th request (in yuan / thousand tokens).
[0012] Specifically, when the data returned by the lexical electricity cost access interface has missing fields, abnormal values, or service unavailability, a tiered degradation process is performed: if a single field is missing or the data is expired for no more than 30 minutes, the last successfully obtained data is used and a degradation log is recorded; if multiple fields are missing or the data is expired for more than 30 minutes, the historical average value for the same period over the past seven days is used as replacement data; if the service is unavailable or the price fluctuates by more than 50%, a preset backup pricing table is used; if the number of consecutive failed calls reaches a preset number, real-time value metering is paused, the last successful value metering result is enabled, and an alarm notification is issued.
[0013] Specifically, the cache reuse value score corresponding to the generated corpus data includes: calculating the computational cost of repeated pre-filling avoided due to cache hits as the computational savings value, which is equal to the number of hits multiplied by the cache prefix length multiplied by the unit pre-filling cost; calculating the value of the cache as a storage resource for providing query services based on the cache residence time, the storage rate of the storage level where the cache is located, and the number of cache hits as the storage service value; and calculating the cumulative value added from multiple cache hits using a hit pricing strategy with decreasing marginal unit price as the hit value added, where the unit price of a hit satisfies the following formula: C_hit_k=C_hit_base×γ^(k-1); where C_hit_k is the k-th hit. The unit price of a hit is calculated, where C_hit_base is the base unit price for the first hit, and γ is the decay coefficient, which is greater than 0 and less than 1. The maintenance cost required for cache storage space is calculated. The cache reuse value score is calculated using the following formula: Score_cache=w1×V_compute+w2×V_storage+w3×V_hit-w4×C_maintain; where Score_cache is the comprehensive score of cache reuse value, V_compute is the calculated value saving, V_storage is the value of storing storage services, V_hit is the hit value increase, C_maintain is the maintenance cost, and w1, w2, w3, and w4 are weighting coefficients.
[0014] Specifically, tiered storage decisions are made based on cache reuse value scores, including: when the cache reuse value score > a first threshold, the corresponding key-value cache is migrated to HBM memory; when the second threshold < cache reuse value score ≤ the first threshold, the corresponding key-value cache is retained in DDR memory; when the third threshold < cache reuse value score ≤ the second threshold, the corresponding key-value cache is downgraded to NVMe storage media; when the cache reuse value score ≤ the third threshold, and the duration of the cache not being hit > a preset lifespan, the corresponding key-value cache is evicted and released; wherein, the first threshold is greater than the second threshold, the second threshold is greater than the third threshold, and the first threshold, the second threshold, and the third threshold are dynamically calibrated based on the mean and standard deviation of the full cache reuse value scores.
[0015] Specifically, it also includes: generating corpus optimization prompts based on corpus value measurement results, including prefix matching rate optimization prompts or corpus length simplification prompts; generating prefix matching rate optimization prompts when the calculated saving value in the cache reuse value score corresponding to a corpus data is lower than a preset standard; and generating corpus length simplification prompts when the storage service value in the cache reuse value score corresponding to the corpus data is higher than the calculated saving value.
[0016] Specifically, each piece of corpus data entering the AI inference system is assigned a globally unique corpus identifier, including: a language identifier, content hash, corpus type identifier, and corpus provider identifier based on the corpus data. Candidate corpus identifier values are generated using a hash algorithm and conflict verification is performed through a corpus registry. When an identifier conflict exists, a random salt value or sequence number is added and the identifier is regenerated until the globally unique corpus identifier is obtained. The corpus type identifier includes at least one of system prompts, retrieval-enhanced generated documents, role settings, and few-sample examples.
[0017] Specifically, this also includes cross-tenant security isolation steps: marking the visibility scope of each piece of corpus data, including a private scope visible only to the tenant, a shared scope that can be used by a designated tenant group after authorization, and a public scope that is publicly available across the entire platform; dividing the key-value cache of different tenants into cache storage areas according to the tenant identifier, and restricting cross-tenant cache access through independent memory page tables or access control, and performing cache hit matching only within the same tenant or authorized shared scope; storing the lexical attribution log in partitions according to the tenant identifier, and each tenant can only query the attribution data of its own corpus data; generating audit logs for all cross-tenant corpus sharing operations, recording the operator, time, operation type, and affected corpus identifier.
[0018] A lexical attribution-based artificial intelligence corpus value measurement and reasoning optimization system includes: a corpus identification module, used to assign a globally unique corpus identifier to each piece of corpus data entering the artificial intelligence reasoning system;
[0019] The lexical attribution module, in response to a received inference request containing corpus data, records the start and end positions of input lexical units and the number of input lexical units for each corpus data point through a lexical range log. It directly attributes the input lexical units to their corresponding corpus identifiers and distributes the output lexical units generated by the model in response to the inference request to each corpus data point according to a preset indirect allocation rule, thus establishing an attribution relationship from corpus data to lexical unit consumption. The cost calculation module acquires real-time lexical unit power cost data related to the inference request. This real-time lexical unit power cost data is dynamically generated based at least on the electricity price during the inference period and the energy consumption parameters of the inference endpoint. The system is configured to: 1) calculate the lexical consumption cost of each corpus data within a preset time period based on attribution relationships and real-time lexical power cost data; 2) generate a cache reuse scoring module to generate a cache reuse value score for the corpus data based on key-value cache hit events associated with the corpus identifier; 3) generate a corpus value measurement result based on the lexical consumption cost and cache reuse value score; and 4) adjust a reverse adjustment module to reverse adjust at least one operating parameter of the artificial intelligence inference system based on the corpus value measurement result. The operating parameters include at least one of cache priority, cache storage level, and inference routing node.
[0020] Compared with the prior art, the present invention has the following beneficial effects:
[0021] (1) By assigning a globally unique corpus identifier to the corpus data and establishing an attribution relationship between the corpus identifier and the input and output lexical units during the prompt word assembly and lexical unitization stages, the present invention can refine the traditional request-level lexical unit statistics into corpus-level lexical unit statistics, thereby improving the accuracy of corpus usage intensity and corpus contribution measurement.
[0022] (2) By acquiring real-time lexical electricity cost data dynamically generated based on electricity prices during the reasoning period and energy consumption parameters at the reasoning endpoint, and combining the corpus-level lexical attribution results to calculate the corpus lexical consumption cost, the present invention can enable the corpus value measurement results to reflect the changes in electricity costs during the actual reasoning process, thereby improving the authenticity and timeliness of corpus value measurement.
[0023] (3) By associating corpus identifiers with key-value cache hit events, this invention generates cache reuse value scores and adjusts cache priority, cache storage level or inference routing nodes in reverse based on corpus value measurement results. This can improve the utilization efficiency of key-value cache resources, reduce the overhead of repeated pre-filling calculations, and improve the overall operating efficiency of artificial intelligence inference systems. Attached Figure Description
[0024] Figure 1 This is a system architecture diagram of the AI corpus value measurement and reasoning optimization system based on lexical attribution of the present invention.
[0025] Figure 2 This is a flowchart of the corpus ID embedding and lexical attribution process for the AI corpus value measurement and reasoning optimization method based on lexical attribution of the present invention.
[0026] Figure 3 This is a flowchart of the KV Cache reuse value calculation and hierarchical storage decision-making process for the AI corpus value measurement and reasoning optimization method based on lexical attribution of the present invention.
[0027] Figure 4 This diagram illustrates the reverse mechanism of the corpus value measurement results in the AI corpus value measurement and reasoning optimization method based on lexical attribution of the present invention. Detailed Implementation
[0028] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0029] The terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature; in the description of this application, unless otherwise stated, "multiple" means two or more.
[0030] This embodiment provides a method for measuring and optimizing the value of artificial intelligence corpora based on lexical attribution. (Refer to...) Figure 1 The system architecture shown illustrates that this method operates within a system platform comprising a corpus supply layer, a lexical attribution layer, a lexical power cost transmission layer, a KVCache reuse valuation layer, and a valuation reverse action layer. In this embodiment, Token and lexical have the same meaning; except for interface field names and formula variable names, they are uniformly referred to as lexical below. (Refer to...) Figures 2 to 4 The flowchart shown illustrates the following steps in this method:
[0031] S1: Assign a globally unique corpus identifier to each piece of corpus data entering the artificial intelligence reasoning system.
[0032] In this embodiment, it specifically includes:
[0033] The system generates candidate corpus identifiers based on the language identifier, content hash, corpus type identifier, and corpus provider identifier of the corpus data using the SHA-256 hash algorithm, and performs conflict verification through the corpus registry. When an identifier conflict exists, the system adds a random salt value or sequence number and regenerates the identifier until a globally unique corpus identifier (CorpusID) is obtained, with the following format:
[0034] CorpusID=Hash(Language+ContentHash+Type+Owner)[:16]
[0035] Wherein, Language is the language identifier of the corpus (e.g., "zh" for Chinese, "en" for English), ContentHash is the first 8 bytes of the SHA-256 hash of the corpus content, Type is the corpus type identifier, and Owner is the corpus provider identifier. The corpus type identifier includes at least one of System Prompt (SYS), Retrieval Enhanced Generated Document (RAG), Role Setting (ROLE), and Few Samples (FEW). [:16] indicates taking the first 16 hexadecimal characters (64 bits) of the hash value; combined with the conflict checking and random salt value regeneration mechanism of the corpus registry, the global uniqueness requirement under the corpus registration scale can be met.
[0036] The method in this embodiment also supports secure isolation in multi-tenant scenarios. The secure isolation process is initialized during the corpus registration stage and continues to be effective during subsequent lexical attribution, KV Cache matching, and log querying. The following operations are performed synchronously in this step:
[0037] Each piece of corpus data is marked with a visibility scope, which includes: a private scope visible only to the tenant (PRIVATE), a shared scope that can be used by a specified tenant group after authorization (SHARED), and a public scope that is publicly available across the entire platform (PUBLIC).
[0038] KV Cache for different tenants is divided into cache storage areas according to tenant identifier, and cross-tenant cache access is restricted through independent memory page tables or access control; prefix cache is matched only within the same tenant or authorized shared scope, and unauthorized cross-tenant KV Cache hits are prohibited. When a cache is evicted, only the cache space within its own tenant or authorized scope is reclaimed to avoid high-reuse caches crowding out the normal caches of other tenants.
[0039] The lexical attribution logs are stored in partitions by tenant identifiers. Each tenant can only query the attribution data of its own corpus and cannot obtain the corpus usage statistics of other tenants.
[0040] Audit logs are generated for all cross-tenant corpus sharing operations (including authorization, deauthorization, and access records), recording the operator, operation time, operation type, and affected corpus identifier. Audit logs are retained for 180 days for compliance auditing.
[0041] S2: In response to receiving an inference request containing the corpus data, the start position, end position and number of input words of each corpus data are recorded through the word range log. The input words are directly attributed to the corresponding corpus identifier, and the output words generated by the model in response to the inference request are distributed to each corpus data according to a preset indirect distribution rule, so as to establish an attribution relationship from corpus data to word consumption.
[0042] In this embodiment, the specific process of this step is as follows: Figure 2 ,include:
[0043] S201: Record the lexical range of each corpus segment during the Prompt assembly phase. Upon arrival of an inference request, the system records the start and end positions of the lexical units in each corpus segment and the number of lexical units during the Prompt assembly phase, generating a lexical range log. Log fields include: request_id, corpus_id, token_start, token_end, token_type (INPUT or OUTPUT), number of lexical units contributed to this corpus, model_id, batch_size, timestamp, and region.
[0044] S202: Direct attribution of input terms. Each input term in the Prompt is associated with its source corpus's CorpusID. For terms in the system prompt, all are attributed to the CorpusID in the system prompt; for terms in the RAG document, each document segment is attributed to its corresponding CorpusID.
[0045] S203: Output Lexical Indirect Distribution. The output lexical units generated by the model in response to the inference request are distributed to each corpus data according to a preset indirect distribution rule. The preset indirect distribution rule includes at least one of the following:
[0046] (a) Input Lexical Proportion Allocation (Default Method): Output lexical units are allocated proportionally based on the proportion of input lexical units in each corpus. Output lexical units allocated to corpus i = total output lexical units × (number of input lexical units in corpus i / total number of input lexical units in all corpora). The default method is simple and fair, suitable for scenarios with even contribution, such as system prompts and role settings.
[0047] (b) Recall Similarity Allocation: In RAG scenarios, the similarity (e.g., cosine similarity) between each recalled document and the input query is used as the allocation weight. Weight = softmax(similarity_i / τ), where τ is the temperature coefficient (default 1.0). This is suitable for scenarios with multiple document RAGs and significant differences in document relevance.
[0048] (c) Prompt Position Allocation: Different weights are assigned based on the position of each corpus data point within the prompt word, with higher weights for corpus data points closer to the user input. The weights are calculated using the position decay function w_i=exp(-λ×position_i), where λ is the decay coefficient (default 0.001 / lexicon).
[0049] (d) Attention Weight Allocation: The average attention weight of each input word during the inference process is used as the allocation basis. The average attention weight of the last attention head for each input word is recorded, normalized, and used as the allocation weight. This method has the highest accuracy, but it requires extracting the attention matrix, resulting in high computational cost.
[0050] The system defaults to method (a) and supports mixed configurations based on corpus type—for example, the system prompts to use positional allocation, while RAG documents use similarity allocation.
[0051] S3: Obtain real-time lexical power cost data related to the inference request. The real-time lexical power cost data is dynamically generated based at least on the electricity price and inference endpoint energy consumption parameters during the inference period. Based on the attribution relationship and the real-time lexical power cost data, calculate the lexical consumption cost of each corpus data within a preset period.
[0052] In this embodiment, the step specifically includes:
[0053] S301: Obtain real-time cost data through the standardized lexical electricity cost access interface (TPEC API). The system initiates an HTTP GET request to the lexical electricity metering system, with the request URL carrying the region identifier, model identifier, and timestamp parameters. It receives the returned real-time cost data, including: input lexical electricity cost per k, output lexical electricity cost per k, data center PUE value (pue), green ratio, carbon emission intensity (carbon g per k), and timestamp.
[0054] S302: Calculate the cost of corpus lexical consumption. Use the following formula:
[0055] Cost_token_i=Σ(N_input_ij / 1000×C_input(t_j)+N_output_ij / 1000×C_output(t_j))
[0056] Where Cost_token_i is the token power cost of corpus i in time period Δt, N_input_ij is the number of input tokens contributed by corpus i in the j-th request, C_input(t_j) is the unit price of input token power cost at the time of the j-th request, in yuan / kktoken, N_output_ij is the number of output tokens allocated to corpus i in the j-th request, and C_output(t_j) is the unit price of output token power cost at the time of the j-th request, in yuan / kktoken.
[0057] S303: Interface data anomaly detection and hierarchical degradation handling.
[0058] Data anomaly detection. After each call to the TPEC API, the system performs the following six-dimensional anomaly detection on the returned data:
[0059] Field missing detection: Check whether all 6 required fields (input_cost_per_1k, output_cost_per_1k, pue, green_ratio, carbon_g_per_1k, timestamp) exist;
[0060] Numerical range detection: input_cost_per_1k should be in the range of 0.001-1.0 yuan / thousand words, pue should be in the range of 1.0-3.0, and green_ratio should be in the range of 0-1;
[0061] Timestamp expiration detection: The difference between the timestamp and the current time should be less than 15 minutes; otherwise, it is marked as "expired data".
[0062] Price fluctuation detection: If the change rate is greater than 50% compared with the last successfully obtained price, it is marked as "price anomaly";
[0063] Zero value detection: Any field with a price of 0 or a negative number is marked as "numerical anomaly";
[0064] Connectivity check: If the API response time is greater than 5 seconds or the HTTP status code is not 200, mark it as "service unavailable".
[0065] Tiered degradation processing. Based on the anomaly detection results, the system performs the following tiered degradation processing:
[0066] Level 1 (Minor): When a single field is missing or the data is expired for no more than 30 minutes, the last successfully retrieved data is used, and a degradation log is recorded. The valuation for this period is updated later.
[0067] Level 2 (Moderate): When multiple fields are missing or data is more than 30 minutes out of date, the historical average of the same period over the past seven days is used as the replacement data, which reduces the accuracy of the valuation for this period.
[0068] Level 3 (Severe): When service is unavailable or price fluctuations exceed 50%, a preset backup pricing table (including benchmark pricing for each model and region) will be used, and the valuation will be switched to backup mode at all times.
[0069] Level 4 (Emergency): When the number of consecutive failed calls reaches a preset number (e.g., 3 times), real-time value measurement is suspended, the frozen value of the last successful value measurement result is activated, and an alarm is issued to the operation and maintenance personnel. The value measurement system is then degraded.
[0070] Once the API returns to normal, the system gradually switches back to real-time data mode—first calculating the valuation for the current period using new data, then retrospectively calculating the valuation for the abnormal period, and generating a value measurement deviation report for the abnormal period.
[0071] S4: Based on the key-value cache hit event associated with the corpus identifier, generate a cache reuse value score corresponding to the corpus data.
[0072] In this embodiment, the specific process is as follows: Figure 3 ,include:
[0073] S401: Read the Cache Token data structure. The system maintains a CacheToken record for each cached corpus prefix, which includes: cache unique identifier (cache_id), associated corpus identifier (corpus_id), prefix text hash (prefix_hash), KV Cache block ID list (kv_block_ids), current storage tier (storage_tier, value is HBM / DDR / NVMe), generation cost (generation_cost), storage cost rate (storage_cost_rate), hit count (hit_count), last hit time (last_hit_time), reference count (reference_count), generated model identifier (model_id), and creation time (create_time).
[0074] S402: Calculate the savings value. When the prefill cost per unit token is expressed in yuan / token, the savings value is determined by the formula: V_compute=hit_count×prefix_length×C_prefill_per_token; when the prefill cost per unit token is expressed in yuan / thousand tokens, the savings value is determined by the formula V_compute=(hit_count×prefix_length / 1000)×C_prefill_per_1k.
[0075] Where V_compute is the calculated savings value, hit_count is the number of hits, prefix_length is the cache prefix length (number of tokens), and C_prefill_per_token is the prefill cost per token.
[0076] S403: Calculate the value of storage services. Based on cache residency time, storage rate of the storage tier where the cache resides, and cache hit count, calculate the value of the cache as a storage resource for providing query services using the following formula:
[0077] V_storage=storage_duration×storage_tier_rate×hit_count
[0078] Where V_storage is the storage service value, storage_duration is the residence duration, and storage_tier_rate is the storage service rate corresponding to the storage tier, defined as the storage service fee generated for each hit within a unit residence duration (unit: yuan / (hour·time)), so that V_storage is expressed in monetary terms.
[0079] S404: Calculate the hit increment V_hit.
[0080] Using a hit-based pricing strategy with diminishing marginal unit price, the unit price for the k-th hit satisfies the following formula:
[0081] C_hit_k = C_hit_base × γ^(k-1)
[0082] Where C_hit_k is the unit price of the kth hit, C_hit_base is the base unit price of the first hit, and γ is the decay coefficient, which is greater than 0 and less than 1 (typical value 0.85-0.95).
[0083] The hit bonus is the sum of the unit price of each hit:
[0084] V_hit=Σ(C_hit_k), k=1,2,…,hit_count.
[0085] S405: Calculate the maintenance cost C_maintain, using the following formula to calculate the maintenance cost required to maintain the storage space occupied by the cache:
[0086] C_maintain=storage_size×storage_duration×storage_cost_per_GB_hour
[0087] S406: Calculate the overall score for cache reuse value using the following four-dimensional scoring formula:
[0088] Score_cache=w1×V_compute+w2×V_storage+w3×V_hit-w4×C_maintain
[0089] Wherein, Score_cache is the comprehensive cache reuse value score, V_compute is the computation saving value, V_storage is the storage service value, V_hit is the hit increment value, C_maintain is the maintenance cost, and w1, w2, w3, and w4 are weight coefficients.
[0090] The score update adopts a hybrid strategy of event-driven and periodic scanning. Each Cache hit event triggers an incremental update (updating V_compute, V_hit, and hit_count, with a time consumption of less than 1ms); every 5 minutes, the background scanning thread fully recalculates the Score_cache of all Caches (updating time-related items such as V_storage and C_maintain); when the utilization of the storage tier exceeds 90%, a full recalculation and storage decision evaluation are immediately triggered.
[0091] S407: A tiered storage decision is made based on the cache reuse value score.
[0092] The tiered storage decision rules are as follows: the storage tier is automatically determined according to the reuse value score Score_cache:
[0093] When Score_cache > S_high, the corresponding key-value cache is migrated to the HBM memory to achieve low-latency access;
[0094] When S_medium < Score_cache ≤ S_high, the corresponding key-value cache is retained in the DDR memory;
[0095] When S_low < Score_cache ≤ S_medium, the corresponding key-value cache is downgraded to NVMe SSD;
[0096] When Score_cache ≤ S_low and the duration of no hit exceeds a preset lifecycle (TTL, default 72 hours), the corresponding key-value cache is evicted and released.
[0097] Wherein, the first threshold (S_high), the second threshold (S_medium), and the third threshold (S_low) satisfy S_high > S_medium > S_low. The three thresholds are dynamically calibrated based on the mean and standard deviation of the full cache reuse value scores: in the initialization phase, the Score_cache distribution of all Caches is collected, and the mean μ_S and standard deviation σ_S are calculated;
[0098] Set S_high = μ_S + 0.8 × σ_S;
[0099] S_medium = μ_S, and S_low = μ_S - 0.5 × σ_S;
[0100] The distribution is recalculated and updated adaptively every 24 hours based on the latest distribution. For corpora marked as "critical business", their S_low is reduced by 30% to prevent critical corpora from being prematurely eliminated.
[0101] The system triggers cache hierarchical migration under the following conditions:
[0102] Promotion: When Score_cache exceeds the target level threshold twice consecutively (with a scan interval of 5 minutes), and the utilization rate of the target storage level is less than 90%, a promotion migration to a higher storage level is triggered.
[0103] Degradation: If Score_cache has no hits for 3 consecutive scans below 60% of the current tier threshold, or for 7 consecutive days (from HBM to DDR) or 3 consecutive days (from DDR to NVMe), a degradation migration to a lower storage tier is triggered.
[0104] Evicting: When Score_cache is lower than S_low and the time without a cache hit exceeds TTL (default 72 hours), eviction is triggered.
[0105] The design of multiple consecutive scans avoids unnecessary migration jitter caused by occasional score fluctuations. For degradation paths with consecutive misses, the tolerance period for HBM→DDR is 7 days (a longer observation window is given due to the high cost and scarcity of HBM resources), and the tolerance period for DDR→NVMe is 3 days.
[0106] When a cached entry meets the migration triggering conditions described above, the system executes the following asynchronous migration process:
[0107] The rating engine marks cache entries that need to be migrated and adds them to the asynchronous migration queue;
[0108] Migration tasks are executed during inference off-peak periods, that is, when the system detects that the current token request volume is less than 30% of the peak in the past 24 hours, the migration tasks in the queue will be executed to avoid affecting the online inference service due to migration operations occupying I / O bandwidth and video memory.
[0109] The migration process uses a copy-on-write mechanism—first, a complete copy of the KVCache is created in the target storage level. After the copy is created, the access pointer is switched atomically so that subsequent inference requests can directly access the new copy. Finally, the old storage space in the original storage level is released to complete the migration without interrupting the online inference service.
[0110] After the migration is complete, update the migration change log (tier_change_log) to record the migration time, source tier, target tier, cache identifier, and migration time. At the same time, update the storage tier metadata of the cache.
[0111] S5: Based on the lexical consumption cost and the cache reuse value score, generate the corpus value measurement result of the corpus data.
[0112] In this embodiment, the corpus value measurement module generates corpus value measurement results based on the lexical consumption cost and cache reuse value score, according to a preset mapping rule. When the cache reuse value score is represented by a monetary value, the corpus value measurement result is obtained by weighting the lexical consumption cost and the cache reuse value score; when the cache reuse value score is a dimensionless score, the cache reuse value score is first mapped to a cache reuse value, and then the corpus value measurement result is generated by combining it with the lexical consumption cost.
[0113] S6: Based on the corpus value measurement results, adjust at least one of the operating parameters of the artificial intelligence inference system in reverse, the operating parameters including at least one of cache priority, cache storage level and inference routing node.
[0114] In this embodiment, the corpus value measurement results are mainly used to influence the operational decisions of the inference system; in optional applications, they can also serve as data for subsequent statistics, settlement, or operational analysis. (Refer to...) Figure 4 The reverse action mechanism shown includes at least dynamic adjustment of cache priority and optimization of inference routes; optionally, it also includes corpus quality feedback and budget allocation optimization.
[0115] S601: Dynamic adjustment of cache priority. The Valuation Engine calculates the corpus value measurement results for each corpus every 5 minutes and generates a cache priority label (CachePriorityLabel), which is divided into five levels as shown in Table 1.
[0116] Table 1 Tag value condition Priority effect Execution module CRITICAL Score_cache > S_high × 1.5 and hit frequency in the top 5% During the preset protection period, it will not be considered a regular elimination target, and will be given priority for preloading in HBM and for cross-node synchronization. CacheManager HIGH S_high < Score_cache ≤ S_high × 1.5, or Score_cache > S_high × 1.5 but the hit frequency does not fall within the Top 5% Remove last during elimination, prioritize preloading, and prioritize synchronization. CacheManager NORMAL S_medium<Score_cache≤S_high Standard LRU processing, regular preloading CacheManager LOW S_low<Score_cache≤S_medium Prioritize removal during obsolescence, without preloading. CacheManager EVICT Score_cache≤S_low Immediately mark as elimination candidate EvictionController
[0117] The CachePriorityLabel is written to the priority field of the CacheTokenRecord, which is then read by the Cache Manager module to perform the corresponding cache management operations.
[0118] S602: Inference Routing Optimization. When a corpus is cached on multiple inference nodes, the system prioritizes routing requests containing that corpus to the node with the highest cache hit rate to maximize reuse value. The specific process is as follows:
[0119] The valuation engine calculates a route score for each (corpus ID, node ID) combination:
[0120] RouteScore(corpus_id,node_id)=α×LocalCacheHitRate+β×NodeTokenEfficiency-γ×NetworkLatency_norm
[0121] Among them, LocalCacheHitRate is the node's local cache hit rate, NodeTokenEfficiency is the node's token efficiency, and NetworkLatency_norm is the normalized value of the node's network latency. All three components are normalized to the [0,1] interval using the min-max method before being weighted; α=0.5, β=0.3, γ=0.2; α, β, and γ are empirical weights that can be adjusted according to the business's preference for cache reuse rate, node efficiency, and access latency.
[0122] Generate route priority labels (RoutePriorityLabel), which are divided into three levels as shown in Table 2:
[0123] Table 2 Tag value condition Routing effect Execution module PREFERRED RouteScore is the highest among all nodes in this corpus. This corpus request is preferentially routed to this node. Request Router ACCEPTABLE Not the highest, and the RouteScore is greater than the average RouteScore of the corpus × 0.5. Normal route candidates Request Router AVOID RouteScore ≤ Average RouteScore of the corpus × 0.5 Only as an alternative when the PREFERRED node is overloaded. Load Balancer
[0124] The route priority label is written to the distributed routing table (metadata of the Consistent Hash Ring), which is queried and the routing decision is executed by the Request Router module when a request arrives.
[0125] S603: Corpus Quality Feedback. Feedback the corpus value measurement results to the corpus provider, offering optimization suggestions.
[0126] If a corpus has high reuse value but low hit value (it is frequently loaded but rarely hits), it is recommended to optimize the prefix design to improve the matching rate.
[0127] If the computational savings of a corpus are low but the storage service value is high, it is recommended to shorten the corpus length to reduce storage costs.
[0128] Quality feedback information is generated by the Valuation Engine and pushed to the corpus provider via a message queue (such as Kafka) through the Notification Service.
[0129] S604: Budget Allocation Optimization. When the corpus procurement budget is limited, the system automatically allocates the procurement budget based on the corpus value measurement results—prioritizing the procurement of corpus types with the highest return on investment (ROI = value of use / procurement cost). The budget allocation plan is calculated by the Valuation Engine, executed by the Procurement Scheduler, and written into the budget allocation plan table.
[0130] The execution modules and tag storage locations for the above four dimensions are summarized in Table 3 below:
[0131] Table 3 Reverse Action Dimension Tag generation module Module that performs the operation Tag storage location Cache priority Valuation Engine Cache Manager CacheTokenRecord.priority Inference routing Valuation Engine Request Router Distributed routing table Quality feedback Valuation Engine Notification Service Message Queues (Kafka) Budget allocation Valuation Engine Procurement Scheduler Budget allocation plan
[0132] This embodiment also provides an AI corpus value measurement and reasoning optimization system based on lexical attribution, including the following modules:
[0133] The corpus identification module is used for language identification, content hashing, corpus type identification, and corpus provider identification of the corpus data. It generates candidate corpus identifier values using a hash algorithm and performs conflict verification through a corpus registry. When identifier conflicts exist, a random salt value or sequence number is added, and the identifier is regenerated until a globally unique corpus identifier is obtained. The corpus type identifier includes at least one of system prompts, retrieval-enhanced generated documents, role settings, and few-sample examples. This module also implements multi-tenant security isolation functions, including corpus visibility range marking, KV Cache inter-tenant storage isolation, attribution logs partitioned by tenant, and cross-tenant operation audit log recording.
[0134] The lexical attribution module, in response to a received inference request containing the corpus data, records the start and end positions of input lexical units and the number of input lexical units corresponding to each corpus data through a lexical range log. It directly attributes the input lexical units to the corresponding corpus identifiers and distributes the output lexical units generated by the model in response to the inference request to each corpus data according to a preset indirect allocation rule, thereby establishing an attribution relationship from corpus data to lexical unit consumption. The indirect allocation rule supported by this module includes at least one of the following: input lexical unit proportion allocation, recall similarity allocation, cue position allocation, and attention weight allocation.
[0135] The cost calculation module is used to acquire real-time token electricity cost data related to the inference request. This real-time token electricity cost data is dynamically generated based at least on the electricity price and inference endpoint energy consumption parameters during the inference period. Based on the attribution relationship and the real-time token electricity cost data, the module calculates the token consumption cost of each corpus data within a preset time period. This module initiates a query request to the token electricity metering system through a standardized token electricity cost access interface, receiving real-time cost data including input token unit price, output token unit price, data center PUE value, green electricity ratio, and carbon emission intensity. The module calculates the token consumption cost according to the formula Cost_token_i=Σ[(N_input_ij / 1000)×C_input(t_j)+(N_output_ij / 1000)×C_output(t_j)]. This module also includes an exception handling submodule, which performs tiered degradation processing when the interface returns abnormal data.
[0136] The cache reuse scoring module is used to generate a cache reuse value score for the corpus data based on key-value cache hit events associated with the corpus identifier. This module calculates a comprehensive score using the four-dimensional scoring formula: Score_cache = w1 × V_compute + w2 × V_storage + w3 × V_hit - w4 × C_maintain. Here, V_compute represents the calculated savings value, and a hit pricing strategy with decreasing marginal cost is used to calculate V_hit as the hit value increment: C_hit_k = C_hit_base × γ^(k-1). Based on the scoring results, a tiered storage decision (HBM / DDR / NVMe / retirement) is executed.
[0137] The value measurement generation module is used to generate the corpus value measurement result of the corpus data based on the word element consumption cost and the cache reuse value score.
[0138] The reverse adjustment module is used to reverse adjust at least one operating parameter of the artificial intelligence inference system based on the corpus value measurement results. The operating parameters include at least one of cache priority, cache storage level, and inference routing node. The module specifically implements: (1) performing cache priority adjustment through the Cache Manager module; (2) performing inference routing optimization through the Request Router module; (3) pushing quality optimization feedback to the corpus provider through the message queue; and (4) automatically optimizing the corpus procurement budget allocation through the budget allocation plan.
[0139] The following example uses an AI customer service system of a certain enterprise as an application scenario to provide a specific numerical calculation example of the method of the present invention. The scenario is set as follows: the AI customer service system of a certain enterprise uses the GPT-4 model, the system prompt is an industry standard template of 200 words, and the RAG knowledge base contains 1000 product documents (average 500 words per document).
[0140] The lexical consumption tracking (daily data) is shown in Table 4 below:
[0141] Table 4 Corpus CorpusID Number of calls Input words Output words Model Industry Standard Template cid_a1b2 50,000 10,000,000 - gpt-4 Product A Document cid_c3d4 5,000 2,500,000 - gpt-4 Product B Documents cid_e5f6 3,000 1,500,000 - gpt-4
[0142] Total output tokens: 15,000,000, distributed according to the proportion of input tokens;
[0143] The industry standard template output of terms is: 15,000,000 × (10,000,000 / 14,000,000) = 10,714,286;
[0144] Product A's allocated output words: 15,000,000 × (2,500,000 / 14,000,000) = 2,678,571.
[0145] Calculation of electricity cost for word elements:
[0146] Assuming the electricity price during the period is 0.45 yuan / kWh, PUE=1.15, the input word unit price of gpt-4 is 0.015 yuan / kWh, and the output price is 0.045 yuan / kWh.
[0147] The cost of industry standard template terms = 10,000,000 / 1000×0.015 + 10,714,286 / 1000×0.045 = 150 + 482.14 = 632.14 yuan / day.
[0148] KV Cache reuse value calculation:
[0149] The industry-standard template prefix has 200 terms, with 45,000 cache hits per day (90% hit rate). The prefix prefilling cost, C_prefill, is 0.012 yuan per thousand terms.
[0150] V_compute = 45,000 × 200 × 0.012 / 1000 = 108 yuan / day;
[0151] V_hit is set to C_hit_base = 8.5 yuan / hit (the value of each hit is determined by the corpus licensing fee rate, not by the pricing based on computing power savings), and γ = 0.9. Therefore, V_hit = Σ_{k=1}^{45000}8.5×0.9^(k−1)≈8.5 / (1−0.9) = 85 yuan / day.
[0152] V_storage (HBM storage cost) ≈ 0 yuan / day (in this example, the cache does not provide storage query services to the public); C_maintain (HBM storage maintenance cost) ≈ 12 yuan / day;
[0153] Score_cache≈108+85-12=181 yuan / day.
[0154] Corpus value measurement results and optional settlement references:
[0155] The industry standard template calculates the daily corpus value as follows: lexical cost 632.14 + cache reuse value 181 = 813.14 yuan / day, with a monthly corpus value of approximately 24,394 yuan. In optional settlement applications, the corpus value calculation result can be used as a settlement reference according to preset allocation rules. These settlement rules do not constitute necessary steps for implementing lexical attribution, lexical power cost calculation, cache reuse value scoring, and reverse adjustment of inference system operating parameters in this embodiment.
[0156] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit it. This application is not limited to the exact structures described above and illustrated in the accompanying drawings, and it should not be considered that the specific implementation of this application is limited to these descriptions. For those skilled in the art, various changes and modifications made without departing from the concept of this application should be considered to fall within the protection scope of this application.
Claims
1. A method for quantifying and optimizing the value of AI corpora based on lexical attribution, characterized in that, Includes the following steps: Assign a globally unique corpus identifier to each piece of corpus data entering the artificial intelligence inference system; In response to receiving an inference request containing the corpus data, the starting position, ending position and number of input words of each corpus data are recorded through the word range log. The input words are directly attributed to the corresponding corpus identifier, and the output words generated by the model in response to the inference request are distributed to each corpus data according to a preset indirect distribution rule, so as to establish an attribution relationship from corpus data to word consumption. Acquire real-time lexical power cost data related to the inference request. The real-time lexical power cost data is dynamically generated based at least on the electricity price and energy consumption parameters of the inference endpoint during the inference period. Based on the attribution relationship and the real-time lexical power cost data, calculate the lexical consumption cost of each corpus data within a preset period. Based on the key-value cache hit event associated with the corpus identifier, a cache reuse value score corresponding to the corpus data is generated; Based on the lexical consumption cost and the cache reuse value score, the corpus value measurement result of the corpus data is generated; Based on the corpus value measurement results, at least one of the operating parameters of the artificial intelligence inference system is adjusted in reverse. The operating parameters include at least one of cache priority, cache storage level and inference routing node.
2. The method for quantifying and optimizing the value of AI corpus based on lexical attribution according to claim 1, characterized in that, The preset indirect apportionment rules include at least one of the following: Input word proportion allocation: Output words are allocated proportionally according to the proportion of input words in each corpus data. In the scenario of enhanced retrieval generation, the similarity of the retrieved documents with the input query vector is used as the allocation weight. The prompt location allocation assigns different weights based on the position of each piece of corpus data in the prompt words, with the corpus data closer to the user input having a higher weight; Attention weight allocation uses the average attention weight of each input word during the reasoning process as the basis for allocation.
3. The method for quantifying and optimizing the value of AI corpus based on lexical attribution according to claim 1, characterized in that, The acquisition of real-time lexical power cost data related to the inference request specifically includes: A query request is sent to the word-based power metering system through a standardized word-based power cost access interface; Receive the returned real-time cost data, which includes the input unit price, the output unit price, the data center PUE value, the proportion of green electricity, and the carbon emission intensity; The cost of lexical consumption is calculated using the following formula: Cost_token_i=Σ(N_input_ij / 1000×C_input(t_j)+N_output_ij / 1000×C_output(t_j)) Where Cost_token_i is the token power cost of corpus i in time period Δt, N_input_ij is the number of input tokens contributed by corpus i in the j-th request, C_input(t_j) is the unit price of input token power cost at the time of the j-th request, N_output_ij is the number of output tokens allocated to corpus i in the j-th request, and C_output(t_j) is the unit price of output token power cost at the time of the j-th request.
4. The method for quantifying and optimizing the value of AI corpus based on lexical attribution according to claim 3, characterized in that, When the data returned by the terminology power cost access interface has missing fields, abnormal values, or service unavailability, a tiered degradation process is performed: If a single field is missing or the data has expired for no more than 30 minutes, use the last successfully retrieved data and record a degradation log. When multiple fields are missing or data is more than 30 minutes out of date, the historical average of the same period over the past seven days is used as the replacement data. When service is unavailable or prices fluctuate by more than 50%, the default backup pricing table will be used. When the number of consecutive failed calls reaches a preset number, real-time value measurement is paused, the result of the last successful value measurement is activated, and an alarm notification is issued.
5. The method for quantifying and optimizing the value of AI corpus based on lexical attribution according to claim 1, characterized in that, The generation of the cache reuse value score corresponding to the corpus data specifically includes: The computational cost of repeated pre-filling avoided due to cache hits is calculated as a computational saving value, which is equal to the number of hits multiplied by the cache prefix length multiplied by the unit token pre-filling cost. The value of the cache as a storage resource for providing query services is calculated based on the cache residency time, the storage rate of the storage tier where the cache resides, and the number of cache hits. A hit pricing strategy with decreasing marginal cost is used to calculate the cumulative value added from multiple cache hits, which is taken as the hit value added, where the unit price of a hit satisfies the following formula: C_hit_k = C_hit_base × γ^(k-1) Where C_hit_k is the unit price of the kth hit, C_hit_base is the base unit price of the first hit, and γ is the decay coefficient, which is greater than 0 and less than 1; Calculate the maintenance cost required to store the cache. The cache reuse value score is calculated using the following formula: Score_cache=w1×V_compute+w2×V_storage+w3×V_hit-w4×C_maintain Among them, Score_cache is the comprehensive score of cache reuse value, V_compute is the computational saving value, V_storage is the storage service value, V_hit is the hit value, C_maintain is the maintenance cost, and w1, w2, w3 and w4 are weight coefficients.
6. The method for quantifying and optimizing the value of AI corpus based on lexical attribution according to claim 5, characterized in that, Based on the cache reuse value score, a tiered storage decision is made, including: When the cache reuse value score is greater than the first threshold, the corresponding key-value cache will be migrated to HBM memory; When the second threshold is less than the cache reuse value score and less than the first threshold, the corresponding key-value cache is retained in DDR memory; When the third threshold is less than the cache reuse value score and less than the second threshold, the corresponding key-value cache will be downgraded to NVMe storage medium; When the cache reuse value score is less than or equal to the third threshold, and the duration of the cache not being hit is greater than the preset lifecycle, the corresponding key-value cache will be evicted and released. Wherein, the first threshold is greater than the second threshold, the second threshold is greater than the third threshold, and the first threshold, the second threshold and the third threshold are dynamically calibrated based on the mean and standard deviation of the full cache reuse value score.
7. The method for quantifying and optimizing the value of AI corpus based on lexical attribution according to claim 5, characterized in that, Also includes: Based on the corpus value measurement results, corpus optimization prompts are generated, including prefix matching rate optimization prompts or corpus length simplification prompts. When the calculated saving value in the cache reuse value score corresponding to a corpus data is lower than the preset standard, the prefix matching rate optimization prompt is generated. When the storage service value in the cache reuse value score corresponding to the corpus data is higher than the calculated saving value, a corpus length reduction prompt is generated.
8. The method for quantifying and optimizing the value of AI corpus based on lexical attribution according to claim 1, characterized in that, The process of assigning a globally unique corpus identifier to each piece of corpus data entering the artificial intelligence inference system includes: Based on the language identifier, content hash, corpus type identifier, and corpus provider identifier of the corpus data, candidate corpus identifier values are generated by a hash algorithm and conflict verification is performed by a corpus registry. When an identifier conflict exists, a random salt value or sequence number is added and the corpus identifier is regenerated until the globally unique corpus identifier is obtained. The corpus type identifier includes at least one of system prompts, search-enhanced generated documents, role settings, and few-sample examples.
9. The method for quantifying and optimizing the value of artificial intelligence corpora based on lexical attribution according to claim 1, characterized in that, It also includes cross-tenant security isolation steps: Each piece of corpus data is marked with a visibility scope, which includes a private scope that is only visible to the tenant to which it belongs, a shared scope that can be used by a designated tenant group after authorization, and a public scope that is publicly available across the entire platform. The key-value cache for different tenants is divided into cache storage areas according to the tenant identifier, and cross-tenant cache access is restricted through independent video memory page tables or access control, and cache hit matching is only performed within the same tenant or authorized sharing scope; The lexical attribution log is stored in partitions according to tenant identifiers, and each tenant can only query the attribution data of its own corpus data. An audit log is generated for all cross-tenant corpus sharing operations, recording the operator, time, operation type, and affected corpus identifier.
10. A system for measuring and optimizing the value of AI corpus based on lexical attribution, characterized in that, include: The corpus identification module is used to assign a globally unique corpus identifier to each piece of corpus data entering the artificial intelligence inference system; The lexical attribution module is used to respond to a reasoning request containing the corpus data, record the start position, end position and number of input lexical units corresponding to each corpus data through the lexical range log, directly attribute the input lexical units to the corresponding corpus identifier, and distribute the output lexical units generated by the model in response to the reasoning request to each corpus data according to the preset indirect allocation rule, so as to establish the attribution relationship from corpus data to lexical consumption; The cost calculation module is used to acquire real-time lexical power cost data related to the inference request. The real-time lexical power cost data is dynamically generated based at least on the electricity price and energy consumption parameters of the inference endpoint during the inference period. Based on the attribution relationship and the real-time lexical power cost data, the module calculates the lexical consumption cost of each corpus data within a preset period. The cache reuse scoring module is used to generate a cache reuse value score corresponding to the corpus data based on the key-value cache hit event associated with the corpus identifier. The value measurement generation module is used to generate the corpus value measurement result of the corpus data based on the word element consumption cost and the cache reuse value score; The reverse adjustment module is used to reverse adjust at least one of the operating parameters of the artificial intelligence inference system based on the corpus value measurement results. The operating parameters include at least one of cache priority, cache storage level and inference routing node.
