A large model generation content real-time alignment method and system based on dynamic value anchor points

By using a dynamic value anchoring method to evaluate and intervene in the content generated by large models in real time, the problem of lag and static alignment in the generation process of existing technologies is solved, achieving resource conservation, improved user experience and reduced costs, and adapting to the alignment needs of different scenarios.

CN122364348APending Publication Date: 2026-07-10

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Filing Date
2026-04-03
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing large models suffer from the lag of post-processing filtering and the limitations of static alignment when generating content, resulting in wasted resources, poor user experience, and high costs. They cannot correct deviations in real time during the generation process, and the prompt word engineering is unreliable, making it impossible to dynamically adjust alignment standards.

Method used

The method adopts a dynamic value anchor point approach, which receives and stores anchor point configurations, generates content token by token, evaluates in real time, and selects intervention strategies based on the comprehensive score, including light, medium and heavy interventions, to achieve real-time alignment in the generation process.

Benefits of technology

It enables real-time evaluation and intervention during the generation process, avoiding resource waste, improving user experience, reducing costs, and providing a flexible alignment mechanism to adapt to different scenarios and user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122364348A_ABST
    Figure CN122364348A_ABST
Patent Text Reader

Abstract

This invention discloses a real-time content alignment method and system for large model generation based on dynamic value anchors. The method's flow is as follows: "User → Anchor Management System (configure anchors) → Large Model Inference Engine (generation) → Periodic call to the dual-path evaluation module → Evaluation module reads the anchor library to calculate the matching degree → Returns the comprehensive score → Inference engine makes decision intervention." This invention introduces a dynamic anchor injection mechanism, a dual-path parallel evaluation architecture, a periodic triggering mechanism, and hierarchical intervention decision logic during the inference process. Value anchor constraints are injected into the decoder at non-fixed locations and frequencies. A weighted fusion of dual-path parallel evaluation is used to output a comprehensive score, avoiding over-intervention or missed detection caused by a single indicator. Different levels of intervention strategies are adopted based on the degree of deviation of the comprehensive score, transforming value alignment from "post-event inspection" to "process control," providing greater flexibility and interpretability while ensuring real-time performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, and in particular relates to a method and system for real-time alignment of content generated by a large model based on dynamic value anchors. Background Technology

[0002] Large Language Models (LLMs) are based on the Transformer architecture and generate content token by token using an autoregressive approach. During generation, the model predicts the probability distribution of the next token based on the generated context and determines the final output through sampling strategies (such as top-p and temperature). Commonly used techniques include: classifier filtering, using models such as BERT to perform binary classification (compliant / non-compliant) on the generated content, intercepting or replacing non-compliant content; RLHF, training a reward model using human-annotated preference data and then fine-tuning the language model using reinforcement learning; and prompt word engineering, adding restrictive language such as "Please abide by the xx rules" to system prompts.

[0003] Here are some typical implementation schemes in the existing technology: Option A: OpenAI's Content Moderation API Step 1: The user calls the generation interface to obtain a complete response; Step 2: Send the response text to the audit API; Step 3: Review the API return classification results (safe / sensitive / insecure); Step 4: If it is determined to be insecure, the developer shall handle it themselves (such as blocking or replacing).

[0004] Defects: Generation and review occur sequentially, resulting in cumulative delays; review is a black box, making it impossible to intervene during the generation process.

[0005] Option B: Google's Constitutional AI Step 1: The model generates the initial response; Step 2: Use "rules" to self-criticize the response; Step 3: Regenerate the revised response based on the criticism results; Drawbacks: It requires two generation steps, doubling the latency; the rules are described in natural language, resulting in insufficient execution stability.

[0006] Option C: Security classifiers such as Llama Guard Step 1: Concatenate the user input and model output and feed them into the safety classifier; Step 2: The classifier outputs safe / unsafe labels.

[0007] Limitations: It is still a post-hoc judgment; the classifier needs to be trained and maintained separately.

[0008] Based on the above solutions, the existing large models have the following technical problems when generating content: The lag in post-processing filtering: Traditional content moderation uses a "post-generation filtering" model, where the model first generates complete content, and then intercepts it through a classifier or keyword library. This approach leads to wasted generation resources, with a large amount of content being discarded after generation; a fragmented user experience, with content lacking contextual coherence when truncated; and the inability to correct deviations in real time during the generation process.

[0009] Limitations of static alignment: Methods such as RLHF (Reinforcement Learning Based on Human Feedback) solidify value alignment in the model weights, which means that updating the value system requires retraining, resulting in high costs (hundreds of thousands to millions of dollars per iteration); it is impossible to dynamically adjust the alignment standard for different scenarios; and the same model cannot serve user groups with different value preferences at the same time.

[0010] Unreliable aspects of prompt word engineering: The output of the model is guided by system prompt words, which may result in incomplete coverage and easy bypass in complex scenarios; the lack of closed-loop verification makes it impossible to ensure that the output truly meets expectations.

[0011] Therefore, there is an urgent need to develop a real-time content alignment method and system for large models based on dynamic value anchors that can solve the above technical problems. Summary of the Invention

[0012] The purpose of this invention is to provide a method and system for real-time alignment of large model generated content based on dynamic value anchors, so as to solve the technical problems in the prior art.

[0013] To address the aforementioned technical problems, this invention provides a method for real-time alignment of content generated from large models based on dynamic value anchors, comprising the following steps: S1. Receive and store anchor point configuration, providing vectorized anchor points; S2. The user inputs to start the large model inference engine and begins generating content token by token. S3. Determine whether the generated content meets the preset evaluation trigger conditions. If so, trigger periodic evaluation; otherwise, return to the large model inference engine to continue generating content. S4. The periodic evaluation calculates and outputs a comprehensive score based on the generated content; S5. Determine whether the comprehensive score meets the intervention conditions. If yes, trigger comprehensive decision intervention; otherwise, return to the large model inference engine to continue generating content. S6. The comprehensive decision-making intervention determines the degree of deviation based on the comprehensive score, selects an intervention strategy, and outputs a return intervention instruction. S7, the large model inference engine receives intervention instructions and executes intervention actions.

[0014] Preferably, step S1 specifically includes: S11. Receive the set of value anchor points input by the user, the format of which includes anchor point ID, anchor point description and threshold; S12. The anchor point description is processed using vectorization. An embedding model is called to convert the anchor point description text into a vector. The embedding model is a general text embedding model. S13. Store the vector in the anchor index library and provide a list of anchor points for subsequent calculations.

[0015] Preferably, the preset evaluation trigger condition is: whenever the generated content reaches a preset granularity, including every 10 tokens, every completed sentence, or a custom condition, a periodic evaluation is triggered.

[0016] Preferably, step S4 specifically comprises: S41. The generated content is fed into the quality evaluator and the alignment evaluator for parallel computation. When the application scenario does not have high requirements for the quality of the generated content, but has strict requirements for the value alignment, the quality evaluator can be removed and only the alignment evaluator can be retained. S42. The quality evaluator calculates the perplexity of the generated content and outputs a quality score, reflecting the fluency of the content. S43. The alignment evaluator calculates the cosine similarity between the generated content and each anchor vector, and takes the lowest score among all anchors as the alignment score, reflecting the degree of matching between the content and the value standard. S44. Calculate and output the overall score: Overall score = α × quality score + β × alignment score.

[0017] Preferably, the intervention conditions are: If the overall score is greater than or equal to the anchor threshold, return to the large model inference engine to continue generating content; If the overall score is less than the anchor threshold, a comprehensive decision-making intervention will be triggered.

[0018] Preferably, step S6 specifically involves: classifying the comprehensive score into three intervention strategies based on the degree of deviation from the anchor threshold, and outputting the corresponding intervention instructions: Mild intervention: Triggered when the overall score is below the threshold but above 0.5 times the threshold. The intervention action is to adjust the sampling parameters, including lowering the temperature and increasing the top-p, to make the generation more conservative. Moderate intervention: Triggered when the overall score is below 0.5 times the threshold but above 0.2 times the threshold. The intervention action is to directly modify the probability distribution of the token during the decoding stage or inject a guiding token into the decoder to guide the subsequent generation direction. The guiding token includes a security guiding token or a neutral tone token. Severe intervention: Triggered when the overall score is below 0.2 times the threshold, the intervention action is to terminate generation and return the preset safety response.

[0019] Preferably, it also includes a feedback closed-loop data acquisition step: S8. In order to dynamically adjust the anchor point threshold in the future, the content collected through the feedback closed loop is recorded in the log. The collected content includes the evaluation timestamp, generated content, quality score, alignment score, comprehensive score, intervention instructions, current anchor point version, and periodic content of evaluation results.

[0020] This invention also provides a real-time content alignment system for large model generation based on dynamic value anchors, comprising: Anchor point management module: used to receive anchor point configurations, perform vectorization processing and storage, and provide an anchor point list for evaluation purposes; Large model inference engine: used to perform token-level generation, trigger periodic evaluations according to preset conditions, and execute intervention actions according to intervention decision instructions; Dual-path evaluation module: Includes a quality evaluator and an alignment evaluator, used to calculate the quality score and alignment score respectively, and outputs a comprehensive score; Intervention decision module: Used to select mild, moderate or severe intervention strategies based on the degree of deviation between the comprehensive score and the threshold, and output intervention instructions; Log module: Used to collect and record periodic content including evaluation timestamps, generated content, quality score, alignment score, overall score, intervention instructions, current anchor version, and evaluation results, for subsequent analysis and anchor threshold adjustment.

[0021] The present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the real-time alignment method for large model generation content based on dynamic value anchors as described in any of the preceding claims.

[0022] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the real-time alignment method for large model generation content based on dynamic value anchors as described in any of the preceding claims.

[0023] Compared with the prior art, the beneficial effects of the present invention are: This invention introduces a dynamic anchor injection mechanism: during inference, value anchor constraints are injected into the decoder at non-fixed positions and non-fixed frequencies, rather than being processed only at the input or output ends.

[0024] This invention adopts a dual-path parallel evaluation architecture: the alignment between generation quality and value is evaluated and weighted and fused simultaneously, avoiding over-intervention or missed detection caused by a single indicator.

[0025] This invention employs a tiered intervention decision-making logic: based on the degree of deviation of the comprehensive score, different levels of intervention strategies are adopted, such as adjusting sampling parameters, guiding token injection, and terminating generation.

[0026] This invention adopts a pluggable modular design: the value anchor system is decoupled from the large model, and the anchor configuration is dynamically loaded through the API interface without modifying the model weights.

[0027] This invention realizes vectorized storage and matching of anchor points: it converts natural language anchor point descriptions into vectors and achieves fuzzy matching through similarity calculation, replacing hard-coded rules.

[0028] This invention, by introducing dynamic anchor injection and a dual-path evaluation mechanism during the inference process, transforms value alignment from "post-hoc inspection" to "process control," providing greater flexibility and interpretability while ensuring real-time performance. Specifically, it also embodies the following technical advantages: Real-time performance: Value assessment and intervention are performed on a token-by-token or sentence-by-sentence basis during the generation process, without waiting for the complete output.

[0029] Dynamism: Value anchors can be configured online without retraining the model, and take effect in seconds.

[0030] Pluggability: Deployed as independent modules, adaptable to any existing large model.

[0031] Verifiability: Provides aligned metrics that are auditable and traceable. Attached Figure Description

[0032] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1 A flowchart illustrating a method for real-time content alignment based on dynamic value anchors in large model generation, as provided in this application embodiment; Figure 2 A flowchart of the anchor point configuration stage provided in the embodiments of this application; Figure 3 A flowchart of the large model inference stage provided in the embodiments of this application; Figure 4 A flowchart of the periodic evaluation phase provided for embodiments of this application; Figure 5A flowchart of the comprehensive decision-making intervention stage provided in the embodiments of this application; Figure 6 This application provides an overall architecture diagram of a large model-generated content real-time alignment system based on dynamic value anchors, as shown in the embodiments of this application. Figure 7 This is a schematic diagram of the structure of a storage medium provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0034] In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified. All directional indications (such as up, down, left, right, front, back, top, bottom, etc.) in the embodiments of this application are only used to explain the relative positional relationships and movement of the components in a specific posture (as shown in the figures). If the specific posture changes, the directional indication will also change accordingly. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or IoT terminal that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or IoT terminals.

[0035] Furthermore, the reference to "embodiment" herein means that a particular feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The appearance of this phrase in various places throughout the specification does not necessarily refer to the same embodiment, nor is it a separate or alternative embodiment mutually exclusive with other embodiments. It will be explicitly and implicitly understood by those skilled in the art that the embodiments described herein can be combined with other embodiments.

[0036] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0037] like Figure 1 , 3 As shown, this invention provides a method for real-time alignment of content generated from large models based on dynamic value anchors, including the following steps: S1. Receive and store anchor point configuration, providing vectorized anchor points; S2. The user inputs to start the large model inference engine and begins generating content token by token. S3. Determine whether the generated content meets the preset evaluation trigger conditions. If so, trigger periodic evaluation; otherwise, return to the large model inference engine to continue generating content. S4. The periodic evaluation calculates and outputs a comprehensive score based on the generated content; S5. Determine whether the comprehensive score meets the intervention conditions. If yes, trigger comprehensive decision intervention; otherwise, return to the large model inference engine to continue generating content. S6. The comprehensive decision-making intervention determines the degree of deviation based on the comprehensive score, selects an intervention strategy, and outputs a return intervention instruction. S7, the large model inference engine receives intervention instructions and executes intervention actions.

[0038] Furthermore, the large model inference engine employs a standard Transformer decoder, setting anchor injection points (every N tokens or every sentence) during the generation process. After the user inputs content, the large model inference engine is launched, and the model begins generating token by token, caching the generated content.

[0039] As a preferred technical solution of the present invention, such as Figure 2 As shown, step S1 specifically includes: S11. Receive the set of value anchor points input by the user, the format of which includes anchor point ID, anchor point description and threshold; S12. The anchor point description is processed using vectorization. An embedding model is called to convert the anchor point description text into a vector. The embedding model is a general text embedding model. S13. Store the vector in the anchor index library and provide a list of anchor points for subsequent calculations.

[0040] Furthermore, anchors are predefined value constraints. Users pass in a set of value anchors through the API interface, and each anchor contains three elements: Anchor ID: A unique identifier; Anchor description: Natural language text, such as "Does not contain violent content"; Threshold: A value between 0 and 1, representing the required degree of matching.

[0041] Example anchor: AP-001, "Does not contain violent content", 0.85. The system automatically vectorizes and stores the anchor description text upon receipt.

[0042] This invention also designs a layered anchor architecture, dividing anchors into global anchors (effective in all scenarios) and local anchors (effective in specific scenarios). Global anchors are preloaded, while local anchors are loaded on demand, reducing real-time matching overhead.

[0043] As a preferred technical solution of the present invention, the preset evaluation triggering condition is: whenever the generated content reaches a preset granularity, including every 10 tokens, every completed sentence, or a custom condition, a periodic evaluation is triggered.

[0044] As a preferred technical solution of the present invention, such as Figure 4 As shown, step S4 specifically includes: S41. The generated content is fed into the quality evaluator and the alignment evaluator for parallel computation. When the application scenario does not have high requirements for the quality of the generated content, but has strict requirements for value alignment, the quality evaluator can be removed and only the alignment evaluator can be kept (set to a lightweight version). S42. The quality evaluator calculates the perplexity of the generated content and outputs a quality score, reflecting the fluency of the content. The perplexity is normalized and takes a value of 0-1, with a higher value indicating better fluency. S43. The alignment evaluator calculates the cosine similarity between the generated content and each anchor vector in the anchor index library, and takes the lowest score (the strictest standard) among all anchors as the alignment score, with a value of 0-1, reflecting the degree of matching between the content and the value standard. S44. Calculate and output the overall score: Overall score = α × quality score + β × alignment score.

[0045] Furthermore, α and β are weighting coefficients that satisfy α+β=1. The default recommended values ​​are α=0.3 and β=0.7 (alignment priority). These values ​​can also be dynamically adjusted according to the application scenario, without limiting their specific values.

[0046] This invention employs a dual-path evaluation mechanism that simultaneously assesses the alignment between quality and value. The quality score and alignment score are calculated in parallel and weighted together as the basis for decision-making. The evaluation is periodically triggered during the reasoning process, and different processing strategies are selected based on the evaluation results to intervene in the generation process in real time.

[0047] As a preferred embodiment of the present invention, the intervention conditions are as follows: If the overall score is greater than or equal to the anchor threshold, return to the large model inference engine to continue generating content; If the overall score is less than the anchor threshold, a comprehensive decision-making intervention will be triggered.

[0048] As a preferred technical solution of the present invention, such as Figure 5 As shown, step S6 specifically involves: classifying the comprehensive score into three intervention strategies based on the degree of deviation from the anchor threshold, and outputting the corresponding intervention instructions: Mild intervention: Triggered when the overall score is below the threshold but above 0.5 times the threshold. The intervention action is to adjust the sampling parameters, including lowering the temperature and increasing the top-p, to make the generation more conservative. Moderate intervention: Triggered when the overall score is below 0.5 times the threshold but above 0.2 times the threshold. The intervention action is to directly modify the probability distribution of the token during the decoding stage or inject a guiding token into the decoder to guide the subsequent generation direction. The guiding token includes a safe guiding token or a neutral tone token, such as "Please continue in a safe way". Severe intervention: Triggered when the overall score is below 0.2 times the threshold, the intervention action is to terminate generation and return the preset safety response.

[0049] Furthermore, during moderate intervention, when injecting a guiding token into the decoder, the injection position is chosen to be the end of the currently generated sequence, appending the guiding token to the input sequence, and the model continues to generate based on the new sequence. When the intervention action directly modifies the probability distribution of the token during the decoding stage, the anchor matching degree is used as the bias term of logits: logits' = logits + λ × anchor_bias.

[0050] As a preferred embodiment of the present invention, it further includes a feedback closed-loop acquisition step: S8. In order to dynamically adjust the anchor point threshold in the future, the content collected through the feedback closed loop is recorded in the log. The collected content includes the evaluation timestamp, generated content, quality score, alignment score, comprehensive score, intervention instructions, current anchor point version and periodic content of evaluation results. The collection timing includes each time a periodic evaluation is triggered, after the calculation is completed, and before decision intervention, etc.

[0051] like Figure 6 As shown, the present invention also provides a real-time alignment system for large model-generated content based on dynamic value anchors, comprising: Anchor Management Module: Receives anchor configurations, performs vectorization processing and storage, provides an anchor list for evaluation purposes; can interact with users, the large model inference engine, the dual-path evaluation module, and the log module. Large model inference engine: used to perform token-level generation, trigger periodic evaluations according to preset conditions, and execute intervention actions according to intervention decision instructions; it can interact with the anchor management module, dual-path evaluation module, intervention decision module, and log module; Dual-path evaluation module: used to calculate quality score and alignment score, and output a comprehensive score; it can interact with the large model inference engine, anchor management module, intervention decision module and log module. Intervention Decision Module: Used to select mild, moderate or severe intervention strategies based on the degree of deviation between the comprehensive score and the threshold, and output intervention instructions; it can interact with the dual-path evaluation module, the large model inference engine and the log module; Log module: Used to collect and record periodic content including evaluation timestamps, generated content, quality score, alignment score, overall score, intervention instructions, anchor changes, current anchor version, and evaluation results, for subsequent analysis and anchor threshold adjustment; can interact with all other modules.

[0052] Furthermore, the anchor management module interacts with users via API, providing an anchor list for the large model inference engine and vectors for the dual-path evaluation module, while the logging module records its changes. The anchor management module includes an anchor definition module, an anchor index library, and a dynamic loader. The anchor definition module is responsible for receiving externally input value anchors, dynamic anchor management, multi-tenant isolation, intervention strategy configuration, and audit logs; the anchor index library is responsible for vectorized storage, supporting input from external APIs and also supporting system-preset general anchors (such as "does not contain violent content"); the dynamic loader is responsible for online configuration, taking effect within seconds.

[0053] The dual-path evaluation module consists of two sub-modules: a quality evaluator and an alignment evaluator. The quality evaluator is responsible for calculating the perplexity of the generated content and outputting a quality score, which reflects the fluency of the content. The alignment evaluator is responsible for calculating the cosine similarity between the generated content and each anchor vector, taking the lowest score among all anchors as the alignment score, which reflects the degree of matching between the content and the value standard. The two sub-modules are calculated in parallel, and the output results are aggregated and then weighted and fused by the intervention decision module for hierarchical judgment.

[0054] This invention employs a pluggable modular design: the system provided by this invention can be decoupled from large models, dynamically loading anchor point configurations via API interfaces without modifying model weights. This invention also optimizes edge deployment by quantizing and compressing the dual-path evaluation module and deploying it to edge devices, achieving localized real-time alignment without requiring cloud access.

[0055] The repeated content describing the real-time alignment system and method for generating large models based on dynamic value anchors provided by this invention is omitted here.

[0056] like Figure 7 As shown, the present invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the real-time alignment method for large model generation content based on dynamic value anchors as described in any of the preceding claims.

[0057] like Figure 8 As shown, the present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the real-time alignment method for large model generation content based on dynamic value anchors as described in any of the preceding claims.

[0058] The innovation of this invention lies in its adoption of a dynamic anchor injection mechanism, a dual-path parallel evaluation architecture, a periodic triggering mechanism, hierarchical intervention decision logic, and a pluggable modular anchor system. During inference, value anchor constraints are injected into the decoder at non-fixed locations and frequencies, rather than being processed only at the input or output ends. Dual-path parallel evaluation generates quality and value alignment for simultaneous evaluation, weighted fusion, and outputs a comprehensive score, avoiding over-intervention or missed detections caused by a single indicator. Based on the deviation of the comprehensive score, different levels of intervention strategies are adopted, such as adjusting sampling parameters, guiding token injection, and terminating generation. This invention also achieves vectorized storage and matching of anchors, converting natural language anchor descriptions into vectors and achieving fuzzy matching through similarity calculation, replacing hard-coded rules.

[0059] The following detailed application scenario examples further illustrate the solution of the present invention: Example (Customer Service Robot Scenario) Preset anchor point: AP-001, "Does not contain violent content", threshold 0.85; AP-002, "Maintain a professional tone", threshold 0.75; The user entered: "I have a problem I want to complain about."

[0060] First assessment: The message "Hello, what problem are you encountering?" has been generated.

[0061] Quality score 0.92, alignment score 0.88, overall score 0.90 ≥ threshold.

[0062] Result: Continue generating.

[0063] Second assessment: The message "We apologize for the poor experience..." has been generated.

[0064] Quality score 0.89, alignment score 0.86, overall score 0.87 ≥ threshold.

[0065] Result: Continue generating.

[0066] Third assessment: Some of the generated content has deviated from the "professional tone" anchor point.

[0067] Alignment score 0.68, overall score 0.72 < threshold and ≥ 0.5 times threshold.

[0068] Result: Triggered moderate intervention, injected the pilot token "[Keep a professional tone]".

[0069] Follow-up assessment: The alignment score rose back to 0.82, normal generation resumed, and a complete response was returned.

[0070] The present invention is further compared with existing technologies and application scenarios, as shown in the table below:

[0071] In summary, the technical solution of this invention adopts the following process: "User → Anchor point management system (configure anchor points) → Large model inference engine (generate) → Periodic call to the dual-path evaluation module → Evaluation module reads the anchor point library to calculate the matching degree → Returns the comprehensive score → Inference engine decision intervention." By introducing dynamic anchor point injection and a dual-path evaluation mechanism during the inference process, value alignment is transformed from "post-event inspection" to "process control," providing greater flexibility and interpretability while ensuring real-time performance. Specifically, it embodies the following technical advantages: Real-time performance: Value assessment and intervention are performed on a token-by-token or sentence-by-sentence basis during the generation process, without waiting for the complete output.

[0072] Dynamism: Value anchors can be configured online without retraining the model, and take effect in seconds.

[0073] Pluggability: Deployed as independent modules, adaptable to any existing large model.

[0074] Verifiability: Provides aligned metrics that are auditable and traceable.

[0075] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the specific details described above. The above description is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features of this application.

[0076] The above are merely preferred embodiments of this application and are not intended to limit the scope of this application. Any modifications or equivalent substitutions made within the spirit and principles of this application shall be included within the protection scope of this application.

[0077] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.

Claims

1. A method for real-time alignment of content generated from a large model based on dynamic value anchors, characterized in that, Including the following steps: S1. Receive and store anchor point configuration; S2. The user inputs to start the large model inference engine and begins generating content token by token. S3. Determine whether the generated content meets the preset evaluation trigger conditions. If so, trigger periodic evaluation; otherwise, return to the large model inference engine to continue generating content. S4. The periodic evaluation calculates and outputs a comprehensive score based on the generated content; S5. Determine whether the comprehensive score meets the intervention conditions. If yes, trigger comprehensive decision intervention; otherwise, return to the large model inference engine to continue generating content. S6. The comprehensive decision-making intervention determines the degree of deviation based on the comprehensive score, selects an intervention strategy, and outputs a return intervention instruction. S7, the large model inference engine receives intervention instructions and executes intervention actions.

2. The method for real-time alignment of large model generated content based on dynamic value anchors according to claim 1, characterized in that, Step S1 specifically involves: S11. Receive the set of value anchor points input by the user, the format of which includes anchor point ID, anchor point description and threshold; S12. The anchor point description is processed using vectorization. An embedding model is called to convert the anchor point description text into a vector. The embedding model is a general text embedding model. S13. Store the vector in the anchor index library and provide a list of anchor points for subsequent calculations.

3. The method for real-time alignment of large model generated content based on dynamic value anchors according to claim 1, characterized in that, The preset evaluation trigger condition is as follows: whenever the generated content reaches a preset granularity, including every 10 tokens, every completed sentence, or a custom condition, a periodic evaluation is triggered.

4. The method for real-time alignment of large model generated content based on dynamic value anchors according to claim 1, characterized in that, Step S4 specifically involves: S41. The generated content is fed into the quality evaluator and the alignment evaluator for parallel computation. When the application scenario does not have high requirements for the quality of the generated content, but has strict requirements for the value alignment, the quality evaluator can be removed and only the alignment evaluator can be retained. S42. The quality evaluator calculates the perplexity of the generated content and outputs a quality score, reflecting the fluency of the content. S43. The alignment evaluator calculates the cosine similarity between the generated content and each anchor vector, and takes the lowest score among all anchors as the alignment score, reflecting the degree of matching between the content and the value standard. S44. Calculate and output the overall score: Overall score = α × quality score + β × alignment score.

5. The method for real-time alignment of large model generated content based on dynamic value anchors according to claim 1, characterized in that, The intervention conditions are as follows: If the overall score is greater than or equal to the anchor threshold, return to the large model inference engine to continue generating content; If the overall score is less than the anchor threshold, a comprehensive decision-making intervention will be triggered.

6. The method for real-time alignment of large model generated content based on dynamic value anchors according to claim 1, characterized in that, Step S6 specifically involves: classifying the overall score into three intervention strategies based on the degree of deviation from the anchor threshold, and outputting the corresponding intervention instructions: Mild intervention: Triggered when the overall score is below the threshold but above 0.5 times the threshold. The intervention action is to adjust the sampling parameters, including lowering the temperature and increasing the top-p, to make the generation more conservative. Moderate intervention: Triggered when the overall score is below 0.5 times the threshold but above 0.2 times the threshold. The intervention action is to directly modify the probability distribution of the token during the decoding stage or inject a guiding token into the decoder to guide the subsequent generation direction. The guiding token includes a security guiding token or a neutral tone token. Severe intervention: Triggered when the overall score is below 0.2 times the threshold, the intervention action is to terminate generation and return the preset safety response.

7. The method for real-time alignment of large model generated content based on dynamic value anchors according to claim 1, characterized in that, It also includes a feedback closed-loop data collection step: S8. In order to dynamically adjust the anchor point threshold in the future, the content collected through the feedback closed loop is recorded in the log. The collected content includes the evaluation timestamp, generated content, quality score, alignment score, comprehensive score, intervention instructions, current anchor point version, and periodic content of evaluation results.

8. A real-time content alignment system for large-scale model generation based on dynamic value anchors, characterized in that, include: Anchor point management module: used to receive anchor point configurations, perform vectorization processing and storage, and provide an anchor point list for evaluation purposes; Large model inference engine: used to perform token-level generation, trigger periodic evaluations according to preset conditions, and execute intervention actions according to intervention decision instructions; Dual-path evaluation module: Includes a quality evaluator and an alignment evaluator, used to calculate the quality score and alignment score respectively, and outputs a comprehensive score; Intervention decision module: Used to select mild, moderate or severe intervention strategies based on the degree of deviation between the comprehensive score and the threshold, and output intervention instructions; Log module: Used to collect and record periodic content including evaluation timestamps, generated content, quality score, alignment score, overall score, intervention instructions, current anchor version, and evaluation results, for subsequent analysis and anchor threshold adjustment.

9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the real-time alignment method for large model generation content based on dynamic value anchors as described in any one of claims 1 to 7.

10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the real-time alignment method for large model generation content based on dynamic value anchors as described in any one of claims 1 to 7.