Financial fraud detection method based on large language model

By combining a large language model with sensitive word weight feature vectors and word embedding technology, the shortcomings of traditional financial fraud detection methods in understanding the deep associations of unstructured texts are solved, efficient identification of financial fraud is achieved, and the missed detection rate is reduced.

CN120598644APending Publication Date: 2025-09-05CHONGQING UNIV OF TECH
View PDF 0 Cites 8 Cited by

Patent Information

Application Number
CN202510756783.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

Traditional financial fraud detection methods are unable to effectively understand the deep connections in unstructured text, resulting in a high missed detection rate and difficulty in identifying complex financial fraud methods.

Method used

A large language model is used in combination with sensitive word weight feature vectors and word embedding technology. The pre-trained model captures the deep semantics of the text and combines the experience of experts in the financial field to identify high-risk words and determine the type of fraud.

Benefits of technology

It improves the recognition rate of financial fraud, reduces the missed detection rate, and improves the accuracy of identifying financial fraud.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120598644A_ABST
    Figure CN120598644A_ABST
Patent Text Reader

Abstract

The invention provides a financial fraud detection method based on a large language model. The method comprises the steps of obtaining a to-be-recognized text; performing word segmentation on the to-be-recognized text through the target word segmentation tool and the financial fraud dictionary, and determining a fraud sensitive word list; calculating the weight of each sensitive word in the sensitive word list according to a target algorithm to obtain a sensitive word weight feature vector; inputting the sensitive word weight feature vector and a to-be-recognized text into a large language model, and determining a context semantic vector of the sensitive word in combination with a word embedding technology; determining the similarity between the context semantic vector of the sensitive word and a preset financial fraud type semantic vector; and determining a financial fraud type according to the similarity. Through the implementation of the method, the generalization ability of the pre-training model is utilized to capture text deep semantics, priori knowledge is injected in combination with a sensitive word weight mechanism, the model is guided to focus high-risk vocabularies, the defect of a traditional method in semantic comprehension is overcome, the financial fraud recognition rate is increased, and the omission ratio is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent anti-fraud technology, and specifically relates to a financial fraud detection method based on a large language model. Background Art

[0002] With the rapid development of financial technology, financial fraud incidents occur frequently, especially among young people who are inexperienced in the world and the elderly who are less able to make judgments due to lack of information. They are more vulnerable to being deceived, and their wealth security is seriously threatened. At the same time, financial fraud is increasingly characterized by diversified means and covert rhetoric. Traditional detection methods face significant challenges when processing unstructured text data.

[0003] First, clues to financial fraud are often hidden in unstructured data such as text messages and customer communication texts, such as the natural language inducement in fraudulent text messages. Traditional methods for identifying this type of text fraud rely on keyword matching and rule engines, which can only capture surface features and cannot understand the deep connections of the text, resulting in a high rate of missed detection of financial fraud. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a financial fraud detection method based on a large language model to meet the requirements of protecting the privacy and security of each intelligent agent.

[0005] In order to achieve the above object, the present invention provides the following technical solutions: According to a first aspect, the present invention provides a financial fraud detection method based on a large language model, including: obtaining a text to be identified; segmenting the text to be identified using a target word segmentation tool and a financial fraud dictionary to determine a list of fraud-sensitive words; calculating the weights of each sensitive word in the sensitive word list according to a target algorithm to obtain a sensitive word weight feature vector; inputting the sensitive word weight feature vector and the text to be identified into a large language model, and combining word embedding technology to determine the contextual semantic vector of the sensitive word; determining the similarity between the contextual semantic vector of the sensitive word and a preset financial fraud type semantic vector; and determining the type of financial fraud based on the similarity.

[0006] According to the second aspect, an embodiment of the present invention provides a financial fraud detection device based on a large language model, including: a text recognition module for obtaining a text to be recognized; a sensitive word determination module for segmenting the text to be recognized through a target word segmentation tool and a financial fraud dictionary, and determining a list of fraud sensitive words; a sensitive word weight feature vector determination module for calculating the weight of each sensitive word in the sensitive word list according to the TF-IDF algorithm to obtain a sensitive word weight feature vector; a context semantic vector determination module for inputting the sensitive word weight feature vector and the text to be recognized into the large language model, and combining word embedding technology to determine the context semantic vector of the sensitive word; a similarity determination module for determining the similarity between the context semantic vector of the sensitive word and a preset financial fraud type semantic vector; a fraud determination module for determining whether it is a financial fraud based on the similarity.

[0007] According to the third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the financial fraud detection method based on a large language model as described in the first aspect or any embodiment of the first aspect.

[0008] This embodiment provides a financial fraud detection method based on a large language model. It captures the deep semantics of the text through the generalization ability of the pre-trained model, and injects the experience of experts in the financial field by combining the sensitive word weight mechanism to guide the model to focus on high-risk words. This solves the shortcomings of traditional methods in semantic understanding, improves the recognition rate of financial fraud, and reduces the missed detection rate.

[0009] Other advantages, objectives and features of the present invention will be described in the following description and will be apparent to those skilled in the art to some extent, or those skilled in the art can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to make the purpose, technical solutions and beneficial effects of the present invention more clear, the present invention provides the following drawings for illustration: Figure 1 This is a specific example flow chart of a financial fraud detection method based on a large language model in the present invention; Figure 2 This is a specific example flow chart of the process of inputting the sensitive word weight feature vector and the text to be recognized into the large language model, combining the word embedding technology, and determining the context semantic vector of the sensitive word in the present invention; Figure 3 This is a principle block diagram of a specific example of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION

[0011] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the embodiments described are only some embodiments of the present invention, not all embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.

[0012] In the description of the present invention, it should be noted that, unless otherwise expressly specified or limited, the terms "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; mechanical connections or electrical connections; direct connections or indirect connections through an intermediate medium; internal connections between two components; wireless connections or wired connections. Those skilled in the art will understand the specific meanings of the above terms in the present invention based on specific circumstances.

[0013] In addition, the technical features involved in the different embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0014] This embodiment provides a financial fraud detection method based on a large language model. Figure 1 Shown, including: S101, obtaining the text to be recognized; S102, segmenting the text to be identified using a target word segmentation tool and a financial fraud dictionary to determine a list of fraud-sensitive words; S103, calculating the weight of each sensitive word in the sensitive word list according to the target algorithm to obtain a sensitive word weight feature vector; S104: Input the sensitive word weight feature vector and the text to be recognized into the large language model, and combine it with word embedding technology to determine the contextual semantic vector of the sensitive word; S105, determining the similarity between the context semantic vector of the sensitive word and the preset financial fraud type semantic vector; S106, determining the type of financial fraud based on the similarity.

[0015] Exemplarily, this embodiment can be enabled in the form of a mini-program, and the user can input the text to be recognized into the text input prompt box of the mini-program. The text to be recognized can be SMS text, chat record text, or article text. This embodiment does not limit the type of text to be recognized, and technical personnel in this field can input it as needed.

[0016] The target word segmentation tool can be the Jieba word segmentation component or a word segmentation tool optimized through training with financial data, such as a deep learning-based LTP word segmenter. Furthermore, a financial fraud dictionary can be jointly maintained by a team of risk control experts and data analysts, regularly updated with new fraud-related terms. By combining word segmentation tools with dictionaries, the text can be broken down and sensitive terms can be screened out to form a list of fraud-sensitive terms. Then, a pre-set target algorithm is used to calculate the weight of each sensitive word. Specifically, the target algorithm can use the TF-IDF (Term Frequency - Inverse Document Frequency) algorithm. The TF-IDF algorithm calculates the frequency of sensitive words in the current text and the inverse document frequency of sensitive words in the entire financial text corpus to measure their prevalence and importance.

[0017] Subsequently, the sensitive word weight feature vector and the entire text to be recognized are input into a large language model. The large language model can be a GPT series large language model fine-tuned in the financial field. Specifically, the large language model can be a Transformer-based decoder architecture with a multi-layer stacked self-attention mechanism. The process of determining the contextual semantic vector of the sensitive word is as follows: First, the text to be recognized passes through the input layer of the large language model. Using word embedding technology, such as Word2Vec or BERT, each word in the text is converted into a multidimensional vector. These vectors initially contain the semantic information of the word and its position in the text. Simultaneously, the weighted feature vectors of sensitive words are fed into the large language model as a guiding signal. During the calculation of the model's self-attention mechanism, these weighted vectors are converted into attention biases and added to the score matrix of the self-attention calculation. This allows the model to pay more attention to sensitive words with higher weights when calculating attention weights between words, highlighting the importance of sensitive words in contextual semantic understanding. In other words, this solution provides the large language model with prior domain knowledge through weighted vectors, using sensitive words as anchor points for semantic analysis and reducing the analysis of meaningless words. This allows the large language model to focus on fraud detection, addressing the problem in financial text where critical risk information can be diluted by the vast amount of normal content.

[0018] Next, the model's multi-layer Transformer architecture begins processing the input vectors. At each layer, word vectors continuously interact with other word vectors through a self-attention mechanism and a feedforward neural network, gradually integrating contextual information. In this process, sensitive words, given the model's increased attention, more fully absorb the semantic information of surrounding words. As the model processes the text layer by layer, the word vectors are continuously updated, ultimately resulting in a vector representation rich in contextual semantic information at the output layer. The vectors corresponding to sensitive words are now their contextual semantic vectors. These vectors not only capture the semantic meaning of the sensitive words themselves, but also fully incorporate their meaning and relationships within the context of the text being recognized.

[0019] The algorithm then compares each type of vector with a pre-built library of semantic vectors for financial fraud, such as "illegal fundraising," "Ponzi scheme," and "financial fraud." This library is typically trained based on historically annotated fraudulent text. Each type of vector represents the typical semantic features of that type of fraud. For example, the vector for "illegal fundraising" includes semantic dimensions such as "high-interest promises," "fund pool," and "guaranteed principal."

[0020] For each sensitive word's contextual semantic vector, a cosine similarity algorithm is used to calculate the cosine of the angle between it and each financial fraud type vector. The closer this value is to 1, the more semantically similar it is. For example, the cosine similarity between the contextual vector of "guaranteed principal and interest" and the type vector of "illegal fundraising" is 0.88, and the similarity with the type vector of "Ponzi scheme" is 0.75, indicating a stronger correlation between the former. The similarities are then weighted and summed based on the sensitive word's weighted feature vector to obtain a comprehensive similarity. For example, if sensitive word A has a weight of 0.9 and a similarity of 0.8, and sensitive word B has a weight of 0.7 and a similarity of 0.7, the comprehensive similarity is: (0.9 × 0.8 + 0.7 × 0.7) / (0.9 + 0.7) ≈ 0.77. Alternatively, clustering algorithms can be used to group similar vectors together to match the corresponding fraud type, but this is not detailed in this example.

[0021] Finally, based on the calculated comprehensive similarity value, the type of financial fraud involved in the text to be identified is determined. Specifically, a similarity threshold is set. When the similarity of a certain type of financial fraud exceeds the threshold and is the highest among all types, it is determined that the user has encountered this type of financial fraud.

[0022] This embodiment provides a financial fraud detection method based on a large language model. It captures the deep semantics of the text through the generalization ability of the pre-trained model, and injects the experience of experts in the financial field by combining the sensitive word weight mechanism to guide the model to focus on high-risk words. This solves the shortcomings of traditional methods in semantic understanding, improves the recognition rate of financial fraud, and reduces the missed detection rate.

[0023] As an optional implementation method, the sensitive word weight feature vector and the text to be recognized are input into the large language model, and the context semantic vector of the sensitive word is determined by combining the word embedding technology, such as Figure 2 Shown, including: S1041, converting the text to be recognized into a word embedding vector sequence through word embedding technology; S1042, generating a weight mask matrix based on the sensitive word weight feature vector; S1043: Input the word embedding vector sequence into an LLM encoder to obtain a hidden state tensor containing contextual semantic information. The LLM encoder is an encoder using a Transformer architecture. In the LLM encoder, the initial attention weights in the self-attention mechanism are modified according to the weight mask matrix. S1044, obtaining the position interval of each sensitive word in the text to be recognized, and extracting the position weight vector from the hidden state tensor; S1045: Project the position weighted vector to the direction of the predefined basic sensitive word vector in a scalar projection manner to obtain the context semantic vector of the sensitive word.

[0024] For example, when processing financial fraud text, the text to be identified is first subjected to word embedding processing. BERT is used to convert each word in the text into a fixed-dimensional word embedding vector, forming a continuous sequence of word embedding vectors that retains the basic semantic information of the word. Simultaneously, based on the previously calculated sensitive word weight feature vectors, a weight mask matrix with the same length as the word embedding vector sequence is generated. Specifically, the elements in the weight mask matrix corresponding to the sensitive word position are filled with the weight value of the sensitive word, while other non-sensitive word positions are filled with default values ​​(such as 0 or 1), thus forming a mask that emphasizes the importance of sensitive words.

[0025] The word embedding vector sequence is input into the LLM encoder using the Transformer architecture. During the self-attention mechanism calculation process of the encoder, the weight mask matrix is ​​used to modify the initial attention weight. Specifically, the sensitive word weight feature vector is converted into a diagonal matrix. For example, the sensitive word weight feature vector is: ; in, is the weight feature of sensitive words 1-n.

[0026] Then, convert it into a weight mask matrix: ; By superimposing a weight mask matrix on the initial self-attention weights, high-weighted sensitive words receive higher attention scores, gaining more attention in subsequent attention weight calculations. After multi-layer Transformer encoding, a hidden state tensor containing rich contextual semantic information is obtained.

[0027] Next, the starting and ending positions of each sensitive word in the original text to be recognized are determined to form position intervals. The vectors corresponding to these position intervals are extracted from the hidden state tensor. These vectors are then weighted averaged based on the weight of the sensitive word to obtain a position-weighted vector that represents the entire sensitive word. This vector integrates the contextual information of each word within the sensitive word.

[0028] Finally, the resulting position-weighted vector is projected onto the predefined basic sensitive word vector direction. The basic sensitive word vector is pre-trained on a large number of financial fraud texts and represents the typical semantic direction of each sensitive word in a fraud scenario. The projection process calculates the dot product of the position-weighted vector and the basic sensitive word vector, then divides it by the modulus of the basic sensitive word vector to obtain a scalar value. This scalar value is then multiplied by the unit vector of the basic sensitive word vector to obtain the final sensitive word contextual semantic vector. This vector preserves the contextual characteristics of the sensitive word in the current text while aligning with the typical semantic direction of the financial fraud field, facilitating subsequent fraud type similarity calculations.

[0029] This embodiment provides a financial fraud detection method based on a large language model. The above-mentioned method realizes the conversion from original text to sensitive word context semantic vector, and corrects the initial attention weight in the self-attention mechanism by introducing the sensitive word weight feature vector, so that the attention score corresponding to high-weight sensitive words is higher, avoiding the neglect of key information when processing massive information, enabling the model to more accurately capture the key semantic information in the financial fraud text, and improving the accuracy of fraud identification.

[0030] As an optional implementation, the word embedding vector sequence is input into an LLM encoder to obtain a hidden state tensor containing contextual semantic information. The LLM encoder is an encoder using a Transformer architecture. In the LLM encoder, the initial attention weights in the self-attention mechanism are modified according to the weight mask matrix, including: In the LLM encoder, the initial attention weight in the self-attention mechanism is corrected according to the weight mask matrix to obtain a first weight correction value; the sensitive word association matrix is ​​added to the first weight correction value to obtain a second weight correction value, and the calculation of the hidden state tensor containing contextual semantic information is completed based on the second weight correction value; wherein, the construction process of the sensitive word association matrix includes: according to the text to be recognized, determining the sensitive word pairs associated across sentences, and calculating the attenuation compensation weight of each pair of sensitive words; according to the associated sensitive word pairs and their compensation weights, constructing a sparse sensitive word association matrix.

[0031] For example, we identify sensitive word pairs that are related across sentences in the text to be identified. Specifically, we analyze the distribution of sensitive words in different sentences and determine which sensitive words may have semantic connections based on a pre-set sensitive word association database, which contains a large number of related sensitive words. For example, if the word "high return" appears in the first sentence and "risk-free" appears in the second sentence, these two words constitute a potential sensitive word pair.

[0032] When calculating the attenuation compensation weight, the sentence interval and semantic relevance between sensitive word pairs are taken into account. The larger the sentence interval, the more significant the weight attenuation. However, in order to strengthen cross-sentence relevance, compensation will be given according to pre-set rules. For example, for sensitive word pairs separated by one sentence, the compensation weight is set to 0.8; for pairs separated by two sentences, the compensation weight is set to 0.6, and so on. The specific value is adjusted based on the actual training and testing results. The pre-set rules can be: in, To compensate for the weight, 、 is the weight value of sensitive word i and sensitive word j, is the distance value between sensitive word i and sensitive word j, which can be represented by sentence interval.

[0033] After determining the sensitive word pairs and their compensation weights, we begin to construct a sparse sensitive word association matrix. The size of this matrix is ​​related to the length of the word embedding vector sequence, and the rows and columns of the matrix correspond to the words in the text. In the matrix, the positions belonging to the sensitive word pairs are filled with the corresponding attenuation compensation weights, and the other positions are 0. Since we only focus on cross-sentence sensitive word pairs, some positions on the off-diagonal line have values, forming a sparse off-diagonal matrix, which records the association information between sensitive word pairs that needs to be strengthened. Specifically, the sensitive word association matrix as follows: ; The word embedding vector sequence is input into the LLM encoder using the Transformer architecture. In the self-attention mechanism calculation process of the encoder, the initial attention weights are first obtained. These weights reflect the degree of association between each word and other words. Then, in the above embodiment, the initial attention weights are corrected using the weight mask matrix to obtain a first weight correction value. At this time, the previously constructed sensitive word association matrix is ​​directly added to the first weight correction value, which is equivalent to enhancing the association weights between sensitive word pairs and obtaining a second weight correction value. In this way, the sensitive word pairs receive a higher degree of attention when calculating attention, and the model can better capture the cross-sentence semantic associations between them. After processing by multiple layers of encoders, a hidden state tensor containing rich contextual semantic information is finally obtained.

[0034] This embodiment provides a financial fraud detection method based on a large language model. The weight mask will force an increase in the attention scores of the two words, so that the model prioritizes the semantic association analysis of the two words during calculation. In this way, cross-sentence association analysis can be performed. High-weight sensitive words can attract the model to pay attention to the semantic association of distant contexts, thereby improving the accuracy of risk pattern capture.

[0035] As an optional implementation, the target word segmentation tool and the financial fraud dictionary are used to segment the text to be identified and determine a list of fraud-sensitive words, including: The text to be identified is segmented using a financial fraud dictionary to determine an initial fraud sensitive word list; unidentified text in the text to be identified is determined; the unidentified text is segmented again based on an unsupervised word segmentation model to obtain at least one group of segmented phrases; the segmented phrases are searched in a synonym library; when any segmented phrase has a synonym, the segmented phrase is mapped to the corresponding word in the financial fraud dictionary, and the corresponding word is included in the initial fraud sensitive word list to form a fraud sensitive word list; when any segmented phrase does not have a synonym, it is determined whether the segmented phrase is added to the financial fraud dictionary based on the similarity result.

[0036] For example, the text is input into a professional word segmentation tool and, combined with an existing financial fraud dictionary, undergoes initial word segmentation. The word segmentation tool breaks the text down into individual words according to pre-set rules. During this process, fraud-related terms are filtered out using the financial fraud dictionary to form an initial list of fraud-sensitive terms. For example, if a dictionary entry such as "guaranteed principal and interest" or "super high yield" appears in the text, it will be directly marked and added to the initial list.

[0037] After the first round of word segmentation, there may still be some parts in the text that are not recognized by the financial fraud dictionary. These are the unrecognized texts, such as some newly emerged Internet terms, abbreviations, or fraud expressions after being deformed. For such unrecognized texts, an unsupervised word segmentation model is used to perform secondary word segmentation on these unrecognized texts. The unsupervised word segmentation model does not require pre-labeled data. It will split the unrecognized text into different word groups based on the internal rules and language patterns of the text. These word groups may be two characters, three characters, or even longer, and finally at least one set of word segmentation groups is obtained. The unsupervised word segmentation model can be an unsupervised word segmentation model based on statistical learning, an unsupervised word segmentation model based on deep learning, or an unsupervised word segmentation model based on a language model. This embodiment does not limit the unsupervised word segmentation model.

[0038] Taking the unsupervised word segmentation model based on a language model as an example for illustration, first, each character in the text, such as "high", "income", "product", is mapped to a low-dimensional dense vector. Through training with the Skip-gram or CBOW model, the adjacent character vectors are closer in the semantic space. For example, the vector distance between "high" and "income" is less than that between "high" and "wind". For the continuous character sequence "ABC" in the text, calculate the conditional probabilities of P(B|A) and P(C|B) (based on vector cosine similarity). If P(B|A) is significantly higher than P(C|B), then a word boundary is divided between A and B (such as "A / B C"). Finally, the Viterbi algorithm is used to select the word segmentation path with the highest overall probability. For example, "high-income product" may be segmented into "high / income / product" rather than "high income / product product".

[0039] After obtaining the word segmentation groups, they are put into the thesaurus one by one for query. The thesaurus contains a large number of words and their synonymous expressions. If during the query process, it is found that a certain word segmentation group has a synonym, and this synonym just has a corresponding word in the financial fraud dictionary, then this word segmentation group is directly mapped to the corresponding word in the financial fraud dictionary, and the corresponding word is added to the initial fraud-sensitive word list to make the initial list richer, and finally a complete fraud-sensitive word list is formed. For example, if the word segmentation group "guaranteed profit" is found to be synonymous with "capital preservation commitment" in the financial fraud dictionary in the thesaurus, then "capital preservation commitment" is added to the list.

[0040] However, if a certain word segmentation group cannot find a corresponding synonym in the thesaurus, determine the financial fraud type according to the final similarity. If it is a financial fraud type, then add the word to the financial fraud dictionary. If it is not a financial fraud type, then do not add the word to the financial fraud dictionary.

[0041] This embodiment provides a financial fraud detection method based on a large language model. This method can not only make up for the problems of omissions in financial fraud dictionary updates, but also complete secondary recognition of unrecognized text through synonym recognition, thereby improving the recognition rate and thus improving the accuracy of financial fraud detection.

[0042] As an optional implementation, the type of financial fraud is determined based on the similarity, including: when the similarity between the context semantic vector of the sensitive word and the semantic vectors of multiple financial fraud types is higher than the first target threshold, multiple first target dimension feature vectors and multiple second target dimension feature vectors are obtained, wherein the first target dimension feature vector is the target dimension feature vector of the context semantic vector of the sensitive word, and the second target dimension feature vector is the target dimension feature vector of the financial fraud type; according to preset rules, weights are set for each first target dimension feature vector; the similarity between each first target dimension feature vector and the corresponding second target dimension feature vector is calculated respectively; weighted calculation is performed based on the weights of each first target dimension feature vector and the corresponding similarity to obtain a comprehensive similarity; and the type of financial fraud is determined based on the comprehensive similarity.

[0043] Exemplarily, when the comprehensive similarity values ​​determine that the similarities between the contextual semantic vectors of multiple sensitive words and the semantic vectors of multiple financial fraud types are all higher than the first target threshold, for example, the similarities with "illegal fundraising" and "Ponzi scheme" are 75% and 68% respectively, and the first target threshold is 60%, then these two types become candidate financial fraud types.

[0044] To avoid misjudgments caused by relying solely on overall similarity, target dimension features can be incorporated into clustering. A secondary screening can be performed within the two candidate financial fraud types to determine the final financial fraud type. Specifically, two types of target dimension features are first extracted: the first target dimension feature vector is derived from the semantic properties of the sensitive words themselves, reflecting their behavioral characteristics within specific fraud patterns; the second target dimension feature vector corresponds to the essential attributes of each financial fraud type. Specifically, if there are only two candidate financial fraud types remaining, the second target dimension features of the two candidate financial fraud types are first determined. The second target dimension features are pre-associated with the financial fraud types based on extensive analysis of historical fraud cases. Then, the corresponding first target dimension features are determined from the contextual features of each sensitive word. For example, if one of the financial fraud types is investment fraud, and the second target dimension features include the degree of exaggeration of returns and the urgency of fund transfer, then the contextual features of each sensitive word are also analyzed for these exaggerations of returns and the urgency of fund transfer.

[0045] Then, the static weights in the basic rule library are loaded to assign weights to the first target dimension feature vector. The basic rule library presets an expert experience matrix in the field of financial fraud, and sets benchmark weights for the second target dimension feature vector according to the fraud type. This benchmark value is derived from the dimensional contribution analysis of a large number of historical fraud cases. For example, the benchmark weight of the urgency of fund transfer dimension in investment fraud is set to 0.9, while it is only 0.4 in phishing fraud. After obtaining the weight of the corresponding second target dimension feature vector, the weight of the second target dimension feature vector is assigned to the corresponding first target dimension feature vector. For example, when the fraud type of the current candidate financial fraud type is investment fraud, the weight of the second target dimension feature vector of the urgency of fund transfer dimension is 0.9, and the corresponding weight of the first target dimension feature in the corresponding sensitive word is also 0.9.

[0046] After weighting is completed, the similarity relationships between the corresponding feature vectors in each group are calculated in parallel. Specifically, the cosine similarity is calculated for each feature vector in the first target dimension and its corresponding feature vector in the second target dimension, generating a dimension-level similarity score matrix. This process pays special attention to the directional consistency of the feature vectors, as the essential differences in fraud types are often reflected in the angles between the vectors in the feature space.

[0047] A weighted comprehensive similarity calculation is then performed. The system multiplies the similarity scores for each dimension by their corresponding weights, and uses a weighted summation formula to determine the overall similarity value. This calculation uses normalization to ensure that the comprehensive similarities of different fraud types are comparable. Ultimately, the fraud type is determined through a comprehensive similarity decision mechanism.

[0048] This embodiment provides a financial fraud detection method based on a large language model. When the similarity between the context semantic vector of a sensitive word and the semantic vectors of multiple financial fraud types is higher than a first target threshold, the closest financial fraud type is selected through secondary screening. The above method decomposes the target features, focuses on screening key features for secondary comparison in the secondary screening, and assigns different weights to the key features of each financial fraud type. This can effectively determine the fit of sensitive words in the text to be identified under different financial fraud types, thereby improving the accuracy of the judgment.

[0049] As an optional implementation, a financial fraud detection method based on a large language model further includes: When the similarity between the context semantic vector of the sensitive word and any financial fraud type semantic vector is higher than a first target threshold, the financial fraud type is determined to be the type corresponding to the financial fraud type semantic vector; When the similarity between the contextual semantic vector of a sensitive word and the semantic vectors of all financial fraud types is lower than the first target threshold, the contextual semantic feature vector of the sensitive word is marked, and its context text is extracted to generate a risk warning for manual review.

[0050] This embodiment provides a financial fraud detection method based on a large language model. When there is only one financial fraud type with a similarity higher than a first target threshold, the financial fraud type of the text to be identified is directly considered to be the corresponding type. When both are lower, it means that the text to be identified may not be a financial fraud, or the preset financial fraud type semantic vector may be missing. Therefore, a risk warning is sent to prompt manual review.

[0051] As an optional implementation, the weight of each sensitive word in the sensitive word list is calculated according to the target algorithm to obtain a sensitive word weight feature vector, including: Detect the word frequency of each sensitive word in the text to be identified. When the word frequencies are all higher than the second target threshold, calculate the word frequency value of the sensitive word in the text to be identified; calculate the inverse document frequency value of the sensitive word in all documents in the corpus; multiply the word frequency value by the inverse document frequency value to obtain the weight value of the sensitive word; combine the weight values ​​of all sensitive words in the fraud sensitive word list into an ordered set in a predetermined order to form a sensitive word weight feature vector.

[0052] For example, the text to be identified is segmented and all sensitive words are extracted using a financial fraud dictionary. The number of occurrences of each sensitive word in the text (i.e., word frequency) is then counted. For example, if "high interest return" appears four times in the text with a word frequency of 4, and "guaranteed principal" appears three times with a word frequency of 3, and the preset second target threshold is 2, then the word frequencies of both words meet the requirements and further word frequency calculation is required.

[0053] Then, based on the pre-built financial domain corpus, the inverse document frequency (IDF) of each sensitive word is calculated. The inverse document frequency reflects the rarity of the sensitive word in the entire corpus. The calculation formula is: Here, x represents the total number of documents in the corpus, and y represents the number of documents containing the sensitive word. 1 is added for smoothing to avoid the denominator being 0.

[0054] Suppose the corpus contains 2,000 documents, of which "high-interest return" appears in 80 and "guaranteed principal" appears in 50. The IDF value of "high-interest return" is ln(2001 / 81)≈ln(24.7)≈3.21, and the IDF value of "guaranteed principal" is ln(2001 / 51)≈ln(39.2)≈3.67. Multiply the frequency of each sensitive word by its corresponding inverse document frequency to obtain its weight. For example, the weight of "high-interest return" is 4×3.21=12.84, and the weight of "guaranteed principal" is 3×3.67=11.01.

[0055] Finally, the weights of all sensitive words are combined into an ordered set, based on the order in which they first appear in the text. If "high-interest returns" appears before "guaranteed principal," the sensitive word weight feature vector is [12.84, 11.01]. This vector reflects the activity of sensitive words in the current text through word frequency, and its unusualness within the domain through inverse document frequency. The weight formed by multiplying the two effectively highlights high-risk and rare fraudulent expressions, providing a quantitative feature basis for subsequent large language model analysis.

[0056] As an optional implementation, a financial fraud detection method based on a large language model further includes: When the word frequency of any sensitive word is lower than the second target threshold, the static risk weight of the sensitive word is obtained based on the predefined sensitive word risk level table; the position enhancement coefficient is calculated based on the position information of the sensitive word in the text to be identified; the static risk weight is multiplied by the position enhancement coefficient to generate a dynamic importance weight; the dynamic importance weights are combined according to the original order of the sensitive words to form a weighted sensitive word feature vector.

[0057] For example, this embodiment proposes a new method for determining weighted feature vectors when the text to be recognized is short and the above-mentioned method of calculating word frequency is not applicable. Specifically, a predefined table of sensitive word risk levels is first established, assigning static risk weights to each sensitive word. For example, "guaranteed principal and interest" is classified as high risk, with a static weight of 0.9; "high yield" is classified as medium risk, with a static weight of 0.7; and "unable to withdraw cash" is classified as high risk, with a static weight of 0.85. This table can be developed by financial risk control experts based on historical fraud cases and regulatory rules to reflect the risk level of the sensitive words themselves.

[0058] Analyze the position of sensitive words in the text to be identified and calculate the position enhancement coefficient. Generally speaking, sensitive words at the beginning and end of a text are more likely to be core expressions, while words in the middle are less important. Assume that the position weighting rule is set as follows: the coefficient for the beginning paragraph (the first 1 / 3 of the text) is 1.2, the middle paragraph (the middle 1 / 3) is 1.0, and the ending paragraph (the last 1 / 3) is 1.1. For example, if "guaranteed principal and interest" appears in the beginning paragraph of a text, the position enhancement coefficient is 1.2; "high yield" appears in the middle paragraph, the coefficient is 1.0; and "unable to withdraw cash" appears in the ending paragraph, the coefficient is 1.1.

[0059] The static risk weight of each sensitive word is multiplied by the corresponding position enhancement coefficient to obtain a dynamic importance weight. For example, the dynamic weight of "guaranteed principal and interest" is 0.9 × 1.2 = 1.08; "high yield" is 0.7 × 1.0 = 0.7; and "unable to withdraw cash" is 0.85 × 1.1 = 0.935. This process combines the inherent risk of sensitive words with the importance of their position in the text, making the weights more accurate to the actual semantic context.

[0060] Finally, the dynamic importance weights are combined into a weighted feature vector based on the original order in which sensitive words appear in the text. For example, if "high yield," "guaranteed principal and interest," and "unable to withdraw" appear in that order, the weighted feature vector would be [0.7, 1.08, 0.935]. This vector retains the predefined risk levels of sensitive words while dynamically adjusting weights based on their position. This can be used as input into a large language model, guiding the model to prioritize sensitive words in high-risk locations, improving the accuracy and specificity of fraud detection.

[0061] The present application also provides an electronic device, such as Figure 3 As shown, a processor 501 and a memory 502 , wherein the processor 501 and the memory 502 may be connected via a bus or other means.

[0062] The processor 501 may be a central processing unit (CPU). The processor 501 may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of these chips.

[0063] Memory 502, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer executable programs, and modules, such as the program instructions / modules corresponding to the large language model-based financial fraud detection method in the embodiments of the present invention. The processor executes the non-transitory software programs, instructions, and modules stored in the memory to perform various processor functions and data processing.

[0064] The memory 502 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 502 may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0065] The one or more modules are stored in the memory 502 and when executed by the processor 501, perform the following steps: Figure 1 The financial fraud detection method based on a large language model in the illustrated embodiment.

[0066] For details of the above electronic equipment, please refer to Figure 2 The corresponding descriptions and effects in the embodiments shown can be understood and will not be repeated here.

[0067] This embodiment also provides a computer storage medium storing computer-executable instructions capable of executing the large language model-based financial fraud detection method described in any of the aforementioned method embodiments. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a random access memory (RAM), a flash memory, a hard disk drive (HDD), or a solid-state drive (SSD). The storage medium may also include a combination of the aforementioned types of memory.

[0068] Finally, it should be noted that the above preferred embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail through the above preferred embodiments, those skilled in the art should understand that various changes can be made in form and details without departing from the scope defined by the claims of the present invention.

Claims

1. A financial fraud detection method based on a large language model, characterized in that: include: Get the text to be recognized; Use the target word segmentation tool and the financial fraud dictionary to segment the text to be identified and determine the list of fraud-sensitive words; Calculate the weight of each sensitive word in the sensitive word list according to the target algorithm to obtain the sensitive word weight feature vector; The sensitive word weight feature vector and the text to be recognized are input into the large language model, and the contextual semantic vector of the sensitive word is determined by combining word embedding technology; Determine the similarity between the contextual semantic vector of the sensitive word and the preset financial fraud type semantic vector; Determine the type of financial fraud based on the similarity.

2. The financial fraud detection method based on a large language model according to claim 1, characterized in that: The sensitive word weight feature vector and the text to be recognized are input into the large language model. Combined with word embedding technology, the contextual semantic vector of the sensitive word is determined, including: Convert the text to be recognized into a sequence of word embedding vectors using word embedding technology; Generate a weight mask matrix based on the sensitive word weight feature vector; The word embedding vector sequence is input into the LLM encoder to obtain a hidden state tensor containing contextual semantic information. The LLM encoder is an encoder using the Transformer architecture. In the LLM encoder, the initial attention weights in the self-attention mechanism are modified according to the weight mask matrix. Obtain the position interval of each sensitive word in the text to be recognized and extract the position weight vector from the hidden state tensor; The position weighted vector is projected to the direction of the predefined basic sensitive word vector in a scalar projection manner to obtain the contextual semantic vector of the sensitive word.

3. The financial fraud detection method based on a large language model according to claim 2, characterized in that: The word embedding vector sequence is input into the LLM encoder to obtain a hidden state tensor containing contextual semantic information. The LLM encoder is an encoder using the Transformer architecture. In the LLM encoder, the initial attention weight in the self-attention mechanism is modified according to the weight mask matrix, including: In the LLM encoder, the initial attention weight in the self-attention mechanism is corrected according to the weight mask matrix to obtain the first weight correction value; Adding the sensitive word association matrix to the first weight correction value to obtain a second weight correction value, and completing the calculation of the hidden state tensor containing contextual semantic information based on the second weight correction value; The construction process of the sensitive word association matrix includes: Based on the text to be recognized, determine the sensitive word pairs associated across sentences and calculate the attenuation compensation weight for each pair of sensitive words; According to the associated sensitive word pairs and their compensation weights, a sparse sensitive word association matrix is ​​constructed.

4. The financial fraud detection method based on a large language model according to claim 1, characterized in that: Use the target word segmentation tool and the financial fraud dictionary to segment the text to be identified and determine the list of fraud-sensitive words, including: Use the financial fraud dictionary to segment the text to be identified and determine the initial list of fraud-sensitive words; Determining unrecognized text in the text to be recognized; According to the unsupervised word segmentation model, the unrecognized text is segmented twice to obtain at least one group of word phrases; Search for segmented phrases in the thesaurus; When any segmented word group has a synonym, the segmented word group is mapped to the corresponding word in the financial fraud dictionary, and the corresponding word is included in the initial fraud sensitive word list to form a fraud sensitive word list; When any segmentation phrase has no synonyms, it is determined whether to add the segmentation phrase to the financial fraud dictionary based on the similarity result.

5. The financial fraud detection method based on a large language model according to claim 1, characterized in that: Based on the similarity, determine the type of financial fraud, including: When the similarity between the context semantic vector of the sensitive word and the semantic vectors of multiple financial fraud types is higher than the first target threshold, multiple first target dimension feature vectors and multiple second target dimension feature vectors are obtained, wherein the first target dimension feature vector is the target dimension feature vector of the context semantic vector of the sensitive word, and the second target dimension feature vector is the target dimension feature vector of the financial fraud type; According to preset rules, weights are set for each first target dimension feature vector; Calculate the similarity between each first target dimension feature vector and the corresponding second target dimension feature vector respectively; Perform weighted calculation based on the weights of the feature vectors of each first target dimension and the corresponding similarities to obtain a comprehensive similarity; Determine the type of financial fraud based on comprehensive similarity.

6. The financial fraud detection method based on a large language model according to claim 5, characterized in that: Also includes: When the similarity between the context semantic vector of the sensitive word and any financial fraud type semantic vector is higher than a first target threshold, the financial fraud type is determined to be the type corresponding to the financial fraud type semantic vector; When the similarity between the contextual semantic vector of a sensitive word and the semantic vectors of all financial fraud types is lower than the first target threshold, the contextual semantic feature vector of the sensitive word is marked, and its context text is extracted to generate a risk warning for manual review.

7. The financial fraud detection method based on a large language model according to claim 1, characterized in that: Calculate the weight of each sensitive word in the sensitive word list according to the target algorithm to obtain the sensitive word weight feature vector, including: Detect the frequency of each sensitive word in the text to be recognized. When the frequency is higher than the second target threshold, calculate the frequency value of the sensitive word in the text to be recognized. The frequency value is determined based on the frequency and position weight. Calculate the inverse document frequency value of sensitive words in all documents in the corpus; Multiply the word frequency value by the inverse document frequency value to obtain the weight value of the sensitive word; The weight values ​​of all sensitive words in the fraud sensitive word list are combined into an ordered set in a predetermined order to form a sensitive word weight feature vector.

8. The financial fraud detection method based on a large language model according to claim 7, characterized in that: Also includes: When the frequency of any sensitive word is lower than the second target threshold, the static risk weight of the sensitive word is obtained based on the predefined sensitive word risk level table; Combined with the position information of sensitive words in the text to be identified, calculate the position enhancement coefficient; Multiply the static risk weight by the position enhancement factor to generate the dynamic importance weight; The dynamic importance weights are combined according to the original order of sensitive words to form a weighted sensitive word feature vector.

9. A financial fraud detection device based on a large language model, characterized in that: include: A text recognition module is used to obtain the text to be recognized; The sensitive word determination module is used to segment the text to be identified using the target word segmentation tool and the financial fraud dictionary to determine the list of fraud-sensitive words; The sensitive word weight feature vector determination module is used to calculate the weight of each sensitive word in the sensitive word list according to the TF-IDF algorithm to obtain the sensitive word weight feature vector; The context semantic vector determination module is used to input the sensitive word weight feature vector and the text to be recognized into the large language model, and combine it with word embedding technology to determine the context semantic vector of the sensitive word; A similarity determination module is used to determine the similarity between the context semantic vector of the sensitive word and the preset financial fraud type semantic vector; The fraud determination module is used to determine whether it is financial fraud based on the similarity.

10. An electronic device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the steps of the financial fraud detection method based on a large language model as described in any one of claims 1 to 8.

Citation Information

Cited By

  • Application logic vulnerability detection method based on large model driving

    CN120763945A

  • Application logic vulnerability detection method based on large model

    CN120763945B

  • Sensitive data processing method and system combining privacy score and dynamic threshold

    CN121302434A

  • Semantic perception-based black box large model sensitive word positioning method and system

    CN121502533A

  • A semantic perception-based black box large model sensitive word positioning method and system

    CN121502533B