Cross-group message missending prevention method and system based on large model

By employing a cross-group message mis-sending prevention method based on a large language model, and utilizing multimodal contextual information and reinforcement learning strategies, the method achieves accurate identification and intelligent intervention of cross-group messages in instant messaging applications, solving the problem of mis-sending cross-group messages and improving user experience and information security.

CN121967367APending Publication Date: 2026-05-01BOXIAN GROUP HONG KONG LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BOXIAN GROUP HONG KONG LTD
Filing Date
2026-02-06
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing instant messaging applications suffer from several problems in addressing the issue of accidental sending of cross-group messages: insufficient post-event remediation mechanisms, high false positive and false negative rates due to static rules, and a lack of multimodal contextual understanding and deep semantic understanding capabilities, resulting in poor user experience and information security.

Method used

A cross-group message error prevention method based on a large language model is adopted. By acquiring user input messages and multimodal context information, semantic encoding and scene vector fusion are performed using a large language model on the device or in the cloud. Semantic similarity is calculated, and real-time intervention is carried out in combination with reinforcement learning strategies to provide prompts, confirmations or automatic forwarding functions, so as to achieve pre-emptive prevention and accurate identification of error risks.

Benefits of technology

Significantly reduces the incidence of false alarms, improves user experience and information security, achieving a 97% reduction in false alarms and a semantic false alarm rate of 2.1%, providing intelligent interaction and privacy protection, and meeting global privacy protection regulations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121967367A_ABST
    Figure CN121967367A_ABST
Patent Text Reader

Abstract

The invention discloses a cross-group message missending prevention method and system based on a large model, and belongs to the technical field of instant messaging. The method comprises the following steps of: acquiring input message content and multi-mode context information of a current session in sequence; performing semantic coding on the input message content by using a large language model at an end side or a cloud end to obtain an input vector M, and performing fusion coding on the multi-modal context information to obtain a scene vector S; the semantic similarity rho between the input vector M and the scene vector S is calculated, and then a misissue risk event is judged; and the user is prompted through a reinforcement learning strategy engine, and secondary confirmation is required or the input content is automatically forwarded to the recommended target session. According to the method, the fundamental transformation from post remedy to pre-prevention is realized, the possibility that error messages are sent out can be fundamentally eradicated, and sufficient sense of security and sense of mastering are provided for users.
Need to check novelty before this filing date? Find Prior Art

Description

A method and system for preventing missending of cross-group messages based on a large model Technical Field

[0001] This invention belongs to the field of instant messaging technology, and in particular relates to a method and system for preventing the wrongful sending of cross-group messages based on a large model. Background Technology

[0002] With the widespread adoption of mobile internet and smart devices, instant messaging applications have become indispensable communication tools in people's daily lives and work. Users typically join multiple group chats simultaneously, such as family groups, friend groups, work groups, and project groups. Each group chat has its unique membership, communication topics, and contextual atmosphere. However, the increase in the number of group chats and the increasing complexity of the context have also brought about a common problem: missent messages. Users may inadvertently send messages intended for a specific individual or group chat to an unrelated group chat, which can not only cause embarrassment but may even lead to serious information leaks or work errors.

[0003] Existing technologies for solving the problem of missent cross-group messages generally suffer from four fundamental shortcomings, which limit their effectiveness in practical applications and user experience. First, they rely on post-event remediation, where the impact cannot be eliminated; message recall functions are essentially "post-event remediation" mechanisms. Therefore, shifting the missentment prevention mechanism from "post-event remediation" to "pre-event prevention" is key to solving this problem. Second, they rely on static rules, resulting in high false positive and false negative rates. Missentment prevention mechanisms that depend on static keywords or fixed rules, such as sensitive word blocking, suffer from a lack of flexibility and intelligence. These rules are pre-set and cannot be dynamically adjusted according to specific contexts, leading to high false positive and false negative rates. Third, they lack multimodal contextual understanding, while information communication is highly context-dependent. Finally, they suffer from deficiencies in understanding deep semantics and colloquial expressions. Summary of the Invention

[0004] In view of this, the present invention discloses a method and system for preventing the wrong transmission of cross-group messages based on a large model.

[0005] This invention adopts the following technical solution: a cross-group message error prevention method based on a large model, the method comprising the following steps: S1, obtaining the user's current input message content in an instant messaging application and the multimodal context information of the current session; S2, using a large language model on the client side or in the cloud to perform semantic encoding on the input message content to obtain an input vector M, and performing fusion encoding on the multimodal context information to obtain a scene vector S; S3, calculating the semantic similarity ρ between the input vector M and the scene vector S, wherein when the semantic similarity ρ is less than a preset threshold ρ_min, it is determined to be an error sending risk event; when the semantic similarity ρ is greater than or equal to the preset threshold ρ_min, it is determined to be an error sending risk event; S4, when it is determined to be an error sending risk event, at least one of the following operations is performed through a reinforcement learning policy engine: prompting the user, requiring secondary confirmation, or automatically forwarding the input content to a recommended target session; when it is determined to be an error sending risk event, it is sent normally.

[0006] Furthermore, the multimodal context information mentioned in step S1 includes the group name, group announcement, the most recent N historical messages, or group member identity tags.

[0007] Furthermore, the algorithm for semantic similarity ρ in step S3 includes obtaining it through cosine similarity or contrastive learning dual-tower model.

[0008] Furthermore, the dual-tower model includes: a neural network employing a dual-tower structure, wherein the "input tower" in the dual towers is used to encode the input message content into an input vector M; and the "scene tower" in the dual towers is used to encode the multimodal context information into a scene vector S.

[0009] Furthermore, the formula for calculating the cosine similarity is: ρ=(M·S) / (||M||*||S||), where "·" represents the vector dot product, ||M|| and ||S|| represent the L2 norm of the vectors, and * represents the vector product.

[0010] Furthermore, the cosine similarity value ranges from [-1, 1].

[0011] Furthermore, the algorithm for semantic similarity ρ also includes the setting of a dynamic threshold, which is dynamically adjusted according to the type of group chat or the activity level of historical messages.

[0012] Furthermore, the reinforcement learning policy engine described in step S4 includes: making a decision by weighing the positive and negative rewards of the reward function.

[0013] Furthermore, the reward function is defined as: R = 2·CorrectForward - 1·FalseForward - 0.5·UserCancel, where R is the reward function, CorrectForward represents correct forwarding, FalseForward represents incorrect forwarding, and UserCancel represents user cancellation of system suggestion.

[0014] A cross-group message error prevention system based on a large model is disclosed. The system employs the aforementioned method to control the error prevention of cross-group messages. The system includes: a multimodal context acquisition module for real-time acquisition of the group name, announcements, historical messages, or member identities of the current session; an encoding module for encoding input vector M and scene vector S; an adaptation calculation module for calculating the semantic similarity ρ between input vector M and scene vector S; a decision and execution module for triggering prompts, confirmations, or automatic forwarding when ρ < ρ_min; and a reinforcement learning update module for updating the decision strategy online based on user feedback.

[0015] The beneficial effects of this invention: It shifts the timing of interception from post-event remediation to pre-event prevention, fundamentally changing the intervention logic of preventing mis-sent messages. By moving the detection and judgment process to the user input stage, this invention achieves a fundamental shift from "post-event remediation" to "pre-event prevention." Users no longer need to rely on the brief and unreliable "recall" function to fix things after the fact; instead, the system silently performs risk assessment and early warning before the message is sent, acting like a helpful assistant. This "prevention before it happens" mechanism fundamentally eliminates the possibility of incorrect messages being sent, providing users with an unprecedented sense of security and control. According to actual test data, this invention can reduce the occurrence rate of "sent to the wrong group" incidents by up to 97%, a qualitative leap.

[0016] Significantly Reduced Semantic False Alarm Rate: Thanks to the powerful semantic understanding capabilities of the large language model and the training method based on contrastive learning, this invention demonstrates accuracy far exceeding traditional keyword matching techniques in judging message and scene suitability. Traditional static rule-based systems typically have false alarm rates as high as 15% or even higher because they cannot understand context and can only perform rigid literal matching. This invention, however, learns from massive amounts of data to deeply understand the deeper meaning of language, contextual relationships, and communication norms in different scenarios. Real-world testing shows that after processing 5000 diverse test messages, the semantic false alarm rate of this invention is only 2.1%. This means the system can very accurately identify genuine mis-sent risks without unnecessary interference to normal user communication, greatly improving the user experience. Support for Multimodal Information Fusion: Another outstanding advantage of this invention is its powerful multimodal information fusion capability. The system is no longer limited to analyzing isolated text content but can comprehensively consider contextual information from multiple dimensions, such as group name, group announcements, historical chat records, and member identity tags. This comprehensive scene perception capability makes the system's understanding of the group chat "atmosphere" more profound and comprehensive. For example, the system can combine the group name "Project Task Force" with recent historical messages (all discussing technical solutions) to determine if a message about "dinner tonight" was sent to the wrong place. This multimodal fusion capability enables the invention to handle real-world communication scenarios that are far more complex than single-text analysis, thus greatly improving the accuracy and robustness of its judgments.

[0017] Enhancing user experience and enabling one-click or zero-click forwarding: This invention provides powerful anti-misdirection capabilities while also prioritizing a smooth and convenient user experience. By introducing a reinforcement learning decision engine, the system can provide tiered and graded intervention measures based on specific situations and user habits. For low-risk scenarios, a gentle, non-intrusive prompt may suffice; for high-risk scenarios, secondary confirmation will be required. When the system has extremely high confidence, it can even achieve automatic forwarding with "zero clicks," directly sending the message to the correct group chat. This intelligent interactive design avoids the crude, "one-size-fits-all" blocking of traditional security software, allowing users to enjoy security protection while being virtually unaware of the system's presence. For situations requiring manual intervention, the system also provides convenient operations such as "one-click forwarding," simplifying the process of correcting errors for users.

[0018] Strengthening privacy compliance and enabling edge-side inference: In today's world where data privacy is increasingly valued, this invention places user privacy protection in a paramount position. The system adopts a "edge-side inference + federated update" technical approach. All semantic encoding and similarity calculations involving sensitive user data (such as chat content) are completed on the user's local device, without uploading the original data to a cloud server. This not only fundamentally eliminates the risk of data leakage during transmission and storage but also complies with increasingly stringent global privacy regulations (such as GDPR). Furthermore, model updates and optimizations are performed through federated learning, which optimizes the global model by aggregating only the updated model parameters without accessing the user's original data. This design achieves a "data remains unchanged, model moves" privacy protection paradigm, allowing users to enjoy powerful AI capabilities while maintaining complete control over their personal data. Attached Figure Description

[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the embodiments 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.

[0020] Figure 1 is an overview diagram of the error prevention system of the present invention; Figure 2 is a flowchart of the input-scene adaptability calculation of the present invention; Figure 3 is a schematic diagram of the state transition of the reinforcement learning decision of the present invention. Detailed Implementation

[0021] To better understand the technical solution of the present invention, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0022] It should be understood that the described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0023] Example 1: A method for preventing mis-sending of cross-group messages based on a large model, the method comprising the following steps: S1, obtaining the input message content of the user currently in the instant messaging application and the multimodal context information of the current session; S2, using a large language model on the client side or in the cloud to perform semantic encoding on the input message content to obtain an input vector M, and performing fusion encoding on the multimodal context information to obtain a scene vector S; the number of input vectors M is a positive integer greater than or equal to 1, and the number of scene vectors S is a positive integer greater than or equal to 1; S3, calculating the semantic similarity ρ between the input vector M and the scene vector S; when the semantic similarity ρ is less than a preset threshold ρ_min, it is determined to be a mis-sending risk event; when the semantic similarity ρ is greater than or equal to the preset threshold ρ_min, it is determined to be a no-mis-sending risk event; S4, when it is determined to be a mis-sending risk event, at least one of the following operations is performed through a reinforcement learning policy engine: prompting the user, requiring secondary confirmation, or automatically forwarding the input content to the recommended target session; when it is determined to be a no-mis-sending risk event, it is sent normally.

[0024] Furthermore, the multimodal context information in step S1 includes the group name, group announcement, the most recent N historical messages or group member identity tags, where N is a positive integer greater than or equal to 1.

[0025] Furthermore, the algorithm for semantic similarity ρ in step S3 includes obtaining it through cosine similarity or contrastive learning dual-tower model.

[0026] Furthermore, the dual-tower model includes: a neural network employing a dual-tower structure, wherein the "input tower" in the dual towers is used to encode the input message content into an input vector M; and the "scene tower" in the dual towers is used to encode the multimodal context information into a scene vector S.

[0027] Furthermore, the formula for calculating the cosine similarity is: ρ=(M·S) / (||M||*||S||), where "·" represents the vector dot product, ||M|| and ||S|| represent the L2 norm of the vectors, and * represents the vector product.

[0028] Furthermore, the cosine similarity value ranges from [-1, 1]. The closer the value is to 1, the more similar the directions of the two vectors are, and the more semantically matched they are.

[0029] Furthermore, the algorithm for semantic similarity ρ also includes the setting of a dynamic threshold, which is dynamically adjusted according to the type of group chat or the activity level of historical messages.

[0030] Furthermore, the reinforcement learning policy engine described in step S4 includes: making a decision by weighing the positive and negative rewards of the reward function.

[0031] Furthermore, the reward function is defined as: R = 2·CorrectForward - 1·FalseForward - 0.5·UserCancel, where R is the reward function, CorrectForward represents correct forwarding, FalseForward represents incorrect forwarding, and UserCancel represents user cancellation of system suggestion.

[0032] A cross-group message error prevention system based on a large model is disclosed. The system employs the aforementioned method to control the error prevention of cross-group messages. The system includes: a multimodal context acquisition module for real-time acquisition of the group name, announcements, historical messages, or member identities of the current session; an encoding module for encoding input vector M and scene vector S; an adaptation calculation module for calculating the semantic similarity ρ between input vector M and scene vector S; a decision and execution module for triggering prompts, confirmations, or automatic forwarding when ρ < ρ_min; and a reinforcement learning update module for updating the decision strategy online based on user feedback.

[0033] Example 2: This invention proposes a systematic technical solution composed of [components]. This solution deeply integrates cutting-edge technologies such as natural language processing, multimodal information fusion, edge model inference, and reinforcement learning, constructing a complete closed-loop system from context awareness and semantic analysis to intelligent decision-making and execution. The various levels and core modules of this system will be described in detail below.

[0034] 1. System Overall Architecture The system of this invention adopts a layered and decoupled architecture design, consisting of the following layers from bottom to top: a lightweight client-side inference layer, a scene semantic extraction layer, an adaptation prediction layer, an error correction decision layer, an intelligent prompt layer, and an automatic forwarding layer. This modular design gives the system good scalability and maintainability. The lightweight client-side inference layer, as the foundation of the system, is responsible for efficiently running the compressed large language model on the local device, providing core semantic understanding capabilities to the upper layers. The scene semantic extraction layer is responsible for comprehensively capturing the multimodal context information of the current group chat and encoding it into a unified scene vector. The adaptation prediction layer is the "brain" of the system; by comparing the input vector and the scene vector, it calculates the semantic similarity between the message and the scene, thereby quantifying the risk of misdelivery. The error correction decision layer acts like an experienced "advisor," using reinforcement learning algorithms to dynamically formulate the optimal intervention strategy based on historical data and the current situation. Finally, the intelligent prompt layer and the automatic forwarding layer, as the "execution terminal" of the system, are responsible for presenting the decision results to the user in a user-friendly manner and performing corresponding operations, such as generating prompts, requiring confirmation, or completing automatic forwarding. The layers of the system architecture are shown in the table below.

[0035] 2. Lightweight Client-Side Inference Layer The lightweight client-side inference layer is key to achieving low latency and high privacy protection in this invention. To efficiently run large language models on resource-constrained mobile devices (such as iOS / Android phones), this invention employs advanced model compression technology. Specifically, firstly, knowledge distillation is used to transfer the knowledge of a large and complex "teacher model" to a smaller, lighter "student model." This process significantly reduces the number of model parameters and computational complexity while minimizing performance loss. Secondly, INT4 quantization (4-bit Integer Quantization) is used to compress the weights and activation values, originally represented by 32-bit or 16-bit floating-point numbers, into 4-bit integers. This extreme quantization further reduces the model size and significantly improves inference speed. Through the combination of these two technologies, this invention successfully controls the size of the large language model to within 50MB and achieves an inference speed of 30 tokens per second on mainstream mobile devices, fully meeting the needs of real-time interaction. The entire reasoning process is completed on the user's local device, and the original message content does not need to be uploaded to the cloud, thus ensuring the absolute security of user data.

[0036] 3 Scene Semantic Extraction Layer The core task of the scene semantic extraction layer is to construct a scene vector (SceneVector, S) that can comprehensively and accurately describe the current group chat's "atmosphere" and "topic". To achieve this goal, this invention designs a multi-modal encoder, which can integrate contextual data from different information sources. These data sources include: (1) Group name and group announcement: This is the most explicit identity identifier and rule description of the group chat. For example, the names "XX Company Executives Group" and "Weekend Werewolf Group" themselves contain completely different scene information. The group announcement may contain more specific communication norms or current topics.

[0037] (2) Recent N historical messages: Recent chat history is the most direct basis for judging the current group chat discussion topic and atmosphere. By performing semantic analysis on historical messages, we can understand what group members are paying attention to and whether the tone of discussion is formal or casual.

[0038] (3) Group member identity tags: The identity and role of group members are an important part of the scenario. For example, whether there are bosses, customers, elders, etc. in a group will greatly affect the appropriateness of the communication method and content. The system can preset different embedding vectors for different roles (such as "executive", "colleague", "customer" and "friend").

[0039] The multimodal encoder encodes these heterogeneous information sources uniformly and generates a high-dimensional scene vector S through a fusion formula, which is described in the scene vector fusion algorithm section of Example 3. This vector S acts like a "scene fingerprint," uniquely characterizing the current context of the group chat.

[0040] 4. Fit Prediction Layer The fit prediction layer is the core decision-making module of the system, responsible for determining whether a message a user is about to send is "suitable" for the current group chat scenario. This layer receives two key inputs from the lower layer: a scenario vector S generated by the scenario semantic extraction layer, and an input vector M obtained by encoding the user's input content by the client-side lightweight inference layer. The system uses a contrastive-prompt dual-tower model to calculate the semantic similarity ρ (rho) between these two vectors. This similarity ρ value represents the "input-scenario" fit. The higher the ρ value, the better the message content matches the group chat scenario; conversely, the lower the ρ value, the higher the risk of mis-sending. The system presets a similarity threshold ρ_min. When the calculated ρ value is lower than this threshold, the system determines this as a "mis-sending risk event" and triggers the upper-layer error correction decision process. This judgment method based on semantic vector similarity, compared to traditional keyword matching, can more deeply and flexibly understand semantic-level matching relationships.

[0041] 5 Error Correction Decision Layer When the fit prediction layer triggers a mis-sending risk event, the error correction decision layer will intervene and be responsible for deciding what specific intervention measures to take. This invention abandons the fixed intervention strategy and instead introduces a reinforcement learning policy engine. The core idea of ​​this engine is to learn and optimize an optimal decision strategy by continuously interacting with users and trying and failing. The engine will build a user profile based on the user's historical behavior data (e.g., whether the user was more inclined to accept the system's forwarding suggestions in the past or preferred to make manual selections? Whether the user often ignores the system's prompts or takes them seriously?). Then, based on the current risk confidence and user profile, the engine will use the ε-greedy strategy (a classic reinforcement learning algorithm that balances "utilizing" the known optimal strategy and "exploring" new strategies) to make dynamic decisions. Possible decisions include: (1) Prompt only: Display a mild prompt on the screen to inform the user of the possible risk of mis-sending, but do not prevent them from sending.

[0042] (2) Forced confirmation: A confirmation dialog box pops up, requiring the user to make a second confirmation before sending.

[0043] (3) Automatic forwarding: When the system has a very high degree of confidence, the message will be sent directly to the correct group chat recommended by the system.

[0044] This dynamic decision-making mechanism based on reinforcement learning makes the system's intervention behavior increasingly "understand" the user, providing effective protection while avoiding excessive interference.

[0045] 6. Intelligent Prompt Layer: When the error correction decision layer decides to adopt a "prompt" or "forced confirmation" strategy, the intelligent prompt layer is responsible for generating a user-friendly and easy-to-understand interface. This layer includes an Explainable Generation Module, which translates potentially abstract "semantic mismatch" issues into a simple, instructive prompt. For example, instead of simply prompting "message mismatch," the system might generate a prompt like: "This message contains 'Give me a kiss,' which is inappropriate for the formal context of 'XX Company Executives Group.' Would you consider forwarding it to your 'Friends Group'?" This prompt not only clearly identifies the problem (informal content) but also provides specific advice (forwarding to the friends group), greatly improving user experience and system usability. This explainability is key to building user trust, allowing users to understand why the system made this judgment, thus making them more willing to adopt the system's suggestions.

[0046] 7. Automatic Forwarding Layer: When the error correction decision layer makes an "automatic forwarding" decision under high confidence, the automatic forwarding layer will be responsible for executing this operation. This layer completes message forwarding through a session routing gateway. To avoid the confusion that automatic forwarding may cause (e.g., users may wonder, "Where did my message go?"), this invention designs a clever gray placeholder message mechanism. After a message is automatically forwarded, the system leaves a special placeholder message in the original, incorrect group chat. This message is usually displayed in gray and its content is similar to "[System Automatic Forwarding] You have a message forwarded to 'Friends Group'". This placeholder message is clickable, and users can click it to view the specific content and destination of the forwarded message. More importantly, this placeholder message also provides a one-click reversal entry, allowing users to cancel this automatic forwarding operation within a certain period of time and "pull" the message back into the original group chat. This design takes into account the convenience of automatic forwarding and the user's right to know and control the destination of messages, achieving a good balance between transparency and reversibility.

[0047] Example 3 The technical solution of the present invention relies on three core algorithms, which play a crucial role in the three key stages of scene vector construction, model training and decision optimization.

[0048] 1. Scene Vector Fusion Algorithm To construct a vector S that comprehensively represents the group chat scene, this invention designs a weighted fusion algorithm. This algorithm linearly combines the encoded vectors from different information sources, and its specific fusion formula is as follows: S = α·TextEncoder(Group Name + Announcement) + β·MeanPooling(Latest 10 Historical Messages) + γ·RoleEmbedding(Member Identity) Where: TextEncoder(GroupName + Announcement): This represents the vector obtained by encoding the text content of the group name and group announcement. This information is usually relatively static, defining the basic attributes and rules of the group chat.

[0049] MeanPooling (Latest 10 Historical Messages): This represents a vector obtained by averaging the encoded messages from the last 10 historical messages. This information is dynamic, reflecting the current hot topics and discussion atmosphere in the group chat. Using mean pooling can smooth out the impact of individual extreme messages and better capture the overall trend.

[0050] RoleEmbedding (Member Identity): This represents the vector obtained by embedding the identity tags of group members. This information defines the social structure and power relationships of the group chat.

[0051] α, β, and γ are three adjustable weighting coefficients that determine the contribution of different information sources to the final scene vector. These three coefficients satisfy the constraint α + β + γ = 1. Their specific values ​​are not fixed but are calibrated on a large number of real chat datasets through offline grid search and cross-validation to find the optimal combination that maximizes the representational power of the scene vector.

[0052] 2. Input-Scene Contrast Loss Function To train a dual-tower model capable of accurately calculating the similarity between input vector M and scene vector S, this invention employs a contrastive learning-based training method. The core idea is to teach the model to bring "matching" (input, scene) pairs closer together, while pushing "mismatching" (input, scene) pairs further apart. The specific loss function adopts the InfoNCE form, with the following formula: L=-log(exp(ρ(M,S+) / τ) / Σiexp(ρ(M,Si) / τ)) where: M: The vector of the encoded user input message.

[0053] S+: The "positive sample" scenario vector that matches the input message M, i.e., the scenario vector of the group chat to which the message was actually sent.

[0054] Si: A vector of "negative sample" scenarios that do not match the input message M. These negative samples are randomly sampled from other group chats in which the user participates.

[0055] ρ(·,·): A function that calculates the cosine similarity between two vectors.

[0056] τ(tau): A temperature parameter used to control the difficulty of contrastive learning. In this invention, τ is set to a small value (e.g., 0.05) to enhance the model's ability to distinguish between difficult negative samples.

[0057] By minimizing this loss function, the model can continuously optimize its parameters, enabling it to accurately find the best-matching scene S+ for any input message M, thereby achieving high-precision fitness prediction.

[0058] 3. Reinforcement Learning Reward Function To drive the reinforcement learning policy engine of the error correction decision layer to continuously optimize its decision-making ability, this invention defines a carefully designed reward function. This reward function aims to guide the system to make the decision most beneficial to the user. Its specific formula is as follows: R = 2·CorrectForward - 1·FalseForward - 0.5·UserCancel Where the meanings of each term are: CorrectForward: When the system successfully intercepts a message that should have been sent to group A and forwards it to group B, the system receives a +2 reward. This is the system's most desired goal.

[0059] FalseForward: When the system mistakenly forwards a message that should have been sent to group A to group B (i.e., group B is not the correct target), or when the system mistakenly intercepts a message that should have been sent to group A, the system receives a penalty of -1. This is designed to prevent the system from over-intervening or making incorrect judgments.

[0060] UserCancel: When the system provides a suggestion or forwarding recommendation, but the user chooses to ignore or cancel the suggestion, the system receives a penalty of -0.5. This is designed to encourage the system to provide suggestions that users truly need and are willing to accept, avoiding unnecessary disruptions.

[0061] By continuously interacting with users in an online environment and collecting reward signals, the reinforcement learning policy engine continuously updates its internal policy network parameters θ, with the ultimate goal of maximizing the long-term accumulated discount reward. This process enables the system's decision-making strategy to continuously adapt to user behavior, becoming increasingly intelligent and personalized.

[0062] Example 4: To more clearly illustrate the technical solution and implementation details of the present invention, the three core illustrations included in the accompanying drawings will be described in detail below. These illustrations together constitute a complete visual description of the system architecture, core processes, and decision-making logic of the present invention.

[0063] Figure 1 is a schematic diagram of the system overview of the present invention, which shows the six core layers that constitute the entire cross-group message error prevention system and their interrelationships in a modular manner. The diagram intuitively presents the entire chain of processes from user input to final message processing.

[0064] Client-side lightweight inference layer: Located at the bottom layer, it forms the computational foundation of the system. The diagram will indicate "micro-compressed large model (≤50MB)," and specify its key technologies as "knowledge distillation + INT4 quantization," with a target performance of "30 tokens / s." This layer directly interacts with the user's input device (such as a mobile phone keyboard), responsible for encoding the user's raw input (text, speech, etc.) into a machine-understandable input vector M.

[0065] Scene semantic extraction layer: Immediately above this is the scene semantic extraction layer. The diagram shows a "multimodal encoder" module, whose input is connected to multiple information sources, including "group name + announcement", "the most recent N historical messages", and "member identity tags". Its output generates a unified "scene vector S".

[0066] Fit Prediction Layer: This layer is located at the center, and its core is the "Comparison-Cue Dual-Tower Model". The diagram clearly shows that this model receives input vector M and scene vector S from the lower layer, and calculates and outputs a value called "Semantic Cosine Similarity ρ". Next to it is a comparator that compares ρ with a preset threshold "ρ_min". When "ρ < ρ_min", an "interception / warning" signal is triggered and passed to the upper layer.

[0067] Error Correction Decision Layer: Upon receiving an early warning signal, the "reinforcement learning policy engine" in this layer begins operation. The diagram illustrates the engine's decision-making process. It receives "user history logs" as input, makes decisions through its internal "ε-greedy policy," and outputs three possible decision results: "prompt only," "force confirmation," or "automatic forwarding."

[0068] Intelligent prompting layer and automatic forwarding layer: These two layers are located at the top and are the execution end of the system. If the decision is "prompt" or "confirm," the "interpretable generation module" generates a user-friendly prompt interface. If the decision is "automatic forwarding," the "session routing gateway" performs the forwarding operation and generates a "grayscale placeholder message" in the original session.

[0069] Figure 1 provides a clearer understanding of the overall technical architecture of this invention and the collaborative working methods among its modules.

[0070] Figure 2 is a schematic diagram of the input-scene adaptation calculation process of the present invention; Figure 2 is a further refinement and expansion of the core workflow of the "adaptation prediction layer" in Figure 1, which aims to explain in detail the specific calculation process of input-scene adaptation.

[0071] Process Start: On the left side of the diagram are two parallel start boxes, representing "user input content" and "multimodal context information" respectively.

[0072] Encoding process: The two starting boxes point to two "encoder" modules. One module is the "input semantic encoder," which encodes user input into an "input vector M." The other module is the "scene semantic encoder," which encodes multimodal contextual information into a "scene vector S." Figure 2 emphasizes that these two encoders share base parameters and are jointly trained through contrastive learning.

[0073] Similarity calculation: The vectors M and S generated by the two encoders are fed into a "cosine similarity calculation" module. The figure will show the mathematical formula or calculation diagram of cosine similarity, and finally output a scalar value "ρ".

[0074] Threshold determination: The calculated ρ value is fed into a "threshold comparator" diamond box and compared with the preset "ρ_min".

[0075] Branching Result: The comparator splits into two branches. If "ρ ≥ ρ_min", the process proceeds to the "normal transmission" endpoint. If "ρ < ρ_min", the process proceeds to the "triggered mistransmission risk event" endpoint and sends a warning signal to the upper-level module.

[0076] Figure 2, in the form of a flowchart, reveals how the present invention derives the final fit judgment step by step from the original input and context information.

[0077] Figure 3 is a schematic diagram of the state transition of reinforcement learning decision-making in this invention. Figure 3 aims to vividly illustrate the working mechanism and decision-making logic of the reinforcement learning policy engine in the error correction decision layer in the form of a state transition diagram.

[0078] Status nodes: The diagram will contain several key status nodes, such as: "Risk detected", "Prompt user", "Wait for user confirmation", "Automatic forwarding", "User accepts", "User cancels", etc.

[0079] Decision-making actions: The transition from one state to another is driven by "decision-making actions". For example, from the "risk detected" state, the system can take three actions: "a1: prompt only", "a2: force confirmation", and "a3: automatic forwarding", respectively, to transition to the corresponding state.

[0080] Reward / Penalty: The path of state transitions will be marked with the "reward" or "penalty" value the system receives after performing the action. For example, the path from "automatic forwarding" to "user acceptance" will be marked with "+2," representing a reward for correct forwarding. The path from "notify user" to "user cancels" will be marked with "-0.5," representing a penalty for user cancellation.

[0081] The embodiments of the present invention have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method for preventing the wrongful transmission of cross-group messages based on a large model, characterized in that, The method includes the following steps: S1, obtaining the user's current input message content in the instant messaging application and the multimodal context information of the current session; S2, using a large language model on the client side or in the cloud to perform semantic encoding on the input message content to obtain an input vector M, and performing fusion encoding on the multimodal context information to obtain a scene vector S; S3, calculating the semantic similarity ρ between the input vector M and the scene vector S. When the semantic similarity ρ is less than a preset threshold ρ_min, it is determined to be a mis-sent risk event; when the semantic similarity ρ is greater than or equal to the preset threshold ρ_min, it is determined to be a no-mis-sent risk event; S4, when it is determined to be a mis-sent risk event, at least one of the following operations is performed through a reinforcement learning policy engine: prompting the user, requiring secondary confirmation, or automatically forwarding the input content to the recommended target session; when it is determined to be a no-mis-sent risk event, it is sent normally.

2. The method according to claim 1, characterized in that, The multimodal context information mentioned in step S1 includes the group name, group announcement, the most recent N historical messages, or group member identity tags.

3. The method according to claim 1, characterized in that, The algorithm for semantic similarity ρ in step S3 includes obtaining it through cosine similarity or contrastive learning dual-tower model.

4. The method according to claim 3, characterized in that, The dual-tower model includes: a neural network with a dual-tower structure, wherein the "input tower" in the dual tower is used to encode the input message content into an input vector M; and the "scene tower" in the dual tower is used to encode the multimodal context information into a scene vector S.

5. The method according to claim 4, characterized in that, The formula for calculating the cosine similarity is: ρ=(M·S) / (||M||*||S||), where "·" represents the vector dot product, ||M|| and ||S|| represent the L2 norm of the vectors, and * represents the vector product.

6. The method according to claim 5, characterized in that, The cosine similarity value ranges from [-1, 1].

7. The method according to claim 3, characterized in that, The algorithm for semantic similarity ρ also includes the setting of a dynamic threshold, which is dynamically adjusted according to the type of group chat or the activity level of historical messages.

8. The method according to claim 1, characterized in that, The reinforcement learning policy engine described in step S4 includes: making a decision by weighing the positive and negative rewards of the reward function.

9. The method according to claim 8, characterized in that, The reward function is defined as: R = 2·CorrectForward - 1·FalseForward - 0.5·UserCancel, where R is the reward function, CorrectForward represents correct forwarding, FalseForward represents incorrect forwarding, and UserCancel represents the user canceling the system suggestion.

10. A cross-group message error prevention system based on a large model, characterized in that, The system employs the method described in any one of claims 1-9 to control cross-group message error prevention. The system includes: a multimodal context acquisition module for real-time capture of the group name, announcements, historical messages, or member identities of the current session; an encoding module for encoding input vector M and scene vector S; an adaptation calculation module for calculating the semantic similarity ρ between input vector M and scene vector S; a decision and execution module for triggering prompts, confirmations, or automatic forwarding when ρ < ρ_min; and a reinforcement learning update module for updating the decision strategy online based on user feedback.