IP Library Granted Patent US 12,373,554
Granted Patent B2
US 12,373,554 · App. 17/900,394 · Granted Jul 29, 2025

Generating security language queries

Inventors: Daniel Lee Mace (Bellevue, WA); William Blum (Bellevue, WA); Jeremias Eichelbaum (Vancouver, CA); Amir Rubin (Vancouver, CA); Edir V. Garcia Lazo (Seattle, WA); Nihal Irmak Pakis (Vancouver, CA); Yogesh K. Roy (Redmond, WA); Jugal Parikh (Sammamish, WA); Peter A. Bryan (Seattle, WA); Benjamin Elliott Nick (Bellevue, WA); Ram Shankar Siva Kumar (Bothell, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F21/554G06F16/2423G06F40/47
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,373,554
App. No.
17/900,394
Granted
Jul 29, 2025
Kind
B2
Abstract

A computer-implemented method of generating a security language query from a user input query includes receiving, at a computer system, an input security hunting user query indicating a user intention; selecting, using a trained machine learning model and based on the input security hunting query, an example user security hunting query and corresponding example security language query; generating, using the trained machine learning model, query metadata from the input security hunting query; generating a prompt, the prompt comprising: the input security hunting user query; the selected example user security hunting query and the corresponding example security language query; and the generated query metadata; inputting the prompt to a large language model; receiving a security language query from the large language model corresponding to the input security hunting query reflective of the user intention.

Claims (136)

1. A computer-implemented method comprising:

receiving a training data set comprising a plurality of user security hunting queries, corresponding ground truth security language queries, and corresponding query metadata;

generating a plurality of probe prompts from the training data set, wherein generating each probe prompt comprises:

selecting one of the plurality of user security hunting queries as a subject of the probe prompt, and

randomly selecting a subset of the plurality of user security hunting queries and corresponding ground truth security language queries as examples for inclusion into the probe prompt;

inputting the probe prompts to a large language model;

receiving, as output from the large language model, security language queries corresponding to the subjects of the probe prompts;

comparing the security language queries for the probe prompts to the corresponding ground truth security language queries;

calculating probe scores for the probe prompts based on the comparison; and

training a machine learning model based on the calculated probe scores and the training data set, the machine learning model being trained to:

receive an input user security hunting user query,

generate output scores reflective of a utility of the user security hunting queries and corresponding ground truth security language queries of the training data set to the input user security hunting user query, and

select a user security hunting query and corresponding ground truth security language query of the training data set as an example for inclusion into a prompt for input to the large language model based on the output scores, and

generate query metadata for inclusion into the prompt for input to the large language model from the input security hunting user query.

2. The method of claim 1 , wherein the trained model comprises:

a base large language model;

a pooling layer;

a ranking head; and

a classification head,

wherein the ranking head is trained to select the user security hunting query and corresponding ground truth security language query, and the classification head is trained to generate the query metadata.

3. The method of claim 1 , comprising generating the training data set by:

receiving an initial training data set comprising a plurality of user security hunting queries, corresponding ground truth security language queries, and corresponding query metadata;

receiving a security query set comprising security language queries and corresponding textual descriptions of the security language queries;

generating a prompt including:

a user security hunting query and corresponding ground truth security language query drawn from the initial training data set, and

a security language query and corresponding textual description from the security query set;

inputting the prompt to a natural language generation large language model;

receiving, as output from the natural language generation large language model, a user security hunting query corresponding to the security language query from the security query set,

including the received user security hunting query and the security language query from the security query set in the training data set.

4. The method of claim 1 , comprising:

backtranslating the user security hunting queries to generate backtranslated security hunting queries; and

including the backtranslated security hunting queries in the training data set.

5. The method of claim 1 , comprising:

fitting a linear model to the probe scores;

generating, from the linear model, rankings indicative of usefulness of the examples included in the probe prompts to the subjects of the probe prompts;

wherein training the machine learning model to generate the output scores to select a user security hunting query and corresponding ground truth security language query of the training data set is based on the ranking.

6. The method of claim 5 , wherein training the machine learning model based on the ranking comprises:

selecting a pair of examples from the ranking;

inputting the pair of examples to the machine learning model;

training the machine learning model to minimize a pairwise cross-entropy loss calculated from the pair of examples.

7. The method of claim 1 , comprising:

generating a plurality of hyperparameter probe prompts, wherein generating each hyperparameter probe prompt comprises:

selecting one of the plurality of user security hunting queries as a subject of the hyperparameter probe prompt, and

randomly selecting values for a hyperparameter of the machine learning model;

inputting the generated hyperparameter probe prompts to the large language model;

receiving, as output from the large language model, security language queries corresponding to the subjects of the hyperparameter probe prompt;

comparing the received security language queries for the hyperparameter probe prompts to the corresponding ground truth security language queries;

calculating hyperparameter probe scores for the hyperparameter probe prompts based on the comparison; and

training the machine learning model to select a value for the hyperparameter based on the calculated hyperparameter probe scores.

8. A system comprising a processor and a storage, the storage storing computer-readable instructions which, when executed by the processor, cause the system to perform operations comprising:

receiving a training data set comprising a plurality of user security hunting queries, corresponding ground truth security language queries, and corresponding query metadata;

generating a plurality of probe prompts from the training data set, wherein generating each probe prompt comprises:

selecting one of the plurality of user security hunting queries as a subject of the probe prompt, and

randomly selecting a subset of the plurality of user security hunting queries and corresponding ground truth security language queries as examples for inclusion into the probe prompt;

inputting the probe prompts to a large language model;

receiving, as output from the large language model, security language queries corresponding to the subjects of the probe prompts;

comparing the security language queries for the probe prompts to the corresponding ground truth security language queries;

calculating probe scores for the probe prompts based on the comparison; and

training a machine learning model based on the calculated probe scores and the training data set, the machine learning model being trained to:

receive an input user security hunting user query,

generate output scores reflective of a utility of the user security hunting queries and corresponding ground truth security language queries of the training data set to the input user security hunting user query, and

select a user security hunting query and corresponding ground truth security language query of the training data set as an example for inclusion into a prompt for input to the large language model based on the output scores, and generate query metadata for inclusion into the prompt for input to the large language model from the input security hunting user query.

9. The system of claim 8 , wherein the trained model comprises:

a base large language model;

a pooling layer;

a ranking head; and

a classification head,

wherein the ranking head is trained to select the user security hunting query and corresponding ground truth security language query, and the classification head is trained to generate the query metadata.

10. The system of claim 8 , the operations further comprising generating the training data set by:

receiving an initial training data set comprising a plurality of user security hunting queries, corresponding ground truth security language queries, and corresponding query metadata;

receiving a security query set comprising security language queries and corresponding textual descriptions of the security language queries;

generating a prompt including:

a user security hunting query and corresponding ground truth security language query drawn from the initial training data set, and

a security language query and corresponding textual description from the security query set;

inputting the prompt to a natural language generation large language model;

receiving, as output from the natural language generation large language model, a user security hunting query corresponding to the security language query from the security query set,

including the received user security hunting query and the security language query from the security query set in the training data set.

11. The system of claim 8 , the operations further comprising:

backtranslating the user security hunting queries to generate backtranslated security hunting queries; and

including the backtranslated security hunting queries in the training data set.

12. The system of claim 8 , the operations further comprising:

fitting a linear model to the probe scores;

generating, from the linear model, rankings indicative of usefulness of the examples included in the probe prompts to the subjects of the probe prompts;

wherein training the machine learning model to generate the output scores to select a user security hunting query and corresponding ground truth security language query of the training data set is based on the ranking.

13. The system of claim 12 , wherein training the machine learning model based on the ranking comprises:

selecting a pair of examples from the ranking;

inputting the pair of examples to the machine learning model;

training the machine learning model to minimize a pairwise cross-entropy loss calculated from the pair of examples.

14. The system of claim 8 , the operations further comprising:

generating a plurality of hyperparameter probe prompts, wherein generating each hyperparameter probe prompt comprises:

selecting one of the plurality of user security hunting queries as a subject of the hyperparameter probe prompt, and

randomly selecting values for a hyperparameter of the machine learning model;

inputting the generated hyperparameter probe prompts to the large language model;

receiving, as output from the large language model, security language queries corresponding to the subjects of the hyperparameter probe prompt;

comparing the received security language queries for the hyperparameter probe prompts to the corresponding ground truth security language queries;

calculating hyperparameter probe scores for the hyperparameter probe prompts based on the comparison; and

training the machine learning model to select a value for the hyperparameter based on the calculated hyperparameter probe scores.

15. A non-transitory computer-readable storage medium storing computer-readable instructions which, when executed by a processor, cause the processor to perform operations comprising:

receiving a training data set comprising a plurality of usersecurity hunting queries, corresponding ground truth security language queries, and corresponding query metadata;

generating a plurality of probe prompts from the training data set, wherein generating each probe prompt comprises:

selecting one of the plurality of user security hunting queries as a subject of the probe prompt, and

randomly selecting a subset of the plurality of user security hunting queries and corresponding ground truth security language queries as examples for inclusion into the probe prompt;

inputting the probe prompts to a large language model;

receiving, as output from the large language model, security language queries corresponding to the subjects of the probe prompts;

comparing the security language queries for the probe prompts to the corresponding ground truth security language queries;

calculating probe scores for the probe prompts based on the comparison; and

training a machine learning model based on the calculated probe scores and the training data set, the machine learning model being trained to:

receive an input user security hunting user query,

generate output scores reflective of a utility of the user security hunting queries and corresponding ground truth security language queries of the training data set to the input usersecurity hunting user query, and

select a user security hunting query and corresponding ground truth security language query of the training data set as an example for inclusion into a prompt for input to the large language model based on the output scores, and generate query metadata for inclusion into the prompt for input to the large language model from the input security hunting user query.

16. The non-transitory computer-readable storage medium of claim 15 , wherein the trained model comprises:

a base large language model;

a pooling layer;

a ranking head; and

a classification head,

wherein the ranking head is trained to select the user security hunting query and corresponding ground truth security language query, and the classification head is trained to generate the query metadata.

17. The non-transitory computer-readable storage medium of claim 15 , the operations further comprising generating the training data set by:

receiving an initial training data set comprising a plurality of user security hunting queries, corresponding ground truth security language queries, and corresponding query metadata;

receiving a security query set comprising security language queries and corresponding textual descriptions of the security language queries;

generating a prompt including:

a user security hunting query and corresponding ground truth security language query drawn from the initial training data set, and

a security language query and corresponding textual description from the security query set;

inputting the prompt to a natural language generation large language model;

receiving, as output from the natural language generation large language model, a user security hunting query corresponding to the security language query from the security query set,

including the received user security hunting query and the security language query from the security query set in the training data set.

18. The non-transitory computer-readable storage medium of claim 15 , the operations further comprising:

backtranslating the user security hunting queries to generate backtranslated security hunting queries; and

including the backtranslated security hunting queries in the training data set.

19. The non-transitory computer-readable storage medium of claim 15 , the operations further comprising:

fitting a linear model to the probe scores;

generating, from the linear model, rankings indicative of usefulness of the examples included in the probe prompts to the subjects of the probe prompts;

wherein training the machine learning model to generate the output scores to select a user security hunting query and corresponding ground truth security language query of the training data set is based on the ranking.

20. The non-transitory computer-readable storage medium of claim 19 , wherein training the machine learning model based on the ranking comprises:

selecting a pair of examples from the ranking;

inputting the pair of examples to the machine learning model;

training the machine learning model to minimize a pairwise cross-entropy loss calculated from the pair of examples.

Assignments (2)
CORRECTIVE ASSIGNMENT TO CORRECT THE INVENTOR'S 3 & 9 NAMES TO JEREMIAS EICHELBAUM & PETER A. BRYAN THAT WERE RECORDED AS JEREMIAS LION EICHELBAUM & PETER BRYAN PREVIOUSLY RECORDED ON REEL 062024 FRAME 0306. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT. Recorded Jun 6, 2023
From: MACE, DAN LEE; BLUM, WILLIAM; EICHELBAUM, JEREMIAS; RUBIN, AMIR; GARCIA LAZO, EDIR V.; PAKIS, NIHAL IRMAK; ROY, YOGESH K.; PARIKH, JUGAL; BRYAN, PETER A.; NICK, BENJAMIN ELLIOTT; KUMAR, RAM SHANKAR SIVA
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 063882/0378 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 30, 2022
From: MACE, DANIEL LEE; BLUM, WILLIAM; EICHELBAUM, JEREMIAS LION; RUBIN, AMIR; GARCIA LAZO, EDIR V.; PAKIS, NIHAL IRMAK; ROY, YOGESH K.; PARIKH, JUGAL; BRYAN, PETER; NICK, BENJAMIN ELLIOTT; KUMAR, RAM SHANKAR SIVA
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 062024/0306 →
Continuity (1)
Related Publication 20240070270A1 · Feb 29, 2024
References Cited (37)
US 11893341B2 · Itani · 2024 [cited by examiner]
US 20190132214A1 · Porras · 2019 [cited by examiner]
US 20200341976A1 · Aggarwal · 2020 [cited by examiner]
US 20200412767A1 · Crabtree · 2020 [cited by examiner]
US 20230083512A1 · Newman · 2023 [cited by examiner]
US 20230315856A1 · Lee · 2023 [cited by examiner]
US 20230418815A1 · Zorn · 2023 [cited by examiner]
US 20240037327A1 · Kallepalli · 2024 [cited by examiner]
US 20240095447A1 · Ping · 2024 [cited by examiner]
Brown, et al., “Language Models are Few-Shot Learners”, In Repository of arXiv:2005.14165v4, Jul. 22, 2020, pp. 1-75. [cited by applicant]
International Search Report and Written Opinion received for PCT Application No. PCT/US2023/028905, Dec. 15, 2023, 19 pages. [cited by applicant]
Prashant, “Create a Question-Answer Service using GPT-3 and OpenAI”, Retrieved from: https://medium.com/geekculture/create-a-question-answer-service-using-gpt-3-and-openai-41498c73879b, Jan. 23, 2022, 17 Pages. [cited by applicant]
“GPT-3”, Retrieved from: https://en.wikipedia.org/wiki/GPT-3#:˜:text=Generative%20Pre-trained%20Transformer%203%20%28GPT-3%29%20is%20an%20autoregressive,OpenAI%2C%20a%20San%20Francisco-based%20artificial%20intelligence%… [cited by applicant]
“GPT-3 for Next Generation”, Retrieved from: https://blog.intelgic.com/gpt-3-for-next-generation/, Aug. 13, 2021, 5 Pages. [cited by applicant]
“Multi-Label Text Classification with BERT and PyTorch Lightning”, Retrieved from: https://curiousily.com/posts/multi-label-text-classification-with-bert-and-pytorch-lightning/, Apr. 26, 2021, 34 Pages. [cited by applicant]
“Nlpaug 1.1.11”, Retrieved from: https://pypi.org/project/nlpaug/, Jul. 7, 2022, 9 Pages. [cited by applicant]
“Question and Answering System Using GPT3”, Retrieved from: https://www.pragnakalp.com/question-answering-using-gpt3-examples/, May 31, 2021, 10 Pages. [cited by applicant]
“Question Answering with GPT-3”, Retrieved from: https://www.thecriticalcoder.com/question-answering-with-gpt-3/, Retrieved on: Sep. 20, 2022, 12 Pages. [cited by applicant]
Alberti, et al., “Synthetic QA Corpora Generation with Roundtrip Consistency”, In Proceedings of the 57th Annual Meeting of the Association for Computational Linguistics, Jul. 28, 2019, pp. 6168-6173. [cited by applicant]
Bell, et al., “SQL to Kusto Cheat Sheet”, Retrieved from: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/sqlcheatsheet, Jul. 26, 2022, 3 Pages. [cited by applicant]
Copeland, Marshall, “Kusto Query Language and Threat Hunting”, In Proceedings of Cloud Defense Strategies with Azure Sentinel, Oct. 2, 2021, pp. 185-211. [cited by applicant]
Cruz, et al., “Learn the Advanced Hunting Query Language”, Retrieved from: https://learn.microsoft.com/en-us/microsoft-365/security/defender/advanced-hunting-query-language?view=o365-worldwide, Aug. 31, 2022, 8 Pages. [cited by applicant]
Droste, Benedikt, “Multilabel Classification With PyTorch in 5 Minutes”, Retrieved from: https://towardsdatascience.com/multilabel-classification-with-pytorch-in-5-minutes-a4fa8993cbc7, Jan. 13, 2022, 12 Pages. [cited by applicant]
Hendler, et al., “AMSI-Based Detection of Malicious PowerShell Code Using Contextual Embeddings”, In Repository of arXiv:1905.09538v2, Sep. 19, 2019, 17 Pages. [cited by applicant]
Kane, Brian, “Automating my Job by using GPT-3 to Generate Database-Ready SQL to Answer Business Questions”, Retrieved from: https://web.archive.org/web/20220117162642/https://blog.seekwell.io/gpt3, Jan. 17, 2022, 14 Pa… [cited by applicant]
Lu, et al., “Fantastically Ordered Prompts and Where to Find Them: Overcoming Few-Shot Prompt Order Sensitivity”, In Repository of arXiv:2104.08786v2, Mar. 3, 2022, 13 Pages. [cited by applicant]
Ma, et al., “Nlpaug”, Retrieved from: https://github.com/makcedward/nlpaug, Jul. 7, 2022, 11 Pages. [cited by applicant]
Mishra, Prakhar, “Training Question Answering Models from Synthetic Data (Research Paper Summary)”, Retrieved from: https://towardsdatascience.com/training-question-answering-models-from-synthetic-data-research-paper-su… [cited by applicant]
Mukherjee, Rajshekhar, “Gpt-3-NLP-to-SQL”, Retrieved from: https://github.com/rajshekharM/gpt-3-NLP-to-SQL, Jul. 30, 2020, 2 Pages. [cited by applicant]
Sagir, et al., “Kusto Query Language (KQL) Overview”, Retrieved from: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/query/, Mar. 7, 2022, 3 Pages. [cited by applicant]
Souza, Tiago, “KQL Overview—Kusto Query Language”, Retrieved from: https://cybergeeks.cloud/2021/07/overview-kql-kusto-query-language/, Sep. 20, 2021, 10 Pages. [cited by applicant]
Zaremba, et al., “OpenAl Codex”, Retrieved from: https://openai.com/blog/openai-codex/, Aug. 10, 2021, 4 Pages. [cited by applicant]
Kha, Huy, “Kusto Query Internals: Hunting TTPs with Azure Sentinel”, Retrieved From: https://identityandsecuritydotcom.files.wordpress.com/2020/05/kql_internals_sentinel.pdf, May 9, 2020, 86 Pages. [cited by applicant]
Ouyang, et al., “Training Language Models to Follow Instructions with Human Feedback”, In Repository of arXiv:2203.02155v1, Mar. 4, 2022, 68 Pages. [cited by applicant]
“Invitation to Pay Additional Fees Issued in PCT Application No. PCT/US23/028905”, Mailed Date: Oct. 24, 2023, 13 Pages. [cited by applicant]
Rony, et al., “SGPT: A Generative Approach for SPARQL Query Generation From Natural Language Questions”, In Journal of IEEE Access, vol. 10, Jul. 11, 2022, pp. 70712-70723. [cited by applicant]
Shrivastava, et al., “Repository-Level Prompt Generation for Large Language Models of Code”, In Repository of arXiv:2206.12839v1, Jun. 26, 2022, 18 Pages. [cited by applicant]