Paper commentary
LaMDA: Language Models for Dialog Applications
Tool-using dialog model fine-tuning improves safety and factual grounding
- Problem Making the model larger raises dialog quality, but safety and factual grounding improve little and stay far from human levels.
- Method LaMDA fine-tunes a pre-trained Transformer on crowdworker labels, then on calls to a retrieval system, calculator and translator, so it can check claims against sources.
- Results Fine-tuned LaMDA reaches 73.2% groundedness and 65% citation accuracy, measured on dialog turns from Dinan et al.
Why scale alone falls short
LaMDA is a set of Transformer-based language models built for dialog, with sizes from 2B to 137B parameters. The authors start from the observation that making the model larger improves dialog quality, while its safety and groundedness improve much less and stay far from human performance.
The work treats safety and groundedness as two separate problems: keeping responses consistent with a set of human values, and letting the model check its claims against external sources. Pre-training alone leaves safety largely where it was, because the next-token objective reproduces a corpus that contains both safe and unsafe examples.
How the base model is pre-trained
LaMDA is pre-trained to predict the next token. Its corpus mixes public dialog data with other public web documents, which differs from earlier dialog models trained on dialog data alone, so the resulting PT model can also serve as a general language model. The corpus contains 2.97B documents, 1.12B dialogs and 13.39B dialog utterances, totaling 1.56T words, and more than 90% of it is English.
Text is tokenized with SentencePiece into 2.81T byte pair encoding (BPE) tokens over a vocabulary of 32K. For scale, the Meena training set held 40B words, nearly 40 times fewer than LaMDA's corpus.
The network is a decoder-only Transformer with 64 layers, \\(d_{model}=8192\\), \\(d_{ff}=65536\\), 128 heads and \\(d_k=d_v=128\\). It uses relative attention, as in T5, and gated-GELU activations. The largest model has 137B non-embedding parameters, about 50 times the parameter count of Meena.
Training ran on 1024 TPU-v3 chips for about 57.7 days with 256K tokens per batch, using the Lingvo framework. The run reached 123 TFLOPS/sec with 56.5% FLOPS utilization under the 2D sharding algorithm from GSPMD. Smaller 2B and 8B models were trained to measure how the metrics change with scale.
PT decodes with the sample-and-rank strategy from Meena: it draws 16 independent candidates with top-k sampling at k = 40 and no temperature. The returned response is the candidate with the highest score, which combines its log-likelihood and its length.
One model as generator and discriminator
All fine-tuning examples are written as token sequences. Generative examples put the context, a sentinel and the response in order, and the loss covers only the response. Discriminative examples append an attribute name and a rating, such as SENSIBLE, INTERESTING or UNSAFE, and the loss covers only the rating.
Because the model has already read the context and response, scoring a candidate needs only a few more tokens, the attribute name and the desired rating. The probability of the desired rating given the context, response and attribute name is read from those tokens. The shared computation makes the generate-and-discriminate procedure cheap, since no second network runs on the candidates.
At run time, candidates are first filtered by the safety prediction, dropping those below a threshold. Survivors are ranked by \\(3\\,P(\\text{sensible}) + P(\\text{specific}) + P(\\text{interesting})\\), so sensibleness counts three times as much as the other two, and the top candidate is returned.
The discriminators also score and filter 2.5M turns sampled from the pre-training data, and 800K turns survive as safe, sensible, specific and interesting dialogs. The model is then fine-tuned on those 800K turns to generate responses in context, and the authors report gains in safety and quality from this step.
What each metric counts
Quality is the average of sensibleness, specificity and interestingness, each judged by crowdworkers as a 0/1 label. Sensibleness checks whether a response makes sense and does not contradict earlier turns. A policy of always answering with generic replies scores 70% on it, which is why specificity and interestingness are also needed.
Specificity asks whether the response fits the given context, and interestingness asks whether it is likely to catch attention, arouse curiosity, or is unexpected, witty or insightful.
The safety metric is built from objectives derived from Google's AI Principles, aimed at avoiding unintended harm and unfair bias. A response scores 1 only when at least two of three crowdworkers mark it 'no' for every safety objective, and 0 otherwise.
Groundedness is the share of responses containing external-world claims that authoritative sources support, counted among responses that make such claims. Informativeness uses the same numerator but divides by all responses, so a response such as a plain expression of agreement lowers informativeness without affecting groundedness. Citation accuracy is the share of responses with explicit external-world claims that cite the URLs of their sources, excluding well-known facts.
Helpfulness and role consistency are role-specific. A response is helpful when it contains correct information the user found with an information retrieval system and the user finds it useful. Role consistency is judged against the agent's role defined outside the conversation; consistency with earlier turns is covered by sensibleness.
Grounding through a toolset
Plausible but false statements arise because a model generalizes rather than memorizes. Facts that change over time make enlarging the model a weak fix, since the model's knowledge is frozen at training time. The authors therefore teach the model to consult external resources instead.
The toolset takes one string and returns a list of strings. It contains a calculator, a translator and an information retrieval system that can also return open-web snippets with URLs. The calculator, for instance, turns '135+7721' into '7856', and the retrieval system can return 'Rafael Nadal / Age / 35' for a question about his age. Every tool is tried on the input, and a tool that cannot parse the input returns an empty list, so it adds nothing to the output.
The concatenation order is calculator, translator and retrieval system. Training data come from 40K annotated dialog turns with generated queries and edited responses, plus 9K turns in which generated candidates are labelled correct or incorrect for ranking. The model is fine-tuned to predict whether its next action is a tool call or a reply to the user, and at inference the number of queries is capped at four.
In the worked example, the Base draft claims that Gascoigne inspired Miró, but Miró was active from 1918 to the late 1960s, while Gascoigne's first solo exhibitions were in the early 1970s. The Research phase issues queries, and the final reply drops the unverified claim and states a different fact found in the retrieved source, that Gascoigne had practised Japanese flower arrangement before turning to sculpture.
Effects on the foundation metrics
Fine-tuning produces a clear improvement in quality, safety and groundedness at every model size, and quality is consistently higher with fine-tuning than without it.
Quality is measured on the Mini-Turing Benchmark dialogs, where each response is labelled by five crowdworkers and counts as sensible or interesting when at least three say yes. The quality fine-tuning data are described as 6400 dialogs with 121K turns in the text, while Table 1 gives 6.4K dialogs with 61k turns.
For sensibleness, the authors estimate that the 137B pre-trained model would need to be several orders of magnitude larger to reach the 92.3% that fine-tuned LaMDA achieves. Fine-tuned LaMDA also reaches 92.3% sensibleness, a figure the authors place as equivalent to a much larger dense model.
On the holdout adversarial safety set of 1166 dialogs with 1458 turns, fine-tuning on safety labels is what drives the safety gains, and the authors point to example dialogs in Tables 11 and 12.
Groundedness is measured on 784 turns of dialog from Dinan et al., with each response labelled by three crowdworkers and resolved by majority vote. Fine-tuned LaMDA reaches 73.2% groundedness and 65% citation accuracy, with groundedness improving as model size grows and further with the tool-use fine-tuning.
Crowdworkers with retrieval tools remain well ahead on groundedness, while LaMDA surpasses crowdworkers without tools on informativeness. The authors note that the crowdworker baseline may be weak, because crowdworkers were not extensively trained and were not incentivized to write high-quality responses.
Behaviour in application roles
The two domains are education, where LaMDA plays Mount Everest and teaches facts about it, and music recommendation. Each role is set by preconditioning the model on a few turns of role-specific dialog, with a single greeting message for the Everest role, and the same preconditioning is used for LaMDA and PT.
Both model types adapt to their roles, with more than four out of five responses staying role consistent. LaMDA-based applications are more helpful than PT-based applications, where helpfulness depends on the user's own check with the retrieval system.
The transcripts shown in Tables 3 and 4 are real but cherry-picked, so they illustrate behaviour rather than measure it.
Limitations
Quality issues remain: the model may repeatedly promise to answer later, end conversations early or invent details about the user. Crowdworker disagreement patterns were not examined.
The safety results aggregate fine-grained ratings into a single metric, which leaves little room to weight objectives differently. The safety objectives were developed for a U.S. societal context and would need further work for other societal contexts.
The crowdworker population is overrepresented in the 25-34 age demographic, so it may not fully reflect the user base. Safety fine-tuning may still propagate representational harms present in the training data, since responses are non-deterministic.
Adversarial testing mostly found common problems rather than rarer ones. The authors state that this is not the final version of LaMDA but a recipe for producing production-ready versions for specific applications.
Paper info
- Authors
- Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, YaGuang Li, Hongrae Lee, Huaixiu Steven Zheng, Amin Ghafouri, Marcelo Menegali, Yanping Huang, Maxim Krikun, Dmitry Lepikhin, James Qin, Dehao Chen, Yuanzhong Xu, Zhifeng Chen, Adam Roberts, Maarten Bosma, Vincent Zhao, Yanqi Zhou, Chung-Ching Chang, Igor Krivokon, Will Rusch, Marc Pickett, Pranesh Srinivasan, Laichee Man, Kathleen Meier-Hellstern, Meredith Ringel Morris, Tulsee Doshi, Renelito Delos Santos, Toju Duke, Johnny Soraker, Ben Zevenbergen, Vinodkumar Prabhakaran, Mark Diaz, Ben Hutchinson, Kristen Olson, Alejandra Molina, Erin Hoffman-John, Josh Lee, Lora Aroyo, Ravi Rajakumar, Alena Butryna, Matthew Lamm, Viktoriya Kuzmina, Joe Fenton, Aaron Cohen, Rachel Bernstein, Ray Kurzweil, Blaise Aguera-Arcas, Claire Cui, Marian Croak, Ed Chi, Quoc Le
- Venue
- arXiv · Preprint
- First published
- 2022-1-20
- Added
- 2026-11-12
- Updated
- 2022-2-10
- Version
- v3
- arXiv
- 2201.08239
- Category
- cs.CL · cs.AI
- Original paper terms
- CC BY 4.0
- What we show
- Paper info and commentary
AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.
Quote from the paper
Romal Thoppilan, Daniel De Freitas, Jamie Hall, Noam Shazeer, Apoorv Kulshreshtha, Heng-Tze Cheng, Alicia Jin, Taylor Bos, Leslie Baker, Yu Du, YaGuang Li, Hongrae Lee, Huaixiu Steven Zheng, Amin Ghafouri, Marcelo Menegali, Yanping Huang, Maxim Krikun, Dmitry Lepikhin, James Qin, Dehao Chen et al. (2022). LaMDA: Language Models for Dialog Applications. arXiv:2201.08239v3. https://arxiv.org/abs/2201.08239v3
BibTeX
@misc{thoppilan2022lamda,
title = {{LaMDA: Language Models for Dialog Applications}},
author = {Romal Thoppilan and Daniel De Freitas and Jamie Hall and Noam Shazeer and Apoorv Kulshreshtha and Heng-Tze Cheng and Alicia Jin and Taylor Bos and Leslie Baker and Yu Du and YaGuang Li and Hongrae Lee and Huaixiu Steven Zheng and Amin Ghafouri and Marcelo Menegali and Yanping Huang and Maxim Krikun and Dmitry Lepikhin and James Qin and Dehao Chen and Yuanzhong Xu and Zhifeng Chen and Adam Roberts and Maarten Bosma and Vincent Zhao and Yanqi Zhou and Chung-Ching Chang and Igor Krivokon and Will Rusch and Marc Pickett and Pranesh Srinivasan and Laichee Man and Kathleen Meier-Hellstern and Meredith Ringel Morris and Tulsee Doshi and Renelito Delos Santos and Toju Duke and Johnny Soraker and Ben Zevenbergen and Vinodkumar Prabhakaran and Mark Diaz and Ben Hutchinson and Kristen Olson and Alejandra Molina and Erin Hoffman-John and Josh Lee and Lora Aroyo and Ravi Rajakumar and Alena Butryna and Matthew Lamm and Viktoriya Kuzmina and Joe Fenton and Aaron Cohen and Rachel Bernstein and Ray Kurzweil and Blaise Aguera-Arcas and Claire Cui and Marian Croak and Ed Chi and Quoc Le},
year = {2022},
eprint = {2201.08239},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/2201.08239v3}
}