Episode 7 — Keys
Episode 7 — Keys
In the previous episode, we learned that every word sends out a Query. A query is simply the question a word asks the rest of the sentence. But asking a question isn't enough. The transformer now needs a way to identify which words have the information being requested. This is where Keys come in. Every word generates its own Key. A key describes the kind of information that word can provide to others. Imagine you're searching for a book in a library. Your query is the topic you're interested in. The books don't answer by speaking to you. Instead, each book has a title and catalog information that helps you decide whether it's relevant. A Key works in a similar way. It tells the transformer, "This is the kind of information I contain. " When one word sends out a query, the transformer compares that query with the keys of every other word in the sentence. Words whose keys closely match the query become more relevant. Words with weaker matches become less important. At this point, the transformer knows which words are worth paying attention to. But it still hasn't collected any information from them. Knowing who has useful information is different from receiving the information itself. That final piece is called the Value. We'll explore that in the next episode.