Training method and device for oracle single-character image reasoning task

By optimizing the training scheme through multi-task collaboration, and combining a multimodal large model and a reward function, the problem of recognizing and interpreting single-character images of oracle bone inscriptions was solved, achieving structured and interpretable interpretation of oracle bone inscriptions, and improving the model's ability to understand and reason about complex characters.

CN120997850AActive Publication Date: 2025-11-21HUAZHONG UNIV OF SCI & TECH

Patent Information

Application Number
CN202510902031.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2025-06-09
Filing Date
2025-07-01
Publication Date
2025-11-21
Estimated Expiration
2045-07-01

AI Technical Summary

Technical Problem

Existing technologies are ineffective in recognizing and interpreting single-character images of oracle bone inscriptions, especially in complex character formation logic and semantic reasoning. General multimodal large models lack applicability, and existing methods rely on limited labeled data, which is difficult to meet the rigorous requirements of scientific research and cultural applications.

Method used

A training scheme employing a multimodal large model and multi-task collaborative optimization is adopted. By training the backbone network, the model is used to perform Chinese character recognition of oracle bone script single-character images, decomposition of modern Chinese character radicals, identification of script period, oracle bone script image recognition, multi-image sentence recognition, and character shape thinking chain reasoning. This gradually improves the model's understanding and interpretation capabilities. Fine-grained tuning is performed through the reward function to generate structured output.

Benefits of technology

It significantly improves the model's ability to interpret single oracle bone script characters, generates structured and interpretable outputs, adapts to the understanding and reasoning of complex oracle bone script characters, and provides a low-cost, automated solution for interpreting oracle bone script characters.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120997850A_ABST
    Figure CN120997850A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of oracle paraphrasing, and provides a training method and device for an oracle single-character image reasoning task. According to the method, a backbone network is trained to perform Chinese character recognition, modern Chinese character radical splitting, literal period identification and recognition, oracle-bone image recognition, oracle-bone multi-graph statement recognition, oracle-bone character meaning evolution analysis and font thinking chain reasoning on single-character images; calculating a joint loss value according to the primary output, the intermediate output and the advanced output obtained by training so as to iteratively update network parameters of the backbone network, and obtaining an intermediate model until the joint loss value meets a training ending condition; and training the intermediate model to perform font thinking chain reasoning, and finely adjusting the intermediate model by using a reward function to obtain a target model, thereby solving the problem that the oracle single-character image is difficult to accurately identify, infer and explain.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of oracle bone script interpretation, in particular to a training method and device for oracle bone script single character image reasoning tasks. BACKGROUND

[0002] Oracle bone script is one of the earliest writing systems in ancient China, with high historical and linguistic value. Due to the variability of oracle bone script forms, the incompleteness of strokes, and the lack of modern corresponding information, its interpretation has long relied on expert manual comparison, literature research, and subjective judgment, which is not only inefficient but also difficult to meet the interpretation needs of unbroken oracle bone script. With the development of artificial intelligence technology, some studies have attempted to use image recognition and deep learning models to recognize or classify oracle bone script, and some methods use radical matching and combination as well as character shape diffusion generation to recognize or decipher oracle bone script. However, these methods mostly rely on limited labeled data and can only perform static matching on known oracle bone script, making it difficult to handle complex character construction logic and semantic reasoning, and even more difficult to extend to the interpretation of unknown oracle bone script.

[0003] Although general multi-modal large models have shown strong understanding and generation capabilities in image-text tasks, they are not suitable for the highly specialized task of oracle bone script interpretation. The main reasons include: difficulty in accurately modeling stroke details and character construction rules; prone to "hallucination" when dealing with few-shot and unknown character shapes, resulting in output content lacking semantic interpretability and historical credibility, making it difficult to meet the rigorous requirements of research and cultural application scenarios.

[0004] Therefore, it is urgent to overcome the defects of the prior art in the technical field. SUMMARY

[0005] The technical problem to be solved by the present application is to provide a training method and device for oracle bone script single character image reasoning tasks, which aims to provide a training scheme based on multi-modal large models and multi-task collaborative optimization, and to analyze the oracle bone character shape structure in the single character image and understand the character construction rules by training the backbone network, so that the target model can interpret oracle bone script from single character images, solving the problem of inaccurate recognition, inference, and interpretation of oracle bone script single character images in the prior art.

[0006] The present application adopts the following technical solutions: In a first aspect, the present application provides a training method for oracle bone script single character image reasoning tasks, comprising: training a large language model in the backbone network to perform Chinese character recognition and modern Chinese character radical decomposition on the single character image, to obtain a primary output and primary parameters; Based on the primary parameters, the backbone network is trained to perform character period identification, oracle image recognition, oracle multi-image sentence recognition, and oracle character meaning evolution analysis on the at least one single-character image, to obtain a middle-level output and middle-level parameters; Based on the middle-level parameters, the backbone network is trained to perform character form thinking chain reasoning on the single-character image, to obtain a high-level output and high-level parameters; A joint loss value is calculated according to the primary output, the middle-level output, and the high-level output; the primary parameters, the middle-level parameters, and the high-level parameters are iteratively updated according to the joint loss value until the joint loss value meets a training end condition, to obtain an intermediate model; The intermediate model is trained to perform character form thinking chain reasoning on the single-character image, and a reward function is used to fine-tune network parameters of the intermediate model according to an output of the intermediate model, to obtain a target model.

[0007] Further, the training of the backbone network to perform character form thinking chain reasoning on the single-character image based on the middle-level parameters includes: The label <think>, tags <answer>, tags <prediction>and tags <another>determining a special token; constructing a formatting template using the special token and a corresponding result parameter; inputting the formatting template and the single-word image into a backbone network, training the backbone network to perform stroke thought chain reasoning on the single-word image using the intermediate parameters, and generating a parameter output corresponding to the result parameter according to the formatting template to obtain a high-level output.

[0008] Further, the training of the intermediate model to perform stroke thought chain reasoning on the single-word image includes: constructing a plurality of structured paragraphs using the special token and the corresponding result parameter to generate a formatting template; inputting the single-word image and the formatting template into the intermediate model to obtain a formatted output; calculating a combined reward value of the formatted output according to a reward function; calculating a policy function value using the combined reward value; iteratively optimizing the intermediate model according to the policy function value until the policy function value satisfies a reinforcement end condition, and determining the intermediate model after the iteration optimization as the target model.

[0009] Further, the calculating of the combined reward value of the formatted output according to the reward function includes: determining a format specification reward according to a completeness of the plurality of structured paragraphs and a nesting order of the special token in the formatted output; in the formatted output, the label <think>corresponding parameter output and the label <answer>a semantic similarity between the corresponding parameter outputs, determined as a semantic similarity reward; when the label in the formatted output is <prediction>When the corresponding parameter output is consistent with the reference answer, the reward value is determined as a prediction accuracy reward; when the label <prediction>determining a non-reward value as the prediction accuracy reward when the corresponding parameter output is inconsistent with the reference answer; determining a difference between the actual token number of the formatted output and the preset maximum length as an output difference value; when the output difference value is greater than zero, determining the output difference value as a comparison length, and determining the inverse of the ratio of the comparison length to the preset maximum length as the length control reward; when the output difference value is less than or equal to zero, determining zero as the length control reward; determining a weighted sum of the format specification reward, the semantic similarity reward, the prediction accuracy reward and the length control reward as a combined reward value, so as to calculate the combined reward value according to a reward function.

[0010] Further, the expression of the policy function value is:

[0011] wherein, represents the probability distribution of all single-character images, represents the probability of occurrence of each single-character image; is the intermediate model at the last iteration for a given single-character image, a candidate output, is the i th single-character image, is the i th token in the candidate output of the i th single-character image, is the i th token in the candidate output of the i th single-character image, is the KL divergence between the current formatted output and the reference output is the advantage function value, which is calculated based on the combined reward value.

[0012] Further, Chinese character recognition and modern Chinese character radical decomposition are both primary sub-tasks, character period identification recognition, oracle bone script image recognition, oracle bone script multi-image sentence recognition and oracle bone script semantic evolution analysis are all intermediate sub-tasks, and character form thinking chain reasoning is a high-level sub-task. The joint loss value is calculated according to the primary output, the intermediate output and the high-level output; the primary parameters, the intermediate parameters and the high-level parameters are iteratively updated according to the joint loss value until the joint loss value meets the training end condition, so as to obtain the intermediate model, which comprises: obtaining the corresponding labels of the single-character image in each of the primary sub-tasks, the intermediate sub-tasks and the high-level sub-tasks; comparing the labels with the corresponding primary output, intermediate output or high-level output to calculate the loss function value of the corresponding sub-task; ​A weighted sum of loss function values of all the sub-tasks is determined as a multi-task cooperative loss; and the primary parameters, the intermediate parameters and the high-level parameters are iteratively updated according to the multi-task cooperative loss to obtain an intermediate model.

[0013] Further, when calculating the loss function value of the high-level sub-task, the comparing the label with the corresponding primary output, intermediate output or high-level output to calculate the loss function value of the corresponding sub-task comprises: comparing the label of the high-level sub-task with the high-level output to obtain a label <prediction>a raw loss of a corresponding character token, and a character loss of the remaining tokens in the high-level output; determining a sum of the raw loss and the character loss by a preset multiple as a loss function value of the high-level subtask.

[0014] Further, the joint loss value is calculated according to the primary output, the intermediate output and the high-level output; the primary parameters, the intermediate parameters and the high-level parameters are iteratively updated according to the joint loss value until the joint loss value meets a training end condition, and an intermediate model is obtained. Each of the primary subtask, the intermediate subtask and the high-level subtask is trained according to a decay expression respectively; the decay expression is:

[0015] wherein, a current learning rate, a predetermined learning rate, a total number of iterations for training the corresponding subtask.

[0016] In a second aspect, the present application further provides a training device for an oracle single character image inference task, comprising: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the processor to execute the training method for the oracle single character image inference task according to the first aspect.

[0017] In a third aspect, the present application further provides a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the training method for the oracle single character image inference task according to the first aspect.

[0018] In a fourth aspect, a computer program product containing instructions is provided, and when the instructions are run on a computer or a processor, the computer or the processor executes the training method for the oracle single character image inference task according to the first aspect.

[0019] In a fifth aspect, the present application further provides a training system for an oracle single character image inference task, which comprises the training device for the oracle single character image inference task according to the second aspect, and uses the training method for the oracle single character image inference task according to the first aspect to complete the interaction of the training device for the oracle single character image inference task according to the second aspect.

[0020] Compared with the prior art, the present application has at least the following beneficial effects: The application trains the main network to analyze single character images, divides the oracle bone script interpretation task into multiple subtasks, trains in stages from low to high according to the task complexity, simulates the process from easy to difficult when human beings learn ancient characters, the primary stage only trains the large language model in the main network to perform Chinese character recognition and modern Chinese character radical decomposition on single character images, the intermediate stage adds the character period identification recognition subtask, the oracle bone image recognition subtask, the oracle bone multi-image sentence recognition subtask and the oracle bone character meaning evolution analysis subtask on the basis of the primary stage, significantly improves the understanding, reasoning and interpretation ability of the model to complex oracle bone character forms by sharing the network parameters of each subtask in the training process, and makes the model output have interpretability. Finally, the glyph thinking chain reasoning subtask is introduced in the advanced stage, so that the intermediate model generates structured output. And the intermediate model is fine-tuned based on the reward function to obtain the target model. An automatic solution with structured and low cost is provided for oracle bone interpretation. BRIEF DESCRIPTION OF DRAWINGS

[0021] In order to more clearly illustrate the technical solutions of the embodiments of the application, the following will briefly introduce the drawings needed to be used in the embodiments of the application. Obviously, the drawings described below are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.

[0022] Figure 1 is a flowchart of a training method for an oracle bone single character image reasoning task provided by the embodiments of the application; Figure 2 is a specific example diagram of an oracle bone interpretation subtask provided by the embodiments of the application; Figure 3 is a training flowchart provided by the embodiments of the application; Figure 4 is a flowchart of step 30 provided by the embodiments of the application; Figure 5 is a specific example diagram of a training strategy provided by the embodiments of the application; Figure 6 is a flowchart of step 40 provided by the embodiments of the application; Figure 7 is a flowchart of step 401 provided by the embodiments of the application; Figure 8 is a flowchart of step 50 provided by the embodiments of the application; Figure 9 is a flowchart of step 503 provided by the embodiments of the application; Figure 10 The figure is a schematic diagram of an architecture of a training device for an Oracle single-character image reasoning task provided by an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and should not be used to limit the present application.

[0024] Unless otherwise required by context, the term "include" is to be interpreted as open inclusion, i.e. "include, but not limited to". In the description of the specification, the terms "one embodiment", "some embodiments", "exemplary embodiments", "example", "specific example" or "some examples" are intended to mean that the specific features, structures, materials or characteristics related to the embodiment or example include in at least one embodiment or example of the present disclosure. The illustrative representation of the above terms does not necessarily mean the same embodiment or example. In addition, the specific features, structures, materials or characteristics described can be included in any one or more embodiments or examples in any appropriate manner, i.e. although they are carried by the embodiments or examples of the above terms due to the order of appearance and location, they are not limited to being carried by one embodiment or example in a combined manner.

[0025] In the description of the present application, it should be understood that the terms "center", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, and are only used to facilitate the description of the present disclosure and simplify the description, and therefore cannot be understood as indicating or implying that the device or element referred to must have a particular orientation, be constructed and operated in a particular orientation, and therefore cannot be understood as limiting the present disclosure.

[0026] In the description of the present application, the terms "first", "second" are only for description purpose, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated. Therefore, the features limited by "first", "second" can be explicitly or implicitly included one or more of the features. In the description of the embodiments of the present disclosure, unless otherwise specified, the meaning of "multiple" is two or more. In addition, for example, in the description, the same type of nouns can also be described as two independent individuals by adding "A", "B" at the end, in which case the features limited by "A", "B" are only used for the purpose of distinguishing the same type of individual description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the technical features indicated.

[0027] In describing some embodiments, the use of "coupled" or "coupling" and variations thereof can be used. For example, these terms can be used to indicate that two or more elements are in direct physical or electrical contact with one another. As used herein, the term "coupled" can also mean that two or more elements are not in direct contact with one another, but yet still co-operate or interact with one another. The embodiments disclosed herein are not necessarily limited in terms of the manner in which the various elements are coupled together.

[0028] In the description of the application, the expression "A and / or B" (wherein A and B represent a specific feature content in the form) includes the following three combinations: only A, only B, and the combination of A and B.

[0029] As used herein, the terms "about," "approximately," or "substantially" include the recited value and the average value within an acceptable range of deviation from the specified value, as determined by one of ordinary skill in the art considering the measurement in question and the error in measuring the particular quantity (i.e., the limitations of the measurement system).

[0030] In addition, the technical features involved in each embodiment of the application described below can be combined with each other as long as there is no conflict.

[0031] Embodiment 1: To solve the above problems, as shown in the technical scheme of the present application, an embodiment of the present application provides a training method for an oracle single character image inference task, comprising: Figure 1 Step 10: training a large language model in the backbone network to perform Chinese character recognition and modern Chinese character radical decomposition on the single character image, to obtain a primary output and a primary parameter.

[0032] The single character image is an oracle single character image. The backbone network includes a visual encoder and a large language model (LLM for short), and the backbone network is a model with an initialized network structure.

[0033] The training method for the oracle single character image inference task of the embodiment of the present application aims to train a pre-training model in combination with a multi-task cooperative optimization mechanism, to obtain a multi-modal large model for oracle interpretation. In order to achieve this goal, as shown in the technical scheme of the present application, the training method for the oracle single character image inference task comprises the following steps: Figure 2 ​As shown, the training is carried out from easy to difficult by simulating the cognitive way of human learning ancient characters; specifically, the model learns oracle bone script interpretation through learning of seven sub-tasks, and the seven sub-tasks are respectively: Chinese character recognition, modern Chinese character radical disassembly, character period identification and recognition, oracle bone script image recognition, oracle bone script multi-image sentence recognition, oracle bone character meaning evolution analysis and oracle bone script single character form thinking chain reasoning. Among them, the Chinese character recognition sub-task is: single character recognition of modern Chinese characters in a single character image; Figure 2 In the middle The "label" indicates that a single character image is inserted at this position. Modern Chinese character radical disassembly. The modern Chinese character radical disassembly sub-task is: for the single character recognized from the single character image, determine the radicals that can be disassembled. The character period identification and recognition sub-task is: identify the oracle bone script single character from the single character image, and classify the font style and period, the font style and period including: gold script, spring and autumn characters, warring states characters, clerical script, large seal script, small seal script, etc. The oracle bone script image recognition sub-task is: identify the oracle bone script single character from the single character image, and determine the modern Chinese character corresponding to the oracle bone script single character. The oracle bone script multi-image sentence recognition sub-task is: identify the corresponding modern Chinese characters from multiple single character images, and determine the sentence composed of the modern Chinese characters. The oracle bone character meaning evolution analysis sub-task is: according to the oracle bone script single character in the single character image, determine the process of evolving to the corresponding modern Chinese character. The oracle bone script single character form thinking chain reasoning sub-task is: integrate the structured output based on the above tasks, and the process and structured output will be described below.

[0034] To realize the training of the seven sub-tasks, the training scheme of the embodiment of the present application is: using the same backbone network to train the seven sub-tasks; one-stage training of the backbone network learns simple tasks, two-stage training of the backbone network learns slightly complex tasks, and three-stage training of the backbone network learns to generate structured output. Specifically, as shown in Figure 3 In the middle Figure 3 The multi-task curriculum learning module, the embodiment of the present application realizes the training of the seven sub-tasks in three stages of "primary, intermediate and advanced", and the tasks gradually transition from basic recognition to form evolution modeling and structured interpretation generation.

[0035] To simulate the process of human learning ancient characters and ensure that the model gradually masters multi-level abilities from basic knowledge to complex interpretation, the present application adopts a curriculum learning strategy, and the entire training process is divided into three stages in general: 1) Primary: Chinese character recognition, modern Chinese character component disassembly; during training, by freezing the network parameters of the visual encoder in the backbone network, only the network parameters of the large language model are trained, the language generation part is stabilized, the vocabulary of the network model is expanded, and the basic model recognition ability is constructed. The essence of freezing the network parameters of the visual encoder is not to calculate the gradient of the visual encoder, and the specific implementation mode is selected by a person skilled in the art according to the specific use scene, which is not limited here. In the primary stage, the single character image is first input into the visual coding module to extract stroke and structure features.

[0036] 2) Intermediate: Text period identification and recognition, oracle bone script image recognition, oracle bone script multi-image sentence recognition, and oracle bone script semantic evolution analysis. In the intermediate stage, the visual encoder is gradually unfrozen, and the entire network model is comprehensively trained (i.e., the network parameters of any part of the backbone network are not frozen), the goal is to improve the model's ability to jointly model oracle bone script images and texts of various periods.

[0037] 3) Advanced: Oracle bone script single character form thinking chain reasoning; the main purpose of the advanced stage is to fine-tune the network model's ability to generate oracle bone script structured single character interpretation models, and combine the character structure annotation in the primary stage, the character form evolution chain and semantic reasoning information in the intermediate stage, so that the network model can generate structured output in a specified format, realize unified reasoning structure, and ultimately realize the oracle bone script single character interpretation function.

[0038] The seven sub-tasks are optimized in a multi-task cooperative manner, and the network structure of the backbone network is shared during training; the specific network structure of the backbone network is selected by a person skilled in the art according to the specific use scene; in one embodiment, the backbone network can use the open source Qwen2.5-VL-7B model.

[0039] During the training of the seven sub-tasks, the backbone network extracts features from single character images to obtain structured visual representations. The reasoning process of the embodiment of the present application is: inputting a single character image into a visual encoder to obtain the output of the visual encoder, and then inputting the output into a large language model to obtain the final output.

[0040] Step 20: Based on the primary parameters, training the backbone network to perform text period identification and recognition, oracle bone script image recognition, oracle bone script multi-image sentence recognition, and oracle bone script semantic evolution analysis on at least one single character image, to obtain intermediate output and intermediate parameters.

[0041] The primary stage training obtains primary parameters; the network structure of the backbone network uses these primary parameters, which can have basic recognition ability to extract stroke and structure features; during the training process in the intermediate stage, based on these primary parameters, through multi-task cooperative training and curriculum learning strategy, the network model gradually masters the ability of modern Chinese character recognition, font classification, oracle bone script semantic understanding, etc.

[0042] Step 30: based on the intermediate parameters, training the backbone network to infer the character thinking chain of the single character image to obtain high-level output and high-level parameters.

[0043] The high-level stage trains the backbone network based on the intermediate parameters, and further learns the character thinking chain inference on the basis of the network model capability in the intermediate stage, and generates a structured output. The process of generating the structured output will be described below.

[0044] Step 40: calculating a joint loss value according to the primary output, the intermediate output and the high-level output; and iteratively updating the primary parameters, the intermediate parameters and the high-level parameters according to the joint loss value until the joint loss value meets a training end condition, to obtain an intermediate model.

[0045] The intermediate model is obtained by training the backbone network based on the high-level parameters. The training end condition is determined by a person skilled in the art according to the specific use scenario; in an optional embodiment, the training end condition can be that the number of iterations of training reaches a preset value, and the preset value is determined by a person skilled in the art according to the specific use scenario.

[0046] In an optional embodiment, the training of the primary stage, the intermediate stage and the high-level stage can be performed simultaneously, or can be performed separately, which is not limited herein.

[0047] The embodiment of the present application adopts a multi-task cooperative calculation joint loss value mode to optimize the primary parameters, the intermediate parameters and the high-level parameters of each subtask as a whole, and the process of calculating the joint loss value will be described below.

[0048] In an embodiment, when training each subtask in each stage, a decreasing learning rate strategy is adopted, and a temperature pre-starting strategy is used, and the preset parameter is 0.05; wherein the learning rate is linearly increased before training until a predetermined learning rate , and then decays in a cosine manner, specifically, each of the primary subtasks, the intermediate subtasks and the high-level subtasks is trained according to the decay expression; the decay expression is:

[0049] wherein, is the current learning rate, is the predetermined learning rate, is the total number of iterations for training the corresponding subtask.

[0050] According to the above steps, the gradual modeling training from easy to difficult is realized, the gradient shock and performance instability problems caused by directly training a complex task are effectively avoided, and the convergence speed and generalization ability of the model on the structured inference and interpretation generation task are improved.

[0051] Step 50: training the intermediate model to perform character image reasoning, using a reward function to fine-tune the network parameters of the intermediate model according to the output of the intermediate model, to obtain a target model.

[0052] Then the trained intermediate model is subjected to reinforcement learning. As shown in Figure 3 The right side is a human feedback reinforcement learning module, and the embodiment of the present application sets format rewards, accuracy rewards, semantic rewards and length rewards, etc. The intermediate model is guided to optimize the generation behavior through the corresponding reward function. Among them, Figure 3 As shown in the figure, the multi-task curriculum learning and human feedback reinforcement learning are both training means. Through the training based on reinforcement learning, a target model is finally obtained, which has the abilities of character structure understanding, character form evolution modeling and structured inference output. It can not only automatically analyze the character structure of oracle bone characters in a single character image, understand the character formation rules, and accurately interpret known oracle bone texts, but also infer and generate reasonable interpretation candidate results for unknown oracle bone texts.

[0053] In an embodiment, FlashAttention, Liger Kernel and DeepSpeedZero3 Offload are used in the training process to optimize memory occupation and calculation efficiency, and to speed up the training speed of large models. In the inference stage, the visual language model inference (Visual-Language Large Model Inference, abbreviated as VLLM) is used to realize efficient batch generation, and the scene graph language (Scene Graph Language, abbreviated as SGLang) is used to build an application programming interface (Application Programming Interface, abbreviated as API) to support rapid deployment and online calling.

[0054] The application trains the backbone network to analyze single character images. By dividing the oracle bone text interpretation task into multiple subtasks, the training is divided into stages from low to high complexity, simulating the process of learning ancient characters from easy to difficult. In the primary stage, only the large language model in the backbone network is trained to recognize single character images and modern Chinese character components. In the intermediate stage, the character period identification recognition subtask, oracle bone image recognition subtask, oracle bone multi-image sentence recognition subtask and oracle bone character meaning evolution analysis subtask are added on the basis of the primary stage. Through the sharing of network parameters of each subtask during the training process, the understanding, reasoning and interpretation ability of the model for complex oracle bone character forms is significantly improved, and the model output has interpretability. Finally, the glyph thinking chain reasoning subtask is introduced in the advanced stage, so that the intermediate model generates structured output. Based on the reward function, the intermediate model is fine-tuned in fine granularity to obtain the target model. An automatic solution with structured and low cost is provided for oracle bone interpretation.

[0055] In the prior art, the general multi-modal large model is not suitable for the oracle bone interpretation task for the following reasons: lack of high-quality oracle bone text training data. As shown in the following table, the embodiment of the application uses Internet public data and automatically generated structured interpretation samples to construct multi-task training data as the training set of the above seven subtasks. Figure 3 Figure 3 The left side is the source of oracle bone data, including Internet open source database, open source oracle bone character evolution data set (EVolution Oracle Bone Characters, abbreviated as EVOBC), self-constructed image data, and structured interpretation content generated by multi-language large models (such as GPT-4o model, Gemini model). Unified into a multi-task training data set.

[0056] The multi-task training data includes multiple heterogeneous data subsets, each corresponding to a different subtask and integrated using a unified annotation system. The modern Chinese character component splitting subtask uses a Chinese character splitting library to set a formatted output to split a Chinese character into different components. The Chinese character recognition subtask includes 80000 Chinese characters generated by the Kaixinsongti font library and subjected to certain image enhancement processing, finally forming a unified size of image and text training samples, which contain a large number of uncommon Chinese characters for the model to see more Chinese characters. The data of the character period identification recognition subtask is derived from the image data in the oracle bone character evolution data set (EVolution Oracle Bone Characters, abbreviated as EVOBC) and unified dialog data.

[0057] ​For the initial interpretation data of oracle bone inscriptions, the main sources are the oracle bone interpretation database publicly available on the Internet, academic papers and ancient character research databases. At the same time, since the existing public data mostly only contains oracle bone image and its corresponding Chinese characters, it lacks clear character construction logic and reasoning process text, the present application constructs long prompt to guide large language model to generate structured interpretation content. Specifically, the role of the model is clearly defined as "oracle bone expert", and the task is set as: according to the provided single character oracle bone image, question and answer, reasoning, output structured reasoning process, interpretation result and other possible interpretation candidates. The above prompt is input into Gemini 2.5Pro and GPT-4o two large language models, respectively, to generate corresponding structured interpretation content.

[0058] Then, the multi-task training data constructed and generated above are systematically screened and quality monitored, and a rule-based data filtering mechanism is adopted, mainly including the following contents: 1) Format consistency detection: For structured interpretation data, check whether it contains <think> 、 <answer> 、 <prediction> 、 <another>Four tags, and verify the label nesting order and text content match. For missing labels, label dislocation, format error samples to be rejected.

[0059] 2) Predict single word correctness verification: for label <prediction>The modern Chinese characters generated are compared with the original interpretation of the oracle bone image, and a word table comparison mechanism is used to screen out obviously incorrect, inconsistent in character form, or semantically mismatched prediction results.

[0060] 3) Low semantic data rejection: using regular expressions and keyword filtering, the English characters, meaningless pinyin, random codes, blank labels, redundant punctuation, special characters ("###", "$$$ ", "...") and other invalid fields in the sample are rejected, avoiding the learning of incorrect distribution by the model. Through the above screening mechanism, the present application effectively improves the overall quality of structured data, ensures the consistency of input samples in terms of semantics, structure and label, avoids the interference of dirty data or invalid samples in the model training process, and thus improves the stability and accuracy of the multi-task model in real reasoning tasks.

[0061] The visual encoder in the backbone network is mainly used to extract the stroke detail structure and spatial semantic features of the input oracle bone image, and is the image understanding base of the entire multi-modal interpretation.

[0062] In one embodiment, the visual encoder can use three-dimensional convolution (Convolutional 3D, abbreviated as Conv3D) as the image embedding, and its backbone is composed of 32 vision blocks (VisionBlock), which internally contains root mean square normalization (Root Mean Square Normalization, abbreviated as RMSNorm), scaled dot-product attention (Scaled Dot-Product Attention, abbreviated as SdpaAttention) module and sigmoid linear unit (Sigmoid Linear Unit, abbreviated as SiLU) activation function, and has the ability to extract features of high-resolution images. The encoder supports automatic extraction of stroke details and structural features in oracle bone character images, and is a key foundation for the model to realize the understanding ability of character structure.

[0063] Specifically, the input single character image is first encoded by image patch embedding, and three-dimensional convolution is used for image patch embedding. Its main parameters are as follows:

[0064] This module maps the original RGB image to a patch embedding representation where is the number of image patches.

[0065] The image embedding is then passed into a 32-layer visual encoding backbone network, each layer of which includes the following network structure: RMSNorm layer: used to normalize the intermediate features.

[0066] Scaled dot-product attention layer: a scalable dot-set attention mechanism that calculates the relationship between different regions of the image; its core calculation is as follows:

[0067] where Q, K and V are respectively from the linear mapping of input features . Multilayer Perceptron (MLP) layer: adopts a gated activation structure, including three layers of gate_proj, up_proj and down_proj, and uses SiLU activation function. .

[0068] In addition, the visual encoder of the embodiment of the present application also integrates a rotation position encoding and patch merging module (PatchMerger) module to enhance the model's understanding of stroke direction and spatial structure and reduce redundant features, and finally outputs a set of image representation vectors:

[0069] where, represents the overall mapping function of the visual encoder.

[0070] Through the above model initialization steps, the model obtains deep-level expression ability for oracle characters, has the ability to process complex character structure and stroke deformation, and provides a strong visual basis for subsequent structured interpretation tasks.

[0071] To ensure that the output results of the target model have a unified structure and good interpretability, the data is first formatted during the training process in the advanced stage, and multiple task-specific token special labels are added to the model tokenizer to control the network model to generate structured output. Specifically, in order to illustrate the process of generating structured output, as shown in Figure 4 , the step 30 includes: Step 301: adding a label <think>, tags <answer>, tags <prediction>and tags <another>determining a special token; constructing a formatting template using the special token and a corresponding result parameter.

[0072] wherein the label <think>As a special token, a corresponding set of special tokens and a corresponding result parameter are: <think> ,< / think> and so on. The embedding layer is trained uniformly during training.

[0073] A specific example of the formatted template is: "Q: What modern Chinese character does this oracle bone correspond to? Please reason according to the input picture. A: <think>Detailed reasoning process according to oracle bone data< / think> ; <answer>Brief description of the reasoning process< / answer> ; <prediction>Most likely modern Chinese character predicted< / prediction> ; <another>Other likely modern Chinese characters predicted< / another> ” Step 302: input the formatted template and the single-character image into the backbone network, use the intermediate parameters to train the backbone network to perform character form thought chain reasoning on the single-character image, generate parameter output corresponding to the result parameter according to the formatted template, and obtain high-level output.

[0074] As shown in Figure 3 , wherein the native token is the original token of the backbone network, and the format token is the special token. The format token is used to guide the model to strictly output four structured paragraphs, which represent the reasoning process, the conclusion summary, the main interpretation result and other alternative interpretation items. Using the formatted template ensures that the output content of the network model has complete expression of the reasoning chain, the result summary, the main prediction item and the candidate item.

[0075] To support the effective learning and use of these tokens, in one embodiment, the present application performs efficient fine-tuning on the Qwen2.5-VL-7B model based on the ms-swift framework. In addition to adding special tokens and expanding the word embedding layer according to steps 301 and 302, the training configuration also includes: setting modules_to_save as embed_tokens, lm_head and all_embedding in the low-rank adapter (Low-Rank Adaptation, abbreviated as LoRA) fine-tuning process to save the embedding layer, the language modeling head and the modules related to the learning of special tokens. Introduce low-rank matrix adjustment parameters , train the attention layers of the model: the q_proj of the visual encoder and the q_proj, v_proj of the language model, and the parameter update process is , wherein is the original frozen weight; is a learnable low-rank matrix, which only introduces a very small number of parameter update paths to improve training efficiency and maintain the original ability of the model. The ranks of the low-rank matrices in the primary, intermediate and high-level three stages are . As Figure 5 As shown, during training, the learning rate of the primary stage is 1e-4, the learning rate of the intermediate stage is 1e-5, and the learning rate of the advanced stage is 1e-6. At the same time, the system instruction is set in a targeted manner, and the model is required to output according to the format. Through the above method, the present application not only constructs an output format with stable structure, but also effectively enhances the adaptation ability of the model to structured labels and reasoning modes. In the training, the LoRA fine-tuning and human feedback reinforcement learning mechanism are fused to improve the prediction accuracy and generation consistency.

[0076] Through the above prompt structure design, combined with different character image and existing interpretation text content, the target model can generate a label <think>, tags <answer>, tags <prediction>, tags <another>structured paraphrase samples. These data provide key corpus for structured inference training of the model, and provide high-quality input sources for subsequent character logic modeling and unknown character paraphrase.

[0077] To illustrate the process of calculating the joint loss value, as shown in Figure 6 , the step 40 comprises: Step 401: Obtain the corresponding label of the single-character image in each of the primary subtask, the intermediate subtask and the high-level subtask; compare the label with the corresponding primary output, intermediate output or high-level output to calculate the loss function value of the corresponding subtask.

[0078] In the seven subtasks of the embodiment of the present application, Chinese character recognition and modern Chinese character radical decomposition are primary subtasks, character period identification, oracle bone script image recognition, oracle bone script multi-image sentence recognition and oracle bone character meaning evolution analysis are intermediate subtasks, and character form thinking chain reasoning is a high-level subtask. For each primary subtask, compare the label of the primary subtask with the corresponding primary output to calculate the loss function value of the primary subtask; each intermediate subtask and high-level subtask is similar. The way to calculate the loss function value of each subtask is selected by a person skilled in the art according to the specific use scenario; in one embodiment, the cross-entropy loss function can be used to calculate the loss function value.

[0079] Step 402: Determine the weighted sum of the loss function values of all the subtasks as the multi-task cooperative loss; update the primary parameters, the intermediate parameters and the high-level parameters iteratively according to the multi-task cooperative loss to obtain an intermediate model.

[0080] The loss function layer adopts a multi-branch architecture, and for the seven subtasks, the multi-task cooperative loss is calculated, and the overall optimization target is the weighted combination loss function:

[0081] wherein, is the loss of the i-th subtask, is its weight coefficient, and the total number of tasks is =7.

[0082] In an optional embodiment, a special scale loss is designed in the character form thinking chain reasoning, as shown in Figure 7 , in step 401, when calculating the loss function value of the high-level subtask, the comparison of the label with the corresponding primary output, intermediate output or high-level output to calculate the loss function value of the corresponding subtask comprises: Step 4011: Compare the label of the high-level subtask with the high-level output to obtain the label <prediction>The original loss of the corresponding character token, and the character loss of the remaining tokens in the high-level output.

[0083] Wherein, the remaining tokens refer to the character tokens in the high-level output except for the character token.

[0084] For all tokens in the high-level output, the loss value is calculated using the loss function; the label <prediction>The loss value of the corresponding character token is taken as the original loss, and the loss values of the remaining tokens are taken as character losses.

[0085] Step 4012: Determine the sum of the original loss and the character losses by a preset multiple as the loss function value of the high-level subtask.

[0086] wherein the preset multiple is selected by a person skilled in the art according to a specific use scenario. In an embodiment, the preset multiple can be 10; specifically, the sum of the original loss and the character losses is multiplied by 10 to obtain the loss function value of the high-level subtask. <prediciton> A< / prediciton> < / prediction> The original loss of the character token between the two is weighted by ten times, that is, the expression of the loss value of the character token is as follows:

[0087] After obtaining the intermediate model, in order to further improve the accuracy of the generated content, the structural standardization and the simplicity of the generated language of the intermediate model, and reduce the hallucination of the large model, a reinforcement learning mechanism based on human feedback is introduced, and an intra-group reward optimization strategy is used to fine-tune the model. Specifically, as shown in Figure 8 The step 50 includes: Step 501: using the special token and the corresponding result parameter to construct a plurality of structured paragraphs to generate a formatted template.

[0088] The process is the same as step 301, which will not be repeated here.

[0089] Step 502: inputting the single-character image and the formatted template into the intermediate model to obtain a formatted output.

[0090] In an embodiment, the same formatted template as in step 30 is used in step 50. Step 50 further trains the intermediate model through reinforcement learning to fine-tune its network parameters, so the single-character image and the formatted template need to be input into the intermediate model, and the network parameters of the intermediate model are iteratively optimized according to the formatted output of the intermediate model.

[0091] Step 503: calculating the combined reward value of the formatted output according to the reward function.

[0092] The embodiment of the application performs multi-dimensional quality evaluation and optimization guidance on the output results of the intermediate model through the reward function, which will be described in detail below.

[0093] Step 504: calculating the policy function value using the combined reward value.

[0094] Step 505: iteratively optimizing the intermediate model according to the policy function value until the policy function value meets the reinforcement end condition, and determining the intermediate model after the iteration optimization as the target model.

[0095] Wherein, the reinforcement end condition is determined by a person skilled in the art according to a specific use scenario; in an optional embodiment, the reinforcement end condition can be that the iteration number reaches a preset value, and the preset value is determined by a person skilled in the art according to a specific use scenario.

[0096] As shown in the human feedback reinforcement learning phase of step 50, in step 502, the intermediate model generates multiple candidate outputs, and then selects one as the formatted output; the embodiment of the application uses the formatted output to calculate the combined reward value, and then uses the combined reward value to calculate the policy function value of the multiple candidate outputs, so as to achieve the purpose of screening the candidate output with the highest reward, and then using the candidate output to continue training the intermediate model. Figure 3

[0097] The embodiment of the application provides four reward functions for comprehensively calculating the policy function value, as shown in Figure 9 The step 503 includes: Step 5031: Determine the format specification reward according to the completeness of the multiple structured paragraphs in the formatted output and the nesting order of the special tokens.

[0098] The format specification reward is used to measure whether the formatted output is complete and contains the label <think>, tags <answer>, tags <prediction>, tags <another>Four structured paragraphs, and the label nesting order is correct. Among them, the specific manifestation of the format specification award is selected by the technical personnel in this field according to the specific use scene.

[0099] When the format template is: "Q: What modern Chinese character does this oracle bone correspond to? Please reason according to the input picture in detail. A: <think>Detailed reasoning process according to oracle bone data< / think> ; <answer>Brief description of the reasoning process< / answer> ; <prediction>Most likely modern Chinese character predicted< / prediction> ; <another>Other likely modern Chinese characters predicted< / another> " when, label <think>structured paragraph refers to <think>Detailed reasoning process according to oracle bone data< / think>

[0100] Step 5032: In the formatted output, the label <think>corresponding parameter output and the label <answer>A semantic similarity between the corresponding parameter outputs is determined as a semantic similarity reward.

[0101] wherein, for a label <think>structured passage of the "structured passage" <think>Detailed reasoning process according to oracle bone data< / think> ", tag <think>The corresponding parameter output is detailed according to the specific content of the inference process of the oracle data.

[0102] Semantic similarity reward The formatted output is calculated using bilingual evaluation understudy (BLEU) and recall-oriented understudy for gisting evaluation (ROUGE) and other indicators <think>The semantic similarity between a part and a reference reasoning process is defined as: 。

[0103] wherein, denotes the weight of the BLEU indicator part, denotes the weight of the ROUGE indicator part.

[0104] Step 5033: When the label <prediction>When the corresponding parameter output is consistent with the reference answer, the reward value is determined as a prediction accuracy reward; and when the label <prediction>When the corresponding parameter output is inconsistent with the reference answer, a non-reward value is determined as the prediction accuracy reward.

[0105] wherein, for a label <prediction>structured passage of the "structured passage" <prediction>Most likely modern Chinese character predicted< / prediction> ", tag <prediction>The corresponding parameter output is the specific content of the predicted most likely modern Chinese character.

[0106] The prediction accuracy reward is a single-character interpretation prediction accuracy reward for extracting <prediction>The output character in the middle of the field is consistent with the reference answer; in one embodiment, the prediction accuracy reward is 1 when they are the same, and -1 otherwise.

[0107] Step 5034: Determine the difference between the actual number of tokens of the formatted output and the preset maximum length as an output difference value; when the output difference value is greater than zero, determine the output difference value as a comparison length, and determine the inverse of the ratio of the comparison length to the preset maximum length as a length control reward; when the output difference value is less than or equal to zero, determine zero as the length control reward.

[0108] The preset maximum length is determined by a person skilled in the art according to a specific use scenario.

[0109] In order to prevent the generation of too long or redundant content, a length penalty mechanism is introduced, and the length control reward The expression is:

[0110] wherein, the actual number of tokens of the formatted output, the preset maximum length, the output difference value, max(0, output difference value) represents the maximum value of zero and the output difference value.

[0111] Step 5035: Determine the weighted sum of the format specification reward, the semantic similarity reward, the prediction accuracy reward and the length control reward as a combined reward value, so as to calculate the combined reward value according to the reward function.

[0112] The final total combined reward function is: .

[0113] wherein, the weight of the format specification reward, the weight of the semantic similarity reward, the weight of the prediction accuracy reward, the weight of the length control reward.

[0114] After calculating the combined reward value according to the combined reward function, the combined reward value is also used to calculate the strategy function value; in one embodiment, the expression of the strategy function value is:

[0115] wherein, the probability distribution of all single word images, the probability of each single word image appearing. For a given single-word image, the intermediate model in the previous iteration... 1 candidate output, For the first The candidate output of the nth single-word image Timely rewards for each token For the current formatted output With reference output KL divergence between them; The advantage function value is calculated based on the combined reward value.

[0116] The specific method for calculating the advantage function value using the combined reward value shall be selected by those skilled in the art based on the specific application scenario, and is not limited here. Among the candidate words corresponding to the first single-character image The immediate reward for the first token refers to: upon generation of the first token... When generating the candidate output corresponding to the nth single-character image, the model generates the nth... The immediate reward obtained when a token is generated is usually based on the token's contribution to the current generation process, such as the matching degree with the input image and the coherence of the generated content. These local features are often fed back in real time during the generation process, affecting the model's decision on the generation of subsequent tokens and focusing on the optimization of the local generation process.

[0117] The strategy in this embodiment of the invention generates multiple candidate outputs for each input single-word image, evaluates the timely reward and advantage function value in each candidate output, updates the current strategy through feedback signals, and uses relative entropy (Kullback-Leibler Divergence, abbreviated as KL divergence) penalty to control the change amplitude of the strategy, ultimately maximizing the overall expected reward.

[0118] In one embodiment, to reduce the training resources of large models and improve training and inference efficiency, the present invention employs multiple system optimization strategies, respectively for training and deployment. First, during the training phase, the present invention replaces the attention calculation mechanism of the standard Transformer model with a fast attention module (FLashAttention); this fast attention module can reduce the traditional... The level of video memory usage has been reduced to Level, effectively supports long texts and batch training.

[0119] At the same time, the mixed kernel (Liger Kernel) optimization operator execution efficiency is enabled, and for the matrix penalty, layer normalization, activation and other operations in the operation of the Transformer model, a mixed kernel is used for bottom unified Compute Unified Device Architecture (CUDA) optimization, the forward and backward propagation processes are accelerated, and the arrangement of redundant operators is reduced.

[0120] Finally, the DeepSpeed Zero3-Offload distributed training strategy is introduced, the model parameter optimizer state and activation value are distributed and split, and partial Offload to the central processor is supported, which greatly reduces the single-card memory pressure and realizes the training of a single machine with eight 3090 cards.

[0121] At the inference end, different requirements are respectively used for batch high-speed inference and scene graph language using visual language model inference, a unified application programming interface type inference process is realized, and the process can be quickly integrated into a web page demonstration system to realize visualization and interactive output.

[0122] Embodiment 2: As Figure 10 shown, it is an architecture schematic diagram of the training device for the oracle single character image inference task according to the embodiment of the application. The training device for the oracle single character image inference task according to the embodiment of the application includes one or more processors 21 and a memory 22. Among them, Figure 10 The processor 21 is taken as an example in the embodiment.

[0123] The processor 21 and the memory 22 can be connected through a bus or other means, Figure 10 The connection through the bus is taken as an example in the embodiment.

[0124] The memory 22 is a kind of non-volatile computer readable storage medium, which can be used to store non-volatile software programs and non-volatile computer executable programs, such as the training method for the oracle single character image inference task in the embodiment. The processor 21 executes the training method for the oracle single character image inference task by running the non-volatile software programs and instructions stored in the memory 22.

[0125] The memory 22 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 22 can optionally include a memory remotely arranged relative to the processor 21, which can be connected to the processor 21 through a network. Examples of the above-mentioned network include but are not limited to the Internet, an intranet, a local area network, a mobile communication network and a combination thereof.

[0126] The program instructions / modules are stored in the memory 22, and when executed by the one or more processors 21, perform the training method for the oracle bone script character image inference task in the above-described embodiments, for example, perform each step of the training method for the oracle bone script character image inference task of the embodiments of the application described above.

[0127] The embodiments of the application also provide a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are executed by one or more processors, for example, a processor 21, so that the one or more processors can execute the training method for the oracle bone script character image inference task in the embodiments of the application, for example, perform each step of the training method for the oracle bone script character image inference task of the embodiments of the application described above; and also can realize the various modules, units described above. Figure 10 Figure 10 The embodiments of the application also provide a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are executed by one or more processors, for example, a processor 21, so that the one or more processors can execute the training method for the oracle bone script character image inference task in the embodiments of the application, for example, perform each step of the training method for the oracle bone script character image inference task of the embodiments of the application described above; and also can realize the various modules, units described above. Figure 10 The embodiments of the application also provide a non-volatile computer storage medium, which stores computer executable instructions, and the computer executable instructions are executed by one or more processors, for example, a processor 21, so that the one or more processors can execute the training method for the oracle bone script character image inference task in the embodiments of the application, for example, perform each step of the training method for the oracle bone script character image inference task of the embodiments of the application described above; and also can realize the various modules, units described above.

[0128] It is worth noting that the information interaction, execution process and the like between the modules and units in the above-described apparatus and system are based on the same concept as the processing method embodiments of the application, and the specific content can be referred to the description in the method embodiments of the application, which will not be described here.

[0129] Those skilled in the art can understand that all or part of the steps in the various methods of the embodiments can be completed by a program instructing the related hardware, and the program can be stored in a computer readable storage medium, which can include a read only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0130] The above only describes the preferred embodiments of the application and should not be used to limit the application. Any modification, equivalent replacement and improvement made within the spirit and principle of the application should be included in the protection scope of the application.​< / prediction> < / prediction> < / prediction> < / prediction> < / prediction> < / think> < / think> < / think> < / answer> < / think> ​< / think> < / another> < / prediction> < / answer> < / think> ​​< / prediction> ​< / another> < / prediction> < / answer> < / think> < / think> < / another> < / prediction> < / answer> < / think> < / prediction> < / another> < / prediction> < / answer> < / think> < / prediction> < / prediction> < / prediction> < / answer> < / think> < / another> < / prediction> < / answer> < / think>

Claims

1. A training method for an oracle single character image inference task, characterized in that, The method comprises the following steps: training a large language model in a backbone network to recognize Chinese characters and modern Chinese radicals from a single character image, to obtain a primary output and a primary parameter; based on the primary parameter, training the backbone network to identify the character period, recognize oracle bone script images, recognize oracle bone script multi-image sentences, and analyze the evolution of oracle bone script meanings from at least one single character image, to obtain an intermediate output and an intermediate parameter; based on the intermediate parameter, training the backbone network to infer the character form thinking chain from a single character image, to obtain a high-level output and a high-level parameter; calculating a joint loss value according to the primary output, the intermediate output, and the high-level output; iteratively updating the primary parameter, the intermediate parameter, and the high-level parameter according to the joint loss value until the joint loss value meets a training end condition, to obtain an intermediate model; training the intermediate model to infer the character form thinking chain from a single character image, and using a reward function to fine-tune the network parameters of the intermediate model according to the output of the intermediate model, to obtain a target model. 2.The training method for an oracle single character image inference task according to claim 1, wherein, The method of training the backbone network to infer the character form thinking chain from a single character image based on the intermediate parameter to obtain a high-level output and a high-level parameter comprises the following steps: Attaching a label <think>, tags <answer>, tags <prediction>and tags <another>determining a special token; and constructing a formatted template using the special token and a corresponding result parameter;< / another> < / prediction> < / answer> < / think> inputting the formatted template and the single character image into the backbone network, training the backbone network to infer the character form thinking chain from the single character image using the intermediate parameter, and generating a parameter output corresponding to the result parameter according to the formatted template to obtain a high-level output. 3.The training method for the oracle single character image inference task according to claim 2, characterized in that, The method of training the intermediate model to infer the character form thinking chain from a single character image, using a reward function to fine-tune the network parameters of the intermediate model according to the output of the intermediate model, and obtaining a target model comprises the following steps: constructing multiple structured paragraphs using the special token and the corresponding result parameter to generate a formatted template; inputting the single character image and the formatted template into the intermediate model to obtain a formatted output; calculating a combined reward value of the formatted output according to a reward function; calculating a strategy function value using the combined reward value; iteratively optimizing the intermediate model according to the strategy function value until the strategy function value meets a reinforcement end condition, and determining the intermediate model after the iteration optimization as the target model. 4.The training method for the oracle single character image inference task according to claim 3, characterized in that, The method of calculating a combined reward value of the formatted output according to a reward function comprises the following steps: determining a format specification reward according to the completeness of the multiple structured paragraphs in the formatted output and the nesting order of the special tokens; In the formatted output, the label <think>corresponding parameter output and the label <answer>determining a semantic similarity reward according to the semantic similarity between the corresponding parameter outputs;< / answer> < / think> When the formatted output has a label <prediction>When the corresponding parameter output is consistent with the reference answer, the reward value is determined as a prediction accuracy reward; and when the label <prediction>when the corresponding parameter outputs are inconsistent with the reference answer, determining a non-reward value as a prediction accuracy reward;< / prediction> < / prediction> determining an output difference value as the difference between the actual token number of the formatted output and a preset maximum length; when the output difference value is greater than zero, determining the output difference value as a comparison length, and determining the inverse of the ratio of the comparison length to the preset maximum length as a length control reward; when the output difference value is less than or equal to zero, determining zero as the length control reward; A weighted sum of the format specification reward, the semantic similarity reward, the prediction accuracy reward, and the length control reward is determined as a combined reward value to calculate the combined reward value according to a reward function. 5.The training method for an oracle single character image inference task according to claim 3, characterized in that, An expression of the policy function value is: wherein, P (x) represents the probability distribution over all single-word images, P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; P (x | y) represents the probability of each single-word image occurrence; 6.The training method for an oracle single character image inference task of claim 1, wherein, The Chinese character recognition and the modern Chinese character radical decomposition are primary sub-tasks, the character period identification recognition, the oracle bone image recognition, the oracle bone multi-image sentence recognition, and the oracle bone character meaning evolution analysis are intermediate sub-tasks, and the character form thinking chain reasoning is a high-level sub-task. The intermediate model is obtained by calculating a joint loss value according to the primary output, the intermediate output, and the high-level output, and iteratively updating the primary parameter, the intermediate parameter, and the high-level parameter according to the joint loss value until the joint loss value meets a training end condition. Labels corresponding to each of the primary sub-tasks, the intermediate sub-tasks, and the high-level sub-tasks are obtained for the single character image, and the labels are compared with the corresponding primary output, intermediate output, or high-level output to calculate a loss function value of the corresponding sub-task. A weighted sum of the loss function values of all the sub-tasks is determined as a multi-task cooperative loss, and the primary parameter, the intermediate parameter, and the high-level parameter are iteratively updated according to the multi-task cooperative loss to obtain the intermediate model. 7.The training method for an oracle single character image inference task according to claim 6, characterized in that, When calculating the loss function value of the high-level sub-task, the comparison of the labels with the corresponding primary output, intermediate output, or high-level output to calculate the loss function value of the corresponding sub-task includes: comparing the label of the high-level subtask to the high-level output, resulting in a label <prediction>A sum of a raw loss of the corresponding character token and a character loss of the remaining tokens in the high-level output;< / prediction> A sum of a preset multiple of the raw loss and the character loss is determined as the loss function value of the high-level sub-task. 8.The training method for the oracle single character image inference task of claim 6, wherein, The intermediate model is obtained by calculating a joint loss value according to the primary output, the intermediate output, and the high-level output, and iteratively updating the primary parameter, the intermediate parameter, and the high-level parameter according to the joint loss value until the joint loss value meets a training end condition. Each of the primary sub-tasks, the intermediate sub-tasks, and the high-level sub-tasks is trained according to a decay expression. wherein, is the current learning rate, is the predetermined learning rate, is the total number of iterations for training the respective subtask. 9.A training apparatus for an oracle single character image inference task, characterized in that, The training device for the oracle bone single character image reasoning task includes at least one processor and a memory, the at least one processor and the memory are connected through a data bus, the memory stores instructions executable by the at least one processor, and the instructions are used to implement the training method for the oracle bone single character image reasoning task according to any one of claims 1-8 after being executed by the processor.

10. A non-transitory computer storage medium, comprising, The computer storage medium stores computer executable instructions, and the computer executable instructions are executed by one or more processors to complete the training method for the oracle bone single character image reasoning task according to any one of claims 1-8.

Citation Information

Patent Citations

  • Classification model-based oracle auxiliary decoding classification method and system

    CN117315686A

  • Deep learning-based oracle radical splitting and matching method

    CN117333882A

  • Oracle bone text detection method based on deep learning and computer vision

    CN117437647A

  • Method and system for determining oracle based on lightweight network model

    CN118609141A

  • Oracle bone text image recognition method, device and equipment based on multi-modal large model and medium

    CN119251852A

Cited By

  • Large language model output quality monitoring method and device, program and storage medium

    CN121327447A

  • Method, device, program, and storage medium for monitoring quality of output of large language model

    CN121327447B

  • Training method, platform and equipment for diffusion language model, medium and product

    CN121859920A