# US 2025/0148216 A1 · Method and apparatus for training large model, electronic device and storage medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0148216 A1
- Document ID: US20250148216A1
- Status: Published application
- Kind: A1
- Application number: 19/018,557
- Filed: 2025-01-13
- Published: 2025-05-08
- Earliest claimed: 2024-07-12
- Assignees: Baidu International Technology (Shenzhen) Co., Ltd.
- Applicants: Baidu International Technology (Shenzhen) Co., Ltd.
- Inventors: Chao Huang; Gang Qiao; Zhenpeng Zhan
- Web page: https://patentgrep.com/patent/US20250148216A1

## CPC

- G06F 40/35: Discourse or dialogue representation
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The disclosure discloses a method for training a large model, an apparatus for training a large model, an electronic device and a storage medium, and relates to a field of computer technologies, especially to a field of artificial intelligence technologies such as large model and deep learning. The method includes: obtaining a conversation sample, in which the conversation sample includes portraits of a plurality of roles, a plot containing the plurality of roles and a plurality of rounds of conversations among the plurality of roles; for any one of the plurality of roles, obtaining a predicted conversation sentence of the role by inputting the portraits of the plurality of roles, the plot and a historical conversation sentence corresponding to a sample conversation sentence of the role in the plurality of rounds of conversations into an initial large model; and obtaining a target large model by training the initial large model according to a difference between the predicted conversation sentence and the sample conversation sentence.

## Claims

### Claim 1

A method for training a large model, comprising:
obtaining a conversation sample, wherein the conversation sample comprises portraits of a plurality of roles, a plot containing the plurality of roles and a plurality of rounds of conversations among the plurality of roles;
for any one of the plurality of roles, obtaining a predicted conversation sentence of the role by inputting the portraits of the plurality of roles, the plot and a historical conversation sentence corresponding to a sample conversation sentence of the role in the plurality of rounds of conversations into an initial large model; and
obtaining a target large model by training the initial large model according to a difference between the predicted conversation sentence and the sample conversation sentence.

### Claim 2 (depends on 1)

The method of claim 1, wherein obtaining the conversation sample comprises:
obtaining the portraits of the plurality of roles and the plot;
for any one of the plurality of roles, during a conversation process of the plurality of roles, obtaining a sample conversation sentence of the role according to the portraits of the plurality of roles and the plot;
obtaining the plurality of rounds of conversations among the plurality of roles according to sample conversation sentences of the plurality of roles in the conversation process of the plurality of roles; and
obtaining the conversation sample according to the portraits of the plurality of roles, the plot and the plurality of rounds of conversations.

### Claim 3 (depends on 2)

The method of claim 2, wherein obtaining the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot, comprises:
obtaining the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot by calling a first large model corresponding to the role, wherein different roles of the plurality of roles correspond to different first large models.

### Claim 4 (depends on 3)

The method of claim 3, wherein obtaining the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot by calling the first large model corresponding to the role, comprises:
obtaining a language style of the role; and
obtaining the sample conversation sentence of the role according to the portraits of the plurality of roles, the plot and the language style by calling the first large model corresponding to the role.

### Claim 5 (depends on 2)

The method of claim 2, wherein obtaining the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot, comprises:
determining a target round whose conversation difficulty is to be increased and a target strategy for increasing the conversation difficulty corresponding to the target round;
in a conversation of the target round, obtaining a candidate conversation sentence of the role according to the portraits of the roles and the plot; and
obtaining the sample conversation sentence of the role by adopting the target strategy according to the portraits of the roles, the plot, the candidate conversation sentence and a historical conversation sentence of the candidate conversation sentence.

### Claim 6 (depends on 2)

The method of claim 2, wherein obtaining the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot, comprises:
verifying the plot; and
in response to the plot passing the verification, obtaining the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot.

### Claim 7 (depends on 2)

The method of claim 2, wherein obtaining the portraits of the plurality of roles and the plot, comprises:
obtaining the portraits of the plurality of roles; and
generating the plot according to the portraits of the plurality of roles by calling a second large model.

### Claim 8 (depends on 7)

The method of claim 7, wherein obtaining the portraits of the plurality of roles comprises at least one of:
determining the portraits of the plurality of roles from portraits of a plurality of real roles;
determining a target portrait attribute from a candidate portrait attribute, determining a target attribute value of a target portrait attribute from a candidate attribute value of the target portrait attribute, and determining a portrait of the role according to the target attribute value of the target portrait attribute; and
obtaining reference portraits, and obtaining the portraits of the plurality of roles according to the reference portraits by calling a third large model.

### Claim 9 (depends on 2)

The method of claim 2, wherein obtaining the portraits of the plurality of roles and the plot, comprises:
obtaining a portrait of a target role of the plurality of roles;
obtaining the plot according to the portrait of the target role by calling a second large model; and
obtaining portraits of other roles of the plurality of roles except the target role according to the plot by calling a third large model.

### Claim 10 (depends on 2)

The method of claim 2, wherein obtaining the portraits of the plurality of roles and the plot, comprises:
obtaining the plot by calling a second large model; and
obtaining portraits of a plurality of roles in the plot according to the plot by calling a third large model.

### Claim 11 (depends on 1)

The method of claim 1, wherein obtaining a conversation sample, comprises: obtaining a plurality of conversation samples; wherein obtaining the target large model by training the initial large model according to the difference between the predicted conversation sentence and the sample conversation sentence, comprises: for a current conversation sample, obtaining a first intermediate large model by training the initial large model according to the difference between the predicted conversation sentence and the sample conversation sentence;
obtaining a second intermediate large model by training the first intermediate large model by using a next conversation sample, wherein a difficulty level of the current conversation sample is less than a difficulty level of the next conversation sample; and
continuing to train the second intermediate large model with a next conversation sample of the next conversation sample until the target large model is obtained, wherein a difficulty level of the next conversation sample is less than the difficulty level of the previous next conversation sample.

### Claim 12 (depends on 1)

The method of claim 1, comprising:
obtaining a new conversation sample based on the conversation sample, wherein the sample conversation sentence of any role in the new conversation sample is obtained by calling the target large model; and
continuing to train the target large model using the new conversation sample.

### Claim 13

An electronic device, comprising:
at least one processor; and
a memory communicatively connected to the at least one processor;
wherein the processor is configured to:
obtain a conversation sample, wherein the conversation sample comprises portraits of a plurality of roles, a plot containing the plurality of roles and a plurality of rounds of conversations among the plurality of roles;
for any one of the plurality of roles, obtain a predicted conversation sentence of the role by inputting the portraits of the plurality of roles, the plot and a historical conversation sentence corresponding to a sample conversation sentence of the role in the plurality of rounds of conversations into an initial large model; and
obtain a target large model by training the initial large model according to a difference between the predicted conversation sentence and the sample conversation sentence.

### Claim 14 (depends on 13)

The electronic device of claim 13, wherein obtain the conversation sample comprises:
obtain the portraits of the plurality of roles and the plot;
for any one of the plurality of roles, during a conversation process of the plurality of roles, obtain a sample conversation sentence of the role according to the portraits of the plurality of roles and the plot;
obtain the plurality of rounds of conversations among the plurality of roles according to sample conversation sentences of the plurality of roles in the conversation process of the plurality of roles; and
obtain the conversation sample according to the portraits of the plurality of roles, the plot and the plurality of rounds of conversations.

### Claim 15 (depends on 14)

The electronic device of claim 14, wherein obtain the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot, comprises:
obtain the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot by calling a first large model corresponding to the role, wherein different roles of the plurality of roles correspond to different first large models.

### Claim 16 (depends on 15)

The electronic device of claim 15, wherein obtain the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot by calling the first large model corresponding to the role, comprises:
obtain a language style of the role; and
obtain the sample conversation sentence of the role according to the portraits of the plurality of roles, the plot and the language style by calling the first large model corresponding to the role.

### Claim 17 (depends on 14)

The electronic device of claim 14, wherein obtain the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot, comprises:
determine a target round whose conversation difficulty is to be increased and a target strategy for increasing the conversation difficulty corresponding to the target round;
in a conversation of the target round, obtain a candidate conversation sentence of the role according to the portraits of the roles and the plot; and
obtain the sample conversation sentence of the role by adopting the target strategy according to the portraits of the roles, the plot, the candidate conversation sentence and a historical conversation sentence of the candidate conversation sentence.

### Claim 18 (depends on 14)

The electronic device of claim 14, wherein obtain the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot, comprises:
verify the plot; and
in response to the plot passing the verification, obtain the sample conversation sentence of the role according to the portraits of the plurality of roles and the plot.

### Claim 19

A non-transitory computer-readable storage medium having computer instructions stored thereon, wherein the computer instructions are used to cause a computer to perform the method for training a large model, comprising:
obtaining a conversation sample, wherein the conversation sample comprises portraits of a plurality of roles, a plot containing the plurality of roles and a plurality of rounds of conversations among the plurality of roles;
for any one of the plurality of roles, obtaining a predicted conversation sentence of the role by inputting the portraits of the plurality of roles, the plot and a historical conversation sentence corresponding to a sample conversation sentence of the role in the plurality of rounds of conversations into an initial large model; and
obtaining a target large model by training the initial large model according to a difference between the predicted conversation sentence and the sample conversation sentence.

### Claim 20 (depends on 1)

A computer program product comprising computer programs, wherein when the computer programs are executed by a processor, the steps of the method of claim 1 are implemented.
