Large language model training method for urban areas and urban generative intelligence method and device

The training method integrates urban-specific data and fine-tuning to create a large language model with professional knowledge and cognitive reasoning, addressing the limitations of existing models in handling complex urban environments.

CN118760898BActive Publication Date: 2024-12-31TSINGHUA UNIVERSITY
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411245264.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2024-12-31
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

Existing generative artificial intelligence methods, particularly large language models, struggle to adapt to the complex and diverse urban environments, lacking generalization capabilities and cognitive reasoning, and are unable to effectively handle heterogeneous data.

Method used

A training method that incorporates urban-specific data through a composite dataset, including city knowledge graphs, geographic data, and human behavior data, followed by fine-tuning and preference alignment to create a target city large model with professional knowledge and cognitive reasoning capabilities.

Benefits of technology

The method enables the large language model to respond accurately to urban-related queries and tasks, aligning with human expectations and demonstrating strong generalization and reasoning abilities in urban scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760898B_ABST
    Figure CN118760898B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the field of artificial intelligence, and in particular to a large language model training method for the urban field and a city generative intelligent method and device. The training method includes: obtaining a general large language model and an initial data set; obtaining a composite data set by setting an intelligent agent in a virtual urban scene to simulate various behaviors of humans in a real urban scene; mixing the composite data set with the initial data set into a pre-training data set, and using the pre-training data set to incrementally pre-train the general large language model to obtain a first urban large model; using a fine-tuning data set constructed for the urban field to fine-tune the first urban large model to obtain a second urban large model; using a human preference data set to perform preference alignment training on the second urban large model to obtain a target urban large model. In this way, a target urban large model with professional knowledge in the urban field, universal common sense in the world, and cognitive reasoning capabilities can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a large language model training method for urban areas and an urban generative intelligence method and device. Background Art

[0002] In recent years, generative artificial intelligence, especially represented by large natural language models (i.e., large language models), has made great breakthroughs in common sense understanding and reasoning cognition, and has achieved good application results in code generation, role-playing, multi-round dialogues and other aspects, demonstrating its potential as a general intelligent solution. However, how to apply advanced generative artificial intelligence methods to urban scenarios is an unresolved problem. Most existing methods only apply large natural language models to scenarios that are directly related to natural language, and are unable to handle the large amount of heterogeneous data generated in the diverse and complex scenarios in urban environments, making it impossible to directly apply large natural language models.

[0003] Therefore, how to design a large natural language model for the urban field that has strong generalization capabilities, can adapt to complex environments, and has cognitive reasoning capabilities has become an urgent problem to be solved. Summary of the invention

[0004] In view of this, the present invention proposes a large language model training method for the urban field and an urban generative intelligent method and device, which can learn the relevant knowledge of the urban field into a universal large language model, and obtain a target city large model with professional knowledge in the urban field, universal common sense in the world, and cognitive reasoning capabilities.

[0005] According to one aspect of the present disclosure, a large language model training method for the urban domain is provided, comprising: obtaining a general large language model for a general domain and an initial data set constructed for the urban domain, wherein the initial data set comprises general corpus data for the general domain and a variety of domain-specific data for the urban domain; simulating a virtual urban scene based on the various domain-specific data, and arranging an intelligent agent in the virtual urban scene to simulate a variety of human behaviors in a real urban scene, thereby obtaining a composite data set, wherein the composite data set comprises: composite data of the intelligent agent in the process of simulating various behaviors recorded in the form of natural language, and the composite data comprises urban environment information around the intelligent agent; information and state change information, wherein the state change information represents the state change of the behavior of the agent; the composite data set is mixed with the initial data set into a pre-training data set, and the general large language model is incrementally pre-trained using the pre-training data set to obtain a first city large model; the first city large model is fine-tuned using a fine-tuning data set constructed for the urban field to obtain a second city large model, wherein the fine-tuning data set includes general question-answering data in the general field, specific question-answering data for the urban field, and solution data for solving specific tasks in the urban field; the second city large model is subjected to preference alignment training using a human preference data set to obtain a target city large model.

[0006] In a possible implementation, the process of constructing multiple domain-specific data in the initial data set includes: obtaining a city knowledge graph for the urban domain, converting each pair of tuples in the urban knowledge graph into a text sentence, and combining each pair of tuples with the text sentence converted from each pair of tuples to obtain a first type of training instance; obtaining geographic data for the urban domain, and representing the geographic data in GeoJSON format to obtain a second type of training instance; obtaining human behavior data for the urban domain, and aligning the human behavior data with the urban knowledge graph and the geographic data to obtain a third type of training instance; wherein the multiple domain-specific data include the first type of training instances, the second type of training instances, and the third type of training instances.

[0007] In a possible implementation, the method also includes performing the following performance evaluation on the target city big model: selecting sample data from the pre-training data set, using a general large language model to generate sample question-answer pairs based on the input first prompt information and the sample data, using the general large language model to verify the accuracy of the sample question-answer pairs based on the input second prompt information, and filtering out sample question-answer pairs with an accuracy lower than a preset threshold to obtain a first category of question-answer pairs; extracting a second category of question-answer pairs involving the urban field from multiple general evaluation data sets in general fields, and converting the first category of question-answer pairs and the second category of question-answer pairs into multiple-choice question forms to obtain a first evaluation data set; using the first evaluation data set to evaluate the accuracy of the urban knowledge output by the target city big model to obtain a first performance evaluation result of the target city big model, so as to retrain the target city big model when the first performance evaluation indicates that the accuracy of the urban knowledge output by the target city big model does not meet the preset accuracy threshold.

[0008] In a possible implementation, the method further includes performing the following performance evaluation on the target city big model: constructing a second evaluation data set, the second evaluation data set including question-answer pairs that cannot be extracted from the pre-training data set, and using the second evaluation data set to evaluate the accuracy of the target city big model in reasoning unknown problems, to obtain a second performance evaluation result of the target city big model, so as to retrain the target city big model when the second performance evaluation result indicates that the accuracy of the target city big model in reasoning unknown problems does not meet a preset accuracy threshold; and / or, constructing a third evaluation data set, the third evaluation data set including solutions to a variety of specific tasks in the urban field, and using the third evaluation data set to evaluate the success rate of the target city big model in solving various specific tasks, to obtain a third performance evaluation result of the target city big model, so as to retrain the target city big model when the third performance evaluation result indicates that the success rate of the target city big model in solving various specific tasks does not meet a preset success rate threshold.

[0009] In a possible implementation, mixing the compound dataset and the initial dataset into a pre-training dataset includes: mixing the compound dataset and the initial dataset into a pre-training dataset according to a first preset mixing ratio, wherein the first preset mixing ratio is used to indicate the quantitative ratio between the general corpus data, the domain-specific data, and the compound data contained in the pre-training dataset; wherein the fine-tuning dataset is constructed according to a second preset mixing ratio, and the second preset mixing ratio is used to indicate the quantitative ratio between the general question and answer data, the specific question and answer data, and the solution data contained in the fine-tuning dataset.

[0010] According to one aspect of the present disclosure, a city generative intelligence method is provided, comprising: in response to receiving multimodal question information, encoding the question information to obtain target information, and inputting the target information into a target city big model, wherein the target city big model is trained using the training method; based on the target information, the target city big model retrieves additional knowledge related to the target information from a customized memory module and an experience memory module, wherein the customized memory module is used to store professional knowledge for specific scenarios in the urban field, and the experience memory module is used to store experience knowledge accumulated by the target city big model during operation, wherein the additional knowledge includes professional knowledge and / or experience knowledge; the target city big model makes inference decisions based on the additional knowledge and the core background knowledge stored in the target city big model itself, and obtains an answer result output by the target city big model, wherein the core background knowledge includes general knowledge, city knowledge and world common sense learned by the target city big model during training.

[0011] In a possible implementation, the method further includes: post-processing the answer result output by the target city large model according to a preset processing rule to obtain a target answer result.

[0012] According to another aspect of the present disclosure, a large language model training device for the urban field is provided, comprising: an acquisition module, used to acquire a general large language model for a general field and an initial data set constructed for the urban field, wherein the initial data set includes general corpus data for the general field and a variety of field-specific data for the urban field; a composite data set construction module, used to simulate a virtual urban scene based on the various field-specific data, and to obtain a composite data set by setting an intelligent agent in the virtual urban scene to simulate a variety of human behaviors in a real urban scene, wherein the composite data set includes: composite data of the intelligent agent in the process of simulating various behaviors recorded in the form of natural language, wherein the composite data includes urban environment information around the intelligent agent and status information. state change information, wherein the state change information represents the state change of the behavior of the agent; a pre-training module, used to mix the composite data set and the initial data set into a pre-training data set, and use the pre-training data set to perform incremental pre-training on the general large language model to obtain a first city large model; a fine-tuning training module, used to perform fine-tuning training on the first city large model using a fine-tuning data set constructed for the city domain to obtain a second city large model, wherein the fine-tuning data set includes general question-and-answer data in a general domain, specific question-and-answer data for an urban domain, and task question-and-answer data for solving specific tasks in the urban domain; a preference alignment module, used to perform preference alignment training on the second city large model using a human preference data set to obtain a target city large model.

[0013] According to another aspect of the present disclosure, a city generative intelligent device is provided, comprising: a multimodal input module, for, in response to receiving multimodal question information, encoding the question information to obtain target information, and inputting the target information into a target city big model, wherein the target city big model is trained using the training method; a customized memory module, for storing professional knowledge for specific scenarios in the urban field; an experience memory module, for storing the experience knowledge accumulated by the target city big model during operation; wherein the target city big model comprises a general memory module and a reasoning decision kernel; the general memory module is for storing core background knowledge learned by the target city big model during training, wherein the core background knowledge comprises general knowledge, city knowledge and world common sense; the reasoning decision kernel is for retrieving additional knowledge related to the target information from the customized memory module and the experience memory module based on the target information input by the multimodal input module, wherein the additional knowledge comprises professional knowledge and / or experience knowledge, and making reasoning decisions based on the additional knowledge combined with the core background knowledge to obtain the answer result output by the target city big model for the question information.

[0014] According to another aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing processor-executable instructions; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0015] According to another aspect of the present disclosure, a non-volatile computer-readable storage medium is provided, on which computer program instructions are stored, wherein the computer program instructions implement the above method when executed by a processor.

[0016] According to another aspect of the present disclosure, a computer program product is provided, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0017] According to various aspects of the present disclosure, by utilizing a composite data set determined by various domain-specific data in the urban field and mixing the composite data set with the initial data set as a pre-training data set, a first city big model that has learned urban knowledge can be efficiently trained, and then the first city big model can be fine-tuned using the fine-tuning data set so that the trained second city big model can respond to input instructions and output answers that meet human expectations, and then the second city big model can be trained for preference alignment using the human-edited data set so that the trained target city big model can be more in line with human preferences, thereby obtaining a target city big model for the urban field with strong generalization capabilities that possesses professional knowledge in the urban field, universal common sense, and cognitive reasoning capabilities.

[0018] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.

[0020] Figure 1 A schematic diagram of a large language model training process for an urban domain according to an embodiment of the present disclosure is shown.

[0021] Figure 2 A flowchart of a large language model training method for urban areas according to an embodiment of the present disclosure is shown.

[0022] Figure 3 A schematic diagram of an evaluation framework according to an embodiment of the present disclosure is shown.

[0023] Figure 4a An example diagram showing a question-answering example about urban common sense using an existing large language model.

[0024] Figure 4b An example diagram of question and answer about city common sense using a large model of a target city according to an embodiment of the present disclosure is shown.

[0025] Figure 5a An example diagram of question answering about path planning using an existing large language model is shown.

[0026] Figure 5b An example diagram of questions and answers regarding path planning using a large model of a target city according to an embodiment of the present disclosure is shown.

[0027] Figure 6 A block diagram of a city-generating smart device according to an embodiment of the present disclosure is shown.

[0028] Figure 7A flow chart of a city generative intelligence method according to an embodiment of the present disclosure is shown.

[0029] Figure 8 A schematic diagram of the use process of an urban generative intelligent method for a mobility prediction task according to an embodiment of the present disclosure is shown.

[0030] Fig. 9 A schematic diagram showing the execution flow of a training method and an intelligent method according to an embodiment of the present disclosure.

[0031] Fig.10 A block diagram of a large language model training device for urban areas according to an embodiment of the present disclosure is shown.

[0032] Fig.11 A block diagram of an electronic device 1900 according to an embodiment of the present disclosure is shown. DETAILED DESCRIPTION

[0033] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.

[0034] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.

[0035] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0036] It should be understood that the terms "first", "second", etc. in the claims, specifications and drawings of the present disclosure are used to distinguish different objects rather than to describe a specific order. The terms "include" and "comprise" used in the specifications and claims of the present disclosure indicate the presence of the described features, wholes, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or their collections.

[0037] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the main purpose of the present disclosure.

[0038] The investigation found that the existing intelligent work in the urban field has the following limitations: 1) Most of the existing urban behavior simulation methods rely on simple rules to define behavior or fit distributions from large-scale historical data to achieve their goals. The behavior modeling is simple and not accurate enough, and lacks cognitive reasoning capabilities; 2) Most of the existing urban intelligence methods target specific sub-problems in the urban field and solve the problem by collecting a large amount of data to train specific models. They have the limitation that they can only be applied to a single simple scenario and cannot be generalized to other scenarios and problems; 3) Methods based on large natural language models cannot handle multi-source heterogeneous data in urban environments, and can only be extracted and processed according to simple rules, and cannot be effectively applied to complex problems in urban scenarios.

[0039] The large language model training method and generative intelligence method for the urban field proposed in the embodiments of the present disclosure is to learn the city-related knowledge into the universal large language model, thereby obtaining a target city large model for the urban field that has both professional knowledge in the urban field, world common knowledge, and cognitive reasoning capabilities. And with the target city large model as the core, the city generation intelligence method can be implemented, thereby supporting the realization of an efficient and intelligent solution simulation and verification platform for urban problems.

[0040] In practical applications, the large language model training method and generative intelligence method for the urban field of the embodiment of the present disclosure can be deployed on various terminal devices through software or hardware modification. The terminal device involved in the embodiment of the present disclosure may refer to a device with a wireless connection function and / or a wired connection function. The wireless connection function refers to the ability to connect to other devices through wireless connection methods such as wifi and Bluetooth. The terminal device involved in the embodiment of the present disclosure can also communicate with other devices through a wired connection function. The terminal device involved in the embodiment of the present disclosure can be a touch screen, a non-touch screen, or a screen-free device. The touch screen can control the terminal device by clicking and sliding on the display screen with a finger or a stylus. The non-touch screen device can be connected to an input device such as a mouse, keyboard, touch panel, etc., and the terminal device can be controlled by the input device. The device without a screen can be, for example, a Bluetooth speaker without a screen. For example, the terminal device of the present application may include but is not limited to user equipment (UE), mobile devices, user terminals, terminals, handheld devices, tablet computers, laptops, PDAs, computing devices, etc.

[0041] The large language model training method and generative intelligence method for the urban field of the embodiment of the present disclosure can also be deployed on a server, which can be located in the cloud or locally, and can be a physical device or a virtual device, such as a virtual machine, a container, etc., with a wireless communication function, wherein the wireless communication function can be set in the chip (system) or other parts or components of the server. It can refer to a device with a wireless connection function, and the function of wireless connection refers to the ability to connect to other servers or terminal devices through wireless connection methods such as Wi-Fi and Bluetooth. The server involved in the embodiment of the present disclosure may also have the function of communicating through a wired connection. For example, the server can receive the initial data set sent by the above-mentioned terminal device, and train a large urban model based on the initial data set using the training method deployed with the server. It can also receive question information sent by the terminal device, so as to output the answer result based on the question information using the urban urban intelligent method deployed on the server, and return the answer result to the terminal device, so as to display the answer result to the user through the terminal device, and the embodiment of the present disclosure is not limited to this.

[0042] Figure 1 A schematic diagram of a large language model training process for the urban field according to an embodiment of the present disclosure is shown as follows: Figure 1 As shown in the figure, the training process mainly includes stage 1 and stage 2, wherein stage 1 is used to perform incremental pre-training on the general natural language model (i.e., general large language model) using general text data and domain-specific data to embed urban domain knowledge into the general large language model; stage 2 is used to perform supervised fine-tuning and reinforcement alignment (i.e., preference alignment) training on the large language model pre-trained in stage 1 to enhance the urban intelligence of the large language model pre-trained in stage 1 and obtain the trained target city large model.

[0043] Based on the above Figure 1 The training process shown below is combined with Figures 2 to 3 The large language model training method for the urban field proposed in the embodiment of the present disclosure is introduced in detail.

[0044] Figure 2 A flowchart of a large language model training method for the urban domain according to an embodiment of the present disclosure is shown. The method can be executed by the above-mentioned terminal device or server or other electronic device, such as Figure 2 As shown, the training method includes: step S11 to step S15.

[0045] In step S11, a general large language model of a general domain and an initial data set constructed for an urban domain are obtained, wherein the initial data set includes general corpus data of the general domain and a variety of domain-specific data for the urban domain.

[0046] Among them, the general large language model can adopt any known large language model in the general field (that is, a natural language large model), which is not limited in the embodiments of the present disclosure.

[0047] It is known that most of the training corpus of the existing large language model comes from public network texts, such as network texts obtained by web crawling. However, specific data such as urban domain data are usually not public, and usually require specific data processing methods to process them before they can be used. Therefore, it is necessary to embed the processed urban domain data learning into a general large language model. There are currently several methods for incorporating external knowledge into a large language model, including retrieval-based methods, fine-tuning-based methods, and continuous pre-training-based methods. Retrieval-based methods rely on an effective retrieval mechanism and can only use limited knowledge each time. Although fine-tuning methods can introduce more knowledge than retrieval methods, their capabilities are still limited, and when the model is required to output content that has not been learned during its pre-training, it may cause hallucinations in the large language model. Therefore, the disclosed embodiment applies a continuous pre-training method to incorporate urban domain knowledge into a general large language model to construct a large urban model.

[0048] In practical applications, we can collect general corpus data (such as academic data, research papers, legal text data, high-quality code data, and online network text (i.e. web page text) in general fields), as well as specific data for urban fields (such as urban knowledge graphs, geographic data, human behavior data, etc.) to build an initial dataset, so as to use the initial dataset to continuously pre-train the general large language model.

[0049] Among them, the general corpus data can be processed by referring to the data cleaning rules in the open source large language model. As for the specific data in the urban field, special processing can be performed on the collected specific data to meet the training requirements of the large language model. Specifically, the construction process of various field-specific data in the above initial data set can include:

[0050] Obtaining a city knowledge graph for the city field, converting each pair of tuples in the city knowledge graph into a text sentence, and combining each pair of tuples with the text sentence converted from each pair of tuples to obtain a first type of training instance;

[0051] Obtain geographic data for the city domain and represent the geographic data in GeoJSON format to obtain the second type of training instances;

[0052] Acquire human behavior data for the urban domain, and align the human behavior data with the urban knowledge graph and the geographic data to obtain a third type of training instance;

[0053] The multiple domain-specific data include the first category of training instances, the second category of training instances, and the third category of training instances.

[0054] Among them, the urban knowledge graph can be understood as a knowledge graph for the urban field. The disclosed embodiment does not limit the construction process of the urban knowledge graph. For the urban knowledge graph, a general knowledge-text prediction task can be applied to integrate the knowledge in the urban knowledge graph into a general large language model. Specifically, for any pair of tuples (which can be triples) in the urban knowledge graph, an existing natural language large model can be used to generate a related text sentence based on the pair of tuples, and then the pair of tuples and the related text sentences can be combined into a training instance (that is, a training sample). It should be understood that for each pair of tuples in the urban knowledge graph, the above-mentioned method can be used to convert each pair of tuples in the urban knowledge graph into a text sentence, and each pair of tuples can be combined with the text sentence converted from each pair of tuples to obtain a first type of training instance, and the first type of training instance includes the combined data of each pair of tuples and the related text sentences. For example, assuming there is a pair of triples (China, Beijing, capital) in the city knowledge graph, the text sentence it converts into can be "The capital of China is Beijing", and then "The capital of China is Beijing" can be combined with the triple (China, Beijing, capital) into a training instance.

[0055] Among them, geographic data can be understood as the geographic data contained in the digital map, such as longitude and latitude, altitude, building information, road information, railway information, subway information, etc. In order to facilitate the general large language model to process geographic data, the GeoJSON format (a JSON-based geographic data exchange format) can be used to organize each object in the geographic data as a separate training instance, that is, the geographic data is represented in the GeoJSON format to obtain the second type of training instance.

[0056] Among them, human behavior data can be understood as data that describes the behavior of humans at a certain time and place. Considering that there is associated data between human behavior data and the above-mentioned urban knowledge graph and geographic data, for example, the urban knowledge graph contains tuples about "Beijing", the geographic data contains geographic information of "Beijing", and the human behavior data contains human behavior in "Beijing". The word descriptions of "Beijing" in human behavior data and urban knowledge graph and geographic data may be different. Therefore, the elements in the human behavior data can be aligned with the urban knowledge graph and geographic data to ensure that the word parameters, identifiers, etc. in the above three types of data are consistent. Among them, each aligned behavior session in the human behavior data can be regarded as a single training instance, and each aligned behavior session in the human behavior data can constitute a third type of training instance.

[0057] In step S12, a virtual city scene is simulated based on various domain-specific data, and an intelligent agent is set in the virtual city scene to simulate various behaviors of humans in a real city scene, thereby obtaining a composite data set. The composite data set includes: composite data of the intelligent agent in the process of simulating various behaviors recorded in natural language, the composite data includes urban environment information around the intelligent agent and state change information, and the state change information represents the state change of the intelligent agent's behavior.

[0058] In practical applications, a city simulator known in the art can be used to integrate various domain-specific data to simulate a virtual city scene to form a composite data set. Specifically, various domain-specific data can be organized together with the city simulator as the core to simulate a virtual city scene, and then a simple intelligent agent can be designed in the city simulator to freely explore the urban environment in the virtual city scene and autonomously complete specific tasks (such as path planning, schedule scheduling, daily social interaction, etc.), that is, to achieve the simulation of various behaviors of humans in real city scenes by setting an intelligent agent in the virtual city scene, and to record the surrounding environment and state change information of the intelligent agent in the form of natural language during these behaviors, that is, to record various information that can be recorded in the process of the intelligent agent completing various specific tasks. For example, the intelligent agent simulates the behavior from location A to location B. In this behavior process, the urban environment information around the intelligent agent (such as road information, building information, transportation information, etc.) and state change information (such as the changed geographical location of the intelligent agent, the changed traffic flow information, the flow of people information, the change information of traffic lights at intersections, etc.) can be recorded, thereby completing the reorganization and collection process of composite data (also known as heterogeneous data) to obtain a composite data set. This composite dataset will be integrated with the above initial dataset as a pre-training dataset for the general large language model for incremental pre-training.

[0059] In step S13, the composite data set and the initial data set are mixed into a pre-training data set, and the pre-training data set is used to perform incremental pre-training on the general large language model to obtain the first city large model.

[0060] It can be understood that by mixing the composite data set with the initial data set as a pre-training data set to train the general large language model, it is equivalent to mixing the specific domain data of the urban field and the general corpus data on which the general large language model depends for fusion training. The core of fusion training is to balance the general ability and the newly added ability, that is, to take into account the ability of the first urban large model in the general field and the urban field after training. Therefore, in a possible implementation method, the ability change law of large models of different scales can be explored by finely controlling the data ratio, adjusting the data form, etc., to form a scaling law experience curve in which the data scale and the mixing ratio are equal to the model performance, thereby achieving a balanced development between the general ability and the newly added urban field knowledge. Specifically, the mixing of the composite data set with the initial data set into the pre-training data set includes: mixing the composite data set with the initial data set into the pre-training data set according to a first preset mixing ratio, wherein the first preset mixing ratio is used to indicate the quantitative ratio between the general corpus data, the domain-specific data, and the composite data contained in the pre-training data set.

[0061] In practical applications, for example, different mixing ratios can be traversed at a basic interval of 0.1 to experiment with different mixing ratios to confirm the best mixing ratio as the above-mentioned first preset mixing ratio. Specifically, the above-mentioned general corpus data, domain-specific data, and composite data can be mixed at different mixing ratios to obtain mixed data sets with different mixing ratios, and then the general large language model can be trained using the mixed data sets with different mixing ratios (for example, one round of training can be performed), and the performance of the large language model trained by the mixed data sets with different mixing ratios can be evaluated, and then the mixing ratio with the best performance can be selected as the above-mentioned first preset mixing ratio. In the process of conducting experiments with different mixing ratios, the other model parameters and training parameters of the general large language model remain unchanged. In this way, the first large city model after training can take into account the knowledge of both the general field and the urban field.

[0062] In practical applications, any known incremental pre-training method in the art can be used to implement incremental pre-training of the general large language model using the pre-training data set to obtain the first city large model, which is not limited in the embodiments of the present disclosure. For example, in incremental pre-training, the cross entropy loss function shown in formula (1) can be used As the loss function for training the above-mentioned general large language model, it is used to perform the next word prediction task to complete the model update, that is, to complete the incremental pre-training.

[0063] (1)

[0064] Where M represents the number of categories, is a sign function (0 or 1), if the sample The true category of is equal to c is 1, otherwise is 0; For the observed sample The predicted probability of belonging to category c, N is the number of samples, For sample The corresponding loss.

[0065] In step S14, the first city large model is fine-tuned and trained using a fine-tuning dataset constructed for the urban field to obtain a second city large model. The fine-tuning dataset includes general question and answer data in the general field, specific question and answer data for the urban field, and solution data for solving specific tasks in the urban field.

[0066] It can be known that after the incremental pre-training process of step S13 above, the first city big model has acquired various urban knowledge. Although information can be extracted directly from the first city big model through contextual learning methods, a small number of examples are required during use, and these examples are not easy to build. In addition, humans usually hope that the target city big model obtained after training can respond according to the input factual urban knowledge and output the response results according to instructions with a standard output format (such as JSON format). Therefore, the first city big model can be trained by fine-tuning the data set to guide the first city big model to have these capabilities to respond to inputs and output response results according to human expectations. Therefore, supervised fine-tuning and preference alignment can be used to achieve this goal.

[0067] Among them, the supervised fine-tuning training stage can use a fine-tuning dataset for the urban field. Specifically, a fine-tuning dataset specific to the urban field can be constructed, including general question and answer data (such as question and answer data generated in scenarios such as daily chat, communication and collaboration, and knowledge question and answer), specific question and answer data for the urban field (such as question and answer data generated in professional discussions in urban fields, disciplines, and scenarios), and solution data for solving specific tasks in the urban field (such as social solutions for social behaviors in urban spaces, management solutions for schedule management, and navigation solutions for navigation planning, etc.).

[0068] Among them, the general question-answering dataset can adopt the existing open source general question-answering dataset, which can teach the model how to communicate fluently with people. Similar to the self-guidance framework, specific question-answering data for the urban field can be constructed by using the existing general natural language big model to generate question-answer pairs in the urban field based on the text corpus specific to the urban field. Various specific tasks in the urban field can be solved with the assistance of the existing general natural language big model and external tools (such as navigation software for navigation planning, management software for schedule management, and social software for social behavior) to obtain solution data for various specific tasks. Among them, urban knowledge data such as urban knowledge graphs can not only be used to construct the initial dataset in the incremental pre-training stage, but also the urban knowledge graph can be used as an external knowledge source to solve various specific tasks.

[0069] It should be understood that the construction process of the above-mentioned fine-tuning dataset is a possible implementation method provided by the embodiment of the present disclosure. In fact, those skilled in the art can design the number and types of samples included in the fine-tuning dataset according to actual conditions, and the embodiment of the present disclosure does not limit this.

[0070] In one possible implementation, in order to balance the general capabilities and newly added capabilities in the supervised fine-tuning training phase, the fine-tuning dataset can be constructed according to a second preset mixing ratio, which is used to indicate the quantitative ratio between the general question and answer data, specific question and answer data, and solution data contained in the fine-tuning dataset. Among them, the second preset mixing ratio can be obtained by referring to the generation method of the first preset mixing ratio, which will not be described in detail here. In this way, the trained second city model can have question and answer capabilities in both general and urban fields.

[0071] In practical applications, any supervised fine-tuning training method known in the art can be used to implement fine-tuning training of the first city model using the fine-tuning data set constructed for the city field to obtain the second city model, and the embodiments of the present disclosure are not limited to this. For example, in supervised fine-tuning training, the cross entropy loss function shown in the above formula (1) can also be used to supervise fine-tune the above first city model. The difference is that in supervised fine-tuning training, only the answer part in the fine-tuning data set can be calculated for loss, and the attention mask can be used to shield the influence of the question part on the loss.

[0072] In step S15, preference alignment training is performed on the second city model using the human preference dataset to obtain the target city model.

[0073] In practical applications, the human preference dataset can be any open source human preference dataset in the art, and the embodiments of the present disclosure are not limited to this. Also, a preference alignment method known in the art, such as direct preference alignment (DPO), can be used to implement preference alignment training of the second city model using the human preference dataset to obtain the target city model. It should be understood that the embodiments of the present disclosure do not limit the preference alignment process. For example, the loss function of DPO shown in formula (2) can be used. To achieve preference alignment training for the second city model. In this way, the trained target city model can be made to meet human preferences.

[0074]

[0075] in, represents a human preference dataset, Representative Tips, represents the preferred output, represents non-preferred output, Represents the second city model being trained, represents a reference large language model, wherein the first large language model mentioned above can be used as the reference large language model, Represents the logistic regression function (logistic function), represents the hyperparameter, E x, y w , y l ~D [∙] represents the KL divergence.

[0076] According to the training method of the embodiment of the present disclosure, by utilizing a composite data set determined by various domain-specific data in the urban field and mixing the composite data set with the initial data set as a pre-training data set, a first city big model that has learned urban knowledge can be efficiently trained, and then the first city big model can be fine-tuned using the fine-tuning data set so that the trained second city big model can respond to input instructions and output answers that meet human expectations, and then the second city big model can be trained for preference alignment using the human-edited data set so that the trained target city big model can be more in line with human preferences, thereby obtaining a target city big model with strong generalization capabilities that has professional knowledge in the urban field, universal common sense, and cognitive reasoning capabilities and is oriented to the urban field.

[0077] In order to verify whether the performance of the target city large model is qualified, the embodiment of the present disclosure also provides a Figure 3 The evaluation framework shown in FIG. 1 can evaluate the performance of the trained target city model and the urban generative intelligence method based on the target city model described later. Figure 3As shown, the assessment framework includes:

[0078] The first level of automatic question-answering evaluation: evaluate the urban knowledge of the target city model through automated domain-specific question-answering. Specifically, urban domain-specific question-answer pairs (i.e., related questions in the general evaluation set) can be extracted from multiple general evaluation datasets known in the art (such as Gaokao, C-Eval, and CMMLU). In addition, urban domain-specific question-answer pairs (i.e., domain-related professional evaluation questions) can be constructed based on pre-trained datasets with the help of powerful advanced natural language models. Among them, sample instances can be randomly selected from the pre-trained dataset first. Then, through pre-designed prompt information, the natural language model is required to generate question-answer pairs (i.e., a pair of questions and answers) based on the input prompt information and sample instances. Another prompt is designed to require the natural language model to verify the quality (such as accuracy) of the generated question-answer pairs and filter out question-answer pairs with lower quality. In this way, question-answer pairs covering specific fields in urban fields such as transportation, civil engineering, environment, and geography can be collected. For automated evaluation (i.e., automatic question-and-answer evaluation), all question-and-answer pairs can be formatted as multiple-choice questions (i.e., multiple-choice questions and answers), and the accuracy rate can be used as an evaluation metric to evaluate the basic knowledge (i.e., basic urban knowledge) mastered by the target city model.

[0079] The second level of manual evaluation: evaluate the simple reasoning ability of the target city model through manually labeled domain-specific questions and answers (that is, manually evaluate whether the target city model has simple reasoning ability). Unlike the first level of evaluation, the second level mainly evaluates whether the model can answer questions that cannot be directly extracted from the above pre-training dataset. Therefore, volunteers with various backgrounds can be recruited to write professional questions and corresponding answers related to the urban field (that is, questions and answers written by experts). In order to ensure the coverage of urban field issues, the classification of problems in each specific field can be pre-defined to guide volunteers to choose topics, that is, to define categories to ensure coverage. For example, Figure 4a An example of question answering about urban common sense using an existing large language model is shown. Figure 4b An example of question-answering about city common sense using the target city large language model according to an embodiment of the present disclosure is shown. Figure 5a An example of question answering about path planning using an existing large language model is shown. Figure 5b An example of question and answer regarding route planning using a large model of a target city according to an embodiment of the present disclosure is shown.

[0080] The third layer solves the evaluation of city characteristic tasks: evaluate the planning and decision-making capabilities of the target city model or the city generative intelligence method by solving specific tasks in the city. Among them, several complex city-specific tasks can be introduced as the third-layer evaluation to verify the capabilities of the target city model and the city generative intelligence method in long-term planning and decision-making. For example, the next location prediction, map-free point of interest navigation, daily schedule planning, and social simulation can be evaluated as city-specific tasks, and these city-specific tasks can be understood as tasks that rely on urban environmental knowledge. In practical applications, the data set required for evaluation can be obtained based on the virtual city scene simulated by the above-mentioned city simulator and the setting of the intelligent agent to complete these specific tasks in the virtual city scene. In addition to mastering the above-mentioned basic skills, the intelligent agent can also master some advanced skills, such as spatiotemporal reasoning, multi-step goal decomposition, and the use of external tools. For each city task, hundreds of task samples can be used for the intelligent agent to complete, and the overall success rate of these task samples can be used as the final indicator for evaluation. It should be understood that the definition of success rate depends on the specific tasks of the city. The embodiments of the present disclosure do not limit the definition rules of the success rates of different tasks. For example, for tasks based on social simulation, the standard for successful completion of the task can be defined as the result conforming to the general rules in the field and various predefined metrics.

[0081] Based on the above Figure 3 In the first layer of the evaluation framework shown, in a possible implementation, the method further includes performing the following performance evaluation on the target city large model:

[0082] Select sample data from the pre-training data set, use the general large language model to generate sample question-answer pairs according to the input first prompt information and the sample data, use the general large language model to verify the accuracy of the sample question-answer pairs according to the input second prompt information, and filter out sample question-answer pairs with an accuracy lower than a preset threshold to obtain a first category of question-answer pairs;

[0083] Extracting a second type of question-answer pairs related to the urban field from a plurality of general evaluation data sets in a general field, and converting the first type of question-answer pairs and the second type of question-answer pairs into multiple-choice question forms, respectively, to obtain a first evaluation data set;

[0084] The first evaluation data set is used to evaluate the accuracy of the urban knowledge output by the target city big model, and a first performance evaluation result of the target city big model is obtained, so as to retrain the target city big model when the first performance evaluation indicates that the accuracy of the urban knowledge output by the target city big model does not meet a preset accuracy threshold.

[0085] Among them, multiple sample data can be randomly selected from the pre-training data set, and then the first prompt information is designed to instruct the general large language model to generate sample question-answer pairs based on the sample data, and then the second prompt information is designed to instruct the general large language model to verify the accuracy (i.e., quality) of the above sample question-answer pairs, so as to filter out sample question-answer pairs with an accuracy lower than a preset threshold, and obtain a first type of question-answer pairs with higher accuracy, wherein those skilled in the art can set the specific value of the preset threshold according to actual needs, and the embodiments of the present disclosure are not limited to this. In this way, the first type of question-answer pairs involving various specific fields in the urban field (such as transportation, civil engineering, environment, geography, etc.) can be collected. And the second type of question-answer pairs related to the urban field line pipe are extracted from the general evaluation data sets known in the general field (such as Gaokao, C-Eval and CMMLU mentioned above), and then all the first type of question-answer pairs and the second type of question-answer pairs are converted into multiple-choice questions to obtain the first evaluation data set.

[0086] Among them, using the first evaluation data set to evaluate the accuracy of the city knowledge output by the target city big model can include: allowing the target city big model to output answers based on the questions of each multiple-choice question in the first evaluation data set, and comparing the answers output by the target city big model with the sample answers of each multiple-choice question in the first evaluation data set to obtain the accuracy of the city knowledge output by the target city big model, wherein the first performance evaluation result may include the accuracy of the city knowledge output by the target city big model; and then it can be determined whether the accuracy of the city knowledge output by the target city big model meets the preset accuracy threshold (for example, the accuracy of the target city big model is greater than the preset accuracy threshold of 95%). When the accuracy of the city knowledge output by the target city big model meets the preset accuracy threshold, it is considered that the knowledge reserve of the target city big model is qualified, otherwise, the target city big model can be retrained according to the above-mentioned training method.

[0087] Based on the above Figure 3 In the second layer of the evaluation framework shown, in a possible implementation, the method further includes performing the following performance evaluation on the target city large model:

[0088] A second evaluation data set is constructed, where the second evaluation data set includes question-answer pairs that cannot be extracted from the pre-training data set, and the second evaluation data set is used to evaluate the accuracy of the target city large model in reasoning unknown questions, so as to obtain a second performance evaluation result of the target city large model, so as to retrain the target city large model when the second performance evaluation result indicates that the accuracy of the target city large model in reasoning unknown questions does not meet a preset accuracy threshold.

[0089] As described above, volunteers with various backgrounds can be recruited to write professional questions and corresponding answers related to the urban field (i.e., questions and answers written by experts) to obtain question-answer pairs that cannot be extracted from the preset training data set. In order to ensure the coverage of urban field problems, problem classifications in various specific fields can be pre-defined to guide volunteers to choose different problem classifications to write professional questions and related answers. The present disclosure embodiment does not limit the construction process of the above-mentioned second evaluation data set.

[0090] Among them, using the second evaluation data set to evaluate the accuracy of the target city large model in reasoning unknown problems can include: allowing the target city large model to output answers based on each professional question in the second evaluation data set, and comparing the answers output by the target city large model with the sample answers of each professional question in the second evaluation data set to obtain the accuracy of the target city large model in reasoning unknown problems, wherein the second performance evaluation result may include the accuracy of the target city large model in reasoning unknown problems; and then it can be judged whether the accuracy of the target city large model in reasoning unknown problems meets the preset accuracy threshold. It should be understood that the preset accuracy threshold used in the second layer can be the same as or different from the preset accuracy threshold used in the above-mentioned first layer, and the embodiments of the present disclosure are not limited to this. When the accuracy of the target city large model in reasoning unknown problems meets the preset accuracy threshold, it is considered that the reasoning performance of the target city large model is qualified, otherwise, the target city large model can be retrained according to the above-mentioned training method.

[0091] Based on the above Figure 3 In the third layer of the evaluation framework shown, in a possible implementation, the method further includes performing the following performance evaluation on the target city large model:

[0092] A third evaluation dataset is constructed, which includes solutions to a variety of specific tasks in the urban field. The third evaluation dataset is used to evaluate the success rate of the target city big model in solving various specific tasks, so as to obtain a third performance evaluation result of the target city big model, so as to retrain the target city big model when the third performance evaluation result indicates that the success rate of the target city big model in solving various specific tasks does not meet a preset success rate threshold.

[0093] As described above, solutions to a variety of specific tasks can be obtained based on the virtual city scene simulated by the above-mentioned city simulator and setting the agent to complete a variety of specific tasks in the virtual city scene (such as trajectory prediction, navigation of points of interest without a map, daily schedule planning and social simulation, etc.), wherein each specific task can set multiple task samples for the agent to complete, and obtain solutions to multiple task samples, for example, for the point of interest navigation task, multiple points of interest can be set for the agent to complete, so that navigation results (i.e. solutions) for multiple points of interest can be obtained. Of course, other methods known in the art can also be used to construct the above-mentioned third evaluation data set, which is not limited to this embodiment of the present disclosure.

[0094] Among them, using the third evaluation data set to evaluate the success rate of the target city big model in solving various specific tasks can include: allowing the target city big model to output solutions based on the task samples of various specific tasks in the third evaluation data set, and then comparing the solutions output by the target city big model with the sample solutions of the task samples of various specific tasks in the third evaluation data set to obtain the success rate of the target city big model in solving various specific tasks, wherein the success rate of various specific tasks can be, for example, the average value of the success rate of each task sample of various specific tasks, and the average value can be used to measure the overall ability of the target city big model to plan and decide specific tasks, and the third performance evaluation result can include the success rate of the target city big model in solving various specific tasks (that is, the success rate of the target city big model in planning and deciding various specific tasks). It should be understood that different success rate definition rules can be used for different specific tasks to determine the success rate of the target city big model in solving different specific tasks, and the embodiments of the present disclosure are not limited to this.

[0095] Then, it can be determined whether the success rate of the target city model in solving various specific tasks meets the preset success rate threshold. It should be understood that those skilled in the art can set the specific value of the preset success rate threshold according to actual needs, and the embodiments of the present disclosure are not limited to this. When the success rate of the target city model in solving various specific tasks meets the preset success rate threshold, it is considered that the planning decision-making performance of the target city model is qualified. Otherwise, the target city model can be retrained according to the above training method.

[0096] Based on the target city large model obtained by the above training, the present disclosure embodiment also provides a Figure 6 A block diagram of a city-generating intelligent device is shown in FIG. Figure 6 As shown, the device comprises:

[0097] The multimodal input module 601 is used for, in response to receiving the multimodal question information, encoding the question information to obtain target information, and inputting the target information into the target city model, where the target city model is trained using the training method;

[0098] A customized memory module 602 for storing expertise for specific scenarios in the urban domain;

[0099] Experience memory module 603, used to store the experience knowledge accumulated during the operation of the target city large model;

[0100] The target city model includes a general memory module and a reasoning decision kernel;

[0101] The general memory module 604 is used to store the core background knowledge learned by the target city model during the training process. The core background knowledge includes general knowledge, city knowledge and world common sense.

[0102] The reasoning decision kernel 605 is used to retrieve additional knowledge related to the target information from the customized memory module and the experience memory module based on the target information input by the multimodal input module, and the additional knowledge includes professional knowledge and / or experience knowledge. Based on the additional knowledge combined with the core background knowledge, reasoning decisions are made to obtain the answer result output by the target city large model for the question information.

[0103] Among them, the multimodal input module 601 can process question information in multiple modes such as text, image, voice, etc. input by the user, encode and format convert the question information, obtain target information that can be processed by the target city model, and then input the target information into the inference decision kernel 605 of the target city model.

[0104] The customized memory module 602 can store customized knowledge for specific scenarios in the urban domain injected from the outside (the customized knowledge can be more detailed and comprehensive than the urban knowledge used in the above training process), such as the knowledge graph of traffic scenarios, so that the urban large model can master customized knowledge in specific scenarios based on general knowledge. Specific scenarios can be understood as certain specific domain scenarios in the urban domain, which is a more fine-grained scene division than the urban domain.

[0105] Among them, the experience memory module 603 can store the practical experience knowledge accumulated by the continuous interaction of the target city large model during the operation process. Among them, this experience knowledge can be stored through vectorized encoding, so that when used, it can be recalled through vector similarity to perform query retrieval related to the current input problem information to assist in the processing of the current problem information.

[0106] Among them, the general memory module 604 can store the general knowledge, urban knowledge and world common sense stored by the target city model itself after training and learning, as the core background knowledge of the target city model. The reasoning decision kernel 605 is the reasoning, planning and decision-making capabilities provided by the target city model itself, wherein the model can cooperate with reasoning enhancement methods such as chain reasoning and reflective reasoning to further enhance the model's reasoning and decision-making capabilities. When specifically executing reasoning planning and decision-making, the reasoning decision kernel 605 can retrieve additional knowledge related to the target information from the customized memory module and the experience memory module based on the target information input by the multimodal input module. The additional knowledge includes professional knowledge and / or experience knowledge. Based on the additional knowledge combined with the core background knowledge, reasoning decisions are made to obtain the answer result output by the target city model for the question information, that is, the reasoning decision kernel 605 can use reasoning methods such as chain reasoning based on the target city model to combine its own stored general knowledge and retrieved additional knowledge to make reasoning decisions and output preliminary answer results.

[0107] Considering that the answer output by the target city model may not meet the requirements of the representation of specific city scenarios and some professional problems, for example, the answer output by the target city model for a certain question may be "correct" or "wrong", and the user needs to know the reason and basis for "correct" or "wrong", therefore, in a possible implementation method, Figure 6 As shown, the device may also include: a decision mechanism module 606, which is used to post-process the answer results output by the target city large model according to the preset processing rules to obtain the target answer results. The decision mechanism module 606 may have a generalized decision process (i.e., preset processing rules) customized for specific city scenarios and professional problems to post-process the output results of the target city large model to produce a real output, that is, to output the target answer results that meet the needs. It should be understood that those skilled in the art can design the specific content of the preset processing rules according to actual needs, and the embodiments of the present disclosure do not limit the specific rule content of the above-mentioned preset processing rules.

[0108] According to the system of the embodiment of the present disclosure, it is possible to construct a city intelligent body framework based on a large model of the target city, combining a unified general cognitive framework and differentiated professional processes, and create city generation intelligence with natural language interaction as the core control mode.

[0109] Based on the above-mentioned city-generating intelligent device, the embodiment of the present disclosure also provides the following Figure 7 A flowchart of a city generative intelligence method is shown in FIG. Figure 7 As shown, the smart method includes:

[0110] Step S71, in response to receiving multi-modal question information, encoding the question information to obtain target information, and inputting the target information into a target city model, where the target city model is trained using the training method; wherein the question information may include the question and environmental information and prompt information related to the question, which is not limited in the embodiment of the present disclosure;

[0111] Step S72: The target city macromodel retrieves additional knowledge related to the target information from a custom memory module and an experience memory module based on the target information. The custom memory module is used to store professional knowledge for specific scenarios in the urban field, and the experience memory module is used to store the experience knowledge accumulated by the target city macromodel during operation. The additional knowledge includes professional knowledge and / or experience knowledge.

[0112] Step S73, the target city model makes an inference decision based on the additional knowledge and the core background knowledge stored in the target city model itself, and obtains the answer result output by the target city model, wherein the core background knowledge includes the general knowledge, city knowledge and world common sense learned by the target city model during the training process. Among them, the inference decision can be made by using the inference method such as chain reasoning or reflective reasoning, which is not limited in the embodiment of the present disclosure.

[0113] In one possible implementation, Figure 7 As shown, the method may further include: step S74, post-processing the answer result output by the target city large model according to the preset processing rules to obtain the target answer result. That is, the answer result output by the target city large model may be post-processed by the above-mentioned customized decision-making mechanism module to obtain the target answer result. It should be understood that if there is no need to post-process the answer result output by the target city large model, step S74 may not be performed, that is, step S74 may be an optional option.

[0114] In practical applications, the performance of the above-mentioned urban generative intelligent method can also be evaluated by referring to the above-mentioned performance evaluation process of the target city large model, which will not be elaborated here.

[0115] For example, Figure 8 A use process of the above-mentioned urban generative intelligence method for a mobility prediction task is shown, such as Figure 8As shown, the usage process includes: step S81, inputting data corresponding to the mobile prediction problem described in natural language (such as historical geographical location information), step S82, converting the data corresponding to the mobile prediction problem into a natural language description; step S83, designing prompt words suitable for the mobile prediction problem scenario based on the converted natural language description; step S84, inputting the prompt words and natural language description into the target city model to obtain an output result; step S85, post-processing and formatting the output result of the target city model to obtain a target answer result corresponding to the question (that is, the predicted geographical location to be visited in the future).

[0116] According to the intelligent method of the embodiment of the present disclosure, it is possible to generate city generation intelligence with natural language interaction as the core control mode based on the large model of the target city.

[0117] Based on the training method and intelligent method of the above-mentioned embodiments of the present disclosure, Fig. 9 A schematic diagram showing the execution flow of a training method and an intelligent method according to an embodiment of the present disclosure is shown as follows: Fig. 9 As shown, the execution process includes:

[0118] Step S91, obtaining a general natural language large model as a base model of the city large model;

[0119] Step S92, collecting various domain-specific data in the urban domain and mixing them with general corpus data to form an incremental pre-training data set, and performing incremental pre-training, for details, please refer to the above steps S12 to S13;

[0120] Step S93, collect fine-tuning data in the city area and mix it with general fine-tuning data to form a fine-tuning data set, perform fine-tuning alignment training, and refer to the above steps S14 to S15 for details, to obtain a large model of the target city;

[0121] Step S94, referring to the performance evaluation process of the target city big model in the above embodiment of the present disclosure, the performance of the target city big model is evaluated; if the performance of the target city big model meets the specified performance requirements (such as the accuracy of outputting urban knowledge meets the preset accuracy threshold, the accuracy of reasoning unknown problems meets the preset accuracy threshold, and the success rate of solving specific tasks meets the preset success rate threshold), then proceed to step S95; if the specified performance requirements are not met, then continue to repeat the above steps S91 to S94;

[0122] Step S95, designing a city generative intelligent method based on the target city big model, and evaluating the city generative intelligent method, which may specifically refer to the performance evaluation process of the target city big model in the above-mentioned embodiment of the present disclosure.

[0123] According to the embodiments of the present disclosure, a large target city model with strong generalization ability for the urban field can be trained, and a city generative intelligent method can be implemented based on the large target city model.

[0124] Fig.10 FIG. 2 is a block diagram of a large language model training device for urban areas according to an embodiment of the present disclosure. Fig.10 As shown, the training device comprises:

[0125] An acquisition module 101 is used to acquire a general large language model of a general domain and an initial data set constructed for an urban domain, wherein the initial data set includes general corpus data of the general domain and a variety of domain-specific data for the urban domain;

[0126] The data set construction module 102 is used to simulate a virtual city scene based on the multiple domain-specific data, and to obtain a composite data set by setting an agent in the virtual city scene to simulate multiple behaviors of humans in a real city scene, wherein the composite data set includes: composite data of the agent in the process of simulating various behaviors recorded in a natural language form, wherein the composite data includes urban environment information around the agent and state change information, wherein the state change information represents a state change of the agent's behavior;

[0127] A pre-training module 103, configured to mix the composite data set and the initial data set into a pre-training data set, and use the pre-training data set to perform incremental pre-training on the general large language model to obtain a first city large model;

[0128] A fine-tuning training module 104 is used to perform fine-tuning training on the first large city model using a fine-tuning dataset constructed for the urban domain to obtain a second large city model, wherein the fine-tuning dataset includes general question-answering data in a general domain, specific question-answering data for the urban domain, and task question-answering data for solving specific tasks in the urban domain;

[0129] The preference alignment module 105 is used to perform preference alignment training on the second city model using the human preference data set to obtain a target city model.

[0130] In a possible implementation, the process of constructing the various domain-specific data in the initial data set includes:

[0131] Obtaining a city knowledge graph for the city field, converting each pair of tuples in the city knowledge graph into a text sentence, and combining each pair of tuples with the text sentence converted from each pair of tuples to obtain a first type of training instance;

[0132] Obtain geographic data for the city domain, and represent the geographic data in GeoJSON format to obtain a second type of training instance;

[0133] Acquire human behavior data for the urban field, and align the human behavior data with the urban knowledge graph and the geographic data to obtain a third type of training instance;

[0134] The multiple domain-specific data include the first category of training instances, the second category of training instances, and the third category of training instances.

[0135] In a possible implementation manner, the device further includes: a first performance evaluation module, configured to:

[0136] Selecting sample data from the pre-training data set, generating sample question-answer pairs using a general large language model according to the input first prompt information and the sample data, verifying the accuracy of the sample question-answer pairs using the general large language model according to the input second prompt information, and filtering out sample question-answer pairs whose accuracy is lower than a preset threshold, to obtain a first category of question-answer pairs;

[0137] Extracting a second type of question-answer pairs related to the urban field from a plurality of general evaluation data sets in a general field, and converting the first type of question-answer pairs and the second type of question-answer pairs into multiple-choice question forms, respectively, to obtain a first evaluation data set;

[0138] The accuracy of the city knowledge output by the target city big model is evaluated by using the first evaluation data set to obtain a first performance evaluation result of the target city big model, so as to retrain the target city big model when the first performance evaluation indicates that the accuracy of the city knowledge output by the target city big model does not meet a preset accuracy threshold.

[0139] In a possible implementation manner, the device further includes:

[0140] A second performance evaluation module is used to construct a second evaluation data set, wherein the second evaluation data set includes question-answer pairs that cannot be extracted from the pre-training data set, and use the second evaluation data set to evaluate the accuracy of the target city large model in reasoning unknown questions to obtain a second performance evaluation result of the target city large model, so as to retrain the target city large model when the second performance evaluation result indicates that the accuracy of the target city large model in reasoning unknown questions does not meet a preset accuracy threshold; and / or,

[0141] A third performance evaluation module is used to construct a third evaluation data set, which includes solutions to multiple specific tasks in the urban field, and use the third evaluation data set to evaluate the success rate of the target city big model in solving various specific tasks, so as to obtain a third performance evaluation result of the target city big model, so as to retrain the target city big model when the third performance evaluation result indicates that the success rate of the target city big model in solving various specific tasks does not meet a preset success rate threshold.

[0142] In a possible implementation, mixing the compound data set with the initial data set into a pre-training data set includes: mixing the compound data set with the initial data set into a pre-training data set according to a first preset mixing ratio, wherein the first preset mixing ratio is used to indicate a quantitative ratio among the general corpus data, the domain-specific data, and the compound data contained in the pre-training data set;

[0143] The fine-tuning dataset is constructed according to a second preset mixing ratio, and the second preset mixing ratio is used to indicate the quantitative ratio between the general question and answer data, the specific question and answer data and the solution data contained in the fine-tuning dataset.

[0144] According to the training device of the embodiment of the present disclosure, by utilizing a composite data set determined by various domain-specific data in the urban field and mixing the composite data set with the initial data set as a pre-training data set, a first city big model that has learned urban knowledge can be efficiently trained, and then the first city big model can be fine-tuned using the fine-tuning data set so that the trained second city big model can respond to input instructions and output answers that meet human expectations, and then the second city big model can be trained for preference alignment using the human-edited data set so that the trained target city big model can be more in line with human preferences, thereby obtaining a target city big model with strong generalization ability for the urban field that has professional knowledge in the urban field, universal common sense, and cognitive reasoning ability.

[0145] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0146] The embodiment of the present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and the computer program instructions implement the above method when executed by a processor. The computer-readable storage medium can be a volatile or non-volatile computer-readable storage medium.

[0147] An embodiment of the present disclosure further proposes an electronic device, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above method when executing the instructions stored in the memory.

[0148] The embodiments of the present disclosure also provide a computer program product, including a computer-readable code, or a non-volatile computer-readable storage medium carrying the computer-readable code. When the computer-readable code runs in a processor of an electronic device, the processor in the electronic device executes the above method.

[0149] Fig.11 1 is a block diagram of an electronic device 1900 according to an embodiment of the present disclosure. For example, the electronic device 1900 may be provided as a server or a terminal device. Fig.11 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0150] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output interface 1958 (I / O interface). The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server 2000. TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM or similar.

[0151] In an exemplary embodiment, a non-volatile computer-readable storage medium is also provided, such as a memory 1932 including computer program instructions, which can be executed by the processing component 1922 of the electronic device 1900 to perform the above method.

[0152] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.

[0153] A computer-readable storage medium may be a tangible device that can hold and store instructions used by an instruction execution device. A computer-readable storage medium may be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the above. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disk read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination of the above. The computer-readable storage medium used herein is not to be interpreted as a transient signal itself, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through a wire.

[0154] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.

[0155] The computer program instructions for performing the operations of the present disclosure may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. The computer-readable program instructions may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer, partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect through the Internet). In some embodiments, by using the state information of the computer-readable program instructions to personalize an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), the electronic circuit may execute the computer-readable program instructions, thereby implementing various aspects of the present disclosure.

[0156] Various aspects of the present disclosure are described herein with reference to flowcharts and / or block diagrams of methods, devices (systems) and computer program products according to embodiments of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer-readable program instructions.

[0157] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0158] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0159] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.

[0160] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.

Claims

1. A large language model training method for urban areas, characterized in that: include: Acquire a general large language model for a general domain and an initial data set constructed for an urban domain, wherein the initial data set includes general corpus data for the general domain and a variety of domain-specific data for the urban domain; A virtual city scene is simulated based on the multiple domain-specific data, and a composite data set is obtained by setting an agent in the virtual city scene to simulate multiple behaviors of humans in a real city scene, wherein the composite data set includes: composite data of the agent in the process of simulating various behaviors recorded in a natural language form, wherein the composite data includes urban environment information around the agent and state change information, wherein the state change information represents a state change of the agent's behavior; The composite data set and the initial data set are mixed into a pre-training data set, and the general large language model is incrementally pre-trained using the pre-training data set to obtain a first city large model having general domain knowledge and city domain knowledge; The first large city model is fine-tuned and trained using a fine-tuning dataset constructed for the urban field, so as to obtain a second large city model that responds to input instructions and outputs answers that meet human expectations, wherein the fine-tuning dataset includes general question-answering data in a general field, specific question-answering data for the urban field, and solution data for solving specific tasks in the urban field; The second city model is trained for preference alignment using the human preference data set to obtain a target city model for the city field that is compounded with human preferences, and the target city model is used to output a corresponding answer result for the input question information; The process of constructing various domain-specific data in the initial data set includes: Obtaining a city knowledge graph for the city field, converting each pair of tuples in the city knowledge graph into a text sentence, and combining each pair of tuples with the text sentence converted from each pair of tuples to obtain a first type of training instance; Obtaining geographic data contained in a digital map of an urban area, and expressing the geographic data in GeoJSON format to obtain a second type of training instance; Acquire human behavior data for the urban field, and align the human behavior data with the urban knowledge graph and the geographic data to obtain a third type of training instance; The multiple domain-specific data include the first category of training instances, the second category of training instances, and the third category of training instances.

2. The method according to claim 1, characterized in that The method further includes performing the following performance evaluation on the target city big model: Selecting sample data from the pre-training data set, generating sample question-answer pairs using a general large language model according to the input first prompt information and the sample data, verifying the accuracy of the sample question-answer pairs using the general large language model according to the input second prompt information, and filtering out sample question-answer pairs whose accuracy is lower than a preset threshold, to obtain a first category of question-answer pairs; Extracting a second type of question-answer pairs related to the urban field from a plurality of general evaluation data sets in a general field, and converting the first type of question-answer pairs and the second type of question-answer pairs into multiple-choice question forms, respectively, to obtain a first evaluation data set; The accuracy of the city knowledge output by the target city big model is evaluated by using the first evaluation data set to obtain a first performance evaluation result of the target city big model, so as to retrain the target city big model when the first performance evaluation indicates that the accuracy of the city knowledge output by the target city big model does not meet a preset accuracy threshold.

3. The method according to claim 1 or 2, characterized in that: The method further includes performing the following performance evaluation on the target city big model: Constructing a second evaluation data set, the second evaluation data set includes question-answer pairs that cannot be extracted from the pre-training data set, and using the second evaluation data set to evaluate the accuracy of the target city large model in reasoning unknown questions, to obtain a second performance evaluation result of the target city large model, so as to retrain the target city large model when the second performance evaluation result indicates that the accuracy of the target city large model in reasoning unknown questions does not meet a preset accuracy threshold; and / or, A third evaluation data set is constructed, wherein the third evaluation data set includes solutions to a variety of specific tasks in the urban field, and the third evaluation data set is used to evaluate the success rate of the target city big model in solving various specific tasks, so as to obtain a third performance evaluation result of the target city big model, so as to retrain the target city big model when the third performance evaluation result indicates that the success rate of the target city big model in solving various specific tasks does not meet a preset success rate threshold.

4. The method according to claim 1, characterized in that: The mixing of the compound data set and the initial data set into a pre-training data set comprises: mixing the compound data set and the initial data set into a pre-training data set according to a first preset mixing ratio, wherein the first preset mixing ratio is used to indicate the quantitative ratio between the general corpus data, the domain-specific data, and the compound data contained in the pre-training data set; The fine-tuning dataset is constructed according to a second preset mixing ratio, and the second preset mixing ratio is used to indicate the quantitative ratio between the general question and answer data, the specific question and answer data and the solution data contained in the fine-tuning dataset.

5. A city generative intelligence method, characterized in that: include: In response to receiving multimodal question information, encoding the question information to obtain target information, and inputting the target information into a target city large model, wherein the target city large model is trained using the training method according to any one of claims 1 to 4; The target city macromodel retrieves additional knowledge related to the target information from a custom memory module and an experience memory module based on the target information, wherein the custom memory module is used to store professional knowledge for specific scenarios in the urban field, and the experience memory module is used to store experience knowledge accumulated by the target city macromodel during operation, wherein the additional knowledge includes professional knowledge and / or experience knowledge; The target city big model makes inference decisions based on the additional knowledge and the core background knowledge stored in the target city big model itself to obtain the answer result output by the target city big model. The core background knowledge includes the general knowledge, city knowledge and world common sense learned by the target city big model during the training process.

6. The method according to claim 5, characterized in that The method further comprises: The answer result output by the target city large model is post-processed according to preset processing rules to obtain the target answer result.

7. A large language model training device for urban areas, characterized in that: include: An acquisition module, used to acquire a general large language model in a general field and an initial data set constructed for an urban field, wherein the initial data set includes general corpus data in the general field and a variety of field-specific data for the urban field; A data set construction module is used to simulate a virtual city scene based on the multiple domain-specific data, and to obtain a composite data set by setting an intelligent agent in the virtual city scene to simulate multiple behaviors of humans in a real city scene, wherein the composite data set includes: composite data of the intelligent agent in the process of simulating various behaviors recorded in a natural language form, wherein the composite data includes urban environment information around the intelligent agent and state change information, wherein the state change information represents a state change of the behavior of the intelligent agent; A pre-training module, used for mixing the composite data set and the initial data set into a pre-training data set, and using the pre-training data set to perform incremental pre-training on the general large language model to obtain a first large city model having general domain knowledge and city domain knowledge; A fine-tuning training module, configured to perform fine-tuning training on the first large city model using a fine-tuning dataset constructed for the urban domain, so as to obtain a second large city model capable of responding to input instructions and outputting answers that meet human expectations, wherein the fine-tuning dataset includes general question-answering data in a general domain, specific question-answering data for the urban domain, and task question-answering data for solving specific tasks in the urban domain; a preference alignment module, used to perform preference alignment training on the second city model using a human preference data set, to obtain a target city model for the city field that is compounded with human preferences, and the target city model is used to output a corresponding answer result for the input question information; The process of constructing various domain-specific data in the initial data set includes: Obtaining a city knowledge graph for the city field, converting each pair of tuples in the city knowledge graph into a text sentence, and combining each pair of tuples with the text sentence converted from each pair of tuples to obtain a first type of training instance; Obtaining geographic data contained in a digital map of an urban area, and expressing the geographic data in GeoJSON format to obtain a second type of training instance; Acquire human behavior data for the urban field, and align the human behavior data with the urban knowledge graph and the geographic data to obtain a third type of training instance; The multiple domain-specific data include the first category of training instances, the second category of training instances, and the third category of training instances.

8. A city-generating intelligent device, characterized in that: include: a multimodal input module, configured to, in response to receiving multimodal question information, encode the question information to obtain target information, and input the target information into a target city macromodel, wherein the target city macromodel is trained using the training method according to any one of claims 1 to 4; Customized memory modules to store expertise for specific scenarios in the urban domain; An experience memory module, used to store the experience knowledge accumulated during the operation of the target city large model; The target city model includes a general memory module and a reasoning decision kernel; The general memory module is used to store the core background knowledge learned by the target city model during the training process, and the core background knowledge includes general knowledge, city knowledge and world common sense; The reasoning decision kernel is used to retrieve additional knowledge related to the target information from the customized memory module and the experience memory module based on the target information input by the multimodal input module, wherein the additional knowledge includes professional knowledge and / or experience knowledge, and to make reasoning decisions based on the additional knowledge combined with the core background knowledge to obtain the answer result output by the target city model for the question information.

9. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to implement the method described in any one of claims 1 to 6 when executing the instructions stored in the memory.

10. A non-volatile computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.

Citation Information

Cited By

  • Urban multivariable space-time prediction method based on large model agent

    CN120069235A

  • A method for urban multivariate spatiotemporal forecasting based on large model agents

    CN120069235B