Method for generating reasoning corpus of large language model and computing equipment

By converting natural language reasoning problems into symbolic expressions and optimizing directed acyclic graphs using logical reasoning algorithms, a natural language reasoning corpus is generated. This solves the redundancy and incoherence problems of large language models and improves the accuracy and efficiency of reasoning.

CN120952182APending Publication Date: 2025-11-14ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511135083.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-13
Publication Date
2025-11-14

AI Technical Summary

Technical Problem

Existing large language models suffer from redundant content, incoherence, and suboptimal reasoning during the reasoning process, resulting in low reasoning efficiency and insufficient accuracy.

Method used

The reasoning problem in natural language form is converted into symbolic expression, reasoning data is generated using logical reasoning algorithms, and the reasoning process is optimized by directed acyclic graphs to generate reasoning corpus in natural language form. The corpus is then rewritten using a large language model to improve logical coherence and efficiency.

Benefits of technology

It improves the reasoning accuracy and efficiency of large language models, making the reasoning process more concise and logically coherent, and enhancing the model's problem-solving ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120952182A_ABST
    Figure CN120952182A_ABST
Patent Text Reader

Abstract

A method for generating inference corpus of a large language model and a computing device, the method comprising: converting an inference problem in a natural language form into a symbol expression, the symbol expression performing meaning representation based on a plurality of preset symbols; reasoning based on the symbol expression by using a logical reasoning algorithm to obtain reasoning data; and based on the reasoning data, generating a reasoning corpus in a natural language form.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification pertain to the field of machine learning, and particularly relate to a method and computing device for generating reasoning corpora for large language models. Background Technology

[0002] Recent advancements in the reasoning capabilities of large language models have yielded significant results, with various models demonstrating astonishing reasoning abilities. These models generate Long Chain of Thought (Long-COT) before reaching a final conclusion. COT refers to a series of logical reasoning steps generated by the large language model to solve complex or multi-step problems. COT can improve the accuracy and transparency of AI systems in problem-solving. Long-COT can be understood as the reasoning ability exhibited by large language models during lengthy and multi-step reasoning processes. While this reasoning approach has achieved significant breakthroughs in reasoning about complex problems, Long-COT suffers from redundancy and logical inconsistencies. Further improving the reasoning capabilities of large language models remains a challenge. Summary of the Invention

[0003] The purpose of this invention is to provide a scheme for generating reasoning corpora for large language models.

[0004] The first aspect of this specification provides a method for generating reasoning corpus for a large language model, comprising: converting a reasoning problem in natural language form into a symbolic expression, wherein the symbolic expression represents meaning based on multiple preset symbols; using a logical reasoning algorithm to perform reasoning based on the symbolic expression to obtain reasoning data; and generating a reasoning corpus in natural language form based on the reasoning data.

[0005] In one implementation, the method further includes: training the large language model based on the reasoning problem and the reasoning corpus.

[0006] In one implementation, converting a reasoning problem in natural language form into a symbolic expression includes: if the reasoning problem is a first-order logic problem, converting the reasoning problem into a first symbolic expression corresponding to a first-order logic problem; and if the reasoning problem is a constraint satisfaction problem, converting the reasoning problem into a second symbolic expression corresponding to a constraint satisfaction problem.

[0007] In one embodiment, the method further includes: when the reasoning problem is a first-order logic problem, determining the semantic relationship between predicates and functions in the reasoning problem, and generating a symbolic expression corresponding to the semantic relationship.

[0008] In one implementation, when the reasoning problem is a first-order logic problem, the reasoning data includes a directed acyclic graph (DAG) data, which includes node data and edge data, with the edge data corresponding to the connecting edges between nodes. The step of generating reasoning corpus in natural language form based on the reasoning data includes: traversing the nodes in the DAG according to the node pointing order, and for each traversed node, generating a reasoning statement based on the node data and the edge data of its connecting edges using a preset template corresponding to each node.

[0009] In one implementation, when the reasoning problem is a constraint satisfaction problem, the reasoning data includes directed acyclic graph (DAG) data, which includes node data and edge data, with the edge data corresponding to the connecting edges between nodes. The step of generating reasoning corpus in natural language form based on the reasoning data includes: traversing the nodes in the DAG layer by layer, and for each traversed node, generating a reasoning statement based on the node data and the edge data of its connecting edges using a preset template corresponding to each node.

[0010] In one implementation, converting the reasoning problem in natural language form into a symbolic expression includes: converting the reasoning problem in natural language form into a first symbolic expression; performing a grammatical check on the first symbolic expression; and after determining that the first symbolic expression contains grammatical errors, modifying the first symbolic expression to obtain a second symbolic expression.

[0011] In one implementation, the method further includes: rewriting the reasoning corpus using a large language model to obtain reasoning corpora with different styles.

[0012] In one implementation, converting the reasoning problem in natural language form into a symbolic expression includes converting the reasoning problem in natural language form into a symbolic expression using a large language model.

[0013] A second aspect of this specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described in the first aspect.

[0014] A third aspect of this specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described in the first aspect.

[0015] A fourth aspect of this specification provides a computer program product including a computer program / instructions that, when executed by a processor, implement the steps of the method described in the first aspect.

[0016] The embodiments in this specification obtain reasoning data for reasoning problems based on logical reasoning algorithms, and generate a CoT based on the reasoning data. When the CoT is used to fine-tune a large language model, the large language model can learn the problem-solving ideas of the solver, making the reasoning process more efficient, concise and logically coherent while ensuring the accuracy of reasoning. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments in this specification, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating a method for generating reasoning corpora for a large language model, as described in an embodiment of this specification.

[0019] Figure 2 This is an architecture diagram of the conversion module in the embodiments of this specification;

[0020] Figure 3 This is a directed acyclic graph corresponding to the example FOL problem in the embodiments of this specification;

[0021] Figure 4 This is a directed acyclic graph corresponding to the example CPS problem in the embodiments of this specification. Detailed Implementation

[0022] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0023] In related technologies, Long-COT corpora can be obtained by distilling Large Reasoning Models (LRM), and these Long-COT corpora can be used for fine-tuning of general large language models to improve their reasoning capabilities. However, the Long-COT corpora generated in this way may have the following problems:

[0024] Content redundancy: LRM uses a large portion of its output for text coherence rather than core reasoning advancement, resulting in a lot of redundant content in the Long-COT corpus.

[0025] Overthinking of simple problems makes it difficult for LRM to allocate reasoning resources according to the complexity of the problem. For some simple problems, LRM cannot produce concise COTs and tends to perform multiple rounds of redundant reasoning and explore unnecessary reasoning paths.

[0026] Incoherent and suboptimal reasoning, exhibiting a "lack of thought," causes LRM to prematurely shift its reasoning direction, hindering the development of potential solution paths. This phenomenon results in fragmented and superficial reasoning trajectories, particularly evident in complex mathematical tasks. Instead of progressing along a coherent and in-depth line of thought, the model superficially jumps between multiple methods, ultimately producing longer reasoning sequences and lower-quality solutions.

[0027] To address the aforementioned problems, this specification provides a method for generating reasoning corpora for large language models, thereby overcoming these issues.

[0028] Figure 1 This is a flowchart illustrating a method for generating a reasoning corpus for a large language model, as described in an embodiment of this specification. This method can be executed by a computing device.

[0029] like Figure 1 As shown, in step S101, the reasoning problem in natural language form is converted into a symbolic expression, which represents the meaning based on multiple preset symbols.

[0030] The reasoning problems used in the embodiments of this specification include, but are not limited to, first-order-logic (FOL) problems and / or constraint satisfaction problems (CSP).

[0031] First-order logic (FOL), also known as predicate logic, is a formal system in mathematical logic that describes the relationships and properties between objects, as well as the reasoning involving these objects. First-order logic problems involve deriving new conclusions from known premises. Examples include proving the truth of a theorem, checking whether a logical expression can be derived from given premises, and so on.

[0032] First-order logic problems have corresponding first-order logic formal language systems, which can include the following basic elements:

[0033] Individuals (Objects): In first-order logic, an individual is a specific object or entity in the real world or a particular domain.

[0034] Predicates: Predicates are used to describe the properties of individuals or the relationships between individuals. For example: a unary predicate, P(x), means that x performs the action corresponding to P; a binary predicate, R(x,y), means that x and y satisfy the action corresponding to R.

[0035] Functions: Functions are used to generate new individuals, usually as input to other expressions. For example, f(x) = x + 1 represents a function that increments the input individual x by 1.

[0036] Quantifiers: Quantifiers are used to express limitations on the scope of individuals, and mainly include:

[0037] Universal quantifiers This means that it holds true for all individuals, for example, P(x) means "P(x) is true for all x"; existential quantifier This indicates that "at least one" individual satisfies the condition, for example, P(x) means "there exists at least one x such that P(x) is true".

[0038] Variables: Variables are used to represent individuals and are usually used in conjunction with quantifiers. For example, variables such as x and y can represent any individual.

[0039] Constants: Constants are specific individuals, such as a, b, c, etc., representing fixed objects.

[0040] Logical connectives: These include connectives used in propositional logic, such as negation. Not; conjunction (∧): AND; disjunction (∨): OR; implication (→): if...then...; equivalence If and only if.

[0041] Constraint Satisfaction Problems (CSPs) are primarily used to solve problems involving multiple constraints. The core of these problems is to find a solution that satisfies all constraints.

[0042] The constraint satisfaction problem corresponds to a constraint language system, which includes the following elements:

[0043] Variables: A group of variables that need to be assigned values, such as X1, X2, X3, ..., Xn.

[0044] Domains: The range of values ​​that each variable can take, usually represented by D1, D2, ..., Dn. For example, the domain of variable X1 may be {1,2,3}, meaning that X1 can take the values ​​1, 2, or 3.

[0045] Constraints: Restrictions that must be satisfied between variables. For example, X1 ≠ X2 or X1 + X2 ≤ 5.

[0046] Triplet: CSP = (X, D, C), where X is the set of variables {X1, X2, ..., Xn}, D is the set of domains for each variable {D1, D2, ..., Dn}, C is the set of constraints {C1, C2, ..., Cm}, and CSP corresponds to the set of variables X that satisfy all constraints C.

[0047] In one embodiment, the computing device performing the method may include a conversion module for converting reasoning problems into symbolic expressions. This conversion module may include a FOL conversion module corresponding to a FOL problem and / or a CSP conversion module corresponding to a CSP problem. The FOL conversion module is used to convert FOL problems in natural language form into expressions based on the aforementioned FOL language system, and the CSP conversion module is used to convert CSP problems in natural language form into expressions based on the CSP language system.

[0048] In one implementation, such as Figure 2 As shown, the conversion module 10 may include a FOL converter 11, a CSP converter 12, and an optimizer 13. Figure 2 The checker 14 shown can be a program module connected to the inference module after the conversion module 10. After receiving a reasoning question in natural language form, the conversion module 10 determines whether the reasoning question is a FOL (Forwarding Logic) question or a CSP (Content Logic Parameter) question based on its labeling type and sends the question to the corresponding converter. Then, the FOL converter 11 or the CSP converter 12 converts the reasoning question into a symbolic expression and sends the symbolic expression to the checker 14 for inspection. The checker 14 can, for example, check the syntax of the symbolic expression. If a syntax error is found, the checker sends error-related information about the symbolic expression to the optimizer 13. This error-related information includes, for example, the location and type of the error. The optimizer 13 modifies the symbolic expression based on the error-related information and sends the modified symbolic expression to the checker 14. After determining that the symbolic expression is error-free, the checker 14 outputs the correct symbolic expression.

[0049] It is understood that the conversion module 10 in the embodiments of this specification is not limited to including, for example, Figure 2The structure shown, for example, may include only a FOL converter or only a CSP converter for converting specific types of reasoning problems. Furthermore, the checker 14 is not limited to being located in the reasoning module; it may also be located in the conversion module, for example.

[0050] In one implementation, the in-context learning (ICL) capability of large language models (LLMs) can be utilized to convert logical reasoning problems in natural language into symbolic expressions. It is understood that the embodiments in this specification are not limited to formalizing reasoning problems using large language models; for example, formalizing reasoning problems can also be performed based on preset algorithm rules.

[0051] The following describes the transformation of the large language model for the FOL problem and the CSP problem.

[0052] In an instance involving a FOL problem (Instance 1), the context of the FOL problem in Instance 1 includes:

[0053] If people brew their own matcha every morning, they won't sleep in. (If people make their own matcha teas every morning, then they do not wake uplate);

[0054] If people live in California and attend yoga classes regularly, then they make their own matcha teas every morning.

[0055] If people work in the entertainment industry as high-profile celebrities, then they wake up late.

[0056] If people didn't have 9-to-5 jobs They are celebrities in the entertainment industry.

[0057] All people who prefer working from home do not have regular 9-to-5 jobs.

[0058] Clay either prefers to work at home over going to the office every day and makes his own matcha teas every morning, or he neither prefers to work at home over going to the office every day nor makes his own matcha teas every morning.

[0059] Question: Is it true that "Clay lives in California and regularly attends yoga classes"?

[0060] For the FOL problem in Example 1, the FOL converter can generate the following prompt to be input into the large language model:

[0061] Task Description: You are a logic expert specializing in converting natural language problems into first-order logic (FOL) expressions. Given a logic reasoning problem with context and a question, please perform the following steps:

[0062] 1. Summarize the predicates from the text (including context and questions);

[0063] 2. Define and symbolize individual constants from the text;

[0064] 3. By combining the results of steps 1 and 2 using logical symbols, construct a first-order predicate logical expression. Each sentence in the text should correspond to a logical expression.

[0065] Context: If people make their own matcha every morning... Clay either prefers to work from home and make his own matcha every morning, or he neither works from home nor makes his own matcha every morning.

[0066] Question: Is it true that "Clay lives in California and regularly attends yoga classes"?

[0067] Based on the above Prompt, the large language model transforms the context and question text corresponding to Instance 1 to obtain the symbolic expression corresponding to the text of the FOL question as shown below:

[0068] Facts

[0069] fact1:

[0070] Rules

[0071] rule1:

[0072] rule2: CaliforniaYoga(x) → Matcha(x)

[0073] rule 3: Celebrity(x) → WakeUpLate(x)

[0074] rule4:

[0075] rule5: PreferHome(x) → RegularJob(x)

[0076] Question

[0077] California Yoga (Clay)

[0078] The symbols in the above symbolic expressions can be found in the definitions above, for example... Let $x$ represent all people, $Matcha(x)$ be the predicate representing people making matcha, $⊕$ represent OR, and the question $CaliforniaYoga(Clay)$ indicates whether the statement "Clay lives in California and regularly attends yoga classes" is true or false.

[0079] In related technologies, information loss occurs during the conversion of some FOL problems, leading to incorrect inference results in subsequent FOL problem reasoning. Therefore, in this embodiment, the FOL converter 11, in addition to performing the aforementioned conversion using a large language model to obtain the symbolic expression corresponding to the FOL problem text, also performs the following steps: prompting the large language model to perform semantic extraction, collecting all predicates and functions in the FOL problem text, then extracting the semantic relationships existing in all predicates and functions using the large language model, and generating the symbolic expression corresponding to the semantic relationship. The conversion module 10 provides the symbolic expression corresponding to the semantic relationship, along with the symbolic expression corresponding to the problem text, to the subsequent inference process of the FOL problem executed by the inference module, making the inference result more accurate.

[0080] Specifically, for the following FOL problem example (Example 2), the FOL converter 11 can generate the following prompt to be input into the large language model:

[0081] Task Description: You are a logic expert specializing in converting natural language problems into first-order logic (FOL) expressions. Given a logic reasoning problem with context and a conclusion, please perform the following steps:

[0082] 1. Summarize the predicates from the text (including context and conclusion);

[0083] 2. Define and symbolize individual constants from the text;

[0084] 3. By combining the results of steps 1 and 2 using logical symbols, construct a first-order predicate logical expression. Each sentence in the text should correspond to a logical expression.

[0085] 4. Based on the output of step 1, summarize the hierarchical relationship between predicates and use subClassOf to describe the hierarchical relationship.

[0086] Context: All students who want a long vacation love summer the most. James, in fifth grade, wants a long vacation.

[0087] Conclusion: James' favorite season is summer.

[0088] Based on the above prompt, the large language model can output the following symbolic expressions:

[0089] Define predicate:

[0090] Student-Long-vacation(x), Long-vacation(x),Summer(x), student(x), favorite-season(x)

[0091] Define constants:

[0092] James

[0093] Conversion prerequisites:

[0094] Student-Long-vacation(x)→Summer(x)

[0095] Long-vacation (James)

[0096] Conversion conclusion:

[0097] FavoriteSeason(James,Summer)

[0098] Hierarchical relationship:

[0099] subClassOf(summer, Season)

[0100] subClassof(James, Student).

[0101] For example 2, the FOL converter 11 generates symbolic expressions subClassOf(summer,Season) and subClassof(James,Student) corresponding to the hierarchical relationship between predicates, and uses these symbolic expressions in the reasoning process to improve the accuracy of subsequent reasoning.

[0102] In another instance involving CSP issues (Instance 3), the context of the CSP issue includes:

[0103] On Thursday, V and W each ate four meals: breakfast, lunch, dinner, and a snack. Below is a complete list of what they ate on Thursday:

[0104] V eats different foods at each meal than W eats at that meal.

[0105] V and W: Each person eats different meals (Neither of them eats the same kind of food more than once during the day);

[0106] For breakfast, each person shall eat one of the following: hot cake, poached egg, or omelet;

[0107] For lunch, each person shall eat one of the following: fish, hot cake, macaroni, or omelet;

[0108] For dinner, each person shall eat one of the following: fish, hot cake, macaroni or omelet;

[0109] For the extra meal, each person shall eat one of the following: fish or omelet;

[0110] W ate an omelet for lunch.

[0111] Question: V must have eaten which of the following foods: (A) fish, (B) hot cake, (C) macaroni, (D) omelet, (E) boiled egg.

[0112] CSP converter 12 can generate the following prompt to transform the CSP problem based on a large language model:

[0113] Given a constraint satisfaction problem, which includes a context and a question in natural language, the task is to describe the problem using the XCSP3 Extended Modeling Language.

[0114] Context: On Thursday, V and W each ate four meals... W ate an omelet for lunch.

[0115] Question: V must have eaten which of the following foods: (A) fish, (B) hot cake, (C) macaroni, (D) omelet, (E) boiled egg.

[0116] Based on the above prompt, the large language model can output the following symbolic expressions:

[0117] variable <variables>

[0118] <var id="v_b"n o t e="v's breakfast:1=hot cakes,2=poached eggs,3=omelet">1 2 3< / v a r> ......

[0120] <var id="v_s"note="v's snack:3=omelet,4=fish">3 4< / v a r>

[0121] <var id="w_b"note="w's breakfast:1=hot cakes,2=poached eggs,3=omelet">1 2 3< / v a r> ......

[0123] <var id="w_s"note="w's snack:3=omelet,4=fish">3 4< / v a r>

[0124] constraint <constraints>

[0125] <intension note = "W had an omelette for lunch">eq(W_l, 3)

[0126] <intension note = "The food V eats per meal is different from the food W eats in that meal">ne(V_b, W_b) ......

[0128] <all Different note = "For each of V and W: each meal is different">

[0129] <list> V_b V_l V_d V_s< / list>

[0130] < / all different> ......

[0132] Problem <question>V must have eaten which of the following foods: (A) fish, (B) hot cake, (C) macaroni, (D) omelet, (E) boiled egg.

[0133] In step S103, a logical reasoning algorithm is used to perform reasoning based on symbolic expressions to obtain reasoning data.

[0134] In the embodiments described in this specification, reasoning can be performed using a solver. A solver is a software tool or algorithm capable of processing and solving problems involving symbolic expressions. Unlike numerical methods, symbolic solvers operate on the exact form of mathematical expressions, rather than their numerical approximations. Symbolic solvers can perform precise algebraic operations on expressions containing variables, constants, operators, and other mathematical symbols, and can derive solutions in closed-form.

[0135] The solver includes a pre-defined logical reasoning algorithm to deduce reasoning data from symbolic expressions. Specifically, existing FOL solvers can be used for reasoning in FOL problems, and existing CSP solvers can be used for CSP problems. The format of the reasoning data obtained through the solver is not limited; it can be in tabular or code format.

[0136] In one implementation, the inference data is as follows: Figure 3 or Figure 4 The diagram shows the form of a directed acyclic graph (DAG).

[0137] FOL solvers typically use a tree structure to record the inference process. However, this tree structure can contain redundant nodes due to duplicate records and excessive granularity. Furthermore, loops or mutually exclusive rules in the inference process can introduce inference cycles. To address these issues, embodiments of this specification convert the tree structure into a directed acyclic graph (DAG) and employ optimization techniques such as merging duplicate nodes, eliminating negative nodes, and deleting intermediate results.

[0138] Specifically, the DAG graph is as follows: Figure 3 As shown in the diagram, pink nodes represent hypothesis nodes, blue nodes represent reasoning nodes, and green nodes represent conclusion nodes. When reasoning based on the symbolic expression in Example 1 above, we can first assume that Clay brews matcha himself in the morning, thus obtaining the hypothesis node Matcha(Clay). Starting from this hypothesis node, based on fact1 and rule1, we can deduce that WakeUpLate(Clay) is False, PreferHome(Clay) is TRUE, and so on, ultimately arriving at the conclusion node CaliforniaYoga(Clay), which is False. The reasoning data corresponding to this DAG includes... Figure 3 The values ​​of each node and the values ​​of the connecting edges between the nodes are shown in the diagram.

[0139] The CSP solver uses a list structure to record the detailed changes of each variable under different constraints. To generate concise and accurate chains of inference (COTs), the list structure can be converted to... Figure 4 The DAG diagram shown is in the form of a variable-axis graph. The nodes in the DAG diagram represent variables and their corresponding values, while the edges represent the changes in the value of variable x from v1 to v2 under the influence of a certain constraint c.

[0140] In one implementation, such as Figure 2 As shown, the solver also includes a checker 14, which checks the grammatical correctness of the reasoning problem. If a grammatical error is found, the checker 14 will feed back detailed error information to the upstream optimizer 13 so that the grammatical error can be corrected.

[0141] In step S105, reasoning corpus in natural language form is generated based on the reasoning data.

[0142] In the embodiments described in this specification, reasoning data can be converted into reasoning corpora in natural language form using a generator. Specifically, a FOL generator can be used for conversion of FOL problems, and a CSP generator can be used for conversion of CSP problems.

[0143] The FOL generator can include multiple statement templates, and can transform inference data based on each statement template to generate inference corpus in natural language form. Specifically, for inference data in the form of a DAG graph, the FOL generator can determine the statement template corresponding to each node in the DAG graph, and then iterate through the nodes in the DAG, generating the CoT corresponding to the DAG based on the statement template corresponding to each node.

[0144] For example, taking Instance 1 above as an example, the FOL generator is relative to Figure 3 The DAG graph shown is obtained by traversing upwards from the node Matcha(Clay) with an in-degree of zero, following the arrow directions of the edges in the DAG graph, resulting in the following CoT for instance 1:

[0145] ###Rephrase

[0146] Let me try to rephrase the premises to understand them better.

[0147] Rule 1: "If people make their own matchateas every morning,then they do not wake up late."

[0148] Rule2: CaliforniaYoga(x)→Matcha(x):"If people live in Californiaand attend yoga classes regularly,then they make their own matcha teas everymorning."

[0149] Rule3: Celebrity(x)→WakeUpLate(x):"If people work in theentertainment industry as high-profile celebrities,then they wake up late."

[0150] Rule4: "If peopledo not have regular9-5jobs,then they work in the entertainment industry as high-profilecelebrities."

[0151] Rule5: "All people who prefer workingat home over going to the office every day do not have regular9-5 jobs."

[0152] Fact1:

[0153] "Clay either both prefers to work at home over going to the officeevery day and makes his own matcha teas every morning,or he neither prefersto work at home over going to the office every day nor makes his own matchateas every morning."

[0154] ###Symbolized Question

[0155] We can abstract the question into the following logical expression,and then determine whether the expression holds?

[0156] CaliforniaYoga(Clay)

[0157] ###Breakdown:

[0158] we assume Matcha(Clay)is TRUE.

[0159] base on Fact1 we conclude that PreferHome(Clay)status is TRUE.

[0160] base on Rule5" PreferHome(x)→~(RegularJob(x))",we conclude thatRegularJob(Clay)status is FALSE.

[0161] base on Rule4" ~(RegularJob(x))→Celebrity(x)",we conclude thatCelebrity(Clay)status is TRUE.---->conclusion1

[0162] base on Rule1" Matcha(x)→~(WakeUpLate(x))",we conclude thatWakeUpLate(Clay)status is FALSE.

[0163] base on Rule3" Celebrity(x)→WakeUpLate(x)",we conclude that~(Celebrity(Clay))status is TRUE.---->conclusion2

[0164] under the assumption that PreferHome(Clay)is TRUE,we obtaincontradictory conclusion1,2,so the assumption that Matcha(Clay)=TRUE is wrong.

[0165] Thus we can know that Matcha(Clay)is FALSE

[0166] base on Rule2" CaliforniaYoga(x)→Matcha(x)", we conclude that CaliforniaYoga(Clay) status is FALSE.

[0167] Conclusion:

[0168] Through the analysis above, the result of question=California Yoga (Clay) is FALSE. Therefore, the final answer is FALSE.

[0169] for Figure 4 The inference graph data for the CSP problem shown is similar to the COT generation process described above. It can be generated by traversing the nodes in the DAG graph layer by layer according to the connection order of the nodes in the preset template.

[0170] In one implementation, breadth-first search (BFS) can be used to traverse the nodes in the reasoning graph to generate the CoT. The core idea of ​​BFS is to start from the starting node, visit all adjacent nodes layer by layer, then visit the adjacent nodes of these adjacent nodes in turn, and so on, until all reachable nodes have been traversed.

[0171] Taking Example 3 above as an example, the CSP generator is relative to... Figure 4 The DAG graph shown is traversed level by level using the BFS algorithm to obtain the following CoT for example 3:

[0172] ###Let's rephrase the constraint for better understanding:

[0173] -c1:W eats an omelet for lunch

[0174] -c2:At no meal does V eat the same kind of food as W

[0175] -c3:Neither of them eats the same kind of food more than once during the day

[0176] ###Breakdown:

[0177] To figure this out,we analyze the given constraints step-by-step:

[0178] ####Define variables:

[0179] -V_b:{1,2,3},V's breakfast:1=hot cakes,2=poached eggs,3=omelet ......

[0181] -V_s:{3,4},V's snack:3=omelet,4=fish

[0182] -W_b:{1,2,3},W's breakfast:1=hot cakes,2=poached eggs,3=omelet ......

[0184] -W_s:{3,4},W's snack:3=omelet,4=fish

[0185] ####Let's begin to analyze according to constraints:

[0186] 1.Base on c1,we conclude that:...,W_l:3,...

[0187] 2.Base on c3,we conclude that:...,W_b:{1,2},W_d:{1,4,5},W_s:{4},...

[0188] 3.Base on c3,we conclude that:...,W_d:{1,5},...

[0189] 4.Base on c2:we conclude that:...,V_l:{1,4,5},V_s:{3},...

[0190] 5.Base on c3:we conclude that:...,V_b:{1,2},V_d:{1,4,5},...

[0191] ###Option Analysis:

[0192] Option D("V must eat omelet")

[0193] As can be seen from the CoT above, the CSP generator, based on constraint c1, selects to start from the node W_l = 1, 3, 4, 5 with an in-degree of zero, and sequentially traverses the child node W_l = 3 of node W_l = 1, 3, 4, 5, the child node of node W_l = 3, and so on. Thus, according to the preset template corresponding to each node, based on the traversed nodes and the constraint relationship between nodes, the CoT is generated. And from node V_s = 3, it can be concluded that V will definitely eat the omelet.

[0194] It is understandable that for other forms of inference data, the FOL generator or CSP generator can similarly traverse each data point in the inference data based on a preset template in order to generate the corresponding inference corpus in natural language form based on the inference data.

[0195] After generating the CoT corresponding to the reasoning problem as described above, the statement style of the CoT can be rewritten using a large language model to ensure stylistic diversity of the reasoning corpus.

[0196] Then, the reasoning problem and its corresponding CoT can be used to generate training samples to fine-tune the large language model, so that the large language model can learn the solver's problem-solving ideas, making the reasoning process more efficient, concise and logically coherent while ensuring the accuracy of reasoning.

[0197] In this specification, the Large Language Model (LLM) may also be referred to simply as the Large Model. A Large Language Model is a natural language processing model based on deep learning techniques, typically with billions to hundreds of billions or even more parameters, possessing powerful language understanding and generation capabilities. Large Language Models can employ the Transformer architecture or its variants (such as GPT, BERT, etc.), which utilizes an attention mechanism to globally model sequential data, efficiently handling long-distance dependencies and thus performing exceptionally well in natural language tasks. Large Language Models learn the statistical features and semantic relationships of language through pre-training on large-scale corpora, giving them outstanding generalization capabilities. The core capabilities of Large Language Models include, but are not limited to: understanding contextual semantics, generating coherent and grammatically correct text, performing logical reasoning, and handling multi-task scenarios. Its usage typically includes two modes: direct inference and fine-tuning. In direct inference mode, the user guides the Large Language Model to generate specific outputs by designing prompts. Cue words can be task descriptions or instructions in text form, used to stimulate the semantic understanding and generation capabilities of large language models. In fine-tuning mode, large language models are further trained on small-scale datasets in specific domains to optimize their performance on specific tasks. The powerful generalization ability and flexibility of large language models make them an important tool in the field of artificial intelligence, providing efficient and accurate solutions for automated text generation and understanding.

[0198] In some embodiments, large language models can also understand and generate data from other modalities (such as visual and audio data). In this case, large language models can also be called multimodal large language models (MLLMs). MLLMs provide a richer and more natural interactive experience by integrating multiple types of input and output, such as text, images, and sound. The core advantage of MLLMs lies in their ability to process and understand information from different modalities and fuse this information to complete complex tasks. For example, MLLMs can analyze an image and generate descriptive text, or generate a corresponding image based on a text description. This cross-modal understanding and generation capability makes MLLMs widely applicable across multiple fields.

[0199] It should be noted that the key technologies of large language models can be found in the detailed description of the paper "ASurvey of Large Language Models" (paper number: arXiv:2303.18223v16, published on March 11, 2025, public link: https: / / doi.org / 10.48550 / arXiv.2303.18223), and will not be repeated here.

[0200] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0201] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0202] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not exclude the possibility that, with the future development of computer technology, the computer implementing the functions of the above embodiments can be, for example, a personal computer, a laptop computer, an in-vehicle human-machine interaction device, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0203] While one or more embodiments of this specification provide the steps of operation for the methods described in the embodiments or flowcharts, more or fewer steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in a process, method, product, or apparatus that includes said elements is not excluded. For example, the use of terms such as "first," "second," etc., is to denote names and does not indicate any particular order.

[0204] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, when implementing one or more of these specifications, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0205] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0206] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0207] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0208] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0209] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0210] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0211] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0212] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0213] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0214] The above description is merely an embodiment of one or more embodiments of this specification and is not intended to limit the scope of these embodiments. Various modifications and variations can be made to these embodiments by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims.< / question> < / constraints> < / var> < / var> < / var> < / var> < / variables>

Claims

1. A method for generating inference corpora for large language models, comprising: The reasoning problem in natural language form is converted into a symbolic expression, which represents the meaning based on multiple preset symbols; The logical reasoning algorithm is used to perform reasoning based on the symbolic expression to obtain reasoning data; Based on the inference data, an inference corpus in natural language form is generated.

2. The method according to claim 1, further comprising: The large language model is trained based on the inference problem and the inference corpus.

3. The method according to claim 1, wherein converting the reasoning problem in natural language form into a symbolic expression comprises: When the reasoning problem is a first-order logic problem, the reasoning problem is converted into a first symbolic expression corresponding to the first-order logic problem; When the reasoning problem is a constraint satisfaction problem, the reasoning problem is converted into a second symbolic expression corresponding to the constraint satisfaction problem.

4. The method according to claim 3, further comprising: When the reasoning problem is a first-order logic problem, the semantic relationship between predicates and functions in the reasoning problem is determined, and symbolic expressions corresponding to the semantic relationship are generated.

5. The method according to claim 3, wherein when the reasoning problem is a first-order logic problem, the reasoning data includes directed acyclic graph (DAG) data, the DAG data includes node data and edge data, the edge data corresponds to the connection edges between nodes, and the step of generating reasoning corpus in natural language form based on the reasoning data includes: The nodes in the DAG are traversed according to the node pointing order. For each traversed node, a reasoning statement is generated based on the node data and the edge data of its connected edges using the preset template corresponding to each node.

6. The method according to claim 3, wherein when the reasoning problem is a constraint satisfaction problem, the reasoning data includes directed acyclic graph (DAG) data, the DAG data includes node data and edge data, the edge data corresponding to the connection edges between nodes, and the step of generating reasoning corpus in natural language form based on the reasoning data includes: The nodes in the DAG are traversed layer by layer. For each traversed node, a reasoning statement is generated based on the node data and the edge data of its connected edges using the preset template corresponding to each node.

7. The method according to claim 1, wherein converting the reasoning problem in natural language form into a symbolic expression comprises: Convert reasoning problems in natural language form into first symbolic expressions; The first symbolic expression is syntax-checked. After determining that the first symbolic expression contains syntax errors, the syntax of the first symbolic expression is modified to obtain the second symbolic expression.

8. The method according to claim 1, further comprising: The reasoning corpus is rewritten using a large language model to obtain reasoning corpora with different styles.

9. The method according to claim 1, wherein converting the reasoning problem in natural language form into a symbolic expression comprises converting the reasoning problem in natural language form into a symbolic expression through a large language model.

10. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-9.