---
title: "A Hierarchical Bayesian Language Model Based On — Teh 2006"
description: "The paper addresses a long-standing gap in n-gram language modelling."
authors: ["Yee Whye Teh"]
year: 2006
venue: "Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics"
source: "https://aclanthology.org/P06-1124/"
doi: "10.3115/1220175.1220299"
licence: "CC BY-NC-SA 3.0 (ACL Anthology, before 2016)"
licence_url: "https://creativecommons.org/licenses/by-nc-sa/3.0/"
summary_licence: "Elamur Cosmic License"
canonical: "https://research.elamur.ai/free/en/papers/teh-2006-hierarchical-bayesian-language-model-based/"
---
[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/teh-2006-hierarchical-bayesian-language-model-based/)

[home](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2006](https://md.research.elamur.ai/free/en/papers/2006/) / A Hierarchical Bayesian Language Model Based On Pitman-Yor Processes

# A Hierarchical Bayesian Language Model Based On Pitman-Yor Processes

**Authors:** [Yee Whye Teh](https://md.research.elamur.ai/free/en/authors/yee-whye-teh/) · **Year:** 2006 · **Venue:** Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics · **Licence:** [CC BY-NC-SA 3.0 (ACL Anthology, before 2016)](https://creativecommons.org/licenses/by-nc-sa/3.0/)

**Links:** [Publisher's page](https://aclanthology.org/P06-1124/) · [PDF](https://aclanthology.org/P06-1124.pdf) · [DOI 10.3115/1220175.1220299](https://doi.org/10.3115/1220175.1220299) · [OpenAlex](https://openalex.org/W2154099718)

**Citations:** 489 citations (openalex-snapshot · 2026-10-14) · [82](#cited-by) in our library, of the 140884 papers whose bibliographies we read

## Summary
The paper addresses a long-standing gap in n-gram language modelling. The strongest smoothing techniques, such as Kneser-Ney variants, are justified mostly by empirical results. Earlier Bayesian models, which have explicit prior assumptions, performed poorly. Teh proposes the hierarchical Pitman-Yor language model (HPYLM), which extends MacKay and Peto's earlier Dirichlet-based hierarchical model of language. Each context's next-word distribution gets a Pitman-Yor process prior whose mean is the distribution for the context shortened by its earliest word. This yields a suffix-tree hierarchy ending at a uniform base distribution. Unlike the Dirichlet distribution, the Pitman-Yor process generates power-law word statistics, which better match natural language. Inference uses a Gibbs sampler over seating arrangements in a hierarchical Chinese restaurant process. The paper shows that interpolated Kneser-Ney is exactly a particular approximate inference scheme in this model. In perplexity experiments, HPYLM beats interpolated Kneser-Ney and roughly matches modified Kneser-Ney. A cross-validated variant gives the best overall results. The work matters because it shows a principled Bayesian model can reach state-of-the-art smoothing performance.

## Key points
- **Prior structure:** Each context u has G_u ~ PY(d_|u|, θ_|u|, G_π(u)), where discount and strength depend only on context length.
  - The model has 2n parameters in total.
  - Discounts get uniform priors and strengths get Gamma(1, 1) priors.
- **Link to Kneser-Ney:** Interpolated Kneser-Ney is recovered under three conditions:
  - each word type in a context uses at most one "table" (t_uw = min(1, c_uw));
  - all strength parameters are set to zero;
  - in this regime the model reduces to absolute discounting.
  - Modified Kneser-Ney cannot be derived this way, since Pitman-Yor discounts must lie between 0 and 1.
- **Perplexity results:** Training sets ranged from 2 to 14 million words, with n = 2, 3 and 4. At 14M words with trigrams:

  | Model | Perplexity |
  |---|---|
  | IKN | 116.7 |
  | MKN | 113.6 |
  | HPYLM | 114.3 |
  | HPYCV | 113.2 |
  | HDLM | 140.5 |

  With 4-grams, HPYCV reached 101.9 versus 102.4 for MKN.
- **Dirichlet baseline:** The hierarchical Dirichlet model (HDLM) was far worse at every setting. This confirms the value of the power-law prior.
- **Where the gains come from:** Differences between methods come almost entirely from rare test words.

## Interesting ideas
- **Reinterpret heuristics as inference:** Treating a well-tuned heuristic like Kneser-Ney as approximate inference in a generative model explains why it works. It also suggests better variants, and the same move could clarify other ad hoc smoothing or discounting schemes.
- **Fit the prior to the data's statistics:** The prior was chosen to reproduce power-law vocabulary growth. Here, θ sets the overall number of unique words and d sets their asymptotic growth. Checking whether a prior reproduces known statistics of the data is a cheap sanity test before building a model.
- **Back off by dropping the earliest word:** Encoding back-off as a suffix-tree hierarchy shares statistical strength between related contexts in a principled way. The design could extend to other sparse hierarchical count data, such as morphologically rich vocabularies.
- **Break down error by frequency:** Splitting test cross-entropy by how often each word occurs in the test set reveals where models really differ. In this paper, that was mostly rare words. The analysis is useful for evaluating any model on sparse data.
- **Combine cheap tuning with principled inference:** Hyperparameters were cross-validated with a fast approximation (IKN), then plugged into the full sampler (HPYCV). This practical compromise applies whenever exact tuning of a Bayesian model is too expensive.

*Our summary of the paper, in our own words — not its text. The work belongs to its authors; read it at the links above.*

Fields: [Natural language processing](https://md.research.elamur.ai/free/en/shelves/nlp/)

## Cited by

Cited by

82 papers of our library cite it (of the 140884 whose bibliographies we read); 2 of them have a page here, 80 not yet.

- [Experience Grounds Language](https://md.research.elamur.ai/free/en/papers/bisk-2020-experience-grounds-language/)
- [Probabilistic Modelling of Morphologically Rich Languages](https://md.research.elamur.ai/free/en/papers/langstream-2015-botha-probabilistic-modelling-morphologically-rich-languages/)

## Cite

The paper itself, not this page. BibTeX from the library's record of the work.

```bibtex
@inproceedings{teh2006hierarchical,
  title = {{A Hierarchical Bayesian Language Model Based On Pitman-Yor Processes}},
  author = {Teh, Yee Whye},
  booktitle = {Proceedings of the 21st International Conference on Computational Linguistics and 44th Annual Meeting of the Association for Computational Linguistics},
  year = {2006},
  doi = {10.3115/1220175.1220299},
  url = {https://doi.org/10.3115/1220175.1220299}
}
```

- [← previous A Hebrew Tree Bank Based on Cantillation Marks](https://md.research.elamur.ai/free/en/papers/lingbulk-2006-wu-hebrew-tree-bank-based-cantillation/)
- [next → A Study of Translation Edit Rate with Targeted Human Annotation](https://md.research.elamur.ai/free/en/papers/snover-2006-study-translation-edit-rate-targeted/)
- [↑ back to papers of 2006](https://md.research.elamur.ai/free/en/papers/2006/)

## References

18 references, 1 of them with a card of ours. ↗ leads to the work, «find» searches for one we have no id for yet.

1. Y. Bengio, R. Ducharme, P. Vincent, and C. Jauvin. 2003. A neural probabilistic language model. Journal of Machine Learning Research, 3:1137–1155. [find](https://scholar.google.com/scholar?q=Y%2E+Bengio%2C+R%2E+Ducharme%2C+P%2E+Vincent%2C+and+C%2E+Jauvin%2E+2003%2E+A+neural+probabilistic+language+model%2E+Journal+of+Machine+Learning+Research%2C+3%3A1137%E2%80%931155%2E)
2. S.F. Chen and J.T Goodman. 1998. An empirical study of smoothing techniques for language modeling. Technical Report TR-10-98, Computer Science Group, Harvard University. [find](https://scholar.google.com/scholar?q=S%2EF%2E+Chen+and+J%2ET+Goodman%2E+1998%2E+An+empirical+study+of+smoothing+techniques+for+language+modeling%2E+Technical+Report+TR%2D10%2D98%2C+Computer+Science+Group%2C+Harvard+University%2E) [our card](https://md.research.elamur.ai/free/en/papers/chen-1996-empirical-study-smoothing-techniques-language/)
3. A. Gelman, J. Carlin, H. Stern, and D. Rubin. 1995. Bayesian data analysis. Chapman & Hall, London. [find](https://scholar.google.com/scholar?q=A%2E+Gelman%2C+J%2E+Carlin%2C+H%2E+Stern%2C+and+D%2E+Rubin%2E+1995%2E+Bayesian+data+analysis%2E+Chapman+%26+Hall%2C+London%2E)
4. Z. Ghahramani. 2005. Nonparametric Bayesian methods. Tutorial presentation at the UAI Conference. [find](https://scholar.google.com/scholar?q=Z%2E+Ghahramani%2E+2005%2E+Nonparametric+Bayesian+methods%2E+Tutorial+presentation+at+the+UAI+Conference%2E)
5. S. Goldwater, T.L. Griffiths, and M. Johnson. 2006. Interpolating between types and tokens by estimating power-law generators. In Advances in Neural Information Processing Systems, volume 18. [find](https://scholar.google.com/scholar?q=S%2E+Goldwater%2C+T%2EL%2E+Griffiths%2C+and+M%2E+Johnson%2E+2006%2E+Interpolating+between+types+and+tokens+by+estimating+power%2Dlaw+generators%2E+In+Advances+in+Neural+Information+Processing+Systems%2C+volume+18%2E)
6. J.T. Goodman. 2001. A bit of progress in language modeling. Technical Report MSR-TR-2001-72, Microsoft Research. [find](https://scholar.google.com/scholar?q=J%2ET%2E+Goodman%2E+2001%2E+A+bit+of+progress+in+language+modeling%2E+Technical+Report+MSR%2DTR%2D2001%2D72%2C+Microsoft+Research%2E)
7. J.T. Goodman. 2004. Exponential priors for maximum entropy models. In Proceedings of the Annual Meeting of the Association for Computational Linguistics. [find](https://scholar.google.com/scholar?q=J%2ET%2E+Goodman%2E+2004%2E+Exponential+priors+for+maximum+entropy+models%2E+In+Proceedings+of+the+Annual+Meeting+of+the+Association+for+Computational+Linguistics%2E)
8. H. Ishwaran and L.F. James. 2001. Gibbs sampling methods for stick-breaking priors. Journal of the American Statistical Association, 96(453):161–173. [find](https://scholar.google.com/scholar?q=H%2E+Ishwaran+and+L%2EF%2E+James%2E+2001%2E+Gibbs+sampling+methods+for+stick%2Dbreaking+priors%2E+Journal+of+the+American+Statistical+Association%2C+96%28453%29%3A161%E2%80%93173%2E)
9. M.I. Jordan. 2005. Dirichlet processes, Chinese restaurant processes and all that. Tutorial presentation at the NIPS Conference. 0.03 [find](https://scholar.google.com/scholar?q=M%2EI%2E+Jordan%2E+2005%2E+Dirichlet+processes%2C+Chinese+restaurant+processes+and+all+that%2E+Tutorial+presentation+at+the+NIPS+Conference%2E+0%2E03)
10. IKN MKN HPYLM HPYCV Cross−Entropy Differences from MKN 0.025 0.02 0.015 0.01 0.005 −0.005 −0.01 4 6 8 Count of words in test set R. Kneser and H. Ney. 1995. Improved backing-off for m-gram language modeling. In Proceedings of the IEEE International Conference on Acoustics, Speech and Signal Processi… [find](https://scholar.google.com/scholar?q=IKN+MKN+HPYLM+HPYCV+Cross%E2%88%92Entropy+Differences+from+MKN+0%2E025+0%2E02+0%2E015+0%2E01+0%2E005+%E2%88%920%2E005+%E2%88%920%2E01+4+6+8+Count+of+words+in+test+set+R%2E+Kneser+and+H%2E+Ney%2E+1995%2E+Improved+backing%2Doff+for+m%2Dgram+language+mo)
11. D.J.C. MacKay and L.C.B. Peto. 1994. A hierarchical Dirichlet language model. Natural Language Engineering. [find](https://scholar.google.com/scholar?q=D%2EJ%2EC%2E+MacKay+and+L%2EC%2EB%2E+Peto%2E+1994%2E+A+hierarchical+Dirichlet+language+model%2E+Natural+Language+Engineering%2E)
12. A. Nadas. 1984. Estimation of probabilities in the language model of the IBM speach recognition system. IEEE Transaction on Acoustics, Speech and Signal Processing, 32(4):859–861. [find](https://scholar.google.com/scholar?q=A%2E+Nadas%2E+1984%2E+Estimation+of+probabilities+in+the+language+model+of+the+IBM+speach+recognition+system%2E+IEEE+Transaction+on+Acoustics%2C+Speech+and+Signal+Processing%2C+32%284%29%3A859%E2%80%93861%2E)
13. R.M. Neal. 1993. Probabilistic inference using Markov chain Monte Carlo methods. Technical Report CRG-TR-93-1, Department of Computer Science, University of Toronto. [find](https://scholar.google.com/scholar?q=R%2EM%2E+Neal%2E+1993%2E+Probabilistic+inference+using+Markov+chain+Monte+Carlo+methods%2E+Technical+Report+CRG%2DTR%2D93%2D1%2C+Department+of+Computer+Science%2C+University+of+Toronto%2E)
14. J. Pitman and M. Yor. 1997. The two-parameter Poisson-Dirichlet distribution derived from a stable subordinator. Annals of Probability, 25:855–900. [find](https://scholar.google.com/scholar?q=J%2E+Pitman+and+M%2E+Yor%2E+1997%2E+The+two%2Dparameter+Poisson%2DDirichlet+distribution+derived+from+a+stable+subordinator%2E+Annals+of+Probability%2C+25%3A855%E2%80%93900%2E)
15. J. Pitman. 2002. Combinatorial stochastic processes. Technical Report 621, Department of Statistics, University of California at Berkeley. Lecture notes for St. Flour Summer School. [find](https://scholar.google.com/scholar?q=J%2E+Pitman%2E+2002%2E+Combinatorial+stochastic+processes%2E+Technical+Report+621%2C+Department+of+Statistics%2C+University+of+California+at+Berkeley%2E+Lecture+notes+for+St%2E+Flour+Summer+School%2E)
16. R. Rosenfeld. 2000. Two decades of statistical language modeling: Where do we go from here? Proceedings of the IEEE, 88(8). [find](https://scholar.google.com/scholar?q=R%2E+Rosenfeld%2E+2000%2E+Two+decades+of+statistical+language+modeling%3A+Where+do+we+go+from+here%3F+Proceedings+of+the+IEEE%2C+88%288%29%2E)
17. Y.W. Teh, M.I. Jordan, M.J. Beal, and D.M. Blei. 2006. Hierarchical Dirichlet processes. To appear in Journal of the American Statistical Association. [find](https://scholar.google.com/scholar?q=Y%2EW%2E+Teh%2C+M%2EI%2E+Jordan%2C+M%2EJ%2E+Beal%2C+and+D%2EM%2E+Blei%2E+2006%2E+Hierarchical+Dirichlet+processes%2E+To+appear+in+Journal+of+the+American+Statistical+Association%2E)
18. Y. W. Teh. 2006. A Bayesian interpretation of interpolated Kneser-Ney. Technical Report TRA2/06, School of Computing, National University of Singapore. [find](https://scholar.google.com/scholar?q=Y%2E+W%2E+Teh%2E+2006%2E+A+Bayesian+interpretation+of+interpolated+Kneser%2DNey%2E+Technical+Report+TRA2%2F06%2C+School+of+Computing%2C+National+University+of+Singapore%2E)
