The application uses a Katz’s back-off model. Compared to simple n-gram models, back-off models distribute their probability mass across multiple n-gram models - effectively backing off through progressively shorter models.
\[
P_{bo} (w_i | w_{i-n+1} \cdot \cdot \cdot w_{i-1})\\
= \begin{cases}
d_{w_{i-n + 1}\cdot \cdot \cdot w_i} \frac{C(W_{i-n+1} \cdot\cdot\cdot w_{i - 1}w_i)}{C(W_{i-n+1} \cdot\cdot\cdot w_{i - 1})} & \quad \text{if } C(w_{i-n+1} \cdot \cdot \cdot w_i) > k \\
\alpha_{w_{i-n + 1}\cdot \cdot \cdot w_{i-1}} P_{bo}{(W_i | W_{i-n+2} \cdot\cdot\cdot w_{i - 1})} & \quad \text{otherwise}
\end{cases}
\]
This allows back-off models to capture a more realistic representation of the source material probability distribution. However, some caveats still remain - e.g. it may be significant that a specific trigram is not grammatically valid, even though its constituent bigram parts are both valid.