We first encode the query-document relevance matching via query-document similarity matrices sim |q|×|d| that encodes the similarity between terms from a query q and a document d, where sim ij corresponds to the similarity between the i-th term from q and the j-th term from d. When using cosine similarity, we have  (Hui et al., 2017), query-document similarity matrices preserve a rich signal that can be used to perform relevance matching beyond unigram matches.
n-gram matching corresponds to consecutive document terms that are highly similar to at least one of the query terms.