# US 2025/0148219 A1 · Contextualization of generative language models based on entity resource identifiers

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0148219 A1
- Document ID: US20250148219A1
- Status: Published application
- Kind: A1
- Application number: 18/529,910
- Filed: 2023-12-05
- Published: 2025-05-08
- Earliest claimed: 2023-11-03
- Assignees: Microsoft Technology Licensing, LLC
- Applicants: Microsoft Technology Licensing, LLC
- Inventors: Sujay Kumar JAUHAR; Silviu-Petru CUCERZAN; Nirupama CHANDRASEKARAN; Allen HERRING; Jinheon BAEK
- Web page: https://patentgrep.com/patent/US20250148219A1

## CPC

- G06F 16/951: Indexing; Web crawling techniques
- G06F 40/40: Processing or translation of natural language (natural language analysis G06F40/20; semantic analysis G06F40/30)
- G06F 16/288: {Entity relationship models}
- G06F 16/9535: Search customisation based on user profiles and personalisation
- G06F 40/295: Named entity recognition
- G06N 3/044: Recurrent networks, e.g. Hopfield networks
- G06N 3/088: Non-supervised learning, e.g. competitive learning
- G06N 5/02: Knowledge representation; Symbolic representation
- G06F 40/30: Semantic analysis
- G06N 3/045: Combinations of networks
- G06N 3/047: Probabilistic or stochastic networks
- G06N 3/08: Learning methods
- G06N 5/022: Knowledge engineering; Knowledge acquisition
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The disclosed concepts relate to contextualization of generative language models. In some implementations, a linked entity database is populated with entity resource identifiers of entities extracted from a search log by an entity linker. A contextualized prompt data structure is generated based on the linked entity database, e.g., by including linked entity context information in the contextualized prompt data structure. A response to the contextualized prompt data structure is received, where the response is conditioned on the linked entity context information.

## Claims

### Claim 1

A computer-implemented method comprising:
inputting a search log to an entity linker, the search log including web search queries submitted by a user to obtain web search results from a search engine and clicked web pages selected by the user from the web search results;
receiving, from the entity linker, first linked entity resource identifiers of first linked entities identified by the entity linker by processing the search log;
populating a linked entity database with the first linked entity resource identifiers received from the entity linker;
receiving a current natural language query from the user;
generating a contextualized prompt data structure that is based at least on the current natural language query and linked entity context information derived from the linked entity database;
inputting the contextualized prompt data structure to a generative language model;
receiving a response to the contextualized prompt data structure generated by the generative language model, wherein the response is conditioned on the linked entity context information; and
replying to the current natural language query based at least on the response.

### Claim 2 (depends on 1)

The method of claim 1, wherein the generative language model comprises a decoder.

### Claim 3 (depends on 2)

The method of claim 2, wherein the decoder is a transformer-based decoder including an attention layer.

### Claim 4 (depends on 3)

The method of claim 3, wherein the first linked entity resource identifiers correspond to uniform resource identifiers of a public knowledge graph.

### Claim 5 (depends on 4)

The method of claim 4, further comprising:
inputting at least one of the current natural language query or a currently-visited web page to the entity linker to obtain second linked entity resource identifiers associated with a current user context of the user; and
matching the second linked entity resource identifiers to the first linked entity resource identifiers to determine a set of entities to include in the linked entity context information.

### Claim 6 (depends on 5)

The method of claim 5, further comprising:
inputting both the current natural language query and the currently-visited web page to the entity linker to obtain the second linked entity resource identifiers.

### Claim 7 (depends on 5)

The method of claim 5, further comprising:
populating the linked entity database with aggregate numbers of occurrences in the search log for each of the first linked entity resource identifiers; and
selecting the set of entities to include in the linked entity context information based at least on the aggregate numbers of occurrences.

### Claim 8 (depends on 7)

The method of claim 7, wherein the set of entities is selected by:
sampling from the second linked entity resource identifiers in proportion to the aggregate numbers of occurrences of the second linked entity resource identifiers in the search log.

### Claim 9 (depends on 7)

The method of claim 7, wherein the set of entities is selected by:
filtering the second linked entity resource identifiers to remove recently-accessed second linked entity resource identifiers that have been accessed within a specified time period; and
sampling from the filtered second linked entity resource identifiers proportionally to the aggregate numbers of occurrences of the second linked entity resource identifiers in the search log.

### Claim 10 (depends on 7)

The method of claim 7, wherein the set of entities is selected by:
sampling from the second linked entity resource identifiers in inverse proportion to the aggregate numbers of occurrences of the second linked entity resource identifiers in the search log.

### Claim 11 (depends on 7)

The method of claim 7, further comprising:
traversing the public knowledge graph along a path from a particular first linked entity resource identifier to identify a related entity resource identifier of a related entity; and
including the related entity in the set of entities of the linked entity context information.

### Claim 12

A system comprising:
a linked entity database storing first linked entity resource identifiers of linked entities identified by an entity linker by processing a search log for a user;
a hardware processing unit; and
a storage resource storing computer-readable instructions which, when executed by the hardware processing unit, cause the system to:
receive a current natural language query from the user;
generate a contextualized prompt data structure that includes at least the current natural language query and linked entity context information derived from the linked entity database;
input the contextualized prompt data structure to a generative language model;
receive a response to the current natural language query generated by the generative language model, wherein the response is conditioned on the linked entity context information included in the contextualized prompt data structure; and
reply to the current natural language query based at least on the response.

### Claim 13 (depends on 12)

The system of claim 12, wherein the computer-readable instructions, when executed by the hardware processing unit, cause the system to:
generate the contextualized prompt data structure from a prompt data structure template having a static section instructing the generative language model to provide the response in a specified format and a dynamic section populated based on the current natural language query and the linked entity context information.

### Claim 14 (depends on 13)

The system of claim 13, wherein the computer-readable instructions, when executed by the hardware processing unit, cause the system to:
populate the dynamic section with at least one field from a currently-visited web page.

### Claim 15 (depends on 14)

The system of claim 14, the at least one field being a title of the currently-visited web page or main content of the currently-visited web page.

### Claim 16 (depends on 14)

The system of claim 14, wherein the linked entity database includes other first linked entity resource identifiers identified by the entity linker from one or more of word processing documents, emails, or meeting transcripts.

### Claim 17 (depends on 12)

The system of claim 12, wherein the current natural language query is a current search query, the contextualized prompt data structure requests the generative language model to generate a suggested search query given the current search query and the linked entity context information, and the response includes the suggested search query.

### Claim 18 (depends on 12)

The system of claim 12, wherein the response comprises a summary of a web page, a word processing document, an email, or a meeting transcript, or a new email or new word processing document authored for the user by the generative language model.

### Claim 19

A computer-readable storage medium storing computer-readable instructions which, when executed by a processing unit, cause the processing unit to perform acts comprising:
receiving a current natural language query from a user;
accessing a linked entity database storing first linked entity resource identifiers of linked entities identified by an entity linker by processing a search log for the user;
generating a contextualized prompt data structure that includes at least on the current natural language query and linked entity context information derived from the linked entity database;
inputting the contextualized prompt to a generative machine learning model;
receiving a response to the contextualized prompt generated by the generative machine learning model, wherein the response is conditioned on the linked entity context information; and
replying to the current natural language query based at least on the response.

### Claim 20 (depends on 19)

The computer-readable storage medium of claim 19, wherein the response includes at least one of natural language or an image generated by the generative machine learning model.
