Collaborative dimension reduction-based large language model cross-border compliance review method and medium
Patent Information
- Application Number
- CN202611499142.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-24
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]基于此,有必要针对现有的审查效率较低问题,提出了一种基于协同维度缩减的大语言模型跨境合规审查方法及介质
[0014]本发明的有益效果:通过将新旧法规文本映射至统一语义空间并比对提取变更语义维度,基于滑动时间窗口构建历史变化序列矩阵以计算维度间趋势相似度,语义空间映射与细粒度比对,基于历史演化规律计算趋势相似度并聚合协同维度,从而识别出长期呈现强一致性的维度组,减少了独立审查项的数量,然后借助地理区域优先级权重机制选择代表项并屏蔽从属维度,对关键维度执行多语言语义映射与违规识别,从而避免了计算资源浪费和响应滞后情况,提升了系统在实时合规更新需求下的响应速度与处理效率。
Smart Images

Figure CN123013961A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cross-border e-commerce compliance management technology, and in particular to a cross-border compliance review method and medium based on a large language model with reduced collaborative dimensions. Background Technology
[0002] Existing cross-border channel compliance review methods based on large language models have initially achieved multilingual regulatory text parsing and semantic comparison functions. However, in actual deployment, they still employ a static, full-scale dimensional modeling mechanism. This means that all potential review dimensions are predefined and fixed, and independent semantic mapping and logical verification are performed on all dimensions in each review task. This approach fails to consider the dynamic correlation between different semantic dimensions during regulatory evolution, leading to numerous instances of overlapping content, synchronized changes, or highly coupled judgment logic among dimensions. Despite this, the system still treats these as completely independent review items, repeatedly calling the large language model for inference, resulting in low review efficiency. Summary of the Invention
[0003] Based on this, it is necessary to propose a cross-border compliance review method and medium based on a large language model with reduced collaborative dimensions to address the problem of low review efficiency.
[0004] A cross-border compliance review method for large language models based on collaborative dimension reduction, the method comprising: When a new target regulatory text is received, the target regulatory text and the currently used original regulatory text are mapped to a preset semantic space to obtain a first semantic vector and a second semantic vector, respectively. The first semantic vector and the second semantic vector are compared to obtain multiple semantic change dimensions, which constitute the first set of dimensions to be reviewed; Based on a sliding time window, regulatory change records within a preset time period in the past are sampled from the historical database to construct a historical change sequence matrix for each semantic dimension. Calculate the trend similarity between dimensions in the historical change sequence matrix, and aggregate the dimensions with synergistic change characteristics based on the trend similarity to obtain the corresponding synergistic dimension set; Based on the preset weights of each dimension, the dimension with the highest weight in each collaborative dimension set is selected as the representative item and retained, while the remaining subordinate dimensions are masked, thus obtaining the second set of dimensions to be reviewed. The business datasets for each cross-border business are obtained based on the second set of dimensions to be reviewed, and the business datasets and the target regulatory text are input into a preset large language model to obtain the compliance review results.
[0005] Further, the step of comparing the first semantic vector and the second semantic vector to obtain multiple modified semantic dimensions includes: Fine-grained field-level comparison is performed on the first semantic vector and the second semantic vector, and the cosine similarity between the embedding vectors of each corresponding entry is calculated item by item; Determine whether each cosine similarity is less than a preset similarity. Entries with a cosine similarity less than a preset similarity are identified as substantially changed entries, and the semantic dimension to which the substantially changed entries belong is extracted as the changed semantic dimension.
[0006] Furthermore, after comparing the first semantic vector and the second semantic vector to obtain multiple changed semantic dimensions, the method further includes: Obtain the product category information of the product currently awaiting review, and construct a product-dimension relationship graph; Based on the product-dimension association graph, determine whether the changes to each semantic dimension apply to the product category; Change semantic dimensions that are not applicable to the product category will be removed from the first set of dimensions to be reviewed.
[0007] Further, the step of calculating the trend similarity between dimensions in the historical change sequence matrix, and aggregating dimensions with co-changing characteristics based on the trend similarity to obtain a corresponding set of co-changing dimensions, includes: The dynamic time warping algorithm is used to calculate the pairwise sequence distances between each dimension in the historical change sequence matrix. The trend similarity between dimensions is determined based on the sequence distance; Determine whether the trend similarity is greater than or equal to the similarity threshold. Dimensions with trend similarity greater than or equal to the similarity threshold are identified as having co-change characteristics; By aggregating dimensions that exhibit synergistic change characteristics, we obtain the corresponding set of synergistic dimensions.
[0008] Furthermore, after the step of aggregating dimensions with synergistic change characteristics based on the trend similarity to obtain the corresponding set of synergistic dimensions, the method further includes: Construct a Bayesian network structure for each dimension within the set of collaborative dimensions to learn the causal dependencies between dimensions; Based on the causal dependency relationship, synchronous change relationship and master-slave driven relationship are distinguished, and the subordinate dimension identified in the master-slave driven relationship is removed from the collaborative dimension set.
[0009] Furthermore, before the step of selecting the dimension with the highest weight as the representative item to be retained in each collaborative dimension set according to the preset weights of each dimension, the method further includes: The preset weights are determined based on the risk levels of the geographical regions corresponding to each dimension. Specifically, a first weight value is configured for dimensions corresponding to high-risk market regulatory requirements, a second weight value is configured for dimensions corresponding to medium-risk market regulatory requirements, and a third weight value is configured for dimensions corresponding to low-risk market regulatory requirements. The first weight value is greater than the second weight value, and the second weight value is greater than the third weight value.
[0010] Furthermore, after the step of inputting the business dataset and the target regulatory text into a preset large language model to obtain the compliance review results, the method further includes: The gradient sensitivity of each input dimension to the model output is calculated in reverse from the output of the large language model. Based on the gradient sensitivity, generate violation impact scores for each dimension; Dimensions whose scores are lower than the preset score threshold due to violations will be removed from the second set of dimensions to be reviewed.
[0011] A cross-border compliance review device for large language models based on collaborative dimension reduction, the device comprising: The mapping module is used to map the target regulatory text and the currently used original regulatory text into a preset semantic space when a new target regulatory text is received, so as to obtain a first semantic vector and a second semantic vector respectively. The comparison module is used to compare the first semantic vector and the second semantic vector to obtain multiple change semantic dimensions, which constitute the first set of dimensions to be reviewed; The sampling module is used to sample regulatory change records within a preset time period from the historical database based on a sliding time window, and construct a historical change sequence matrix for each semantic dimension; The calculation module is used to calculate the trend similarity between dimensions in the historical change sequence matrix, and to aggregate the dimensions with synergistic change characteristics according to the trend similarity to obtain the corresponding synergistic dimension set. The selection module is used to select the dimension with the highest weight in each collaborative dimension set as the representative item based on the preset weights of each dimension, and to hide the remaining subordinate dimensions to obtain the second set of dimensions to be reviewed. The input module is used to obtain the business datasets of each cross-border business based on the second set of dimensions to be reviewed, and input the business datasets and the target regulatory text into a preset large language model to obtain the compliance review results.
[0012] An electronic device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps: When a new target regulatory text is received, the target regulatory text and the currently used original regulatory text are mapped to a preset semantic space to obtain a first semantic vector and a second semantic vector, respectively. The first semantic vector and the second semantic vector are compared to obtain multiple semantic change dimensions, which constitute the first set of dimensions to be reviewed; Based on a sliding time window, regulatory change records within a preset time period in the past are sampled from the historical database to construct a historical change sequence matrix for each semantic dimension. Calculate the trend similarity between dimensions in the historical change sequence matrix, and aggregate the dimensions with synergistic change characteristics based on the trend similarity to obtain the corresponding synergistic dimension set; Based on the preset weights of each dimension, the dimension with the highest weight in each collaborative dimension set is selected as the representative item and retained, while the remaining subordinate dimensions are masked, thus obtaining the second set of dimensions to be reviewed. The business datasets for each cross-border business are obtained based on the second set of dimensions to be reviewed, and the business datasets and the target regulatory text are input into a preset large language model to obtain the compliance review results.
[0013] A computer-readable storage medium storing a computer program, which, when executed by a processor, causes the processor to perform the following steps: When a new target regulatory text is received, the target regulatory text and the currently used original regulatory text are mapped to a preset semantic space to obtain a first semantic vector and a second semantic vector, respectively. The first semantic vector and the second semantic vector are compared to obtain multiple semantic change dimensions, which constitute the first set of dimensions to be reviewed; Based on a sliding time window, regulatory change records within a preset time period in the past are sampled from the historical database to construct a historical change sequence matrix for each semantic dimension. Calculate the trend similarity between dimensions in the historical change sequence matrix, and aggregate the dimensions with synergistic change characteristics based on the trend similarity to obtain the corresponding synergistic dimension set; Based on the preset weights of each dimension, the dimension with the highest weight in each collaborative dimension set is selected as the representative item and retained, while the remaining subordinate dimensions are masked, thus obtaining the second set of dimensions to be reviewed. The business datasets for each cross-border business are obtained based on the second set of dimensions to be reviewed, and the business datasets and the target regulatory text are input into a preset large language model to obtain the compliance review results.
[0014] The beneficial effects of this invention are as follows: By mapping the old and new regulatory texts to a unified semantic space and comparing and extracting the semantic dimensions of changes, a historical change sequence matrix is constructed based on a sliding time window to calculate the trend similarity between dimensions. Semantic space mapping and fine-grained comparison are performed, and trend similarity is calculated based on historical evolution patterns and collaborative dimensions are aggregated. This identifies dimension groups that exhibit strong consistency over a long period, reducing the number of independent review items. Then, representative items are selected and subordinate dimensions are masked using a geographic region priority weighting mechanism. Multilingual semantic mapping and violation identification are performed on key dimensions, thereby avoiding waste of computing resources and response delays, and improving the system's response speed and processing efficiency under real-time compliance update requirements. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0016] in: Figure 1 This is a diagram illustrating the application environment of a cross-border compliance review method for a large language model based on collaborative dimension reduction in one embodiment. Figure 2 This is a flowchart of a cross-border compliance review method for a large language model based on collaborative dimension reduction in one embodiment; Figure 3 This is a structural block diagram of a cross-border compliance review device for a large language model based on collaborative dimension reduction in one embodiment. Figure 4 This is a structural block diagram of an electronic device in one embodiment. Detailed Implementation
[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0018] Figure 1 This is a diagram illustrating an application environment for cross-border compliance review of a large language model based on collaborative dimension reduction in one embodiment. (Refer to...) Figure 1This cross-border compliance review method based on collaborative dimension reduction using a large language model is applied to a cross-border compliance review system based on collaborative dimension reduction using a large language model. This system includes a terminal 110 and a server 120. The terminal 110 and server 120 are connected via a network. The terminal 110 can be a desktop terminal or a mobile terminal, specifically a mobile phone, tablet, laptop, or other similar device. The server 120 can be a standalone server or a server cluster consisting of multiple servers. The terminal 110 is used to acquire the target regulatory text, and the server 120 is used to generate the compliance review results.
[0019] like Figure 2 As shown, in one embodiment, a method for cross-border compliance review of large language models based on collaborative dimension reduction is provided. This method can be applied to both terminals and servers; this embodiment illustrates its application to terminals. The specific steps of this method for cross-border compliance review of large language models based on collaborative dimension reduction are as follows: S1: When a new target regulatory text is received, the target regulatory text and the currently used original regulatory text are mapped to a preset semantic space to obtain a first semantic vector and a second semantic vector, respectively. S2: Compare the first semantic vector and the second semantic vector to obtain multiple change semantic dimensions, which constitute the first set of dimensions to be reviewed; S3: Based on a sliding time window, sample regulatory change records within a preset time period from the historical database to construct a historical change sequence matrix for each semantic dimension; S4: Calculate the trend similarity between dimensions in the historical change sequence matrix, and aggregate the dimensions with synergistic change characteristics according to the trend similarity to obtain the corresponding synergistic dimension set; S5: Based on the preset weights of each dimension, select the dimension with the highest weight in each collaborative dimension set as the representative item and keep it, while hiding the remaining subordinate dimensions to obtain the second set of dimensions to be reviewed; S6: Obtain the business datasets of each cross-border business based on the second set of dimensions to be reviewed, and input the business datasets and the target regulatory text into a preset large language model to obtain the compliance review results.
[0020] As described in step S1 above, the target regulatory text and the currently used original regulatory text are mapped to a preset semantic space, resulting in a first semantic vector and a second semantic vector, respectively. The preset semantic space is a high-dimensional vector space used to uniformly represent the semantic features of regulatory texts from different legal jurisdictions and language versions. Its construction is completed during the system initialization phase. The specific construction method includes: collecting historical regulatory texts and multilingual parallel corpora from major global markets; using a pre-trained multilingual alignment encoder for unsupervised or supervised training; and mapping regulatory entries from different languages to the same vector space, ensuring that semantically similar entries have a close Euclidean distance within this space. This semantic space consists of multiple semantic dimensions, each corresponding to a type of compliance review element (such as certification requirements, labeling specifications, ingredient disclosure, warning statements, etc.). In actual operation, when a new target regulatory text is received, the system simultaneously retrieves the currently used original regulatory text from the backend database as a comparison benchmark. By inputting these two texts into the preset semantic space model for encoding, the system outputs a first semantic vector representing the semantic features of the target regulatory text and a second semantic vector representing the semantic features of the original regulatory text, respectively. This process transforms unstructured text information into computable structured vector data, providing a data foundation for subsequent quantitative comparison. It solves the problem of unstructured text being difficult to directly quantify and compare, providing standardized data input for subsequent change identification. This mapping method eliminates the semantic gap caused by language differences, achieving a unified representation of regulations across legal jurisdictions. In one specific embodiment, the preset semantic space uses the output hidden space of the XLM-RoBERTa (XLM-R) model as its basis. This model is pre-trained on a 2.5TB public corpus of 100 languages, with an output dimension of 768. After the old and new regulatory texts are segmented by the Sentence Piece word segmenter, they are input into a shared 12-layer Transformer encoder. The mean pooling result of the last hidden state sequence is taken as the initial semantic vector of the entry. Subsequently, this initial vector is mapped to a semantic subspace oriented towards the compliance domain through a linear projection layer. This semantic subspace is fine-tuned using a small amount of manually annotated bilingual regulatory parallel corpus, ensuring that the distance between the "previous clause" and the "post-change clause" in the space can sensitively reflect the magnitude of regulatory differences. The supervision signal used in the fine-tuning stage is the contrastive loss function, which further enhances the distinguishing power of the semantic space in the task of identifying regulatory changes by narrowing the vector distance between semantically identical clauses and widening the vector distance between semantically different clauses.
[0021] As described in step S2 above, a fine-grained field-level comparison operation is performed on the first semantic vector and the second semantic vector. Specifically, the regulatory text is structurally decomposed into multiple independent semantic dimensions in the semantic space, including but not limited to key compliance items such as certification type requirements, identification specifications, warning statement templates, ingredient disclosure standards, and lists of permitted terms. The system calculates the cosine similarity between the new and old versions of the embedded vectors on the same dimension to quantify the magnitude of change in each dimension. When the cosine similarity of a certain dimension is lower than a preset threshold (e.g., 0.92), the system determines that the dimension has undergone a substantial change. Substantial means that the change is sufficient to affect the compliance judgment of cross-border business regarding the regulation, rather than a simple format adjustment or wording polishing. After this determination, all semantic dimensions that have undergone substantial changes are extracted, forming the first set of dimensions to be reviewed, D={d1,d2,…,dn}. This set represents the scope of compliance changes that need to be focused on, and the system will only review the dimensions within this set, rather than processing all compliance dimensions. This differentiated extraction mechanism allows subsequent model calls to avoid a large number of irrelevant dimensions that have not changed, reducing data redundancy at the source and minimizing the amount of invalid data processing. Changing semantic dimensions refers to determining the semantic dimensions of items whose cosine similarity is less than a preset similarity threshold by comparing the embedding vectors of corresponding entries in the two vectors after mapping the target regulatory text and the original regulatory text to a preset semantic space to obtain the first semantic vector and the second semantic vector, respectively, as dimensions that have undergone substantial changes.
[0022] As described in step S3 above, the temporal evolution trajectory of each semantic dimension is constructed to provide historical data support for subsequent collaborative dimension identification. In the actual process of regulatory evolution, each semantic dimension does not change in isolation, but rather exhibits certain temporal patterns and group linkage characteristics. To capture this dynamic evolution pattern, the system extracts regulatory change records of major global markets within a preset time period (e.g., the past 12 months) from the historical database. The key is to adopt a sliding time window sampling strategy, that is, the system does not only extract discrete historical snapshots of fixed intervals, but uses the current time point as the end point of the window and slides forward to extract continuous time series data, ensuring that the collected historical change records can reflect recent regulatory evolution trends and avoid introducing outdated regulatory dynamics that have lost their reference value. For each semantic dimension to be reviewed extracted in step S2, the system numerically encodes its change status (such as whether the change occurred, the magnitude of the change, etc.) at each time point within the time window, forming a historical change sequence vector for that dimension. The sequence vectors of all dimensions are stacked row by row to construct a historical change sequence matrix M∈R^(n×t), where n represents the number of dimensions and t represents the number of sampling time points within the time window. This matrix serves as the data foundation for subsequent trend similarity calculations and collaborative clustering analysis.
[0023] As described in step S4 above, the collaborative dimension set refers to the grouping of dimensions obtained by aggregating multiple dimensions with a trend similarity greater than or equal to a preset similarity threshold after calculating the trend similarity of the historical change sequences of each semantic dimension. Dimensions within the same collaborative dimension set exhibit collaborative change characteristics of rising and falling together or having similar forms during the evolution of regulations. In the constructed historical change sequence matrix M, each row represents the change time series curve of a semantic dimension. The system traverses the matrix column by column, calculating the trend similarity between any two dimension row vectors. In practical implementation, the Pearson correlation coefficient can be used to measure the linear correlation between two sequences. When the correlation coefficient exceeds a set threshold (e.g., 0.85), it indicates that the two dimensions have a strong collaborative trend of rising and falling together. Alternatively, the dynamic time warping algorithm can be used to measure the shape similarity between sequences. This algorithm is not affected by the sequence phase shift and is suitable for situations where there is a time lag in the response to regulatory changes. Through pairwise calculation, the system identifies all dimension pairs with significant collaborative change characteristics and aggregates dimensions with strong collaborative relationships into the same collaborative dimension group Gk. The essence of this clustering and merging is to identify "like terms" in the evolution of regulations, providing a basis for grouping in subsequent dimensional simplification. When calculating the point-to-point distance between two time series, the DTW algorithm supports multiple distance metrics, the most commonly used being Euclidean distance and Manhattan distance. Considering that the magnitude of changes in each dimension in a regulatory change sequence is usually represented by discrete change states or normalized change intensity (such as 0 / 1 binary change markers, or change magnitude values in the range of 0 to 1), in a one-dimensional time series scenario, Euclidean distance and Manhattan distance are numerically equivalent. Therefore, either can be used as the metric. This application uses Euclidean distance as the point-to-point distance metric for DTW, which is simple to implement and computationally efficient. It is suitable for pairwise similarity calculation between large-scale regulatory dimensions. Since regulatory changes usually follow a gradual evolution pattern, changes in each dimension within the same coordinating group are highly synchronized in time, and there will be no long-term offset across quarters or even years. Therefore, using Sakoe-Chiba constrained DTW can reduce computational complexity, avoid mismatching change points that are too far apart in time, and ensure that similarity comparison is only performed on nearby change trends within the time window, which conforms to the temporal logic of regulatory evolution.
[0024] As described in step S5 above, based on the preset weights of each dimension, the dimension with the highest weight in each collaborative dimension set is selected as the representative item and retained, while the remaining subordinate dimensions are masked, resulting in a second set of dimensions to be reviewed. The preset weights are quantitative indicators used to measure the importance of each semantic dimension in the compliance review system, and their determination is usually related to the risk level of the geographical region corresponding to the dimension. The principle for configuring the preset weights can be, for example, that dimensions corresponding to high-risk market regulatory requirements are assigned a higher first weight value, dimensions corresponding to medium-risk market regulatory requirements are assigned a second-highest second weight value, and dimensions corresponding to low-risk market regulatory requirements are assigned a lower third weight value, with the first weight value being greater than the second weight value, and the second weight value being greater than the third weight value. Within each collaborative dimension set, the system iterates through all dimensions contained in the set, compares their respective preset weights, and selects the dimension with the highest weight as the representative item of the set for retention. The remaining dimensions within the collaborative dimension set are marked as subordinate dimensions and masked in the subsequent review process, i.e., they are not input into the large language model for processing. After the above filtering and masking operations, a simplified second set of dimensions to be reviewed is finally obtained. This set eliminates unchanged dimensions and redundant subordinate dimensions within co-groups, retaining only the most representative core dimensions that have changed. This minimizes the data dimensionality input to large language models while ensuring comprehensive review coverage. It solves the problem of selecting the most representative dimensions from the co-group dimension set as input, providing a concise and core set of dimensions for model inference. This weighted selection method reduces data dimensionality while maintaining comprehensive review coverage.
[0025] As described in step S6 above, business datasets for each cross-border business are obtained based on the second set of dimensions to be reviewed. These business datasets and the target regulatory text are then input into a pre-defined Large Language Model (LLM) to obtain compliance review results. Specifically, based on the simplified second set of dimensions to be reviewed, the system retrieves business data related to each dimension from the cross-border business database to construct the business dataset. The business dataset contains actual business content such as product information, terms of service, and promotional materials to be reviewed. The pre-defined Large Language Model (LLM) is a deep learning model with multilingual understanding and logical reasoning capabilities. Its training is completed offline, and by learning from massive amounts of legal texts and compliance cases, it has mastered the ability to extract compliance requirements from regulatory texts and apply them to specific business scenarios. During the reasoning phase, the business dataset and the aforementioned new target regulatory text are concatenated or combined to form prompt words, which are then input into the Large Language Model. The Large Language Model performs semantic comparison and logical verification on the business data for each core dimension in the second set of dimensions to be reviewed, determining whether the business content meets the requirements of the target regulatory text. Ultimately, the model outputs structured compliance review results, indicating the compliance status of each business data across different dimensions (e.g., compliant, non-compliant, or questionable), and may include specific reasons for violations or rectification suggestions. By inputting only a streamlined set of the second set of dimensions to be reviewed, the length of context and inference paths that the large language model needs to process is significantly reduced, effectively improving review efficiency and reducing computational resource consumption.
[0026] In a preferred embodiment of the present invention, the large language model adopts LLaMA-2-13B as its basic model architecture. This model is an autoregressive language model based on the Transformer decoder architecture, with 13 billion parameters. It uses RMSnorm for layer normalization and introduces the SwiGLU activation function and rotation position encoding. Compared to larger-scale models (such as those with hundreds of billions of parameters), the 13B parameter level significantly reduces inference latency and GPU memory usage while maintaining sufficient semantic understanding and inference capabilities. This enables efficient deployment in real-world production environments (such as inference servers equipped with single or dual NVIDIA A100 / H100 GPUs). The model weights are open-source and readily available, eliminating the need for training from scratch and significantly reducing system construction costs.
[0027] In alternative implementations, the GPT series (accessible via API, suitable for scenarios with extremely high inference accuracy requirements and ample computational budget), the ChatGLM series (suitable for scenarios requiring lightweight deployment and a high proportion of Chinese compliance review), or the mT5 architecture (suitable for generative review tasks requiring bidirectional encoder-decoder understanding) can also be selected. Model selection can be flexibly determined based on the hardware constraints, real-time requirements, and budget conditions of the actual deployment environment. To enhance the professional capabilities and judgment accuracy of the large language model in cross-border compliance review tasks, domain-adaptive fine-tuning of the base model is necessary. This invention preferably employs the LoRA (Low-Rank Adaptation) parameter efficient fine-tuning technique. Without updating all model parameters, a low-rank decomposition matrix is introduced as a bypass to the attention weight matrix of each Transformer layer. Task-oriented optimization of the base model is achieved by training a small number of newly added parameters. Compared to full fine-tuning, the LoRA method reduces the number of trainable parameters to 0.1%~1% of the original model, significantly reduces memory usage, and the inference speed of the fine-tuned model does not show a significant decrease. The training data used in the fine-tuning stage is the Supervised Fine-Tuning (SFT) dataset, and each data point is in triplet format: (input text, output label, compliance basis). Data sources include: (1) typical cases confirmed by manual review in historical compliance review records, covering two types of samples: violations and compliance; (2) regulatory-business pairing data manually annotated by compliance experts based on common cross-border e-commerce scenarios, covering review scenarios of multiple legal domains, multiple languages, and multiple product categories. The input text is composed of structured review instructions, target regulatory clauses, and business data to be reviewed; the output label is a binary judgment result of "compliant" or "violation"; the compliance basis is a textual explanation of the judgment conclusion, including the specific clause number violated and the description of the reason for the violation. The loss function in the fine-tuning stage is the standard cross-entropy loss, which is used to maximize the likelihood probability between the model output and the label sequence. The input of the large language model adopts a structured prompt word template, which is composed of static system instructions and dynamically filled task data. Each time the model is invoked, the system retrieves the target regulatory clause text and the business data to be reviewed based on the second set of dimensions to be reviewed, fills in the pre-set template, and submits it for model reasoning. The construction of the "prompt words" follows a four-layer progressive principle of "role definition - context injection - task decomposition - format constraints". First, the system instruction clarifies the model's identity as a compliance review expert, limiting the knowledge boundaries and role stance of the answer; second, the target regulatory clauses and the business data to be reviewed, after dimension reduction, are injected into the prompt words in the form of structured paragraphs as the factual basis for the model's reasoning; third, the review task is broken down into sub-tasks such as item-by-item comparison, violation identification, cause explanation, and conclusion output, guiding the model to complete the reasoning according to the pre-set thought chain; finally, the output is explicitly required to be in JSON format to ensure that the results can be directly parsed by the system's data processing module.In the preferred implementation, the system also maintains a prompt word template library, configuring differentiated prompt word templates for different legal jurisdictions, product categories, and review dimensions. For example, for US FDA food label review, the prompt word includes specific comparison requirements for the nutrition facts table format; for EU GDPR data privacy review, the prompt word includes instructions for sentence-by-sentence verification of the user consent statement text. The system automatically selects a matching template based on the composition of the second set of dimensions to be reviewed, achieving refined guidance for the review task. To further reduce the calling cost and response latency of the large language model, this invention deploys a lightweight collaborative dimension prediction sub-model as a pre-filter layer before formally calling the large language model. This sub-model extracts interpretable rule paths from the large language model using knowledge distillation technology, which is used to complete preliminary dimension clustering and pruning, only passing cases that are still questionable or highly complex after dimension reduction to the large language model for deep reasoning. Actual testing shows that this pre-filter mechanism can reduce the number of large language model calls by approximately 40% to 60%, significantly reducing cloud service computing costs and energy consumption in a review scenario that processes millions of product pages daily.
[0028] The aforementioned technical processes collaboratively address the technical problems of high model inference load and large response latency caused by the use of static, full-dimensional modeling in existing cross-border compliance review methods. By mapping the target regulatory text and the original regulatory text to a semantic space and comparing them, irrelevant dimensions that have not changed are first eliminated; then, a historical change sequence matrix is constructed based on a sliding time window, and trend similarity is calculated to identify dimension groups with collaborative change characteristics; finally, based on preset weights determined by the risk level of geographical regions, representative items are selectively retained from the collaborative dimension set while subordinate dimensions are masked. The large language model only needs to process the core dimensions that truly affect compliance conclusions, reducing the number of model inference paths and computational load, shortening the response time of a single review, while ensuring the integrity of the review of regulatory requirements for high-risk markets, and enhancing the system's scalability and real-time response capability in high-concurrency scenarios. Collaborative dimension reduction refers to the process of calculating the trend similarity between dimensions based on the historical change sequence of each semantic dimension in the process of regulatory evolution, aggregating dimensions with collaborative change characteristics into a collaborative dimension set, and selecting representative items to retain and masking subordinate dimensions in each collaborative dimension set, thereby reducing the number of review dimensions.
[0029] In one embodiment, step S2, which compares the first semantic vector and the second semantic vector to obtain multiple modified semantic dimensions, includes: S201: Perform fine-grained field-level comparison on the first semantic vector and the second semantic vector, and calculate the cosine similarity between the embedding vectors of each corresponding item; S202: Determine whether each cosine similarity is less than the preset similarity; S203: Entries with a cosine similarity less than a preset similarity are identified as substantially changed entries, and the semantic dimension to which the substantially changed entries belong is extracted as the changed semantic dimension.
[0030] As described in step S201 above, a fine-grained field-level comparison is performed on the first and second semantic vectors, calculating the cosine similarity between the embedding vectors of each corresponding entry. This fine-grained field-level comparison moves the structured analysis of the regulatory text down from the macro-level of paragraphs or chapters to the specific entry level. By parsing the structured data format of the regulatory text, such as JSON (JavaScript Object Notation) or XML (Extensible Markup Language), the smallest text units with independent semantic meaning, such as certification types, identification specifications, ingredient disclosures, and warning statements, are extracted as comparison entries. For each entry, the embedding vector generated in the semantic space of the above embodiment is used for computation. This embedding vector is not a simple word frequency statistical feature, but a dense vector representation obtained by high-dimensional abstraction of the text context through a deep neural network (such as the encoding layer of a Transformer architecture). Its numerical distribution accurately reflects the relative position of the text unit in the semantic space.
[0031] Cosine similarity measures the directional consistency between two embedding vectors, and its calculation logic is implemented by the ratio of the vector dot product to the magnitude. This process can be formally represented as: In the formula, This represents the cosine similarity between the i-th entry in the first semantic vector and the j-th corresponding entry in the second semantic vector; and These represent the embedding vectors for the corresponding entries; This represents the vector dot product operation; and Representing vectors respectively and The Euclidean norm (i.e., modulus) of the formula is calculated. The result ranges from -1 to 1. When the value is closer to 1, it indicates that the two entries are highly consistent in direction in the semantic space, and their semantic content is the same or very similar. When the value decreases, it indicates that the semantic differences increase. Through this item-by-item calculation, subtle deviations between the old and new regulatory texts in the same semantic dimension can be quantified, avoiding the missed detection problems caused by synonym substitutions or reorganizations that cannot be identified by traditional keyword matching or simple string comparison.
[0032] As described in step S202 above, it is determined whether each cosine similarity is less than a preset similarity. The preset similarity is a quantitative boundary distinguishing between routine semantic evolution and substantive changes in regulatory entries; its physical meaning is to define the maximum semantic deviation tolerance allowed by the system. This threshold is not a single fixed value, but is determined comprehensively based on the historical revision frequency of the target legal domain, the rigor requirements of the legal text, and the tolerance of the business scenario for false positives. For example, for regulatory review in high-risk areas such as pharmaceuticals and medical devices, due to strict compliance requirements, the preset similarity can be set to a higher value, such as 0.95, to ensure that any minor wording changes are captured; while for general consumer product labeling specifications, the preset similarity can be appropriately relaxed to 0.90 to filter out non-critical wording adjustments. In engineering implementation, the preset similarity can be determined, for example, by collecting historical manually reviewed annotation data, plotting a precision-recall curve, and selecting the optimal balance point based on business needs. When the cosine similarity calculation result is above the preset similarity threshold, it is determined that the current entry has not undergone a substantial change in legal obligations; otherwise, it is considered that the entry has a significant semantic shift.
[0033] As described in step S203 above, entries with a cosine similarity less than a preset similarity are identified as substantive change entries, and their semantic dimensions are extracted as change semantic dimensions. Substantive change entries refer to field-level content whose deviation in the semantic space exceeds a preset similarity threshold, signifying a fundamental change in their legal binding force, compliance requirements, or scope of application. After identifying an entry as a substantive change entry, its semantic dimension is traced upwards. This semantic dimension is a logical container for the structured classification of regulatory texts, such as environmental labeling requirements, restrictions on cross-border data transfer, and ingredient disclosure rules. By mapping substantive change entries back to their respective semantic dimensions, a set of change semantic dimensions that accurately reflects the latest changes in regulations is constructed. This process eliminates a large number of redundant dimensions that have not undergone any changes in legal effect, ensuring that subsequent steps only conduct collaborative analysis and model invocation on directions where compliance risks truly evolve, thereby significantly improving the data purity and computational efficiency of the entire review process.
[0034] By replacing qualitative judgment with quantitative comparison, cross-language field-level alignment and difference localization are achieved within a unified semantic space. The fine-grained analysis process consisting of steps S201 to S203 ensures that only dimensions that have actually undergone semantic shifts enter the subsequent collaborative analysis process, reducing the inclusion of false positive changes caused by translation errors or differences in expression, thereby improving the initial input quality of collaborative clustering and dimension pruning.
[0035] In one embodiment, after step S2 of comparing the first semantic vector and the second semantic vector to obtain multiple changed semantic dimensions, the method further includes: S301: Obtain the product category information of the product currently under review and construct a product-dimension relationship graph; S302: Determine whether the changes to each semantic dimension are applicable to the product category based on the product-dimensional association graph; S303: Remove semantic dimensions of changes that are not applicable to the product category from the first set of dimensions to be reviewed.
[0036] As described in step S301 above, the product category information of the product under review is obtained, and a product-dimensional relationship graph is constructed. The product category information serves as the foundational data for defining the attribute domain and regulatory boundaries of the product under review. Its meaning extends beyond simple classification labels, encompassing a multi-dimensional structured description including the product's industry, material, purpose, target consumer group, and specific market access restrictions. This information can be directly obtained from the local product basic information database by reading the product's inventory unit or Global Trade Item Code index. This type of data is typically organized using hierarchical classification coding standards, such as Harmonized System codes or multi-level category trees customized by various e-commerce platforms, thus providing a standardized input benchmark for subsequent compliance analysis.
[0037] The product-dimensional association graph is a semantic mapping network built upon the aforementioned product category information, aiming to represent the applicability logic between different product categories and various compliance review dimensions. This graph is not a fully connected network, but rather a bipartite graph structure built upon applicable regulatory clauses. During system initialization or rule base updates, by parsing the scope of application clauses in the texts of laws and regulations from various countries, constraints such as "applicable to toys," "not applicable to cosmetics," and "only applicable to electronic and electrical equipment" are extracted and transformed into structured triple relationships: <product category, association, compliance dimension>. For example, a strong association edge is established between toy safety standards and the category "children's toys," while no association edge or explicit exclusion relationship is established between toy safety standards and the category "women's skincare." By integrating massive amounts of historical compliance cases and applicable legal rules, a high-density knowledge graph is formed, where nodes represent product categories and compliance dimensions, and edge weights represent the strength of the association or probability of application between the two. This construction process ensures that the product-dimensional association graph accurately reflects the jurisdictional effect of specific regulations on different products in the physical world, providing a computable data structure foundation for subsequent precise filtering.
[0038] As described in step S302 above, the product-dimensional association graph is used to determine whether the changes to each semantic dimension apply to the product category. Specifically, the semantic dimensions extracted in the preceding steps are used as query nodes. Path retrieval and association degree calculations are performed in the constructed product-dimensional association graph to confirm whether there is a valid connection path or an association weight that meets preset threshold conditions between the category node corresponding to the product category information obtained in the previous step and the dimension node represented by the target semantic dimension.
[0039] If a direct edge exists in the graph pointing from the current product category to the changed semantic dimension, and the edge's attribute is marked as applicable or its relevance weight is greater than a preset application threshold (e.g., 0.7), then the change in the semantic dimension is determined to be applicable to the product category. Conversely, if there is no connecting path in the graph, or the edge's attribute is explicitly marked as excluded or inapplicable, or its relevance weight is lower than the preset threshold, then the change in the semantic dimension is determined to be inapplicable to the product category. This judgment process essentially transforms the abstract applicability clauses in legal texts into an reachability query problem in graph theory. For example, if the product under review is a face cream, and its category has no connecting edges with the changed semantic dimension of children's toy safety marks in the graph, the system determines that the two are unrelated; however, it has a high-weight connection with the cosmetic ingredient disclosure dimension, thus determining that they are related. Through this graph-based reasoning, it is possible to effectively distinguish which regulatory changes the current product must respond to and which are irrelevant noise.
[0040] As described in step S303 above, semantic dimensions for changes that are not applicable to product categories are removed from the first set of dimensions to be reviewed. Specifically, for semantic dimensions for changes determined to be inapplicable in the above steps, a removal operation is performed, removing them from the first set of dimensions to be reviewed. This process involves simplifying and rearranging the set data, rather than simply deleting data. At the data structure level, through set difference operations or list filtering algorithms, the current set of dimensions to be reviewed is traversed, and all dimension identifiers marked as inapplicable are excluded from the set, generating a new, simplified set containing only applicable semantic dimensions for changes.
[0041] The direct purpose of this elimination process is to optimize the input context for subsequent large language models. By removing dimensions that are not substantially related to the current product, ineffective computation and attentional distraction when the model processes irrelevant information are avoided. For example, when reviewing a batch of electronic products, if the regulatory update involves flame retardant standards for infant textiles, this dimension will be precisely eliminated, allowing the large language model to focus only on directly relevant dimensions such as electromagnetic compatibility and energy efficiency labeling for reasoning. This graph-based context-aware filtering mechanism realizes the transformation from full-scale regulatory scanning to targeted and precise review. While ensuring the accuracy of compliance coverage, it significantly reduces the token consumption and computational latency of model reasoning, improving the overall processing efficiency and resource utilization of the system.
[0042] In one embodiment, step S4, which involves calculating the trend similarity between dimensions in the historical change sequence matrix and aggregating dimensions with co-changing characteristics based on the trend similarity to obtain a corresponding set of co-changing dimensions, includes: S401: The dynamic time warping algorithm is used to calculate the pairwise sequence distances between each dimension in the historical change sequence matrix; S402: Determine the trend similarity between dimensions based on the sequence distance; S403: Determine whether the trend similarity is greater than or equal to the similarity threshold. S404: Dimensions with trend similarity greater than or equal to the similarity threshold are determined to have cooperative change characteristics; S405: Aggregate dimensions with synergistic change characteristics to obtain the corresponding set of synergistic dimensions.
[0043] As described in step S401 above, the dynamic time warping algorithm is used to calculate the pairwise sequence distances between each dimension in the historical change sequence matrix. The dynamic time warping algorithm is an effective method for measuring the similarity between two time series, especially when the sequence lengths are different or the rhythms are inconsistent. Unlike traditional Euclidean distance, which requires strict point-to-point alignment, the dynamic time warping algorithm allows for non-linear alignment on the time axis by finding the optimal curved path between two sequences. For any two semantic dimensions in the historical change sequence matrix, such as dimension A and dimension B, their change value sequences within a preset time period (e.g., the past three months) are extracted, forming sequence X and sequence Y respectively. A distance matrix is constructed, and a dynamic programming method is used to find the path with the minimum cumulative distance; the cumulative distance value of this path is taken as the sequence distance between the two dimensions. This process can tolerate differences in the timing or slight fluctuations in the magnitude of regulatory changes, thereby capturing potential co-evolutionary patterns.
[0044] As described in step S402 above, the trend similarity between dimensions is determined based on the sequence distance. The obtained sequence distance reflects the degree of difference between dimensions and needs to be converted into a trend similarity index characterizing the degree of synergy. The sequence distance is mapped to a similarity value using a monotonically decreasing function, such as a Gaussian kernel function or a negative exponential function, to obtain a trend similarity coefficient ranging from 0 to 1. The closer the coefficient is to 1, the closer the historical change trajectories of the two dimensions are in terms of shape and trend, although there may be deviations in time phase; the closer the coefficient is to 0, the more significant the differences in their evolutionary patterns. The trend similarity determined in this way can objectively reflect the consistency of responses of different semantic dimensions to changes in the external regulatory environment.
[0045] As described in step S403 above, it is determined whether the trend similarity is greater than or equal to a similarity threshold. Dimensions with a trend similarity greater than or equal to the similarity threshold are considered to have synergistic change characteristics. Specifically, a similarity threshold based on historical statistical data or business needs is set to distinguish between accidental synchronous fluctuations and statistically significant synergistic evolution. For example, by conducting statistical tests on a large number of known independent and synergistic dimension pairs, it is determined that when the trend similarity reaches 0.8 or higher, there is a strong synergistic correlation between dimensions. The calculated trend similarity is compared with the preset similarity threshold. If the trend similarity of a dimension pair is greater than or equal to the threshold, the pair of dimensions is determined to have synergistic change characteristics, meaning that they have a high degree of dependence or linkage in the process of regulatory evolution, and are suitable for merging. Conversely, if the trend similarity is lower than the threshold, the two are considered to evolve relatively independently and should be reviewed separately.
[0046] As described in step S404 above, dimensions exhibiting synergistic change characteristics are aggregated to obtain corresponding synergistic dimension sets. The aggregation operation is performed based on the aforementioned synergy determination results. All dimensions marked as having synergistic change characteristics are grouped to form several synergistic dimension sets. This process can be implemented using clustering algorithms (such as hierarchical clustering or connected component search), that is, in the graph structure formed by dimensions, nodes connected by edges satisfying synergistic relationships are grouped into the same cluster. Within each synergistic dimension set, the historical change trends of the dimensions are highly similar, indicating an inherent coupling in legal logic or regulatory requirements. These synergistic dimension sets form the basis for subsequent dimension reduction and representative item selection. By treating strongly correlated dimensions as a whole, redundant information can be effectively eliminated.
[0047] By employing the above steps and utilizing the dynamic time warping algorithm to deeply mine the time-series characteristics of regulatory changes, we can more accurately identify collaborative dimensions with flexible correspondences on the time axis, thereby overcoming the limitations of traditional linear correlation analysis in handling asynchronous changes. This sequence-based aggregation mechanism provides reliable data support for subsequent precise dimensional pruning and reducing the inference load of large language models.
[0048] In one embodiment, after step S4, which aggregates dimensions with collaborative change characteristics based on the trend similarity to obtain a corresponding set of collaborative dimensions, the method further includes: S501: Construct a Bayesian network structure for each dimension within the set of collaborative dimensions to learn the causal dependencies between dimensions; S502: Based on the causal dependency relationship, distinguish between synchronous change relationship and master-slave driven relationship, and remove the subordinate dimension identified in the master-slave driven relationship from the collaborative dimension set.
[0049] As described in step S501 above, a Bayesian network structure is constructed for each dimension within the co-occurrence dimension set to learn the causal dependencies between dimensions. Specifically, after aggregating dimensions with co-occurrence characteristics using trend similarity to obtain a co-occurrence dimension set, a deeper causal inference analysis is performed on these initially aggregated dimension sets. This process aims to address the pseudo-co-occurrence problem that may be introduced by aggregation based solely on statistical correlation; that is, although some dimensions may historically show a synchronous trend of change, there is no logical causal relationship between them, and they are merely accidental statistical co-occurrences.
[0050] A Bayesian network, a graphical model based on probabilistic reasoning, is used to model the dependencies between the aforementioned dimensions. In this model, nodes of a directed acyclic graph represent random variables, i.e., the various compliance semantic dimensions in this embodiment; directed edges between nodes represent causal dependencies between variables. When constructing this network structure, all semantic dimensions within the collaborative dimension set are used as network nodes. Based on the time-series data of state changes in each dimension in historical regulatory change records, structural learning algorithms (such as score-based search algorithms or constraint-based PC algorithms) are applied to determine the connection directions and conditional probability distributions between nodes. For example, when analyzing the two dimensions of updates to the EU RoHS (Restriction of Hazardous Substances) directive and changes to UKCA (UK Conformity Assessed) environmental clauses, the conditional probability of the latter changing given that the former has changed, and vice versa, is calculated to determine whether there is a clear causal relationship between the two.
[0051] By constructing a Bayesian network structure, causal dependencies between dimensions can be automatically extracted from data. These dependencies reveal the intrinsic driving forces behind regulatory evolution, clarifying which dimensions are the root causes of change and which are the result of passive adjustments. This process not only identifies the relationships between dimensions but also clarifies the directionality and logical hierarchy of these relationships, providing a structured knowledge base for subsequent precise selection.
[0052] As described in step S502 above, synchronous change relationships and master-slave driving relationships are distinguished based on causal dependencies, and subordinate dimensions identified as master-slave driving relationships are removed from the collaborative dimension set. Specifically, based on the obtained causal dependencies between dimensions, the dimensions within the collaborative dimension set are classified into synchronous change relationships and master-slave driving relationships. A synchronous change relationship can refer to two or more dimensions being mutually causal or driven by the same external latent variable, exhibiting equal logical status. A master-slave driving relationship can refer to a change in one dimension directly causing a change in one or more other dimensions; the former is defined as the controlling dimension, and the latter as the subordinate dimension.
[0053] For dimension groups identified as having a master-slave driving relationship, a subordinate dimension removal operation is performed, which involves removing subordinate dimensions identified as having a master-slave driving relationship from the set of collaborative dimensions. The core logic of this operation is to retain the master dimension, which has legal interpretability and source significance, while removing subordinate dimensions that only show consistency in results. For example, if the Bayesian network structure indicates that changes to the EU CE (Conformité Européenne) mark specification are the causal variable for adjustments to certification standards in some Eastern European markets, then the former is retained as a representative item in the second set of dimensions to be audited, while the latter is masked as a subordinate dimension.
[0054] By precisely filtering and removing dimensions based on causal dependencies, the erroneous merging of dimensions that co-occur occasionally but lack strong logical connections can be effectively avoided, thus significantly improving the rationality and interpretability of dimension reduction. This mechanism ensures that the final set of review dimensions covers key compliance risks while eliminating redundant information to the greatest extent possible. This not only optimizes the computational resource consumption of subsequent large language models but also reduces the risk of compliance omissions due to erroneous merging from the source, guaranteeing the accuracy and authority of cross-border compliance review results.
[0055] In one embodiment, before step S5, which selects the dimension with the highest weight as the representative item to be retained in each collaborative dimension set according to the preset weights of each dimension, the method further includes: S411: Determine the preset weights based on the risk levels of the geographical regions corresponding to each dimension, wherein a first weight value is configured for dimensions corresponding to high-risk market regulatory requirements, a second weight value is configured for dimensions corresponding to medium-risk market regulatory requirements, and a third weight value is configured for dimensions corresponding to low-risk market regulatory requirements, wherein the first weight value is greater than the second weight value, and the second weight value is greater than the third weight value.
[0056] As described in step S411 above, the preset weights serve as a quantitative scoring standard for selecting representative items from the collaborative dimension set, and their specific values are directly determined by the aforementioned geographical region risk levels. When constructing the preset weights, a risk grading mapping logic can be used to establish a correspondence between the geographical region risk levels and specific weight values. Specifically, for dimensions corresponding to high-risk market regulatory requirements, a first weight value is configured, which is set relatively high to reflect its regulatory priority; for dimensions corresponding to medium-risk market regulatory requirements, a second weight value is configured, which is set at a medium level; and for dimensions corresponding to low-risk market regulatory requirements, a third weight value is configured, which is set relatively low.
[0057] To ensure the rigor of the screening logic, the weight values are clearly defined in terms of magnitude: the first weight value is greater than the second weight value, and the second weight value is greater than the third weight value. This magnitude ensures that when selecting representative items, the system tends to prioritize dimensions corresponding to high-risk markets. For example, in engineering practice, the first weight value can be set to 1.2, the second weight value to 1.0, and the third weight value to 0.8. Through this weight configuration mechanism based on geographical risk levels, the preset weights can accurately reflect the strategic importance of different dimensions in cross-border compliance reviews, providing a reliable basis for decision-making in subsequent dimension reduction steps. This improves review efficiency while minimizing the probability of missing significant compliance risks due to dimension masking.
[0058] In one embodiment, after step S6, which involves inputting the business dataset and the target regulatory text into a preset large language model to obtain the compliance review result, the method further includes: S701: Calculate the gradient sensitivity of each input dimension to the model output from the output of the large language model; S702: Generate violation impact scores for each dimension based on the gradient sensitivity; S703: Remove dimensions whose scores are lower than the preset score threshold from the second set of dimensions to be reviewed.
[0059] As described in step S701 above, the gradient sensitivity of each input dimension to the model output is calculated backwards from the output of the large language model. This process aims to quantify and evaluate the actual contribution of each semantic dimension input to the large language model in the preceding steps to the final compliance review conclusion. Gradient sensitivity is not a simple statistical correlation indicator, but rather a differential mapping relationship between the activation state of neurons within the large language model and the final output result, reflecting the drastic response of the model output to changes in a specific input dimension. In the actual calculation process, using automatic differentiation technology, after the model inference is completed, the predicted probability or log-likelihood value of the compliance review result is used as the scalar objective function, propagating backwards along the model's computational graph to the input layer to calculate the partial derivatives of the objective function with respect to the elements of each input dimension vector. The absolute value or magnitude of these partial derivatives constitutes the corresponding gradient sensitivity, which physically represents the probability that the model output will fluctuate drastically when the input data of a certain dimension undergoes a small perturbation. A higher value indicates that this dimension plays a crucial role in the model's decision-making path.
[0060] When the current review samples are not manually labeled, the original logits output by the model (i.e., the output of the last linear layer before softmax) are used as the objective function. Specifically, the large language model outputs logits values for two categories in the compliance binary classification task, namely the logit value \(z_{violation}\) corresponding to the "violation" category and the logit value \(z_{compliant}\) corresponding to the "compliance" category. When the review samples contain real labels confirmed by manual review, the cross-entropy loss \(\mathcal{L}_{CE}\) is used as the objective function. Let the predicted probability distribution of the model output category be \(p\) and the one-hot distribution of the real label be \(y\). When calculating the gradient of the objective function with respect to the input, there are multiple optional gradient calculation layers. This invention supports the following three layers of gradient calculation according to different analysis granularity and computational cost requirements: Layer 1: Input Embedding Layer Gradient: The objective function is used to calculate the partial derivative with respect to each token embedding vector of the model input embedding layer to obtain the gradient vector at the corresponding position of each token. This layer is the entry point for all semantic information into the model. Calculating gradients at this layer most directly reflects the contribution of each token in the original input text to the model's output. The gradient dimension of this layer is related to the length of the input token sequence and the embedding dimension (e.g., sequence length × 768 dimensions), providing the finest information granularity. Layer 2: Last Hidden State Gradient: The objective function is used to calculate the partial derivative of the objective function with respect to the hidden vector of each token output by the last Transformer layer. This layer's gradient reflects the semantic importance of each token position after complete encoding. Compared to the input embedding layer gradient, this layer's gradient encodes contextual interaction information, more accurately reflecting the actual impact of the token in the entire sentence context. Layer 3: One-Hot Representation Gradient of the Input Text: The objective function is used to calculate the derivative of the one-hot vector of the input tokens, directly assigning a scalar importance score to each input token position. This method is the simplest and natively outputs a token-level importance scalar, but gradient vanishing may occur during the transmission of gradient information due to multiple chained derivatives. This application preferably adopts layer 1 (input embedding layer gradient) as the default scheme because: (1) the gradient of this layer is furthest from the objective function on the back propagation path, and needs to be passed back through all Transformer layers. The information is complete and has not been excessively distorted by the nonlinear transformation of the activation function of the intermediate layer; (2) the L2 norm of the gradient vector of this layer can be used as a direct measure of the importance of the token; (3) it is convenient to aggregate into dimension-level sensitivity through pooling operations in the future.Large language models take token sequences as input, while the semantic dimension of compliance review in this invention is an item-level structural unit (such as "certification requirements," "identification specifications," etc.), with each dimension corresponding to a set of tokens in the input. Therefore, it is necessary to aggregate the gradient vectors at the token level into gradient sensitivity scalars of the same semantic dimension. This invention provides the following three aggregation methods: 1. Intra-dimensional mean aggregation of the L2 norm of the token gradient; 2. Aggregation of the inner product of the token gradient and the embedding vector direction; 3. Intra-dimensional maximum aggregation of the L1 norm of the token gradient.
[0061] In a preferred implementation, after the large language model completes a single compliance review inference, the system records the original logit value \(z_{violation}\) corresponding to the "violation" category in the model output layer as the target scalar. Subsequently, the automatic differentiation engine is invoked to perform a backpropagation, calculating the partial derivative of \(z_{violation}\) with respect to the embedding vectors of each token in the model input embedding layer, obtaining the gradient vector at each token position. For the \(i\)-th token, the L2 norm \(g_i = \|\nabla_{embed(t_i)} z_{violation}\|_2\) of its gradient vector is used as a measure of the token's influence on the violation determination result.
[0062] Since the input prompts are composed of legal clauses and business data from multiple semantic dimensions, the system maintains a "Token-Dimension Attribution Map" while constructing the input sequence, recording the semantic dimension number to which each token belongs. After backpropagation, the system groups the sensitivity scores of all tokens according to their assigned dimension based on this mapping table, and takes the arithmetic mean of \(g_i\) of all tokens within the same dimension to obtain the violation impact score \(\text{Sens}(d)\) for that dimension.
[0063] If the sensitivity score of a certain dimension is lower than a preset sensitivity threshold, that dimension is determined to be a low-impact dimension in the current review task. The system will assign a lower retention priority to this dimension during the collaborative clustering process in subsequent step S4, and may even proactively downgrade or remove it in extreme cases. Conversely, if the sensitivity score is higher than the threshold, it is determined to be a high-impact dimension and will be retained preferentially during dimension merging. This mechanism forms a closed-loop feedback importance control system, ensuring that dimension reduction always focuses on the core elements that truly affect compliance conclusions.
[0064] During the retraining phase, which includes manually reviewed labels, the system can switch the objective function to cross-entropy loss (\mathcal{L}_{CE}\) to provide more accurate gradient supervision signals using real labels. Experimental results show that this mechanism reduces the false retention rate of low-impact dimensions by approximately 34%, further improving the effectiveness of dimensionality reduction and the interpretability of review conclusions.
[0065] As described in step S702 above, violation impact scores for each dimension are generated based on gradient sensitivity. Specifically, based on the calculated gradient sensitivity, violation impact scores are further aggregated to uniformly measure the weight of different dimensions in determining violations. The violation impact score is a scalar indicator of gradient sensitivity after normalization or weighting. Its internal structure includes comprehensive information such as the average gradient magnitude, maximum gradient peak, and weight coefficients assigned in the model's multi-head attention mechanism for a single dimension. The generation process of this indicator can be, for example: first, L2 norm aggregation is performed on the gradient values corresponding to all tokens within each dimension to obtain the original sensitivity value for that dimension; then, to eliminate bias caused by different input lengths, the original value is divided by the number of elements contained in that dimension; finally, to facilitate cross-dimensional comparison, the calculation results are processed by Min-Max normalization or Z-score standardization, mapping them to a unified numerical range. Through this calculation method, the violation impact score can accurately reveal the actual influence of each dimension in the model's compliance determination, distinguishing which dimensions are key factors in determining violations and which dimensions only exist as background information.
[0066] As described in step S703 above, dimensions with violation impact scores below a preset score threshold are removed from the second set of dimensions to be reviewed. The preset score threshold serves as the dividing line between valid review dimensions and redundant interference dimensions. Its setting is primarily based on the distribution statistics of historical review data and the business's tolerance for underreporting risks. The threshold is determined by: collecting the violation impact score distribution of each dimension in historical review tasks, plotting its probability density curve, and combining it with manually verified samples of unnecessary dimensions to select a quantile value (e.g., the 10th percentile) that can cover a high proportion of redundant dimensions as a benchmark; simultaneously, it is dynamically adjusted according to the business scenario's requirements for review rigor. In high-risk regulatory scenarios, the threshold is appropriately lowered to retain more dimensions, while in regular scenarios, the threshold is raised to achieve greater screening. For example, for general consumer product reviews, the preset score threshold can be set to 0.15 or 0.2. During screening, the violation impact scores of each dimension in the current second set of dimensions to be reviewed are compared sequentially with this threshold. Dimensions with scores below this threshold are considered to have no substantial impact on the generation of the current compliance conclusion and are thus removed from the set. This process shifts from rule-based static screening to model-feedback-based dynamic refinement. By eliminating low-impact dimensions, it not only further reduces the resource overhead of subsequent storage and computation but also reduces the interference of noisy data on model interpretability, ensuring that the system can continuously focus on the core elements that truly affect compliance judgments.
[0067] Reference Figure 3 The present invention also provides a cross-border compliance review device for large language models based on collaborative dimension reduction, the device comprising: The mapping module 902 is used to map the target regulatory text and the currently used original regulatory text into a preset semantic space when a new target regulatory text is received, so as to obtain a first semantic vector and a second semantic vector respectively. The comparison module 904 is used to compare the first semantic vector and the second semantic vector to obtain multiple change semantic dimensions, which constitute the first set of dimensions to be reviewed; The sampling module 906 is used to sample regulatory change records within a preset time period from the historical database based on a sliding time window, and construct a historical change sequence matrix for each semantic dimension. The calculation module 908 is used to calculate the trend similarity between dimensions in the historical change sequence matrix, and to aggregate the dimensions with synergistic change characteristics according to the trend similarity to obtain the corresponding synergistic dimension set. The selection module 910 is used to select the dimension with the highest weight in each collaborative dimension set as the representative item based on the preset weight of each dimension, and to hide the remaining subordinate dimensions to obtain the second set of dimensions to be reviewed. Input module 912 is used to obtain business datasets of each cross-border business based on the second set of dimensions to be audited, and input the business datasets and the target regulatory text into a preset large language model to obtain compliance review results.
[0068] In one embodiment, the comparison module 904 includes: The comparison submodule is used to perform fine-grained field-level comparisons on the first semantic vector and the second semantic vector, and calculate the cosine similarity between the embedding vectors of each corresponding entry item by item. The judgment submodule is used to determine whether each cosine similarity is less than the preset similarity. The determination submodule is used to determine entries with a cosine similarity less than a preset similarity as substantial change entries, and to extract the semantic dimension to which the substantial change entries belong as the change semantic dimension.
[0069] In one embodiment, the cross-border compliance review device based on a large language model with reduced collaborative dimensions further includes: The product category information acquisition module is used to obtain the product category information of the product currently under review and to construct a product-dimension relationship graph; The change judgment module is used to determine whether changes to each semantic dimension are applicable to the product category based on the product-dimension association graph. The removal module is used to remove semantic dimensions of changes that are not applicable to the product category from the first set of dimensions to be reviewed.
[0070] In one embodiment, the computing module 908 includes: The sequence distance calculation submodule is used to calculate the pairwise sequence distances between each dimension in the historical change sequence matrix using a dynamic time warping algorithm. A trend similarity calculation submodule is used to determine the trend similarity between dimensions based on the sequence distance; The trend similarity judgment submodule is used to determine whether the trend similarity is greater than or equal to a similarity threshold. The collaborative change feature determination submodule is used to determine dimensions with trend similarity greater than or equal to the similarity threshold as having collaborative change features; The aggregation submodule is used to aggregate dimensions with synergistic change characteristics to obtain the corresponding set of synergistic dimensions.
[0071] In one embodiment, the cross-border compliance review device based on the large language model of collaborative dimension reduction further includes: The network construction module is used to build Bayesian network structures for dimensions within each collaborative dimension set and to learn the causal dependencies between dimensions. The removal module is used to distinguish between synchronous change relationships and master-slave driven relationships based on the causal dependency relationship, and to remove the subordinate dimensions identified in the master-slave driven relationship from the collaborative dimension set.
[0072] In one embodiment, the cross-border compliance review device based on the large language model of collaborative dimension reduction further includes: The preset weight determination module is used to determine the preset weights based on the risk levels of the geographical areas corresponding to each dimension. Specifically, a first weight value is configured for dimensions corresponding to high-risk market regulatory requirements, a second weight value is configured for dimensions corresponding to medium-risk market regulatory requirements, and a third weight value is configured for dimensions corresponding to low-risk market regulatory requirements. The first weight value is greater than the second weight value, and the second weight value is greater than the third weight value.
[0073] In one embodiment, the cross-border compliance review device based on the large language model of collaborative dimension reduction further includes: The gradient sensitivity calculation module is used to calculate the gradient sensitivity of each input dimension to the model output from the output of the large language model. The violation impact score calculation module is used to generate violation impact scores for each dimension based on the gradient sensitivity. The dimension removal module is used to remove dimensions whose violation impact score is lower than a preset score threshold from the second set of dimensions to be reviewed.
[0074] Figure 4 An internal structural diagram of an electronic device in one embodiment is shown. This electronic device can specifically be a terminal or a server, and more specifically, a computer device. Figure 4 As shown, the electronic device includes a processor, a memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program. When executed by the processor, this computer program enables the processor to implement a cross-border compliance review method based on a large language model with collaborative dimension reduction. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to implement a cross-border compliance review method based on a large language model with collaborative dimension reduction. Those skilled in the art will understand that… Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0075] In one embodiment, an electronic device is provided, including a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the following steps: When a new target regulatory text is received, the target regulatory text and the currently used original regulatory text are mapped to a preset semantic space to obtain a first semantic vector and a second semantic vector, respectively. The first semantic vector and the second semantic vector are compared to obtain multiple semantic change dimensions, which constitute the first set of dimensions to be reviewed; Based on a sliding time window, regulatory change records within a preset time period in the past are sampled from the historical database to construct a historical change sequence matrix for each semantic dimension. Calculate the trend similarity between dimensions in the historical change sequence matrix, and aggregate the dimensions with synergistic change characteristics based on the trend similarity to obtain the corresponding synergistic dimension set; Based on the preset weights of each dimension, the dimension with the highest weight in each collaborative dimension set is selected as the representative item and retained, while the remaining subordinate dimensions are masked, thus obtaining the second set of dimensions to be reviewed. The business datasets for each cross-border business are obtained based on the second set of dimensions to be reviewed, and the business datasets and the target regulatory text are input into a preset large language model to obtain the compliance review results.
[0076] By mapping the old and new regulatory texts to a unified semantic space and comparing them to extract the semantic dimensions of changes, a historical change sequence matrix is constructed based on a sliding time window to calculate the trend similarity between dimensions. Semantic space mapping and fine-grained comparison are used to calculate trend similarity based on historical evolution patterns and aggregate collaborative dimensions, thereby identifying dimension groups that show strong consistency over a long period of time. This reduces the number of independent review items. Then, by using a geographic region priority weighting mechanism to select representative items and mask subordinate dimensions, multilingual semantic mapping and violation identification are performed on key dimensions. This avoids wasting computing resources and response delays, and improves the system's response speed and processing efficiency under real-time compliance update requirements.
[0077] In one embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, causes the processor to perform the following steps: When a new target regulatory text is received, the target regulatory text and the currently used original regulatory text are mapped to a preset semantic space to obtain a first semantic vector and a second semantic vector, respectively. The first semantic vector and the second semantic vector are compared to obtain multiple semantic change dimensions, which constitute the first set of dimensions to be reviewed; Based on a sliding time window, regulatory change records within a preset time period in the past are sampled from the historical database to construct a historical change sequence matrix for each semantic dimension. Calculate the trend similarity between dimensions in the historical change sequence matrix, and aggregate the dimensions with synergistic change characteristics based on the trend similarity to obtain the corresponding synergistic dimension set; Based on the preset weights of each dimension, the dimension with the highest weight in each collaborative dimension set is selected as the representative item and retained, while the remaining subordinate dimensions are masked, thus obtaining the second set of dimensions to be reviewed. The business datasets for each cross-border business are obtained based on the second set of dimensions to be reviewed, and the business datasets and the target regulatory text are input into a preset large language model to obtain the compliance review results.
[0078] By mapping the old and new regulatory texts to a unified semantic space and comparing them to extract the semantic dimensions of changes, a historical change sequence matrix is constructed based on a sliding time window to calculate the trend similarity between dimensions. Semantic space mapping and fine-grained comparison are used to calculate trend similarity based on historical evolution patterns and aggregate collaborative dimensions, thereby identifying dimension groups that show strong consistency over a long period of time. This reduces the number of independent review items. Then, by using a geographic region priority weighting mechanism to select representative items and mask subordinate dimensions, multilingual semantic mapping and violation identification are performed on key dimensions. This avoids wasting computing resources and response delays, and improves the system's response speed and processing efficiency under real-time compliance update requirements.
[0079] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0080] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0081] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A cross-border compliance review method based on a large language model with reduced collaborative dimensions, characterized in that, The method includes: When a new target regulatory text is received, the target regulatory text and the currently used original regulatory text are mapped to a preset semantic space to obtain a first semantic vector and a second semantic vector, respectively. The first semantic vector and the second semantic vector are compared to obtain multiple semantic change dimensions, which constitute the first set of dimensions to be reviewed; Based on a sliding time window, regulatory change records within a preset time period in the past are sampled from the historical database to construct a historical change sequence matrix for each semantic dimension. Calculate the trend similarity between dimensions in the historical change sequence matrix, and aggregate the dimensions with synergistic change characteristics based on the trend similarity to obtain the corresponding synergistic dimension set; Construct a Bayesian network structure for each dimension within the set of collaborative dimensions to learn the causal dependencies between dimensions; Based on the causal dependency relationship, synchronous change relationship and master-slave driven relationship are distinguished, and the subordinate dimension identified in the master-slave driven relationship is removed from the collaborative dimension set; Based on the preset weights of each dimension, the dimension with the highest weight in each collaborative dimension set is selected as the representative item and retained, while the remaining subordinate dimensions are masked, thus obtaining the second set of dimensions to be reviewed. The business datasets for each cross-border business are obtained based on the second set of dimensions to be reviewed, and the business datasets and the target regulatory text are input into a preset large language model to obtain the compliance review results.
2. The cross-border compliance review method for large language models based on collaborative dimension reduction according to claim 1, characterized in that, The step of comparing the first semantic vector and the second semantic vector to obtain multiple modified semantic dimensions includes: Fine-grained field-level comparison is performed on the first semantic vector and the second semantic vector, and the cosine similarity between the embedding vectors of each corresponding entry is calculated item by item; Determine whether each cosine similarity is less than a preset similarity. Entries with a cosine similarity less than a preset similarity are identified as substantially changed entries, and the semantic dimension to which the substantially changed entries belong is extracted as the changed semantic dimension.
3. The cross-border compliance review method for large language models based on collaborative dimension reduction according to claim 1, characterized in that, After comparing the first semantic vector and the second semantic vector to obtain multiple changed semantic dimensions, the method further includes: Obtain the product category information of the product currently awaiting review, and construct a product-dimension relationship graph; Based on the product-dimension association graph, determine whether the changes to each semantic dimension apply to the product category; Change semantic dimensions that are not applicable to the product category will be removed from the first set of dimensions to be reviewed.
4. The cross-border compliance review method for large language models based on collaborative dimension reduction according to claim 1, characterized in that, The step of calculating the trend similarity between dimensions in the historical change sequence matrix and aggregating dimensions with co-changing characteristics based on the trend similarity to obtain a corresponding set of co-changing dimensions includes: The dynamic time warping algorithm is used to calculate the pairwise sequence distances between each dimension in the historical change sequence matrix. The trend similarity between dimensions is determined based on the sequence distance; Determine whether the trend similarity is greater than or equal to the similarity threshold. Dimensions with trend similarity greater than or equal to the similarity threshold are identified as having co-change characteristics; By aggregating dimensions that exhibit synergistic change characteristics, we obtain the corresponding set of synergistic dimensions.
5. The cross-border compliance review method for large language models based on collaborative dimension reduction according to claim 1, characterized in that, Before the step of selecting the dimension with the highest weight as the representative item to be retained in each collaborative dimension set according to the preset weights of each dimension, the method further includes: The preset weights are determined based on the risk levels of the geographical regions corresponding to each dimension. Specifically, a first weight value is configured for dimensions corresponding to high-risk market regulatory requirements, a second weight value is configured for dimensions corresponding to medium-risk market regulatory requirements, and a third weight value is configured for dimensions corresponding to low-risk market regulatory requirements. The first weight value is greater than the second weight value, and the second weight value is greater than the third weight value.
6. The cross-border compliance review method for large language models based on collaborative dimension reduction according to claim 1, characterized in that, After the step of inputting the business dataset and the target regulatory text into a preset large language model to obtain the compliance review results, the method further includes: The gradient sensitivity of each input dimension to the model output is calculated in reverse from the output of the large language model. Based on the gradient sensitivity, generate violation impact scores for each dimension; Dimensions whose scores are lower than the preset score threshold due to violations will be removed from the second set of dimensions to be reviewed.
7. A cross-border compliance review device for a large language model based on collaborative dimension reduction, characterized in that, The device includes: The mapping module is used to map the target regulatory text and the currently used original regulatory text into a preset semantic space when a new target regulatory text is received, so as to obtain a first semantic vector and a second semantic vector respectively. The comparison module is used to compare the first semantic vector and the second semantic vector to obtain multiple change semantic dimensions, which constitute the first set of dimensions to be reviewed; The sampling module is used to sample regulatory change records within a preset time period from the historical database based on a sliding time window, and construct a historical change sequence matrix for each semantic dimension; The calculation module is used to calculate the trend similarity between dimensions in the historical change sequence matrix, and to aggregate the dimensions with synergistic change characteristics according to the trend similarity to obtain the corresponding synergistic dimension set. The network construction module is used to build Bayesian network structures for dimensions within each collaborative dimension set and to learn the causal dependencies between dimensions. The removal module is used to distinguish between synchronous change relationships and master-slave driven relationships based on the causal dependency relationship, and to remove the subordinate dimensions identified in the master-slave driven relationship from the collaborative dimension set; The selection module is used to select the dimension with the highest weight in each collaborative dimension set as the representative item based on the preset weights of each dimension, and to hide the remaining subordinate dimensions to obtain the second set of dimensions to be reviewed. The input module is used to obtain the business datasets of each cross-border business based on the second set of dimensions to be reviewed, and input the business datasets and the target regulatory text into a preset large language model to obtain the compliance review results.
8. A computer-readable storage medium, characterized in that, The system stores a computer program that, when executed by a processor, causes the processor to perform the steps of the cross-border compliance review method for large language models based on collaborative dimension reduction as described in any one of claims 1 to 6.
9. An electronic device, characterized in that, The device includes a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the cross-border compliance review method for large language models based on collaborative dimension reduction as described in any one of claims 1 to 6.
