# US 2019/0318249 A1 · Interpretable general reasoning system using key value memory networks

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

- Number: US 2019/0318249 A1
- Document ID: US20190318249A1
- Status: Published application
- Kind: A1
- Application number: 15/952,698
- Filed: 2018-04-13
- Published: 2019-10-17
- Earliest claimed: 2018-04-13
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Kun Xu; Lingfei Wu; Vadim Sheinin; Wei Zhang
- Web page: https://patentgrep.com/patent/US20190318249A1

## CPC

- G06F 16/3329: Natural language query formulation
- G06N 5/02: Knowledge representation; Symbolic representation
- G06F 16/24549: {Run-time optimisation}
- G06N 3/042: Knowledge-based neural networks; Logical representations of neural networks
- G06N 3/045: Combinations of networks
- G06N 3/08: Learning methods
- G06N 3/0895: Weakly supervised learning, e.g. semi-supervised or self-supervised learning
- G06N 3/09: Supervised learning
- G06N 5/022: Knowledge engineering; Knowledge acquisition
- G06N 5/041: {Abduction}
- G06N 7/01: Probabilistic graphical models, e.g. probabilistic networks
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

Technologies for interpretable general reasoning system using key value memory networks are described. Aspects include processing a complex question having at least two subject and relation pairs into keys in key memory locations, and importing entities of a knowledge base as values into value memory locations based on the keys and importing a STOP key. Other aspects include generating a query representation, a key representation of the keys in the key memory locations, and a value representation of the values in the value memory locations; and updating the query representation into an updated query representation over one or more iterations by combining the query representation with the value representation and the key representations until the STOP key is detected.

## Claims

### Claim 1

A system comprising:
a memory that stores computer executable components;
a processor that executes computer executable components stored in the memory, wherein the computer executable components comprise:
a question embedding and key hashing component that processes a complex question having at least two subject and relation pairs into keys in key memory locations, imports entities of a knowledge base as values into value memory locations based on the keys, and imports a stop key into an unused value memory location;
a key addressing and value reading component that generates a query representation, a key representation of the keys in the key memory locations, and a value representation of the values in the value memory locations; and
a query updating component that updates the query representation into an updated query representation over one or more iterations by combining the query representation with the value representation and the key representations.

### Claim 2 (depends on 1)

The system of claim 1, wherein the query updating component computes relevance probability values between the query representation and the keys, and reads values of the value memory locations comprising taking a weighted sum in which the weights are based on the relevance probabilities of the corresponding keys.

### Claim 3 (depends on 1)

The system of claim 1, wherein the query updating component detects the stop key, and in response to detection of the stop key, stops further updates to the query representation.

### Claim 4 (depends on 1)

The system of claim 1, further comprising an answer prediction component that constructs a structured query based on the relevance probability values and executes the structured query over the knowledge base to obtain an answer to the complex question.

### Claim 5 (depends on 4)

The system of claim 4, further comprising a natural language generation component that describes the structured query in a natural language output presentation to a user, and an input component that obtains data from the user with respect to the natural language output presentation, and if the input data indicates the structured query is accurate based on the natural language output presentation, the input component coupled to instruct the answer output component to return the answer to the complex question.

### Claim 6 (depends on 1)

The system of claim 1, wherein the question embedding and key hashing component performs N-gram matching against the entities in the knowledge base to import the entities of the knowledge base as values into the value memory locations.

### Claim 7 (depends on 1)

The system of claim 1, wherein the key addressing and value reading component uses a bag of words model to generate the question representation, the key representation of the keys in the key memory locations, and the value representation of the values in the value memory locations.

### Claim 8 (depends on 1)

The system of claim 1, wherein the query updating component concatenates the query representation with the value representation and the key representation into a concatenated vector.

### Claim 9 (depends on 1)

The system of claim 1, further comprising a training component that trains a model by using entities of the knowledge base in the memory as answer candidates, classifying the answer candidates with respect to a ground truth value, and using cross entropy error as a loss function.

### Claim 10

A computer-implemented method comprising:
processing a complex question having at least two subject and relation pairs into keys in key memory locations,
importing entities of a knowledge base as values into value memory locations based on the keys;
generating a query representation, a key representation of the keys in the key memory locations, and a value representation of the values in the value memory locations; and
updating the query representation into an updated query representation over one or more iterations by combining the query representation with the value representation and the key representations.

### Claim 11 (depends on 10)

The computer-implemented method of claim 10, further comprising importing a stop key into an unused key memory location, and stopping additional iterations upon detecting the stop key.

### Claim 12 (depends on 10)

The computer-implemented method of claim 10, further comprising computing relevance probability values between the query representation and the keys, and reading values of the value memory locations comprising taking a weighted sum in which the weights are based on the relevance probabilities of the corresponding keys.

### Claim 13 (depends on 12)

The computer-implemented method of claim 12, further comprising maintaining a most relevant key per iteration based on the relevance probability values computed in an iteration with respect to the query representation of that iteration, and constructing a structured query by combining the most relevant keys in the iterations into a combined set of keys that represent the structured query.

### Claim 14 (depends on 13)

The computer-implemented method of claim 13, further comprising executing the structured query over the knowledge base to retrieve an answer to the complex question.

### Claim 15 (depends on 13)

The computer-implemented method of claim 13, further comprising describing the structured query in a natural language output presentation to a user.

### Claim 16 (depends on 10)

The computer-implemented method of claim 10, wherein the updating the query representation into an updated query representation comprises concatenating the query representation with the value representation and the key representation into a concatenated vector, and obtaining the updated query representation by calculating a dot product of the concatenated vector and a learned matrix.

### Claim 17

A computer program product facilitating reasoning using a key value memory network and comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to:
based on a question, generate a query representation, load keys into key memory locations, and import entities of a knowledge base as values into value memory locations based on the keys;
generate a key representation of the keys in the key memory locations, and a value representation of the values in the value memory locations;
update the current query representation into an updated query representation by combining the query representation with the value representation and the key representations to provide the updated query representation as the current query representation over one or more iterations until a stop key is detected; and
return an answer to the question.

### Claim 18 (depends on 17)

The computer program product of claim 17, wherein the program instructions are further executable by the processor to cause the processor to maintain a most relevant key per iteration based on the relevance probability values computed in that iteration, and construct a structured query by combining the most relevant keys into a combined set of keys that represent the structured query.

### Claim 19 (depends on 17)

The computer program product of claim 17, wherein the program instructions are further executable by the processor to cause the processor to execute the structured query over the knowledge base to retrieve the answer to the complex question.

### Claim 20 (depends on 17)

The computer program product of claim 17, wherein the program instructions are further executable by the processor to describe the structured query in a natural language output presentation to a user, receive input data from the user with respect to the natural language output presentation, evaluate the input data, and if the input data indicates the structured query is accurate based on the natural language output presentation, output the answer to the question to the user.
