IP Library Granted Patent US 12,659,130
Granted Patent B2
US 12,659,130 · App. 18/533,080 · Granted Jun 16, 2026

Training optimization of regression trees using fully homomorphic encryption

Inventors: Jonas Boehler (Karlsruhe, DE); Anselme Tueno (Ettlingen, DE); Christian Manz (Framersheim, DE)
Assignee: SAP SE
H04L9/008G06N5/01H04L9/0618
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,659,130
App. No.
18/533,080
Granted
Jun 16, 2026
Kind
B2
Abstract

A computer implemented method can receive n training samples including sample values corresponding to m attributes and respective target values (n and m are positive integers), duplicate the sample values corresponding to the m attributes, pack the sample values into ciphertexts based on a batching option, and train a regression tree using the ciphertexts. The training is configured to encrypt the regression tree through homomorphic operations on the ciphertexts.

Claims (85)

1 . A computing system, comprising:

memory;

one or more hardware processors coupled to the memory; and

one or more computer readable storage media storing instructions that, when loaded into the memory, cause the one or more hardware processors to perform operations comprising:

receiving n training samples comprising sample values corresponding to m attributes and respective target values, wherein n and m are positive integers;

duplicating the sample values corresponding to the m attributes;

packing the sample values into ciphertexts based on a batching option; and

training a regression tree using the ciphertexts,

wherein the training is configured to encrypt the regression tree through homomorphic operations on the ciphertexts,

wherein the regression tree comprises nodes organized in multiple layers and edges connecting between some of the nodes,

wherein the nodes comprise one or more inner nodes and a plurality of leaf nodes, wherein an inner node has two child nodes, wherein a leaf node has no child node,

wherein the inner nodes represent test conditions for corresponding attributes, the edges represent outcomes of evaluating the sample values based on the test conditions, and the leaf nodes represent predictions of the target values,

wherein the act of duplicating creates q copies of the sample values included in the n training samples for each attribute, wherein q defines a count of thresholds which are tested for each attribute to determine a test condition represented by an inner node corresponding to the attribute, wherein q is an integer that is greater than one,

wherein testing the q thresholds for each attribute is performed in parallel,

wherein training the regression tree comprises:

determining the test conditions represented by the inner nodes, wherein a test condition represented by a selected inner node specifies a selected attribute and a selected threshold, wherein the selected threshold is selected from q thresholds for the selected attribute; and

determining whether a training sample is assigned to left or right child node of the selected inner node based on comparison of the selected threshold with a sample value of the training sample corresponding to the selected attribute,

wherein determining the test condition represented by the selected inner node comprises:

evaluating a split score based on a mean squared error between target values of the training samples that are respectively assigned to left and right child nodes of the selected inner node and predicted target values; and

choosing the selected attribute and the selected threshold, among a plurality of possible attribute and threshold combinations, that minimize the split score.

2 . The computing system of claim 1 , wherein the batching option specifies an attribute-wise batching, by which n sample values from n training samples for each attribute are packed into one ciphertext.

3 . The computing system of claim 1 , wherein the batching option specifies a sample-wise batching, by which m×q sample values for each training sample are packed into one ciphertext.

4 . The computing system of claim 1 , wherein the batching option specifies a layer-wise batching, by which m×q sample values for each training sample are first packed into one vector, wherein vectors corresponding to the n training samples are duplicated to match a count of the leaf nodes, wherein duplicated vectors are further concatenated into a combined ciphertext for each layer of the regression tree.

5 . The computing system of claim 1 , wherein training the regression tree further comprises calculating averages of target values of the training samples assigned to the leaf nodes.

6 . The computing system of claim 1 , wherein determining the test condition represented by the selected inner node further comprises:

forming a threshold vector comprising a plurality of thresholds to be tested for the selected attribute;

evaluating split scores for the plurality of thresholds included in the threshold vector; and

identifying a smallest split score among the split scores.

7 . The computing system of claim 6 , wherein determining the test condition represented by the selected inner node further comprises:

arranging the split scores for the plurality of thresholds in a score vector; and

converting the score vector to a minimum score vector in which all elements equal the smallest split score,

wherein identifying the smallest split score and converting the score vector to the minimum score vector comprise iteratively performing element-wise comparison between the score vector and a rotated version of the score vector and updating the score vector based on the element-wise comparison.

8 . The computing system of claim 7 , wherein determining the test condition represented by the selected inner node further comprises:

generating a one-hot vector which identifies a threshold in the threshold vector that is associated with the smallest split score,

wherein generating the one-hot vector comprises performing element-wise comparison between the minimum score vector and the score vector before converting the score vector to the minimum score vector.

9 . The computing system of claim 8 , wherein training the regression tree further comprises pre-rotating the one-hot vector and the threshold vector before determining whether a training sample is assigned to left or right child node of the selected inner node.

10 . A computer-implemented method comprising:

receiving n training samples comprising sample values corresponding to m attributes and respective target values, wherein n and m are positive integers;

duplicating the sample values corresponding to the m attributes;

packing the sample values into ciphertexts based on a batching option; and

training a regression tree using the ciphertexts,

wherein the training is configured to encrypt the regression tree through homomorphic operations on the ciphertexts,

wherein the regression tree comprises nodes organized in multiple layers and edges connecting between some of the nodes,

wherein the nodes comprise one or more inner nodes and a plurality of leaf nodes, wherein an inner node has two child nodes, wherein a leaf node has no child node,

wherein the inner nodes represent test conditions for corresponding attributes, the edges represent outcomes of evaluating the sample values based on the test conditions, and the leaf nodes represent predictions of the target values,

wherein the act of duplicating creates q copies of the sample values included in the n training samples for each attribute, wherein q defines a count of thresholds which are tested for each attribute to determine a test condition represented by an inner node corresponding to the attribute, wherein q is an integer that is greater than one,

wherein testing the q thresholds for each attribute is performed in parallel,

wherein training the regression tree comprises:

determining the test conditions represented by the inner nodes, wherein a test condition represented by a selected inner node specifies a selected attribute and a selected threshold, wherein the selected threshold is selected from q thresholds for the selected attribute; and

determining whether a training sample is assigned to left or right child node of the selected inner node based on comparison of the selected threshold with a sample value of the training sample corresponding to the selected attribute,

wherein determining the test condition represented by the selected inner node comprises:

evaluating a split score based on a mean squared error between target values of the training samples that are respectively assigned to left and right child nodes of the selected inner node and predicted target values; and

choosing the selected attribute and the selected threshold, among a plurality of possible attribute and threshold combinations, that minimize the split score.

11 . The method of claim 10 , wherein the batching option specifies an attribute-wise batching, by which n sample values from n training samples for each attribute are packed into one ciphertext.

12 . The method of claim 10 , wherein the batching option specifies a sample-wise batching, by which m×q sample values for each training sample are packed into one ciphertext.

13 . The method of claim 10 , wherein training the regression tree further comprises calculating averages of target values of the training samples assigned to the leaf nodes.

14 . The method of claim 10 , wherein determining the test condition represented by the selected inner node further comprises:

forming a threshold vector comprising a plurality of thresholds to be tested for the selected attribute;

evaluating split scores for the plurality of thresholds included in the threshold vector; and

identifying a smallest split score among the split scores.

15 . The method of claim 14 , wherein determining the test condition represented by the selected inner node further comprises:

arranging the split scores for the plurality of thresholds in a score vector; and

converting the score vector to a minimum score vector in which all elements equal the smallest split score,

wherein identifying the smallest split score and converting the score vector to the minimum score vector comprise iteratively performing element-wise comparison between the score vector and a rotated version of the score vector and updating the score vector based on the element-wise comparison.

16 . The method of claim 15 , wherein determining the test condition represented by the selected inner node further comprises:

generating a one-hot vector which identifies a threshold in the threshold vector that is associated with the smallest split score,

wherein generating the one-hot vector comprises performing element-wise comparison between the minimum score vector and the score vector before converting the score vector to the minimum score vector.

17 . The method of claim 16 , wherein training the regression tree further comprises pre-rotating the one-hot vector and the threshold vector before determining whether a training sample is assigned to left or right child node of the selected inner node.

18 . One or more non-transitory computer-readable media having encoded thereon computer-executable instructions causing one or more processors to perform a method comprising:

receiving n training samples comprising sample values corresponding to m attributes and respective target values, wherein n and m are positive integers;

duplicating the sample values corresponding to the m attributes;

packing the sample values into ciphertexts based on a batching option; and

training a regression tree using the ciphertexts,

wherein the training is configured to encrypt the regression tree through homomorphic operations on the ciphertexts,

wherein the regression tree comprises nodes organized in multiple layers and edges connecting between some of the nodes,

wherein the nodes comprise one or more inner nodes and a plurality of leaf nodes, wherein an inner node has two child nodes, wherein a leaf node has no child node,

wherein the inner nodes represent test conditions for corresponding attributes, the edges represent outcomes of evaluating the sample values based on the test conditions, and the leaf nodes represent predictions of the target values,

wherein the act of duplicating creates q copies of the sample values included in the n training samples for each attribute, wherein q defines a count of thresholds which are tested for each attribute to determine a test condition represented by an inner node corresponding to the attribute, wherein q is an integer that is greater than one,

wherein testing the q thresholds for each attribute is performed in parallel,

wherein training the regression tree comprises:

determining the test conditions represented by the inner nodes, wherein a test condition represented by a selected inner node specifies a selected attribute and a selected threshold, wherein the selected threshold is selected from q thresholds for the selected attribute; and

determining whether a training sample is assigned to left or right child node of the selected inner node based on comparison of the selected threshold with a sample value of the training sample corresponding to the selected attribute,

wherein determining the test condition represented by the selected inner node comprises:

evaluating a split score based on a mean squared error between target values of the training samples that are respectively assigned to left and right child nodes of the selected inner node and predicted target values; and

choosing the selected attribute and the selected threshold, among a plurality of possible attribute and threshold combinations, that minimize the split score.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 10, 2023
From: BOEHLER, JONAS; TUENO, ANSELME; MANZ, CHRISTIAN
To: SAP SE
Reel/Frame 065821/0895 →
Continuity (1)
Related Publication 20250192979A1 · Jun 12, 2025
References Cited (20)
US 11995519B2 · Gulin · 2024 [cited by examiner]
US 20200244437A1 · Ruan · 2020 [cited by applicant]
US 20210344478A1 · Sarpatwar · 2021 [cited by applicant]
US 20220036250A1 · Wang · 2022 [cited by examiner]
Abspoel et al., “Secure Training of Decision Trees With Continuous Attributes,” [cited by applicant]
Akavia et al., “Privacy-Preserving Decision Trees Training and Prediction,” ACM Transactions on Privacy and Security, vol. 25, No. 3, Article 24, 30 pages, May 2022. [cited by applicant]
Lauter et al., “Protecting Privacy through Homomorphic Encryption,” pp. 31-62, 2021. [cited by applicant]
Barni et al., “Secure Evaluation of Private Linear Branching Programs with Medical Applications,” In [cited by applicant]
Brakerski et al., “(Leveled) Fully Homomorphic Encryption without Bootstrapping,” [cited by applicant]
Breiman, “Random Forests,” [cited by applicant]
Cheon et al., “Numerical method for comparison on homomorphically encrypted numbers,” In [cited by applicant]
De Hoogh et al., “Practical Secure Decision Tree Learning in a Teletreatment Application,” In [cited by applicant]
Frery et al., “Privacy-Preserving Tree-Based Inference with Fully Homomorphic Encryption,” arXiv preprint arXiv:2303.01254, 2023. [cited by applicant]
Gentry, “A Fully Homomorphic Encryption Scheme,” [cited by applicant]
Goldschmidt, “Applications of Division by Convergence,” [cited by applicant]
Hyafil et al., “Constructing Optimal Binary Decision Trees is NP-Complete,” [cited by applicant]
Martin, “An Exact Probability Metric for Decision Tree Splitting and Stopping,” In [cited by applicant]
Shamrat et al., A Comprehensive Study on Pre-Pruning and Post-Pruning Methods of Decision Tree Classification Algorithm, In [cited by applicant]
Tai et al., Privacy-Preserving Decision Trees Evaluation via Linear Functions, In [cited by applicant]
Wu et al., “Privately Evaluating Decision Trees and Random Forests,” [cited by applicant]