Diversified judicial instruction data selection method and system based on large model perception
Through a diversified judicial instruction data selection method based on large model perception, a subset of data with diversity and coverage in large language model training was selected, which solved the problems of low data selection efficiency and insufficient coverage in the existing technology, and achieved better instruction compliance capabilities and computing efficiency improvements in the judicial field of the model.
Patent Information
- Application Number
- CN202510370950.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2045-03-27
AI Technical Summary
In the selection of large-scale judicial instruction training data, it is difficult to efficiently screen out a subset of data that maintains task diversity and fully covers the model activation mode, resulting in insufficient semantic diversity, incomplete coverage of judicial instruction types and ineffective computing efficiency.
A diversified judicial instruction data selection method based on big model perception is adopted. By converting judicial instruction data into tags, inputting into big model for inference, obtaining the activation vector output of each layer of activation function, filtering out the dimensions whose activation value is greater than the set value, calculating the proportion of the dimensions whose activation value is greater than the set value in each layer of activation vector, selecting the layer with the largest proportion and filtering the low-frequency activation tags, and finally selecting judicial instruction data containing the most variety of activation tags.
In the training of large language model, selecting a subset of judicial instruction data with better diversity and coverage is realized, improving the model's instruction compliance capabilities on downstream tasks in multiple judicial fields, and reducing calculation and time costs.
Smart Images

Figure CN119886229A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of judicial instruction training data selection in a large language model, and in particular to a method and system for selecting diversified judicial instruction data based on large model perception. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] In practical applications, in order to make the model better follow the instructions in the judicial field and conform to human preferences, it is necessary to use judicial instruction data to fine-tune the model. Therefore, the fine-tuning stage is a key link to improve the performance of the model in a specific field. In the fine-tuning process for the judicial field, the quality and diversity of judicial instruction data have an important impact on the performance of the model.
[0004] In the field of data selection for large-model judicial instruction training, the core challenge is to efficiently select data subsets from massive judicial instruction data that both maintain task diversity and fully cover model activation patterns. Researchers have proposed a variety of data selection methods. These methods can be divided into two categories: data-aware methods and large-model activation-aware methods. Data-aware methods first use pre-trained language models (such as BERT) to obtain data representations, and then select diverse data through methods such as k-means clustering. These methods are independent of the model to be fine-tuned when obtaining data representations, and can only select semantically diverse data based on text features, and cannot use the model itself to guide the data selection process. Large model activation-aware methods use trainable large language models to calculate the necessity of each data point, thereby selecting diverse data that is beneficial to the model. These methods tend to select data that is difficult for the current model, but it is difficult to ensure the diversity and coverage of the data, which may lead to suboptimal results.
[0005] In addition, some methods based on model gradients to select diverse data require additional gradient calculations, which greatly increases the amount of computation and time cost. In terms of core set selection, the goal is to select a subset from all training data so that the performance of the model trained on this subset is similar to that of the model trained on the full dataset. In the field of large model training data selection, especially in the scenario of instruction tuning, existing methods have the following technical problems when selecting large model training data: (1) Data-aware methods cannot utilize the internal activation information of the model, resulting in insufficient semantic diversity; (2) Large model activation-aware methods prefer to select high-difficulty data, resulting in incomplete coverage of judicial instruction types; (3) Gradient-based screening methods require additional calculations and are difficult to process large-scale judicial instruction data (such as millions of instruction-response pairs), which is inefficient. Summary of the invention
[0006] In order to solve the technical problems existing in the above-mentioned background technology, the present invention provides a method and system for selecting diversified judicial instruction data based on large model perception. The present invention efficiently screens out an optimal judicial instruction data subset with diversity and coverage from a large number of large model judicial instruction fine-tuning training data, so that the large language model can maximize the improvement of instruction compliance ability in downstream tasks in multiple judicial fields after training.
[0007] In order to achieve the above object, the present invention adopts the following technical solution: A first aspect of the present invention provides a method for selecting diversified judicial instruction data based on big model perception.
[0008] A method for selecting diversified judicial instruction data based on large model perception, comprising: Each piece of original judicial instruction data obtained is converted into several tags, and the tags are input into the large model for inference to obtain the activation vector output by the activation function of each layer, and the index set of the dimension whose activation value in the activation vector is greater than the set value is selected; the activation values in the index set are sorted by size as the activation label of the tag, and the maximum activation value is used as the value of the activation label of the tag; the activation labels of all the tags of the judicial instruction data are taken as the union set to obtain the activation label of the judicial instruction data; Obtain the activation vectors of all judicial instruction data at each layer of the large model, calculate the proportion of dimensions whose activation values are greater than the set value in the activation vectors of each layer of the large model, so as to obtain the average proportion of each layer of the large model; select the layer with the largest proportion, and filter out the activation labels of the judicial instruction data with low frequency in the layer with the largest proportion, so as to obtain the activation labels of the filtered judicial instruction data; Based on the activation labels of the screened judicial instruction data, the judicial instruction data containing the most types of activation labels are selected to obtain a sampled judicial instruction data subset.
[0009] Furthermore, the activation labels based on the screened judicial instruction data select the judicial instruction data containing the most types of activation labels to obtain a sampled judicial instruction data subset; the method includes: counting the activation labels covered by the screened original judicial instruction data to obtain an activation label data set, for each activation label in the activation label data set, enumerating all activation values corresponding to it, counting the judicial instruction data corresponding to each activation value, and selecting the judicial instruction data containing the most types of activation labels; sorting all the original judicial instruction data in descending order according to the number of activation label types contained in the judicial instruction data, selecting several judicial instruction data ranked in the front, and constructing a sampled judicial instruction data subset.
[0010] Furthermore, the method of calculating the proportion of dimensions in the activation vector of each layer of the large model whose activation values are greater than a set value to obtain an average proportion of each layer of the large model includes: summing and averaging the proportion of dimensions in the activation vector of each layer of the large model whose activation values are greater than the set value to obtain the average proportion of each layer of the large model.
[0011] Furthermore, the activation labels of the judicial instruction data with low frequency in the layer with the largest proportion are filtered out; the following formula is used to express it: Based on the number of active label categories in each selected layer TN Calculate the filter weights for each layer :
[0012] Set a basic frequency filter threshold , so the filtering threshold of each layer for:
[0013] Filter out the numbers that appear less than 's activation tag, thereby obtaining the activation tag of the filtered judicial instruction data; in, , The selected layer The number of active label types contained in the layer.
[0014] Furthermore, the index set of the dimension whose activation value in the activation vector is greater than the set value is selected; it is expressed by the following formula:
[0015] in, is a vector The dimension index in , Representation vector The indices of the dimensions whose median values are greater than 1, Represents an index set, 1 is the set value.
[0016] Furthermore, the maximum activation value is used as the value of the activation tag of the mark; it is expressed by the following formula:
[0017] in, is the sorting function, Parameters in As the sorting basis, that is, according to Sort the specified sequence of numbers in descending order, using the activation vector The maximum activation value in is taken as the activation label The value of .
[0018] A second aspect of the present invention provides a diversified judicial instruction data selection system based on large model perception.
[0019] A diversified judicial instruction data selection system based on large model perception, comprising: The activation label acquisition module is configured to: convert each acquired original judicial instruction data into a number of labels, input the labels into the large model for inference, obtain the activation vector output by each layer of the activation function, select the index set of the dimension whose activation value in the activation vector is greater than the set value; sort the activation values in the index set according to size as the activation label of the label, and use the largest activation value as the value of the activation label of the label; take the union of the activation labels of all the labels of the judicial instruction data to obtain the activation label of the judicial instruction data; An activation label screening module is configured to: obtain activation vectors of all judicial instruction data at each layer of the large model, calculate the proportion of dimensions whose activation values are greater than a set value in the activation vectors of each layer of the large model, so as to obtain an average proportion of each layer of the large model; select the layer with the largest proportion, and filter out activation labels of judicial instruction data with low frequency in the layer with the largest proportion, so as to obtain activation labels of filtered judicial instruction data; The activation tag-based data sampling module is configured to: based on the activation tags of the screened judicial instruction data, select the judicial instruction data containing the most types of activation tags to obtain a sampled judicial instruction data subset.
[0020] A third aspect of the present invention provides a computer-readable storage medium.
[0021] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the steps in the method for selecting diversified judicial instruction data based on large model perception as described in the first aspect above.
[0022] A fourth aspect of the present invention provides a computer device.
[0023] A computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for selecting diversified judicial instruction data based on large model perception as described in the first aspect above are implemented.
[0024] A fifth aspect of the present invention provides a computer program product or a computer program.
[0025] The present invention provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the method for selecting diversified judicial instruction data based on large model perception as described in the first aspect above.
[0026] Compared with the prior art, the present invention has the following beneficial effects: The present invention combines the advantages of data perception and large model activation perception methods, and uses the differences in the activation states of different data in the reasoning process of the large language model to distinguish different types of judicial instruction data. Specifically, the large language model first calculates all the neuron activation states contained in a judicial data set, and then screens out a data subset covering all activation states as the core set for fine-tuning the large language model. Compared with existing methods, the present invention extracts model-level data features to ensure that the selected judicial instruction data subset has better diversity and coverage. In addition, the neuron activation state can be obtained through a single reasoning without the need for additional training, so the present invention is efficient at the reasoning level and reduces computational and time costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0028] Figure 1 is a flow chart of a method for selecting diversified judicial instruction data based on large model perception shown in the present invention; Figure 2 is an example diagram of a method for selecting diversified judicial instruction data based on large model perception shown in the present invention; Figure 3 It is a structural diagram of the diversified judicial instruction data selection system based on large model perception shown in the present invention. DETAILED DESCRIPTION
[0029] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0030] It should be noted that the following detailed descriptions are all illustrative and intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0031] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, it indicates the presence of features, steps, operations, devices, components and / or combinations thereof.
[0032] It should be noted that the flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the methods and systems according to various embodiments of the present disclosure. It should be noted that each box in the flowchart or block diagram can represent a module, a program segment, or a part of a code, and the module, program segment, or a part of a code may include one or more executable instructions for implementing the logical functions specified in each embodiment. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, or they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted 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 using a dedicated hardware-based system that performs a specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0033] Embodiment 1 like Figure 1 As shown, this embodiment provides a method for selecting diversified judicial instruction data based on large model perception. This embodiment uses the method applied to a server as an example. It can be understood that the method can also be applied to a terminal, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network servers, cloud communications, middleware services, domain name services, security services CDN, and big data and artificial intelligence platforms. The terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, etc., but is not limited to this. The terminal and the server can be directly or indirectly connected via wired or wireless communication, which is not limited in this application. In this embodiment, the method includes the following steps: Each piece of original judicial instruction data obtained is converted into several tags, and the tags are input into the large model for inference to obtain the activation vector output by the activation function of each layer, and the index set of the dimension whose activation value in the activation vector is greater than the set value is selected; the activation values in the index set are sorted by size as the activation label of the tag, and the maximum activation value is used as the value of the activation label of the tag; the activation labels of all the tags of the judicial instruction data are taken as the union set to obtain the activation label of the judicial instruction data; Obtain the activation vectors of all judicial instruction data at each layer of the large model, calculate the proportion of dimensions whose activation values are greater than the set value in the activation vectors of each layer of the large model, so as to obtain the average proportion of each layer of the large model; select the layer with the largest proportion, and filter out the activation labels of the judicial instruction data with low frequency in the layer with the largest proportion, so as to obtain the activation labels of the filtered judicial instruction data; Based on the activation labels of the screened judicial instruction data, the judicial instruction data containing the most types of activation labels are selected to obtain a sampled judicial instruction data subset.
[0034] Now let's introduce the specific technical solution. The core of the present invention is to propose a large model-aware diversified judicial instruction data selection algorithm (Model-Aware Diverse Core Set Selection for InstructionTuning, referred to as MADS) for judicial instruction data selection, so as to select a subset of judicial instruction data that can cover all activation states as the core set for fine-tuning a large language model.
[0035] In some embodiments, each acquired original judicial instruction data is converted into a number of tags, and the tags are input into the large model for inference to obtain the activation vector output by each layer of the activation function, and the index set of the dimension whose activation value in the activation vector is greater than the set value is selected; the activation values in the index set are sorted by size as the activation labels of the tags, and the maximum activation value is used as the value of the activation label of the tag; the activation labels of all the tags of the judicial instruction data are taken as the union set to obtain the activation label of the judicial instruction data; this is specifically implemented by the following scheme: At this stage, we first define is the unfiltered raw judicial instruction data used for large model training. All data in the data are input into the large language model for reasoning, and the neuron activation state triggered by each judicial instruction data during the reasoning process is extracted.
[0036] Then, the output of the activation function is processed into an activation label. First, choose an open source large language model (such as Llama-3-3B, Llama-3-8B, etc.), when the judicial instruction data is input into the large language model Before inference can be made, the judicial order data must be entered into The corresponding word segmenter and multiple tags output by the word segmenter , merge the activation labels of each marker into the activation labels of the judicial instruction data.
[0037] Assuming that the large language model has L layers, each layer contains a neural network submodule with an activation function, the goal of the present invention is to obtain the output of this activation function.
[0038] In the reasoning process of the large model, Will produce L outputs from the activation function:
[0039] in, For the selected open source large language model, Represents the first Marks, Representative Markers (i.e. )exist The The d-dimensional vector produced by the layer, where d is the dimension of the output of the activation layer of the large language model.
[0040] In obtaining The activation function output vector After that, the vector is processed to obtain the activation label The present invention only focuses on the strongly activated dimension, and the activation vector of d dimension The value of each dimension in is the activation value of that dimension. The larger the activation value, the stronger the activation of that dimension. So the activation vector is obtained. The dimensions whose activation values are greater than 1. Representation vector The index set of dimensions whose median value is greater than 1:
[0041] Where j represents a vector The index of the dimension, , Representation vector The index of the dimension whose median value is greater than 1. For example , There are 5 dimensions in total, so j=1,2,3,4,5; the numbers in the 2nd, 4th, and 5th dimensions are greater than 1, then: .
[0042] Considering the index collection The multiple dimensions contained in have different activation levels. In order to retain this information in the activation label, the dimensions are sorted in descending order according to their corresponding activation values and used as activation labels. At the same time, the maximum activation value is used as the value of the activation label:
[0043] in, is the sorting function, Parameters in As the sorting basis, that is, according to Sort the specified numeric sequence in descending order. Representation vector middle j The numeric value of the dimension. For example , There are 5 dimensions in total, so j =1,2,3,4,5; where the numbers in the 2nd, 4th, and 5th dimensions are greater than 1, then: . That is to To sort, ,So The sorting result is {4,5,2}.
[0044] At the same time, using the activation vector The maximum activation value in is taken as the activation label The purpose of recording this value is to ensure that in the subsequent data selection stage, the core set contains data with different activation levels for a specific activation label.
[0045]
[0046] in, Activation tag The value of is a vector The dimension index in .
[0047] Based on the above, corresponding to The activation tag is , where L is the total number of layers in the large language model, and the activation label of the data is the union of the labels of the tokens it contains:
[0048]
[0049] At this stage, the extracted The activation tag for all judicial order data in .
[0050] In some embodiments, the activation vectors of all judicial instruction data at each layer of the large model are obtained, and the proportion of dimensions whose activation values are greater than a set value in the activation vectors of each layer of the large model is calculated to obtain the average proportion of each layer of the large model; the layer with the largest proportion is selected, and the activation labels of the judicial instruction data with low frequency in the layer with the largest proportion are filtered out to obtain the activation labels of the filtered judicial instruction data; this is specifically implemented by the following scheme: The activation label of the data is , which contains the activations of each label in the judicial instruction data at each layer. We consider the following two factors: (1) the activation labels between adjacent layers may have a large overlap. (2) different layers of the language model capture different features.
[0051] Therefore, in view of the hierarchical feature distribution characteristics of large model training data, N layers are selected from low to high as evenly as possible, and In addition, in order to further determine which layers to select, the following method is used: for the Ith layer, obtain The activation vector of all judicial instruction data in this layer is calculated, and then the proportion of activation values greater than 1 in each activation vector is calculated, and finally the average proportion value is obtained. This average represents the proportion of strongly activated neurons in each layer to all neurons in this layer. Starting from the 0th layer, this ratio rises in a wave-like manner. The larger the ratio, the more information it may contain, and the layer corresponding to the peak indicates that the proportion of strongly activated neurons is the largest locally. Therefore, the layer corresponding to the peak is selected. After the layer is selected, low-frequency activation labels are filtered out in each selected layer. This is because very low-frequency activation labels lack universality and may even be noise. First, the number of activation label types in each selected layer is counted, recorded as .
[0052] Then, based on Calculate the filter weights for each layer :
[0053] in, The selected layer The number of active label types contained in the layer.
[0054] Set a basic frequency filter threshold , so the filtering threshold of each layer for:
[0055] Finally, filter out the Activation tag, thus obtaining .
[0056] In some embodiments, the activation tags based on the screened judicial instruction data select the judicial instruction data containing the most types of activation tags to obtain a sampled judicial instruction data subset; this is specifically implemented by the following scheme: In this phase, the goal is to combine key indicators in the field of large model training data selection to Select a subset of , so that The judicial order data in All activation labels in , and all activation values of these labels. First, count Specifically, take The union of the labels contained in all judicial instruction data in is denoted as :
[0057] for Each activation tag in , first enumerate all the corresponding activation values, then further count which judicial instruction data corresponds to each activation value, and finally select a representative judicial instruction data from these judicial instruction data. When selecting representative judicial instruction data, select the data with the highest complexity, that is, the judicial instruction data containing the most types of activation labels. Specifically, sort the judicial instruction data in descending order according to the number of activation label types it contains, and select the judicial instruction data ranked first. Finally, the sampled judicial instruction data can be obtained.
[0058] like Figure 2 As shown, for Each activation tag in (correspond Figure 2 ), first enumerate all the activation values corresponding to it (corresponding to Figure 2 Then further count which judicial instruction data (corresponding to Figure 2 The "index" in the command data here represents the corresponding data) corresponds to each activation value, and finally a representative judicial instruction data is selected from these judicial instruction data. When selecting representative judicial instruction data, the most complex data is selected, that is, the data containing the most types of activation labels (corresponding to Figure 2 Specifically, the judicial instruction data are sorted in descending order according to the number of activated label types contained in the judicial instruction data, and the judicial instruction data ranked first is selected. Finally, the sampled judicial instruction data can be obtained.
[0059] Embodiment 2 like Figure 3 As shown, this embodiment provides a diversified judicial instruction data selection system based on large model perception, including: The activation label acquisition module is configured to: convert each acquired original judicial instruction data into a number of labels, input the labels into the large model for inference, obtain the activation vector output by each layer of the activation function, select the index set of the dimension whose activation value in the activation vector is greater than the set value; sort the activation values in the index set according to size as the activation label of the label, and use the largest activation value as the value of the activation label of the label; take the union of the activation labels of all the labels of the judicial instruction data to obtain the activation label of the judicial instruction data; An activation label screening module is configured to: obtain activation vectors of all judicial instruction data at each layer of the large model, calculate the proportion of dimensions whose activation values are greater than a set value in the activation vectors of each layer of the large model, so as to obtain an average proportion of each layer of the large model; select the layer with the largest proportion, and filter out activation labels of judicial instruction data with low frequency in the layer with the largest proportion, so as to obtain activation labels of filtered judicial instruction data; The activation tag-based data sampling module is configured to: based on the activation tags of the screened judicial instruction data, select the judicial instruction data containing the most types of activation tags to obtain a sampled judicial instruction data subset.
[0060] In some embodiments, the activation label-based data sampling module is specifically configured to: count the activation labels covered by the screened original judicial instruction data to obtain an activation label data set; for each activation label in the activation label data set, enumerate all activation values corresponding to it, count the judicial instruction data corresponding to each activation value, and select the judicial instruction data containing the most types of activation labels; sort all the original judicial instruction data in descending order according to the number of activation label types contained in the judicial instruction data, select several judicial instruction data ranked in the front, and construct a sampled judicial instruction data subset.
[0061] In some embodiments, the activation label screening module is specifically configured to sum and average the proportion of dimensions in the activation vector of each layer of the large model whose activation values are greater than a set value, to obtain an average proportion of each layer of the large model.
[0062] In some embodiments, the activation label screening module is specifically configured to filter out the activation labels of the judicial instruction data with low frequency in the layer with the largest proportion using the following formula: Based on the number of active label categories in each selected layer TN Calculate the filter weights for each layer :
[0063] Set a basic frequency filter threshold , so the filtering threshold of each layer for:
[0064] Filter out the numbers that appear less than Activation tag, thus obtaining ; in, , An activation tag representing filtered judicial order data.
[0065] In some embodiments, the activation label acquisition module is specifically configured to select an index set of dimensions in the activation vector whose activation value is greater than a set value using the following formula:
[0066] in, is a vector The dimension index in , Representation vector The indices of the dimensions whose median values are greater than 1, Represents an index set, 1 is the set value.
[0067] In some embodiments, the activation tag acquisition module is specifically configured to use the following formula to take the maximum activation value as the value of the activation tag of the mark:
[0068] in, is the sorting function, Parameters in As the sorting basis, that is, according to Sort the specified sequence of numbers in descending order, using the activation vector The maximum activation value in is taken as the activation label The value of .
[0069] Embodiment 3 This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps in the method for selecting diversified judicial instruction data based on large model perception as described in the first embodiment above are implemented.
[0070] Embodiment 4 This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in the method for selecting diversified judicial instruction data based on large model perception as described in the first embodiment above are implemented.
[0071] Embodiment 5 This embodiment provides a computer program product or a computer program, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps in the method for selecting diversified judicial instruction data based on large model perception described in the first embodiment.
[0072] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of hardware embodiments, software embodiments, or embodiments combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage and optical storage, etc.) containing computer-usable program code.
[0073] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0074] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0075] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0076] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program, and the program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0077] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for selecting diversified judicial instruction data based on large model perception, characterized in that: include: Each piece of raw judicial instruction data is converted into a number of tags, and the tags are input into the large model for inference to obtain the activation vector output by each layer of activation function, and the index set of the dimension whose activation value in the activation vector is greater than the set value is selected; Sort the activation values in the index set by size to use them as the marked activation labels, and use the largest activation value as the value of the marked activation label; take the union of all marked activation labels of the judicial instruction data to obtain the activation label of the judicial instruction data; Obtain the activation vectors of all judicial instruction data at each layer of the large model, calculate the proportion of dimensions whose activation values are greater than the set value in the activation vectors of each layer of the large model, so as to obtain the average proportion of each layer of the large model; select the layer with the largest proportion, and filter out the activation labels of the judicial instruction data with low frequency in the layer with the largest proportion, so as to obtain the activation labels of the filtered judicial instruction data; Based on the activation labels of the screened judicial instruction data, the judicial instruction data containing the most types of activation labels are selected to obtain a sampled judicial instruction data subset.
2. The method for selecting diversified judicial instruction data based on large model perception according to claim 1 is characterized in that: The activation labels based on the screened judicial instruction data select the judicial instruction data containing the most types of activation labels to obtain a sampled judicial instruction data subset; the method includes: counting the activation labels covered by the screened original judicial instruction data to obtain an activation label data set, for each activation label in the activation label data set, enumerating all activation values corresponding to it, counting the judicial instruction data corresponding to each activation value, and selecting the judicial instruction data containing the most types of activation labels; sorting all the original judicial instruction data in descending order according to the number of activation label types contained in the judicial instruction data, selecting several judicial instruction data ranked in the front, and constructing a sampled judicial instruction data subset.
3. The method for selecting diversified judicial instruction data based on large model perception according to claim 1 is characterized in that: The method comprises: calculating the proportion of dimensions in the activation vector of each layer of the large model whose activation values are greater than the set value to obtain the average proportion of each layer of the large model; and the method comprises: summing and averaging the proportion of dimensions in the activation vector of each layer of the large model whose activation values are greater than the set value to obtain the average proportion of each layer of the large model.
4. The method for selecting diversified judicial instruction data based on large model perception according to claim 1 is characterized in that: The activation labels of the judicial instruction data with low frequency in the layer with the largest proportion are filtered out; It is expressed by the following formula: Based on the number of active label categories in each selected layer TN Calculate the filter weights for each layer : Set a basic frequency filter threshold , so the filtering threshold of each layer for: Filter out the numbers that appear less than 's activation tag, thereby obtaining the activation tag of the filtered judicial instruction data; in, , The selected layer The number of active label types contained in the layer.
5. The method for selecting diversified judicial instruction data based on large model perception according to claim 1 is characterized in that: The index set of the dimension whose activation value in the selected activation vector is greater than the set value; It is expressed by the following formula: in, is a vector The dimension index in , Representation vector The indices of the dimensions whose median values are greater than 1, Represents an index set, 1 is the set value.
6. The method for selecting diversified judicial instruction data based on large model perception according to claim 1 is characterized in that: The maximum activation value is used as the value of the activation label of the mark; It is expressed by the following formula: in, is the sorting function, Parameters in As the sorting basis, that is, according to Sort the specified sequence of numbers in descending order, using the activation vector The maximum activation value in is taken as the activation label The value of .
7. A diversified judicial instruction data selection system based on large model perception, characterized in that: include: An activation label acquisition module is configured to: convert each acquired original judicial instruction data into a number of labels, input the labels into the large model for inference, obtain the activation vector output by each layer of activation function, and select the index set of the dimension whose activation value in the activation vector is greater than the set value; Sort the activation values in the index set by size to use them as the marked activation labels, and use the largest activation value as the value of the marked activation label; take the union of all marked activation labels of the judicial instruction data to obtain the activation label of the judicial instruction data; An activation label screening module is configured to: obtain activation vectors of all judicial instruction data at each layer of the large model, calculate the proportion of dimensions whose activation values are greater than a set value in the activation vectors of each layer of the large model, so as to obtain an average proportion of each layer of the large model; select the layer with the largest proportion, and filter out activation labels of judicial instruction data with low frequency in the layer with the largest proportion, so as to obtain activation labels of filtered judicial instruction data; The activation tag-based data sampling module is configured to: based on the activation tags of the screened judicial instruction data, select the judicial instruction data containing the most types of activation tags to obtain a sampled judicial instruction data subset.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps in the method for selecting diversified judicial instruction data based on large model perception as described in any one of claims 1 to 6 are implemented.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the method for selecting diversified judicial instruction data based on large model perception as described in any one of claims 1-6 are implemented.
10. A computer program product, characterized in that The computer program product comprises a computer program, which, when executed by a processor, implements the steps in the method for selecting diversified judicial instruction data based on large model perception as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Class case recommendation method, system and equipment for judicial documents
CN117435721A
Judicial data processing system based on artificial intelligence
CN118839160A
Description type judicial knowledge generation method and device driven by judicial data
CN119443236A
Judicial domain class case retrieval method and system based on large model
CN119474409A
Model matching and learning rate selection for fine tuning
US20190138895A1