IP Library Granted Patent US 12,373,427
Granted Patent B2
US 12,373,427 · App. 18/208,743 · Granted Jul 29, 2025

Dynamic batching of prompt queries

Inventors: Marko Radmilac (Bellevue, WA); Andrew James Wald (Redmond, WA); Joshua Bryan Wyman Clemons (Seattle, WA)
Assignee: Microsoft Technology Licensing, LLC
G06F16/2433G06F16/2457
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,427
App. No.
18/208,743
Granted
Jul 29, 2025
Kind
B2
Abstract

A model comprises different processing nodes that perform different functions on input data, such as data prompts. Each node has batching criteria including a threshold value that when exceeded triggers a transmission of a batch of processing requests to the corresponding node. Different processing requests for a node are routed to a batching cache for that node. Processing requests are prevented from being routed to the node until the batching criteria is met. Once the batching criteria is met, a batch of processing requests stored in the batching cache are routed to the corresponding node.

Claims (49)

1. A method implemented by a computing system for managing batching of data processing requests, the method comprising:

identifying a model comprising a processing node that is tasked with performing a function on input data;

identifying a batching criterion for the processing node, the batching criterion comprising a threshold that, when met, triggers a transmission of a batch of processing requests to the processing node;

routing a processing request for the processing node to a batching cache corresponding to the processing node;

determining whether the batching criterion has been met;

in response to determining that the batching criterion has not been met, refraining from transmitting the processing request in the batching cache to the first processing node;

in response to determining the batching criterion has been met, routing the batch of processing requests, which includes said processing request, to the processing node for processing;

determining a number of times the processing node is retained by one or more instances of the model; and

based on the number of times the processing node is retained by the one or more instances of the model, predicting how many instances of the function will be needed by the one or more instances of the model, resulting in generation of a predicted number of function instances.

2. The method of claim 1 , further comprising:

processing the batch of processing requests by the processing node.

3. The method of claim 1 , wherein the model is a data moderation graph.

4. The method of claim 1 , wherein the batching criterion includes a maximum number of data processing requests.

5. The method of claim 1 , wherein the batching criterion includes a maximum wait time between received data processing requests.

6. The method of claim 5 , wherein the maximum wait time is less than a millisecond.

7. The method of claim 1 , further comprising:

autoscaling the model according to the predicted number of function instances to provide the predicted number of function instances to the model at run-time.

8. The method of claim 7 , wherein the one or more instances of the model are instantiated for different segments of a data input.

9. The method of claim 7 , wherein the one or more instances of the model are instantiated for multiple data inputs across different users of an enterprise.

10. The method of claim 7 , wherein the one or more instances of the model are instantiated for multiple data inputs across different enterprises.

11. The method of claim 10 , wherein the method further includes:

segmenting an input prompt into a plurality of segments;

for each segment of the plurality of segments:

(i) identifying policy information included in the input prompt, the policy information specifying a subset of nodes of a data moderation graph to be utilized in processing a particular segment of the plurality of segments;

(ii) generating an instance of the model;

(ill) pruning the instance of the model to include the subset of nodes specified in the policy information such that the instance of the model now omits at least one node that was previously included in the data moderation graph; and

(iv) generating an intermediary output comprising one or more labels of interest associated with the particular segment; and

generating a final output based on a combination of each intermediary output generated for the plurality of segments.

12. The method of claim 1 , wherein the input data comprises a data prompt that is an initial prompt generated by a user.

13. The method of claim 1 , wherein the input data comprises a data prompt that is a completed prompt generated by a large language model based on the large language model receiving an initial prompt generated by a user.

14. The method of claim 1 , wherein the computing system determines whether the batching criterion has been met after each new data processing request is received and cached.

15. A computer system comprising: one or more processors; and one or more hardware storage devices that store instructions that are executable by the one or more processors to cause the computer system to:

identify a model comprising a processing node that is tasked with performing a function on input data;

identify a batching criterion for the processing node, the batching criterion comprising a threshold that, when met, triggers a transmission of a batch of processing requests to the processing node;

route a processing request for the processing node to a batching cache corresponding to the processing node;

determine whether the batching criterion has been met response to determining that the batching criterion has not been met, refrain from transmitting the processing request in the batching cache to the first processing node;

in response to determining the batching criterion has been met, route the batch of processing requests, which includes said processing request, to the processing node for processing;

determine a number of times the processing node is retained by one or more instances of the model; and

based on the number of times the processing node is retained by the one or more instances of the model, predict how many instances of the function will be needed by the one or more instances of the model, resulting in generation of a predicted number of function instances.

16. A computer system comprising: one or more processors; and one or more hardware storage devices that store instructions that are executable by the one or more processors to cause the computer system to:

identify a model comprising a processing node that is tasked with performing a function on input data;

identify a batching criterion for the processing node, the batching criterion comprising a threshold that, when met, triggers a transmission of a batch of processing requests to the processing node;

route a processing request for the processing node to a batching cache corresponding to the processing node;

determine whether the batching criterion has been met; in response to determining that the batching criterion has not been met, refrain from transmitting the processing request in the batching cache to the first processing node; in response to determining the batching criterion has been met, route the batch of processing requests, which includes said processing request, to the processing node for processing;

determine a number of times the processing node is retained by one or more instances of the model;

based on the number of times the processing node is retained by the one or more instances of the model, predict how many instances of the function will be needed by the one or more instances of the model, resulting in generation of a predicted number of function instances; and auto-scale the model based on the predicted number of function instances.

17. The computer system of claim 16 , wherein, as a result of auto-scaling the model, the predicted number of function instances are made available to the model at run-time.

18. The computer system of claim 16 , wherein the instructions are further executable to cause the computer system to auto-scale the model based on the predicted number of function instances.

19. The computer system of claim 18 , wherein, as a result of auto-scaling the model, the predicted number of function instances are made available to the model at run-time.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 1, 2023
From: CLEMONS, JOSHUA BRYAN WYMAN; RADMILAC, MARKO; WALD, ANDREW JAMES
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 064779/0688 →
Continuity (1)
Related Publication 20240411751A1 · Dec 12, 2024
References Cited (16)
US 11875250B1 · Xia · 2024 [cited by applicant]
US 12032562B1 · Zuber · 2024 [cited by examiner]
US 20040014826A1 · Wang · 2004 [cited by examiner]
US 20130060807A1 · Rambhia · 2013 [cited by applicant]
US 20200356726A1 · Nelson · 2020 [cited by applicant]
US 20230418665A1 · Chittibabu · 2023 [cited by examiner]
US 20240273345A1 · Bharadwaj · 2024 [cited by examiner]
Cheng, et al., “Batch Prompting: Efficient Inference with Large Language Model APIs”, arXiv:2301.08721v1, Jan. 19, 2023, 18 pages. [cited by applicant]
Dong, et al., “Efficiently Scale LLM Training Across a Large GPU Cluster with Alpa and Ray”, NVIDIA Developer, May 15, 2023, 16 pages. [cited by applicant]
International Search Report and Written Opinion received for PCT Application No. PCT/US2024/033319, (MS# 413073-PCT02) mailed on Oct. 4, 2024, 16 pages. [cited by applicant]
International Search Report and Written Opinion received for PCT Application No. PCT/US2024/033320, (MS# 413073-PCT03) mailed on Oct. 4, 2024, 15 pages. [cited by applicant]
U.S. Appl. No. 18/208,738, filed Jun. 12, 2023. [cited by applicant]
U.S. Appl. No. 18/208,741, filed Jun. 12, 2023. [cited by applicant]
International Search Report and Written Opinion received for PCT Application No. PCT/US2024/033318, (MS#413073-PCT01), Sep. 10, 2024, 14 pages. [cited by applicant]
Li, et al., ““HOT” ChatGPT: The promise of ChatGPT in detecting and discriminating hateful, offensive, and toxic comments on social media”, In Repository of arXiv:2304.10619v1, Apr. 20, 2023, 42 Pages. [cited by applicant]
Non-Final Office Action mailed on Sep. 10, 2024, in U.S. Appl. No. 18/208,738 (MS# 413073-US01), 13 pages. [cited by applicant]