Key-Value Memory Networks for Directly Reading Documents
Paper · 2016 · Alexander Miller, Adam Fisch, Jesse Dodge et al.
Summary
A film database can tell a system which person directed a movie by linking the movie to the person under a named relation. A Wikipedia article might convey the same fact in a sentence that also mentions the cast, the release, or another film. The database has already separated the answer from its surroundings. A system reading the article has to work out which words help it find the relevant passage and which part of that passage can answer the question. The paper addresses this distinction in question answering with Key-Value Memory Networks, an extension of the end-to-end Memory Network.
Each entry in a Key-Value Memory Network has a key for matching the question and a value for passing useful information back to the network. A passage near a person’s name can supply a key, while the name itself serves as the value. For a task that asks the system to select a sentence, a short passage can still serve as the key, and the value can be the whole sentence. The network gives more weight to entries whose keys fit the question, combines their values, and uses the result to refine its search over the same entries. It learns how to score these matches and use the information it retrieves from examples with known answers.
To compare ways of supplying the same facts, the authors build WikiMovies, with more than 100,000 movie question-answer pairs. They use a structured knowledge base assembled from Open Movie Database and MovieLens metadata, the opening sections of the corresponding Wikipedia articles, and a second knowledge base made by running information extraction on those articles. The key-value network leads the methods tested on each source. It answers more questions from Wikipedia directly than from the automatically extracted triples. On the WikiMovies test set, its top-answer accuracy is 76.2% with Wikipedia and 93.9% with the metadata-based knowledge base. Experiments that turn database facts into synthetic prose help explain the gap. Accuracy falls even when the facts are written using a single template, and it falls further when sentences join facts or use pronouns in place of movie names.
The authors also test the method on WikiQA, where the task is to rank a supplied set of Wikipedia sentences for each question. The key-value network improves substantially on the ordinary Memory Network and reports the highest results among the compared systems, with a close competitor. Together, the experiments show why the content used to locate evidence can differ from the content a system needs to return. They also show the extent of the remaining challenge in the movie domain, where giving a reading system access to the relevant facts still leaves it with work that the curated database has already done.
Deep dive: Key-Value Memory Networks for Directly Reading Documents
Key-Value Memory Networks separate how a system finds evidence from what it reads, helping it answer questions directly from Wikipedia. · about 35 minutes to read
The problem and its context
Why the form of the evidence matters
A knowledge base represents a fact using fields with distinct roles. In the movie setting, the subject can be a movie, the relation can specify its director, and the object can be a person. Once the system knows which movie and relation the question refers to, the field containing the answer is already identified. A document can describe the same relationship in different words or mention the movie and the director in separate parts of a passage. Even where both names appear together, the reader must distinguish the director from other people in the same account.
These differences matter both for finding evidence and for using it. A film title and words about directing can help locate a useful piece of text. The director’s name is what the question asks for. In a database, the relation label offers a consistent way to look up the fact, and the object field supplies a compact answer. In a document, words that identify the relation also occur in descriptions of other people or films. A reader has to learn from language that varies from passage to passage and distinguish what identifies a fact from what fills the answer position.
A structured source buys precision by putting information into a predetermined form. The authors identify limits in both the coverage of that source and the range of facts it is designed to express. A useful fact may never have been entered. A question may also call for a kind of answer outside the source’s schema, the set of relation and field types that it supports. The paper uses Wikipedia and Freebase to illustrate the difference in available information and argues that prose is especially important when questions extend beyond the scope of a well-stocked database. Extracting more facts from documents is one route to improving coverage, but the authors see the reliability of extraction as a constraint in its own right.
From retrieving passages to querying a database
The paper places its work after a period in which text-based retrieval and structured querying offered different forms of help. Early systems searched collections of documents for pieces of text likely to contain an answer. Passage retrieval could point a reader to useful material, with the paper noting limits in the complexity of questions such systems could handle and the range of responses they could cover. This tradition is represented by the TREC-8 Question Answering Track.
Large knowledge bases encouraged a different approach. A system could interpret a question as a logical expression, then execute it against a graph of entities and relations. That translation is a form of semantic parsing. The appeal is easiest to see when a question sets several conditions. A structured query can state the conditions over named relations and return the entities that satisfy them. The cited work includes Semantic Parsing on Freebase.
In that approach, a successful interpretation of the question still depends on what the database contains. If the desired relation exists in the schema but a particular fact is absent, a valid query can come back without the answer. The extraction pipeline inherits part of the reading problem when it tries to fill such gaps. It has to identify which entities a sentence refers to, recover how they are related, and preserve the result in a form the question-answering system can use. A mistake at that stage changes the evidence available to every subsequent question.
The paper describes answer-sentence selection as another line of work on reading. Benchmarks such as TrecQA and WikiQA ask systems to rank sentences by whether they answer a question. A sentence can be a correct response under that evaluation even when it contains several facts or leaves the actual answer to be identified by a human reader. The setup is valuable for comparing sentence-ranking techniques. The paper’s movie experiment needs an additional capability: evaluating the same entity answer when the underlying material is supplied in different forms. One of the sentence-selection antecedents is the work behind TrecQA.
What attention and memory offered
The paper describes successful sentence-selection systems that use convolutional or recurrent neural networks, often with attention. Attention lets the question influence how strongly different pieces of input contribute to the computation. It provides a way to emphasize words or passages suited to the current query. The authors trace this use of attention to work on learning alignments for neural machine translation.
Memory Networks offered a related way to organize evidence. They stored pieces of context in addressable entries and could consult those entries repeatedly. A question could direct a search over the memory, and the outcome of that search could help direct the next one. Earlier uses cited by the authors include answering questions about simulated stories, using facts from databases, and predicting missing information in stories for children. Work on reading children’s books had also explored using short windows as memory entries. The Goldilocks Principle
The architectural question in this paper is what to put in such an entry. If the whole entry supplies both the searchable content and the information returned by a read, its representation has to serve both purposes. A sentence makes a rich search target but can return many words that are incidental to the answer. A name is economical to return but offers little context for deciding which questions it can answer. Paired entries let the designer use nearby words for addressing and a name for reading. They also let the designer use a small search window to return a larger unit when the output itself is a sentence.
The authors frame the comparison with a curated database as an intermediate test for document reading. A system that hopes to exploit facts available only in prose should first be evaluated where the relevant information is present in prose and can be looked up in a structured source. The shared questions provide a way to ask how much performance changes with the evidence format while keeping the intended answers fixed. That choice also shapes what WikiMovies can establish. The benchmark concentrates on the difficulty of recovering facts in a different form, while the broader motivation includes questions whose answers are missing from curated sources altogether.
The method, step by step
Give each memory entry a search side and a reading side
The network begins with a collection of memory slots. A slot pairs a key with a value, and the pairing is set when the evidence is encoded. Neither side has to be a single word. The key can contain several words that help match the entry to a question. The value can represent a person, a film, or a sentence, depending on what would help the network produce the required kind of answer.
Consider a question about the release year of Blade Runner. In the structured source, the movie and its release-year relation together give the network something to match against the question. The corresponding year, 1982, is the value. In a document, a window around the year can contain words that indicate a release date. Those words help the network recognize why the year is relevant. A slot centered on a different date can look similar at first, so matching the rest of the window matters. The pairing determines which year a read will retrieve from each slot.
The network can read several slots at once. It assigns weights to the slots by comparing the current query with their keys, then forms a weighted mixture of the values. A strong match gives that slot’s value more influence. A weaker match can still contribute. The mixture is a vector of numerical features and serves as evidence for the next computation. A read can therefore help the network form a better query without requiring it to choose an explicit intermediate answer.
The stages apply whether the slots came from text or a database. The parts that change across sources are the contents of the slots, the features that represent those contents, and, where appropriate, the initial procedure for narrowing the search.
How a Key-Value Memory Network answers a question
The steps in order.
Narrow the search before comparing keys
For a large memory, the authors first use a word-based filter. An inverted index maps a word to the entries whose keys contain it. Given a question, the index retrieves entries that share a word with the question, subject to a frequency cutoff. The threshold in the paper is F = 1000, and a shared word qualifies if its frequency is below the threshold. The restriction suppresses very common words that would otherwise send many questions to a large portion of the memory.
The paper calls this stage key hashing. Its job is to establish which entries the network will consider for the rest of the computation. A question containing a movie title may bring in entries connected to that movie, for instance, including entries that concern different facts about it. Lexical overlap makes those entries eligible. The learned addressing stage decides which ones deserve more weight given the full question and, on later passes, the evidence that has already been read.
The filter is computed from the original question. Subsequent passes reconsider the entries already selected. A later query can give priority to a previously weak candidate, but the hashing step supplies the boundary of that search. WikiQA provides its own candidates for each question, so the authors omit hashing in that experiment.
Turn words into vectors and assign weights
The paper uses separate feature maps for questions, keys, values, and answer candidates. A feature map translates an item into a vector with a common number of coordinates. The question and answer maps in the experiments use bags of words, representations that record words without encoding their order. The key and value maps determine, for example, whether to include all the words in a window, keep its center separate, or represent an entire sentence. A learned matrix projects those features into a space where the network can compare and combine them.
q = A Φₓ(x)
Here x is the question, Φₓ is its feature map, and q is the initial query vector. The map has output dimension D, the size of the feature space. The learned matrix A has d rows and D columns and projects the features into a vector of dimension d. The subscript x on Φₓ identifies the map for the question, while the x inside parentheses is the question supplied to it.
The full memory has M slots. The retained subset has N slots, and hᵢ identifies the position in the full memory of the candidate indexed by i within that subset. Its key and value are kₕᵢ and vₕᵢ. The first addressing pass compares the embedded question with each embedded key.
pₕᵢ = softmaxᵢ(A Φₓ(x) · A Φₖ(kₕᵢ))
Here pₕᵢ is the weight given to candidate slot hᵢ. The map Φₖ produces the key features, and multiplication by A puts those features in the same d-dimensional space as the embedded question. The dot · is the dot product, which gives a single score to the match between those vectors. The notation softmaxᵢ means to take the component for candidate i after normalizing the scores over the whole retained set. The expression inside the parentheses shows the score being evaluated at that candidate.
softmaxᵢ(z) = exp(zᵢ) / Σⱼ exp(zⱼ)
In this definition z is a vector of scores, zᵢ is its score for item i, and exp is the exponential function. The slash denotes division. The sum Σⱼ runs over all items indexed by j in the set being normalized. That set consists of the retained slots during addressing and the available outputs during answer prediction. The resulting weights are positive and sum to one. A slot’s weight depends both on its own match and on the scores of competing slots.
The separation between hashing and addressing is consequential here. Hashing can use a single distinctive shared word to put a slot on the list. Addressing compares the full vectors. It can learn that words around a date or name make a slot relevant to the kind of fact the question seeks. The shared projection supplies the learned comparison, while the feature maps and the paired entries decide which information the comparison has access to.
Read the values and carry evidence into another pass
Once the weights have been computed, the network applies them to the values. Each value is represented by its own feature map before being projected into the same dimensional space.
o = Σᵢ pₕᵢ A Φᵥ(vₕᵢ)
Here o is the vector returned by the read. The symbol Σᵢ adds a contribution from every retained slot, vₕᵢ is the value of slot hᵢ, and Φᵥ is the feature map for values. The matrix A projects each mapped value into dimension d, and pₕᵢ scales that vector by the weight assigned from the key. When a short passage is a key and its central entity is the value, the passage determines the weight and the entity supplies the features being averaged.
The paper calls each round of addressing and reading a hop. The network component maintaining the query is called the controller. It adds the returned evidence to its current query, then applies a learned transformation. The first update takes the following form.
q₂ = R₁(q + o)
Here q₂ is the query for the next pass, R₁ is the matrix used after the first hop, q is the original embedded question, and o is the vector read on that hop. The plus sign adds corresponding coordinates of the query and read vectors. The transformation has d rows and d columns, so the resulting query can be compared with the same embedded keys.
Each hop j has its own update matrix Rⱼ. After that update, the new state qⱼ₊₁ can be used for another round of key addressing over the original candidate subset. With the updated state, the addressing rule becomes the following.
pₕᵢ = softmaxᵢ(qⱼ₊₁ᵀ A Φₖ(kₕᵢ))
Here j indexes the completed hop and qⱼ₊₁ is the query it leaves behind. The superscript ᵀ denotes a transpose so the query and the embedded key can be multiplied to obtain their dot product. The candidate identifier hᵢ, the key kₕᵢ, the key feature map Φₖ, the embedding matrix A, and the normalization softmaxᵢ have the same roles as in the first addressing pass. The weights can change because the query now includes the previous read.
This gives the controller a way to use retrieved information to focus its next read. The first pass can assign weight to several plausible entries, and a later pass can place the emphasis differently. The information carried forward is the transformed vector, so the sequence of passes is defined by updated scores and reads. The feature maps themselves and the association between a slot’s key and value stay fixed during this process.
Score possible answers and learn from correct responses
After a fixed number of hops, the controller compares its final query with the representations of the possible answers. The answer inventory is defined by the task. WikiMovies uses entities as possible outputs. WikiQA uses candidate sentences.
â = argmaxᵢ∈{1,…,C} softmaxᵢ(qₕ₊₁ᵀ B Φᵧ(yᵢ))
In this expression â is the predicted answer index. The operator argmax selects the index with the greatest score, and i ∈ {1,…,C} ranges over the C output candidates. The notation qₕ₊₁ denotes the state after the final hop, where the subscript ₕ here stands for the paper’s total hop count H. The transpose ᵀ gives the dot product with the embedded candidate. Each yᵢ is an answer candidate and Φᵧ maps it to D features. The output embedding matrix B projects those features into dimension d. The softmax normalizes candidate scores before selection. The highest-scoring candidate supplies the predicted response, while the scores also support ranking the sentence candidates in WikiQA.
The paper allows B to be tied to A, making them the same matrix. With that choice, the answer side and the inputs use a common learned projection, although their feature maps still say what information each input contains. Whether a sentence is a good answer is learned through the comparison between its embedded representation and the controller state after reading.
Training uses cross-entropy on the predicted answer probabilities and the correct answer a. Giving a correct answer little probability incurs a larger loss. Back-propagation carries the training signal through the answer scores and the successive memory reads, and stochastic gradient descent adjusts the embedding and hop matrices. The adjustable quantities include A, B when it is separate, and the matrices from R₁ through Rₕ, where ₕ again denotes the final hop H. The key and value formats specify what can be looked up and read. The training examples guide how the network weights those representations and uses them to predict answers.
Choose a representation for the evidence and the response
For a knowledge-base triple, the key contains the subject and the relation. The value contains the object. The authors also store the inverse direction under a separate relation label. A fact connecting Blade Runner to Ridley Scott can thus be reached from the movie using the directing relation or from Ridley Scott using its inverse. This makes the direction of a question a property of which entry is useful. The output of the forward entry is a person. The output of the reverse entry is a movie.
For documents, the simplest representation puts each sentence in a slot and uses the whole sentence on both sides. This gives the search access to every word in the sentence and passes the same content into the read. It is the direct counterpart of equal keys and values in an ordinary Memory Network. For the experimental baseline, when the proposed key and value contain different information, the authors concatenate them into a shared representation. That gives the baseline the constituent information in a form its memory operations can use.
The window representation makes the location of a possible answer central to memory construction. A window contains W words, where W specifies its width. For the entity-centered document representation, the authors keep windows centered on entities. The full window can be used to address the slot, and the center alone can be read as its value. The neighboring terms are useful for distinguishing roles. Words around a person’s name can suggest that the person directed the movie, wrote it, or appeared in it. The center supplies the person associated with those words.
Center encoding gives the words at the center a feature identity separate from the words around them. The authors double the dictionary size D and use the second dictionary for the center and the value. An occurrence of a word in the middle of the window can therefore be represented differently from an occurrence of the same word in the surrounding context. This is a way to encode a selected positional distinction within a representation that otherwise treats the window as a bag of words.
The title variant handles cases in which the body of an article describes the answer but the answer itself is the name at the top of the article. A question seeking a movie in which Harrison Ford acted can benefit from text about the cast while needing the movie title as its answer. The scheme adds a title-valued entry for each ordinary window entry and keeps the entries whose values are the centers. It marks the two types of key with the special features _window_ and _title_. A title key also carries the actual title. Those features let the network treat similar local wording differently according to what reading the slot will return. The title scheme can be combined with center encoding.
WikiQA changes the granularity of the value. There the score is for an answer sentence, so the value attached to a window is its entire sentence. Several local pieces of wording can help identify useful sentences, and a close match to one of those pieces can contribute sentence-level information. The same rule of choosing a key for the match and a value for the response thus supports an entity-valued read in one experiment and a sentence-valued read in the other.
Experiments and results
Build comparable sources for the movie questions
The authors start the document collection by matching titles from Open Movie Database, abbreviated OMDb, to Wikipedia articles. They retain the title and the opening section before the contents box. This produces about 17k movie documents. The articles supply the Doc condition, in which the network represents text directly as memory entries. The product being evaluated is a question-answering system over those selected article sections.
To build the metadata knowledge base, the authors also match the movies to MovieLens. The resulting triples cover nine relation types. Credits account for the director, writer, and actor relations. Release year, language, genre, tags, the IMDb rating, and the IMDb vote count make up the rest of the relations. The knowledge base contains about 10k actors, about 6k directors, and about 43k entities in total. The ratings and vote totals are grouped into bins and represented with textual labels, so those question types can use the same general approach to candidate answers as the rest of the benchmark.
For the principal comparison, the authors filter the database to keep triples whose entities also appear in the Wikipedia articles. This helps align what the questions can ask of the two sources. An answer derived from metadata should also have an occurrence in the selected text. The accompanying data includes a larger version without this filter. The benchmark name WikiMovies covers the questions and the alternative sources used to investigate how answerability changes with the representation.
The IE source starts from the same articles as Doc and passes them through a sequence of extraction steps. First, the pipeline tries to identify when expressions such as it or the film refer to a named entity. Replacing those expressions with the entity is meant to make extracted relations less ambiguous. The general task is coreference resolution, and the pipeline uses tools from Stanford CoreNLP.
Next, SENNA identifies predicates and their arguments through semantic role labeling. This step helps the extractor decide which entities belong with a verb. The system cleans the resulting triples by removing words outside the recognized entities. It also normalizes inflected forms of important verbs to a common form through lemmatization. A final step attaches the movie title to the triple. The authors report that including this document-level information helped the extraction-based setup. The resulting source preserves the convenience of triples where the pipeline succeeds and reflects the omissions or malformed relations it produces.
Generate questions and define the WikiMovies test
The authors use SimpleQuestions to obtain examples of how people had worded queries for the relevant types of facts. They replace the entity in each selected question with a placeholder, then fill that position using entities from their movie triples. A human-written question about the films featuring a particular actor can thus supply a pattern for asking about other actors. The wording has a human source, and the systematic substitution makes it possible to generate questions at the scale required for training.
WikiMovies contains more than 100,000 question-answer pairs across 13 classes. A class can distinguish which direction along a relation the question takes. Asking for the actors in a movie and asking for movies associated with an actor require different answer types even though they use the same underlying credit relation. Some queries have multiple correct answers. The authors separate the data into about 96k training examples, 10k development examples, and 10k test examples. They keep the same underlying question from appearing in training and test under different phrasings.
The metric is test-set hits@1 in percent. For each question the system ranks entities and receives credit when its top choice is a correct answer. A question with several valid answers still asks the system to get the first position right. The metric measures success at returning one acceptable entity from the candidate inventory. Development data is used to select hyper-parameters, including the memory representation where applicable.
The paper compares the Key-Value Memory Network with the ordinary Memory Network, a supervised-embedding baseline, and a system from earlier work on question answering with subgraph embeddings. The supervised embeddings learn to relate questions to answers directly. That baseline gives a sense of how much the mapping from question language to answer can accomplish without consulting a knowledge base at prediction time. The subgraph-embedding system is specialized for structured evidence and is evaluated on the curated and extracted knowledge bases. The ordinary Memory Network gives the closest architectural comparison, with a shared slot representation serving both lookup and readout.
Read the source-dependent WikiMovies results
The earlier subgraph system improves on the supervised embeddings and the ordinary Memory Network for the curated and extracted knowledge bases. The Key-Value Memory Network gives the highest test accuracy among the compared approaches for each source. Within the key-value results, direct Wikipedia reading beats the extracted knowledge base. The curated knowledge base still gives the strongest result. The two ends of that comparison show how far the best reading setup gets when the benchmark is restricted to questions the structured source can also answer.
Key-value memory with curated triples and Wikipedia text on WikiMovies
The curated knowledge base yields higher top-answer accuracy than direct document reading.
The numbers
| System or setting | hits@1 % |
|---|---|
| Curated knowledge base, KV-MemNN (this paper) | 93.9 |
| Wikipedia documents, KV-MemNN | 76.2 |
These are test results for the same architecture supplied with different evidence and an appropriate memory representation for each source. On Wikipedia, the best configuration uses windows, separate features for the center, and title-valued entries. Its window width is W = 7 and its hop count is H = 2. The window gives the reader local evidence to address, while the center and title slots give it distinct routes to candidate entities. The corresponding development comparisons examine the contribution of these choices.
The ordering of Doc and IE matters because their underlying text is shared. The extraction pipeline tries to give the question-answering system a more explicit relation structure. Where it drops evidence or changes how entities are connected, the answer system inherits that loss. The direct reader retains access to local wording around entities, even if the sentence is hard to turn into a correct triple. In this experiment that access proves more valuable, in aggregate, than the structure supplied by the tested extraction pipeline.
Rank a supplied set of sentences on WikiQA
WikiQA asks questions on topics drawn from Wikipedia more broadly, and its training set contains about 1000 examples. A retrieval stage has already supplied a list of candidate sentences for each question. The experiment therefore evaluates the order in which the system ranks those sentences. A relevant sentence can contain the answer as just one part of its text. The sentence is the output unit against which predictions are evaluated.
The paper reports mean average precision, or MAP, and mean reciprocal rank, or MRR. Average precision considers the positions occupied by all relevant sentences, giving credit for placing them high in the ranking. MAP averages this measure across the questions. Reciprocal rank depends on the position of the first relevant sentence and is the reciprocal of that position. MRR averages the resulting values across the questions. Together, the metrics capture how quickly a reader finds a correct sentence and how well the ranking treats relevant sentences overall.
With relatively little task-specific training data, the authors initialize the word vectors using all of Wikipedia. They train supervised embeddings on a sentence and the sentence that follows it, treating the earlier sentence as input and the next one as the target. They tie A and B, using the same embedding matrix on the input and answer sides. This provides a starting representation for learning to rank actual question-and-answer pairs. Word embeddings
The WikiQA training also uses dropout, with words sampled from the questions, memory entries, and answers. The amount of dropout is selected on the development set. Exact shared-word features between a question and a possible answer supplement the learned comparison. A special _number_ feature replaces numbers in the text and the wording that asks for a count in the question. This allows the question and sentence to share a feature associated with numerical answers. Local windows are the keys and entire sentences are the values. The chosen development settings use W = 7 and H = 2.
On the WikiQA test set, the Key-Value Memory Network leads the reported comparison on the sentence-ranking measures. The lexical decomposition and composition system, called L.D.C., comes close. The ordinary Memory Network performs considerably worse. In this experiment a window is useful as a search target, but the ranking has to be expressed over sentences. The key-value setup connects those two units explicitly. The result extends the evidence for the paired representation to a different answer format and a benchmark with broader subject matter.
What the ablations show
Local search, separate centers, and titles
On the WikiMovies development set, the authors compare variants of the key-value document memory. The sentence-level representation is weaker than the window-based choices. A sentence gives a bag of words the entire stretch of material at once. A short window can associate the clues to a relation more closely with a particular entity. In an opening sentence that introduces a movie and names several people, separate windows allow those people to participate in different matches. That is useful when the entity sought by the question is associated with only part of the sentence.
Separating the center features from the surrounding words improves the window representation. The comparison supports treating the center as a different kind of evidence. Words around it can be useful for deciding which relation is being expressed, while the selected center is a possible answer. In a plain bag of words for a window, where a term occurs has little direct representation. Separate center features let the network use that particular position to inform the match.
Adding title-valued slots also helps. WikiMovies includes questions whose answers are movie names. A relevant description of an actor or a writer can occur in an article that identifies the movie in its title. A center-valued read and a title-valued read expose different answers to that evidence. Marking the keys with their types lets the network learn to favor the title route for a question about which films a person worked on, while retaining the center route for questions about a particular film’s credits. The benefit is measured for the title representation as implemented, which includes the additional slots, the type features, and the movie title in the title keys.
The ordinary Memory Network comparison addresses a related issue at the architectural level. It receives the differing key and value content together in one shared representation. The key-value network can keep words useful for finding a slot on one side and the answer-related information on the other. WikiQA makes the distinction particularly visible because a short key window can identify a relevant part of a sentence and return the larger sentence representation. The comparison supports the usefulness of that division in the tested configurations.
What changes across question types
The WikiMovies test breakdown shows that source quality varies by question class. For questions that start with a writer, director, or actor and ask for a movie, the extracted knowledge base falls especially far behind the document and curated sources. A person may be mentioned in a passage where the movie is referred to indirectly or where the connection to the title has to be recovered from article context. The authors suggest that difficulty resolving such references could contribute to the extraction losses.
They also report that only 56% of subject–object pairs in the IE source match triples in the original knowledge base. This is an overlap measure for the extracted pairs against the curated facts. It gives a separate view of the mismatch between the two sources from the accuracy of the downstream system. Differences in the pairs show why having both sources in triple form leaves a substantial distinction in the evidence available to the reader. They also give a reason to be cautious about identifying any single extraction stage as the cause of the largest losses.
The direct document reader trails the metadata knowledge base particularly on tag questions in both directions and on questions that ask for a movie’s writers or actors. The authors point out that language associated with a tag can occur across a document. A word that characterizes a movie may have little local wording that declares it a tag. A metadata triple makes the connection explicit. A window reader has to infer that a mention in context corresponds to the relation asked about.
For a question naming a movie and seeking a writer or actor, the article collection may contain only a few references to the correct entity in the relevant role. A question naming a person and seeking a movie can have several possible answers across different articles. Since hits@1 awards credit for one correct result, having several valid titles gives the reader more opportunities to succeed. The authors use this asymmetry to explain why related question directions can show different levels of difficulty even when they concern the same kinds of credits.
Hold the facts fixed and change how they are written
The synthetic document experiment takes the curated triples and expresses their facts as prose. For each movie, a simple grammar builds a document from the associated triples. The grammar has 100 template phrases in total across the relation types. A release-year triple for Blade Runner, for example, can be turned into a statement about the movie opening in 1982. In a triple the year occupies the answer position directly. In the generated sentence the reader has to recognize the role of the year from where it appears and the words around it.
The authors vary the range of templates, whether conjunctions combine facts, and whether later mentions replace the movie name with a pronoun. The knowledge remains tied to the same original triples while the shape of the evidence changes. The synthetic conditions thus place more control over wording and sentence structure in the experiment than a comparison between curated metadata and real Wikipedia prose can provide.
WikiMovies test hits@1 with triples, synthetic prose, and Wikipedia
Converting triples into sentences lowers accuracy, and the synthetic prose with combined complications gives the weakest result.
The numbers
| System or setting | hits@1 % |
|---|---|
| Curated knowledge base (this paper) | 93.9 |
| Synthetic sentences, one template | 82.9 |
| Synthetic sentences, all templates | 80 |
| Synthetic sentences with conjunctions | 74 |
| Synthetic sentences with coreference | 76 |
| Synthetic sentences with all complications | 72.5 |
| Wikipedia documents | 76.2 |
With the curated triples, WikiMovies test accuracy is 93.9%. Expressing the facts as sentences with one template brings it to 82.9%. This comparison locates some of the difficulty in the move from separated database fields to words in a sentence, even when the wording is predictable. The template may express the relation clearly to a person. The reader must still recover it from a representation of word context and connect it to a candidate value.
Using all the templates yields 80% on the same test metric. The additional variation matters, but the deterioration the paper describes is modest compared with the move to prose itself. The system can encounter alternative ways of expressing the same relation during training and learn associations with the questions. A fixed template already exposes the difference between reading a sentence and looking up a pre-defined relation field.
The conjunction condition reaches 74% WikiMovies test hits@1. Joining facts makes it easier for words about one fact to occur close to an entity involved in another. A local window can then contain plausible clues that belong to different parts of the sentence. The coreference condition reaches 76%. Replacing a movie name with a pronoun can remove the most direct link between the question and the relevant sentence. The reader must use context to connect the reference to the movie. The experiment shows comparable losses for these two kinds of changes under the authors’ generator.
Combining the complications gives 72.5%, below the 76.2% obtained with the real Wikipedia documents on WikiMovies test hits@1. The authors suggest the synthetic generator might use the complications too often. Its rates are 50% for conjunctions and 80% for coreference. The combined result shows that controlled text can heavily concentrate properties that challenge the reader. The rates describe the constructed conditions, and the comparison is most informative as a test of the effects of those conditions.
Limitations
Limits identified by the authors
The authors acknowledge that a gap to the curated knowledge base remains. Their strongest direct reader still performs substantially better when facts arrive with named relations and distinct fields. WikiMovies was designed to make this comparison feasible by selecting questions whose answers are potentially available in both sources. Closing the gap inside that setup remains a separate problem from expanding the range of questions a system can answer beyond the contents of a database.
The authors also identify limits on particular design choices. Their title representation assumes that an informative title is available for each document. A movie article gives a good example of the assumption: the title names the movie, which is frequently a possible answer. Documents whose titles express a general topic or cover several entities would give a different kind of value to those entries. The paper’s experimental benefit concerns a collection organized around documents with meaningful movie titles.
The extraction findings concern a deliberately engineered pipeline. Its coreference step, argument identification, lexical cleanup, and title attachment are all intended to make the extracted evidence more usable. The authors identify malformed or missing triples as a cost of extraction and point to the observed overlap with the curated database. They also propose coreference as one possible reason for the poor results on some question classes. The evidence is strongest about the accuracy of answering from the resulting resource and weaker about the share of errors attributable to any stage.
The paper qualifies the synthetic comparison by noting the frequency with which the generator uses conjunctions and pronouns. Those settings are part of the experiment and can make the generated corpus harder than the natural one. The experiment indicates that these constructions can create trouble for the tested reader. Their exact contribution in Wikipedia depends on their distribution there and on how their use interacts with other properties of the text.
WikiQA has its own bounds. The authors describe it as a small training set with coverage across Wikipedia and a preselected set of candidate answers. It provides a test of ranking those sentences and a comparison with previous sentence selectors. It offers no matched structured source for applying the WikiMovies comparison. The authors also leave applications beyond the tested question-answering settings to future work and single out full conversational interaction as a possible direction for dialogue systems.
What the experimental design leaves open
The filter on the WikiMovies knowledge base aligns entities across sources. The presence of an entity in an article is weaker evidence than a verified statement of the relevant relation. A cast member’s name, for example, can occur without the particular role or connection being stated clearly in the selected section. The benchmark design reduces cases in which sources are incomparable because an entity is absent. The accuracy gap can still include both the difficulty of recovering a fact and differences in how fully the retained text expresses it.
The questions are generated from human wording reused across entities, and the split prevents the same underlying question from appearing across training and test in paraphrased forms. The demonstrated generalization is therefore to held-out questions under this generation procedure. A test that withheld whole relation types, required unfamiliar forms of wording, or used the whole length of the articles would pose a different question about the reader. The evidence here comes from a movie-specific relation inventory and the opening sections of title-matched articles.
Candidate handling places another boundary around the results. In WikiMovies, hashing relies on the original question to bring in relevant entries. A useful slot without a qualifying shared word can be excluded before the learned comparison begins. Hops can use retrieved information to reweight that candidate set, but the reported procedure leaves the candidate boundary in place. In WikiQA, retrieval is supplied by the benchmark. The sentence-ranking measure concerns the material that reached the candidate list, so the score gives no estimate of how often a system would retrieve all necessary evidence from Wikipedia by itself.
The existence of several hops also leaves open what kind of computation they perform on a particular question. An updated query can assign greater weight to a more relevant entry, combine overlapping signals, or concentrate attention on a candidate it already considered. A high answer score is evidence that the ranking succeeded. Establishing that each pass recovered a necessary link in a chain would require supervision or evaluation of the intermediate evidence. The paper’s reported accuracy and ranking measures focus on the final output.
The WikiMovies metric likewise bounds what success means for questions with several valid answers. It credits a correct first choice. Any additional valid answers can be ranked lower without changing that result. Accuracy on these questions establishes how frequently the system produces a valid entity at the top of its ranking. Coverage of the full cast, all films associated with a person, or all applicable tags would require an evaluation that accounts for the whole set.
Finally, the WikiQA result belongs to a complete configuration that includes Wikipedia pretraining, dropout, exact word matches, numerical normalization, and the paired memory representation. The ordinary Memory Network comparison is informative about the value of pairing windows with sentences. The observed margin against the closest competing system is small in the authors’ account, and the results evaluate the combined system. The division of the ranking gain among individual features and training choices remains uncertain.
What came after
Reading Wikipedia and combining sources
The work on reading Wikipedia for open-domain questions carries forward the problem of answering from articles themselves. WikiMovies asks how well a reader can retrieve a movie fact when the same answer is defined in a structured source. WikiQA supplies candidates and evaluates their ranking. Open-domain reading makes Wikipedia the evidence source for a broader question-answering task, so it brings the choice of useful text into the foreground. The connection concerns the problem the later work takes on. The earlier paper’s window and title entries are specific ways of addressing that problem in its benchmark settings. Reading Wikipedia to Answer Open-Domain Questions
Work on early fusion of knowledge bases and text takes up the same two kinds of evidence and combines them for open-domain questions. In WikiMovies, the distinct sources make it possible to observe what each representation contributes and where each loses information. Early fusion treats database facts and document text as evidence that a single question-answering system can use together. That changes the design question from choosing a representation for all facts to making useful connections between the structured and textual evidence available for a particular question. Open Domain Question Answering Using Early Fusion of Knowledge Bases and Text
Another work develops a dense-sparse phrase index for real-time open-domain question answering. Its point of contact with the earlier paper is the decision about what is searchable. The movie reader uses an index over words in memory keys to get a shortlist and then uses learned comparisons on that shortlist. A phrase index puts phrases themselves at the center of the search problem, with the later work framing that design around real-time answering. Both lines of work make the unit chosen for retrieval part of the question-answering design. Real-Time Open-Domain Question Answering with Dense-Sparse Phrase Index
Pursuing multiple steps and resolving references
Later research on multi-hop question answering over knowledge graphs studies the use of knowledge-base embeddings for questions that require multiple steps. The earlier paper supplies a controller that can read, update the query, and read again. Its movie questions are grouped by the kinds of relations they express and the directions in which they ask for answers. The later work places multi-hop questions over a graph at the center of the task. This makes the connections among facts, and how their representations support finding an answer across steps, a direct concern of the study. Improving Multi-hop Question Answering over Knowledge Graphs using Knowledge Base Embeddings
Work on reasoning over multiple mentions using coreference pursues a difficulty that the synthetic WikiMovies experiment exposes. In that experiment, substituting pronouns for movie names makes the same facts harder to recover. The extraction pipeline separately tries to resolve referring expressions before constructing triples. The later work makes connections among mentions a resource for reasoning. The shared issue is that evidence can be distributed across several references to the same entity, so matching the wording of the question against a local piece of text may give an incomplete account of which passages belong together. Reasoning over Multiple Mentions Using Coreference
Applying memory to other tasks
Dynamic Key-Value Memory Networks for Knowledge Tracing carries the paired-memory idea into knowledge tracing. The movie reader shows how to give memory contents distinct roles in lookup and readout. The later work puts dynamic key-value memory at the center of a task concerned with tracing knowledge. It broadens the setting in which the distinction can be used, from accessing evidence for a question to a memory designed for a task that follows changes over time. Dynamic Key-Value Memory Networks for Knowledge Tracing
Mem2Seq takes up the paper’s proposed direction of using memory in dialogue. Its setting is end-to-end task-oriented dialogue, where knowledge-base information has to contribute to a conversational response. In WikiMovies, access to stored facts ends in a ranking over entity candidates. Incorporating a knowledge base in dialogue puts that use of evidence inside a system whose output is part of an ongoing exchange. The new setting carries forward the problem of making stored information available in the form required by the response. Mem2Seq
Cite
Cite as Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes and Jason Weston. 2016. Key-Value Memory Networks for Directly Reading Documents. Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing.
@inproceedings{miller2016key,
title = {{Key-Value Memory Networks for Directly Reading Documents}},
author = {Alexander Miller, Adam Fisch, Jesse Dodge, Amir-Hossein Karimi, Antoine Bordes and Jason Weston},
booktitle = {Proceedings of the 2016 Conference on Empirical Methods in Natural Language Processing},
year = {2016},
doi = {10.18653/v1/d16-1147},
eprint = {1606.03126},
archivePrefix = {arXiv},
url = {https://doi.org/10.18653/v1/d16-1147}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/miller-2016-key-value-memory-networks-directly/
References
- Auer, S., Bizer, C., Kobilarov, G., Lehmann, J., Cyganiak, R., and Ives, Z. (2007). Dbpedia: A nucleus for a web of open data. In Semantic Web Conference, 2007. OpenAlex ↗ · Scholar ↗
- Bahdanau, D., Cho, K., and Bengio, Y. (2015). Neural machine translation by jointly learning to align and translate. In ICLR, 2015. our card
- Banko, M., Brill, E., Dumais, S., and Lin, J. (2002). Askmsr: Question answering using the worldwide web. In AAAI Spring Symposium on Mining Answers from Texts and Knowledge Bases, 2002. OpenAlex ↗ · Scholar ↗
- Berant, J., Chou, A., Frostig, R., and Liang, P. (2013). Semantic parsing on freebase from question-answer pairs. In EMNLP, 2013. our card
- Bollacker, K., Evans, C., Paritosh, P., Sturge, T., and Taylor, J. (2008). Freebase: a collaboratively created graph database for structuring human knowledge. In ACM SIGMOD International Conference on Management of Data, 2008. OpenAlex ↗ · Scholar ↗
- Bordes, A., Chopra, S., and Weston, J. (2014). Question answering with subgraph embeddings. In EMNLP, 2014. OpenAlex ↗ · Scholar ↗
- Bordes, A., Usunier, N., Chopra, S., and Weston, J. (2015). Large-scale simple question answering with memory networks. arXiv preprint arXiv:1506.02075. OpenAlex ↗ · Scholar ↗
- Carlson, A., Betteridge, J., Kisiel, B., Settles, B., Hruschka Jr, E. R., and Mitchell, T. M. (2010). Toward an architecture for never-ending language learning. In AAAI Conference on Artificial Intelligence, 2010. OpenAlex ↗ · Scholar ↗
- Collobert, R., Weston, J., Bottou, L., Karlen, M., Kavukcuoglu, K., and Kuksa, P. (2011). Natural language processing (almost) from scratch. J. Mach. Learn. Res., 12, 2493–2537. our card
- Craven, M., DiPasquo, D., Freitag, D., McCallum, A., Mitchell, T., Nigam, K., and Slattery, S. (2000). Learning to construct knowledge bases from the world wide web. Artificial intelligence, 118, 69–113. OpenAlex ↗ · Scholar ↗
- Dodge, J., Gane, A., Zhang, X., Bordes, A., Chopra, S., Miller, A., Szlam, A., and Weston, J. (2016). Evaluating prerequisite qualities for learning end-to-end dialog systems. In ICLR, 2016. our card
- Fader, A., Zettlemoyer, L., and Etzioni, O. (2014). Open question answering over curated and extracted knowledge bases. In KDD, 2014. OpenAlex ↗ · Scholar ↗
- Hill, F., Bordes, A., Chopra, S., and Weston, J. (2016). The goldilocks principle: Reading children's books with explicit memory representations. In ICLR, 2016. our card
- Kwiatkowski, T., Choi, E., Artzi, Y., and Zettlemoyer, L. (2013). Scaling semantic parsers with on-the-fly ontology matching. In EMNLP, 2013. our card
- Manning, C. D., Raghavan, P., and Schütze, H. (2008). Introduction to Information Retrieval. Cambridge University Press, New York, NY, USA. OpenAlex ↗ · Scholar ↗
- Manning, C. D., Surdeanu, M., Bauer, J., Finkel, J., Bethard, S. J., and McClosky, D. (2014). The stanford corenlp natural language processing toolkit. In ACL: System Demonstrations, 2014. our card
- Miao, Y., Yu, L., and Blunsom, P. (2015). Neural variational inference for text processing. arXiv preprint arXiv:1511.06038. OpenAlex ↗ · Scholar ↗
- Santos, C. d., Tan, M., Xiang, B., and Zhou, B. (2016). Attentive pooling networks. arXiv preprint arXiv:1602.03609. OpenAlex ↗ · Scholar ↗
- Sukhbaatar, S., Szlam, A., Weston, J., and Fergus, R. (2015). End-to-end memory networks. In NIPS, 2015. OpenAlex ↗ · Scholar ↗
- Tsai, C., Yih, W.-t., and Burges, C. (2015). Web-based question answering: Revisiting askmsr. Technical report, Technical Report MSR-TR-2015-20, Microsoft Research. OpenAlex ↗ · Scholar ↗
- Voorhees, E. M. et al. (1999). The trec-8 question answering track report. In Trec, 1999. our card
- Voorhees, E. M. and Tice, D. M. (2000). Building a question answering test collection. In ACM SIGIR Conference on Research and Development in Information Retrieval, 2000. OpenAlex ↗ · Scholar ↗
- Wang, M., Smith, N. A., and Mitamura, T. (2007). What is the jeopardy model? a quasi-synchronous grammar for qa. In EMNLP-CoNLL, 2007. our card
- Wang, Z., Mi, H., and Ittycheriah, A. (2016). Sentence similarity learning by lexical decomposition and composition. arXiv preprint arXiv:1602.07019. OpenAlex ↗ · Scholar ↗
- Weston, J., Chopra, S., and Bordes, A. (2015). Memory networks. In ICLR, 2015. OpenAlex ↗ · Scholar ↗
- Weston, J., Bordes, A., Chopra, S., and Mikolov, T. (2016). Towards ai-complete question answering: a set of prerequisite toy tasks. In ICLR, 2016. our card
- Yang, Y., Yih, W.-t., and Meek, C. (2015). Wikiqa: A challenge dataset for open-domain question answering. In EMNLP, 2015. our card
- Yih, W.-t., Chang, M.-W., He, X., and Gao, J. (2015). Semantic parsing via staged query graph generation: Question answering with knowledge base. In ACL, 2015. our card
- Yin, W. and Schütze, H. (2015). Convolutional neural network for paraphrase identification. In NACL: Human Language Technologies, 2015. our card