Development tree inference method and device based on biological big language model and medium
Through the development tree inference method based on the biological large language model, the topological structure and branch length of the phylogenetic tree are jointly optimized, which solves the problem of separation and optimization of tree structure and branch length in the existing method, improves the inference accuracy and efficiency, and simplifies the Processing process.
Patent Information
- Application Number
- CN202411528299.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-02-14
AI Technical Summary
The existing phylogenetic tree inference method has low inference accuracy and efficiency due to the optimization of the separation and optimization of tree structure and branch length, and ignores key features in gene sequences.
Using the development tree inference method based on the biological large language model, the topological structure and branch length of the phylogenetic tree are jointly optimized, and the feature extraction module, phylogenetic tree construction module and phylogenetic tree structure construction module are used to realize direct inference from the genome sequence. Phylogenetic tree.
It improves the accuracy and computational efficiency of phylogenetic tree inference, simplifies the processing flow, can process multiple gene sequence data, and has wide applicability in different biological research scenarios.
Smart Images

Figure CN119443274A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the intersecting field of bioinformatics and computer science, and in particular to a developmental tree inference method, device and medium based on a biological large language model. Background Art
[0002] Phylogenetic trees are used to represent the evolutionary relationships between species, with each leaf node representing an independent species and branch lengths reflecting evolutionary distances. Although DNA sequencing technology can construct evolutionary relationships based on molecular characteristics, phylogenetic inference is still challenging due to its complex parameter space (including tree topology and branch length). Traditional Markov chain Monte Carlo (MCMC) methods such as MrBayes and RevBayes, although capable of extensively exploring the tree space, are limited in their application due to slow convergence and high computational complexity.
[0003] Variational inference (VI)-based methods provide more efficient phylogenetic tree estimation and are mainly divided into two categories: tree representation learning and tree structure generation. Tree representation learning, such as VBPI, relies on pre-generated topological structures and optimizes the tree representation through variational approximation. Tree structure generation, such as PhyloGFN and VaiPhy, directly infers tree structures from sequences, but these methods often ignore key features in gene sequences, and the process of optimizing tree structure and branch length is separated, which affects the accuracy and efficiency of inference. Summary of the invention
[0004] The purpose of the present invention is to provide a method, device and medium for inferring a phylogenetic tree based on a biological large language model, which can realize direct inference of a phylogenetic tree from a genome sequence by jointly optimizing the topological structure and branch length of the phylogenetic tree.
[0005] The purpose of the present invention can be achieved by the following technical solutions:
[0006] A phylogenetic tree inference method based on a biological large language model, which jointly optimizes the topological structure and branch length of a phylogenetic tree based on a phylogenetic tree generation and optimization model, and directly infers a phylogenetic tree from an input genome sequence, wherein the phylogenetic tree generation and optimization model includes a feature extraction module, a phylogenetic tree construction module, and a phylogenetic tree structure construction module, and the training process includes the following steps:
[0007] Step 1) using a feature extraction module to extract embedded features from the genome sequence data using a pre-trained language model;
[0008] Step 2) Based on the extracted embedded features, an initial phylogenetic tree is constructed using the tree structure generation algorithm of the phylogenetic tree construction module, and latent variables are introduced to represent the topological structure of the tree;
[0009] Step 3) using the topology learning component and the branch length learning component of the phylogenetic tree structure building module to iteratively optimize the topology structure and branch length of the phylogenetic tree;
[0010] Step 4) The scoring function is used to guide the gradient descent of the phylogenetic tree generation and optimization model to complete the model training.
[0011] The pre-trained language model is a model specially trained for genome sequence data, which is used to extract embedded features with biological significance and convert the input genome molecular sequence into Convert to gene embedding features Among them, N represents the number of species involved in the construction of the phylogenetic tree, y i represents the i-th genome molecule, e i represents the i-th gene embedding feature.
[0012] The step 2) comprises the following steps:
[0013] Step 21) Input the extracted embedding feature E into the multi-layer perceptron network to generate parameters μ and σ of the latent space;
[0014] Step 22) Use reparameterization to generate the initial latent variable z * :
[0015]
[0016] Among them, ⊙ represents the element-by-element multiplication operation at the element level, ε is a random variable that satisfies the standard normal distribution;
[0017] Step 23) Use the initial latent variable z * Calculate the distance matrix D:
[0018]
[0019] in, represents the XOR operation reflecting nucleotide mismatch, and N represents the number of species involved in the construction of the phylogenetic tree;
[0020] Step 24) Input the distance matrix D into the neighbor-joining algorithm to generate the initial phylogenetic tree topology τ(z * ).
[0021] The topology learning component includes a tree encoder R(z|τ(z * )) and a tree decoder Q(τ(z)|z):
[0022] For the tree encoder R, it receives the initial tree topology τ(z *) and gene embedding features E as input, and output latent variables z to refine the topological embedding in the continuous space, wherein the latent variables z represent the coordinates of the nodes in the hidden space, and z* represents the initial latent variables;
[0023] For the tree decoder Q, sampling is done from the probability distribution parameterized by the latent variables of the tree encoder R by minimizing the true distribution P(τ(z))=P(y|τ(z), B τ ) and the variational distribution Q(τ(z))=q(τ(z), B τ ) to optimize the model parameters, B τ represents the branch length set, y represents the input genome sequence, and q represents the posterior distribution.
[0024] In the tree decoder, in order to facilitate backpropagation through random nodes, the latent variable z is sampled using reparameterization:
[0025]
[0026] Among them, μ and σ are the parameters of the latent space, ⊙ represents the element-by-element multiplication operation at the element level, and ε is a random variable that satisfies the standard normal distribution.
[0027] The branch length learning component generates and adjusts branch lengths by following the steps below:
[0028] Step 321) Obtain node features through linear time dual-channel traversal, combining post-order traversal and pre-order traversal strategies to ensure that each node is processed only once, where:
[0029] Post-order traversal aggregates information from leaf nodes to the root node:
[0030]
[0031] Among them, c i is the scaling factor of node i; K1 is the maximum number of neighbors of a node, which is affected by the connectivity of the node and due to the properties of the binary tree, K1=3; ch(i) represents the child node of node i;
[0032] The feature f of node i i Through its child node f j The contribution and initial characteristics of i To calculate, the formula is:
[0033] f i =c i ·f j +e i
[0034] Among them, e iis the initial feature of node i extracted from the pre-trained genomic model, and the initial setting c i =0,f i =e i ;
[0035] Pre-order traversal propagates information from the root node to the leaf nodes, enhancing the feature x of each node i :
[0036] x i =c i ·e p[i] +f i
[0037] Among them, e p[i] is the feature of the parent node of node i;
[0038] Step 322) Use the edge convolution layer of the dynamic graph convolutional neural network to enhance node features: For the Lth layer, the input node feature is The output features are Where N represents the number of species involved in the construction of the phylogenetic tree, the characteristic dimension F = 768, F′ = 100, and the conversion formula is:
[0039]
[0040] Among them, DGCNN represents dynamic graph convolutional neural network, is an asymmetric edge function shared by an MLP; according to topological invariance: where z i and z j denote the latent variables of the i-th and j-th nodes, i.e., the coordinates of the nodes in the hidden space, and the function h(x i , x j ) combines global and local features by:
[0041]
[0042] Node features are aggregated on all edges through the MAX operation, the formula is:
[0043]
[0044] Step 323) Reparameterization of branch length: node features obtained by edge convolutional layer is further fed into the M network, which includes two MLP layers: MLP1 and MLP2, where MLP1 is used to capture the node features h of the interactions between nodes. i :
[0045]
[0046] in, Represents the neighbor nodes of node i;
[0047] The output of MLP1 is fed into MLP2 to parameterize the mean μ and logarithmic variance of the branch lengths.
[0048] The branch lengths are updated by a reparameterization method using the formula:
[0049] b=exp(μ+exp(σ)*rvs)
[0050] in, represents a random variable sampled from a standard normal distribution, and b represents the branch length set B τ is a branch length in , μ and σ are parameters of the latent space.
[0051] In the step 4), a scoring function S implemented by a multi-layer perceptron is introduced, which evaluates each leaf node in the latent variable z, provides additional gradient information, and outputs a scoring value;
[0052] In the process of phylogenetic tree generation and optimization model training, the scoring function S and the evidence lower bound ELBO together constitute a joint optimization objective to optimize the gradient direction:
[0053]
[0054] Among them, z *k and is from the variational distribution Q(z * ) and Q(B τ |τ(z)); K represents the number of samples obtained from the variational distribution through Monte Carlo sampling, and Y represents the input genome sequence;
[0055] Total loss function of phylogenetic tree generation and optimization model Defined as:
[0056]
[0057] in, To minimize the KL divergence, q φ represents the approximate posterior distribution based on the neural network parameter φ, p θ represents the prior distribution based on the model parameters θ; represents the embedding scoring function loss.
[0058] In step 4), the model parameters are updated by end-to-end learning using stochastic gradient descent, where:
[0059] The gradient of the model parameter θ in the phylogenetic tree building module is derived as:
[0060]
[0061] Among them, H[Q θ (z * )] is Q θ (z * ), Express expectations, represents the gradient;
[0062] The gradient of the model parameter φ for the branch length learning component is derived as:
[0063]
[0064] The gradient derivation of the model parameter ψ for the topological learning component is:
[0065]
[0066] A developmental tree inference device based on a biological large language model comprises a memory, a processor, and a program stored in the memory, wherein the processor implements the method described above when executing the program.
[0067] A storage medium stores a program, which implements the method described above when executed.
[0068] Compared with the prior art, the present invention has the following beneficial effects:
[0069] (1) The present invention avoids the reliance on traditional evolutionary models by using a pre-trained genomic language model, and does not require the input sequences to be aligned to the same length, thus simplifying the processing flow.
[0070] (2) The present invention can simultaneously infer and optimize the topological structure and branch length of the phylogenetic tree, thereby improving the inference accuracy and computational efficiency.
[0071] (3) By designing a scoring function and guiding the gradient optimization of the model, the inference process is made more stable, the training time is effectively shortened, and the convergence speed of the model is improved.
[0072] (4) The present invention is not limited to a specific input type and can process a variety of gene sequence data, and has wide applicability in different biological research scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] Figure 1 is a flow chart of the overall method of the present invention;
[0074] Figure 2It is a schematic diagram of the structure of the phylogenetic tree generation and optimization model of the present invention;
[0075] Figure 3 This is a visualization result of a phylogenetic tree inferred by the present invention on a data set containing 27 species in an embodiment. DETAILED DESCRIPTION
[0076] The present invention is described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is implemented based on the technical solution of the present invention, and provides a detailed implementation method and specific operation process, but the protection scope of the present invention is not limited to the following embodiments.
[0077] This embodiment provides a phylogenetic tree inference method based on a biological language model. The method optimizes the topological structure and branch length of the phylogenetic tree based on the phylogenetic tree generation and optimization model, and directly infers the phylogenetic tree from the input genome sequence. Figure 1 As shown in Figure 1, the phylogenetic tree generation and optimization model includes three core modules: feature extraction module, phylogenetic tree construction module and phylogenetic tree structure construction module. In addition, a scoring function is introduced to guide the model to achieve stable gradient optimization, aiming to solve the problems of separate optimization of tree structure and branch length, slow convergence speed and neglect of key features of gene sequences in existing methods.
[0078] like Figure 2 As shown, the method realizes the generation and optimization of phylogenetic tree through the following steps:
[0079] Step 1) Figure 2 As shown in the feature extraction module section, embedded features are extracted from genomic sequence data through a pre-trained language model.
[0080] The pre-trained language model is a model specially trained for genomic sequence data to extract embedding features with biological significance. This example uses DNABERT2, a genomic language model, to convert the input genomic molecular sequence into Convert to gene embedding features Where N represents the number of species involved in the construction of the phylogenetic tree. yi represents the i-th genome molecule, e i represents the i-th gene embedding feature.
[0081] Step 2) Based on the extracted embedded features, the tree structure generation algorithm of the phylogenetic tree construction module is used to construct an initial phylogenetic tree, and latent variables are introduced to represent the topological structure of the tree.
[0082] Specifically, Figure 2As shown in the phylogenetic tree construction module section, the preliminary phylogenetic tree structure generation algorithm and the introduction of latent variables to represent the topological structure of the tree are performed by the following method:
[0083] Step 21) The extracted embedding feature E is input into the multi-layer perceptron network to generate the parameters μ and σ of the latent space. The latent space effectively captures the evolutionary relationship between species, thereby guiding the subsequent tree structure generation process.
[0084] Step 22) Use reparameterization to generate the initial latent variable z * :
[0085]
[0086] Among them, ⊙ represents the element-by-element multiplication operation at the element level, ε is a random variable that satisfies the standard normal distribution.
[0087] Step 23) Use the initial latent variable z * Calculate the distance matrix D:
[0088]
[0089] in, represents the XOR operation reflecting nucleotide mismatch, and N represents the number of species involved in the construction of the phylogenetic tree.
[0090] Step 24) Input the distance matrix D into the neighbor-joining algorithm to generate the initial phylogenetic tree topology τ(z * ).
[0091] Step 3) Figure 2 As shown in the phylogenetic tree structure modeling module part, the phylogenetic tree structure modeling module part includes topology learning and branch length learning components. The topology learning component and the branch length learning component are used to iteratively optimize the topology structure and branch length of the phylogenetic tree.
[0092] (1) Topology Learning Component
[0093] The topology learning component consists of a tree encoder R(z|τ(z * )) and a tree decoder Q(τ(z)|z):
[0094] For the tree encoder R, it receives the initial tree topology τ(z * ) and gene embedding features E as input, and output latent variables z to refine the topological embedding in the continuous space, where the latent variables z represent the coordinates of the nodes in the hidden space and z* represents the initial latent variables. Variational inference is introduced to enhance the quality of the tree structure and minimize the Kullback-Leibler r(KL) divergence to adapt to the uncertainty and complexity of data.
[0095] For the tree decoder Q, we sample from the probability distribution parameterized by the latent variables of the tree encoder R. This process is done by minimizing the true distribution P(τ(z))=P(y|τ(z), B τ ) and the variational distribution Q(τ(z))=q(τ(z), B τ ) to optimize the model parameters, B τ represents the branch length set, y represents the input genome sequence, and q represents the posterior distribution.
[0096] To facilitate backpropagation through random nodes, the latent variable z is sampled using reparameterization:
[0097]
[0098] Where μ and σ are the parameters of the latent space, ⊙ represents the element-wise multiplication operation at the element level, and ε is a random variable that satisfies the standard normal distribution. ε introduces controlled randomness while maintaining differentiability, ensuring that z effectively captures the refined topological embedding.
[0099] (2) Branch length learning component
[0100] The branch length learning component generates and adjusts branch lengths through the following steps:
[0101] Step 321) Obtain node features through linear time dual-channel traversal, combining post-order (bottom-up) traversal and pre-order (top-down) traversal strategies to ensure that each node is processed only once.
[0102] Post-order (bottom-up) traversal aggregates information from leaf nodes to the root node:
[0103]
[0104] Among them, c i is the scaling factor of node i; K1 is the maximum number of neighbors of the node, which is affected by the connectivity of the node and due to the properties of the binary tree, K1=3; ch(i) represents the child node of node i.
[0105] The feature f of node i i Through its child node f j The contribution and initial characteristics of i To calculate, the formula is:
[0106] f i =c i ·f j +e i
[0107] Among them, e i is the initial feature of node i extracted from the pre-trained genomic model, and the initial setting c i =0,f i =e i .
[0108] Pre-order (top-down) traversal propagates information from the root node to the leaf nodes, enhancing the features x of each node i :
[0109] x i =c i ·e p[i] +f i
[0110] Among them, e p[i] is the feature of the parent node of node i.
[0111] Step 322) Use the edge convolution layer of the dynamic graph convolutional neural network (DGCNN) to enhance node features: For the Lth layer, the input node feature is The output features are Where N represents the number of species involved in the construction of the phylogenetic tree, the characteristic dimension F = 768, F′ = 100, and the conversion formula is:
[0112]
[0113] Among them, DGCNN represents dynamic graph convolutional neural network, It is an asymmetric edge function shared by MLP, which is mainly used to process the edge features between nodes; according to the topological invariance: where z i and z j denote the latent variables of the i-th and j-th nodes, i.e., the coordinates of the nodes in the hidden space, and the function h(x i , x j ) combines global and local features by:
[0114]
[0115] Node features are aggregated on all edges through the MAX operation, the formula is:
[0116]
[0117] Step 323) Reparameterization of branch length: node features obtained by edge convolutional layer is further fed into the M network, which includes two MLP layers: MLP1 and MLP2, where MLP1 is used to capture the node features h of the interactions between nodes.i :
[0118]
[0119] in, Represents the neighbor nodes of node i;
[0120] The output of MLP1 is fed into MLP2 to parameterize the mean μ and logarithmic variance of the branch lengths.
[0121] The branch lengths are updated by a reparameterization method using the formula:
[0122] b=exp(μ+exp(σ)*rvs)
[0123] in, represents a random variable sampled from a standard normal distribution, and b represents the branch length set B τ is a branch length in , μ and σ are parameters of the latent space.
[0124] Throughout the process, the prior P(B τ ) is assumed to be exponential, and the posterior Q(B τ ) is learned through graph neural networks, reflecting the topological structure and node characteristics of the inferred phylogenetic tree.
[0125] Step 4) The scoring function is used to guide the gradient descent of the phylogenetic tree generation and optimization model to complete the model training.
[0126] Step 41) introduces a scoring function S implemented by a multi-layer perceptron, which evaluates each leaf node in the latent variable z and provides additional gradient information and outputs a scoring value.
[0127] In the process of phylogenetic tree generation and optimization model training, the scoring function S and the evidence lower bound ELBO together constitute a joint optimization objective to optimize the gradient direction:
[0128]
[0129] The above is the ELBO loss implemented using a multi-sample method, where z *k and is from the variational distribution Q(z * ) and Q(B τ |τ(z)); K represents the number of samples obtained from the variational distribution by Monte Carlo sampling to calculate the empirical mean, providing a more robust approximation to ELBO; Y represents the input genome sequence.
[0130] Total loss function of phylogenetic tree generation and optimization model Defined as:
[0131]
[0132] in, Used to minimize KL divergence; q φ represents the approximate posterior distribution based on the neural network parameter φ, which is usually used in variational inference to approximate the true posterior distribution; p θ Represents the prior distribution based on the model parameters θ, which is usually compared with the true distribution in variational inference; the KL divergence term is used to measure the approximate posterior q φ and the prior p θ The difference between.
[0133] represents the embedding scoring function loss.
[0134] Step 42) Update the model parameters by end-to-end learning using stochastic gradient descent, where:
[0135] The gradient of the model parameter θ in the phylogenetic tree building module is derived as:
[0136]
[0137] Among them, H[Q θ (z * )] is Q θ (z * )’s entropy; It is the expectation symbol, which represents the expectation (or average) of a random variable. In variational inference or probability model, the expectation operation is used to estimate the average value of a function under a distribution; Represents the gradient. Represents the derivative (gradient) of the parameter θ. The gradient is used for back propagation in the optimization process to adjust the model parameters to minimize the loss function. Represents the loss function The gradient with respect to the model parameters θ.
[0138] The gradient of the model parameter φ for the branch length learning component is derived as:
[0139]
[0140] Among them, the gradient Represents the loss function The gradient with respect to the model parameters φ.
[0141] The gradient derivation of the model parameter ψ for the topological learning component is:
[0142]
[0143] Among them, the gradient Represents the loss function The gradient with respect to the model parameters ψ.
[0144] The effect of the present invention on the phylogenetic tree inference task is described below through a specific example:
[0145] In this embodiment, if Figure 3 As shown on the left, the visualization result of the phylogenetic tree inferred by the present invention based on a data set containing 27 species is shown. Each leaf node represents a specific species, and the text next to the node indicates the species name. The branch length reflects the genetic distance, with shorter branches indicating a recent evolutionary history and longer branches indicating greater genetic differences. On the right, the colored sequences represent fragments of the species' protein sequences, and blocks of different colors correspond to different amino acid residues. The scale bar in the lower left corner represents the ratio between branch length and evolutionary distance.
[0146] Figure 3 The phylogenetic tree in the paper places two aquatic organisms, Siren intermedia and Trachemys scripta, on adjacent branches, reflecting that the model of the present invention can capture their adaptive evolutionary information to the aquatic environment. At the same time, the reptile species Heterodon platyrhinos and Trachemys scripta are also on adjacent branches, indicating that they are a relatively recent common ancestor compared with other amphibian and reptile species. This sequence presentation method does not require a uniform sequence length or a filling process, and can effectively reflect the actual sequence changes.
[0147] The above is an introduction to a method embodiment. The following is a further explanation of the solution of the present invention through an apparatus embodiment.
[0148] This embodiment also provides a developmental tree inference device based on a biological large language model, including a memory, a processor, and a program stored in the memory, and the processor implements the method described above when executing the program.
[0149] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0150] If the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc., which can store program code.
[0151] The preferred specific embodiments of the present invention are described in detail above. It should be understood that a person skilled in the art can make many modifications and changes based on the concept of the present invention without creative work. Therefore, any technical solution that can be obtained by a person skilled in the art through logical analysis, reasoning, or limited experiments based on the concept of the present invention on the basis of the prior art should be within the scope of protection determined by the claims.
Claims
1. A developmental tree inference method based on a biological large language model, characterized in that: The method is based on a phylogenetic tree generation and optimization model to jointly optimize the topological structure and branch length of the phylogenetic tree, so as to directly infer the phylogenetic tree from the input genome sequence, wherein the phylogenetic tree generation and optimization model includes a feature extraction module, a phylogenetic tree construction module and a phylogenetic tree structure construction module, and the training process includes the following steps: Step 1) using a feature extraction module to extract embedded features from the genome sequence data using a pre-trained language model; Step 2) Based on the extracted embedded features, an initial phylogenetic tree is constructed using the tree structure generation algorithm of the phylogenetic tree construction module, and latent variables are introduced to represent the topological structure of the tree; Step 3) using the topology learning component and the branch length learning component of the phylogenetic tree structure building module to iteratively optimize the topology structure and branch length of the phylogenetic tree; Step 4) The scoring function is used to guide the gradient descent of the phylogenetic tree generation and optimization model to complete the model training.
2. A developmental tree inference method based on a biological large language model according to claim 1, characterized in that: The pre-trained language model is a model specially trained for genome sequence data, which is used to extract embedded features with biological significance and convert the input genome molecular sequence into Convert to gene embedding features Where N represents the number of species involved in the construction of the phylogenetic tree, yi represents the i-th genome molecule, and e i represents the i-th gene embedding feature.
3. A developmental tree inference method based on a biological large language model according to claim 1, characterized in that: The step 2) comprises the following steps: Step 21) Input the extracted embedding feature E into the multi-layer perceptron network to generate parameters μ and σ of the latent space; Step 22) Generate the initial latent variables z* using reparameterization: Among them, ⊙ represents the element-by-element multiplication operation at the element level, ε is a random variable that satisfies the standard normal distribution; Step 23) Calculate the distance matrix D using the initial latent variables z*: in, represents the XOR operation reflecting nucleotide mismatch, and N represents the number of species involved in the construction of the phylogenetic tree; Step 24) Input the distance matrix D into the neighbor-joining algorithm to generate the initial phylogenetic tree topology τ(z*).
4. A developmental tree inference method based on a biological large language model according to claim 1, characterized in that: The topology learning component includes a tree encoder R(z|τ(z*)) and a tree decoder Q(τ(z)|z): For the tree encoder R, it receives the initial tree topology τ(z*) and the gene embedding feature E as input, and outputs a latent variable z to refine the topological embedding in the continuous space, wherein the latent variable z represents the coordinates of the node in the hidden space, and z* represents the initial latent variable; For the tree decoder Q, sampling is done from the probability distribution parameterized by the latent variables of the tree encoder R by minimizing the true distribution P(τ(z))=P(y|τ(z), B τ ) and the variational distribution Q(τ(z))=q(τ(z), B τ ) to optimize the model parameters, B τ represents the branch length set, y represents the input genome sequence, and q represents the posterior distribution.
5. A developmental tree inference method based on a biological large language model according to claim 4, characterized in that: In the tree decoder, in order to facilitate backpropagation through random nodes, the latent variable z is sampled using reparameterization: Among them, μ and σ are the parameters of the latent space, ⊙ represents the element-by-element multiplication operation at the element level, and ε is a random variable that satisfies the standard normal distribution.
6. A developmental tree inference method based on a biological large language model according to claim 1, characterized in that: The branch length learning component generates and adjusts branch lengths by following the steps below: Step 321) Obtain node features through linear time dual-channel traversal, combining post-order traversal and pre-order traversal strategies to ensure that each node is processed only once, where: Post-order traversal aggregates information from leaf nodes to the root node: Among them, c i is the scaling factor of node i; K1 is the maximum number of neighbors of a node, which is affected by the connectivity of the node and due to the properties of the binary tree, K1=3; ch(i) represents the child node of node i; The feature f of node i i Through its child node f j The contribution and initial characteristics of i To calculate, the formula is: f i =c i ·f j +e i Among them, e i is the initial feature of node i extracted from the pre-trained genomic model, and the initial setting c i =0,f i =e i ; Pre-order traversal propagates information from the root node to the leaf nodes, enhancing the feature x of each node i : x i =c i ·e p[i] +f i Among them, e p[i] is the feature of the parent node of node i; Step 322) Use the edge convolution layer of the dynamic graph convolutional neural network to enhance node features: For the Lth layer, the input node feature is The output features are Where N represents the number of species involved in the construction of the phylogenetic tree, the characteristic dimension F = 768, F′ = 100, and the conversion formula is: Among them, DGCNN represents dynamic graph convolutional neural network, is an asymmetric edge function shared by an MLP; according to topological invariance: where z i and z j denote the latent variables of the i-th and j-th nodes, i.e., the coordinates of the nodes in the hidden space, and the function h(x i , x j ) combines global and local features by: Node features are aggregated on all edges through the MAX operation, the formula is: Step 323) Reparameterization of branch length: node features obtained by edge convolutional layer is further fed into the M network, which includes two MLP layers: MLP1 and MLP2, where MLP1 is used to capture the node features h of the interactions between nodes. i : in, Represents the neighboring nodes of node i; The output of MLP1 is fed into MLP2 to parameterize the mean μ and logarithmic variance of the branch lengths. The branch lengths are updated by a reparameterization method using the formula: b=exp(μ+exp(σ)*rvS) in, represents a random variable sampled from a standard normal distribution, and b represents the branch length set B τ is a branch length in , μ and σ are parameters of the latent space.
7. A developmental tree inference method based on a biological large language model according to claim 4, characterized in that: In the step 4), a scoring function S implemented by a multi-layer perceptron is introduced, which evaluates each leaf node in the latent variable z, provides additional gradient information, and outputs a scoring value; In the process of phylogenetic tree generation and optimization model training, the scoring function S and the evidence lower bound ELBO together constitute a joint optimization objective to optimize the gradient direction: Among them, z *k and is from the variational distribution Q(z * ) and Q(B τ |τ(z)); K represents the number of samples obtained from the variational distribution through Monte Carlo sampling, and Y represents the input genome sequence; Total loss function of phylogenetic tree generation and optimization model Defined as: in, To minimize the KL divergence, q φ represents the approximate posterior distribution based on the neural network parameter φ, p α represents the prior distribution based on the model parameters θ; represents the embedding scoring function loss.
8. A developmental tree inference method based on a biological large language model according to claim 7, characterized in that: In step 4), the model parameters are updated by end-to-end learning using stochastic gradient descent, where: The gradient of the model parameter θ in the phylogenetic tree building module is derived as: where H[Qθ(z*)] is the entropy of Qθ(z*), Express expectations, represents the gradient; The gradient of the model parameter φ for the branch length learning component is derived as: The gradient derivation of the model parameter ψ for the topological learning component is:
9. A developmental tree inference device based on a biological large language model, comprising a memory, a processor, and a program stored in the memory, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.
10. A storage medium having a program stored thereon, characterized in that: When the program is executed, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
System generation tree construction method based on metric learning
CN120067895A
Rapid construction method for realizing phylogenetic tree based on core genome mixed distance model
CN120954477A