Elamur Research

KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detection

Paper · 2023 · Sehyun Choi, Tianqing Fang, Zhaowei Wang et al.

Summary

Giving a language model a relevant passage makes it possible to answer from evidence. The passage can still go unused, or the response can add a detail that the passage never establishes. Sehyun Choi and colleagues address this problem at decoding time, when the generator chooses which tokens to put in its answer. Their method, Knowledge-Constrained Tree Search (KCTS), keeps the generator’s weights fixed and uses a separate learned score to steer those choices. The score asks whether the emerging response is likely to stay faithful to the particular reference supplied with the task. Language model · Text generation

The method combines a search procedure with a classifier trained on unfinished responses. Monte Carlo tree search explores several continuations before committing to the next token. It needs a way to judge those continuations while they are still short. For that purpose, the authors develop Reward Inflection-Point Approximation (RIPA). They construct training examples with a supported beginning and a suffix treated as unsupported, then change the label at the start of that suffix. A prefix ending before this boundary keeps its positive label. A prefix extending beyond it receives a negative label because the earlier problem is still present in the accumulated text. During search, the classifier scores partial continuations directly, avoiding the expense of finishing an entire answer in every simulation.

The experiments cover the unseen-topic test split of Wizard of Wikipedia and the CNN/DM summarization test set. In dialogue, KCTS achieves 91.78 for UniEval groundedness, compared with 83.53 for FUDGE and 83.90 for the earlier tree-search decoder on the same Flan-T5-XL generator. In summarization, its MFMA factual-consistency score is 85.36, compared with 71.35 for FUDGE and 71.28 for the earlier tree-search decoder. A simpler decoder called Knowledge Weighted Decoding uses the same classifier to rerank next-token candidates. It leads KCTS on several measures, including the UniEval dimensions for summarization. Human assessments favor KCTS over the comparable baselines studied, while ChatGPT is generally preferred and leads on summarization completeness. Wizard of Wikipedia · Text summarization

The findings concern fidelity to supplied evidence. The dialogue experiments use the benchmark’s designated reference knowledge, and the summarization experiments supply the article itself. The authors leave retrieval outside the main evaluation, and their classifier does not establish whether the source is true. Search also adds work during generation. An experiment that applies KCTS only to an opening span shows why that cost can be adjustable. A better-grounded opening can improve a response even when ordinary sampling writes the rest.

Deep dive: KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detection

KCTS uses token-level checks and tree search to keep generated dialogue and summaries grounded in the evidence supplied with a prompt. · about 38 minutes to read

The problem and its context

Getting a response to use the evidence it receives

A conversational system can produce a fluent reply that contributes little from a relevant passage. It can also use information from the passage and then finish with an unsupported detail. These are different failures for a system meant to give an informative answer anchored in evidence. Ignoring the passage wastes useful material. Adding a claim that the passage cannot substantiate makes the reply harder to rely on. The paper uses hallucination to discuss unsupported or nonfactual generated content and narrows its intervention to what can be assessed against an identified reference.

That scope matters in the tasks the authors study. In dialogue, the reference supplies information that can make a response useful, and the conversation establishes what the user is asking. A suitable answer needs to serve both. A summary has a different obligation. It must choose and compress information from a source article, while preserving the relationships that make its statements accurate. A reply that repeats a relevant sentence with no regard for the conversation and a summary that reproduces an article indiscriminately both miss part of the task. Evidence use is therefore a question of what the response communicates as well as which words it contains.

The paper situates this concern in earlier research on hallucination across several settings, including translation, open-domain conversation, abstractive summarization, and question answering. It also discusses generative search systems whose convincing answers can be difficult to verify. Existing benchmarks and detection methods offer ways to inspect a completed output. For KCTS, the question is what a decoding procedure can do before an unsupported statement has become part of the answer. A detector used after generation can assess what was written. A score used during generation has to help decide which fragment is worth continuing. Survey of Hallucination in Natural Language Generation · Question answering · On Faithfulness and Factuality in Abstractive Summarization

Groundedness, in the paper’s sense, is specific to the evidence supplied on an example. The same sentence can be supported by one passage and unsupported by another. A plausible statement may be outside the reference, and an untrustworthy reference can support an untrustworthy output. The experimental question is whether access to a particular source can be translated into better use of that source. This gives the authors a criterion concrete enough to guide generation and a reason to distinguish faithfulness from factual correctness in the broader sense.

Retrieval and training solve different parts of the problem

The paper describes systems that first retrieve relevant evidence and then supply it to a reader that generates the answer. Some prior work trains the retriever and reader jointly. Another line of work learns representations of entities or facts and exposes those representations to the generator. These approaches vary in how knowledge is found, stored, and delivered. They share the expectation that the generator can learn to use information made available to it. KCTS starts with the information already selected and studies a subsequent decision, namely which words the generator should produce with that information in hand. Information retrieval & search · Retrieval-augmented generation · Dense Passage Retrieval · Leveraging Passage Retrieval with Generative Models

The authors give practical reasons for keeping the generator fixed. Updating a large reader can be expensive, and the provider of an API can limit what a user is able to train. They are also concerned about catastrophic forgetting. An instruction-tuned generator acquires the ability to respond to different tasks, some of which can be attempted zero-shot, meaning that the prompt specifies the task without supplying worked examples for it. Further training on a particular task can interfere with abilities acquired earlier. The paper’s design keeps a task-specific groundedness component separate from the generator’s original parameters, which can still be used with the component disabled. Fine-tuning · Overcoming catastrophic forgetting in neural networks

The paper also describes an earlier attempt to improve groundedness by putting evidence into a prompt and supplying textual feedback. That approach can operate without training the underlying generator, but its success depends on whether the generator can use the feedback and work with the reference. KCTS puts the additional signal inside decoding. A check can affect which continuation is explored before the response is finalized. This intervention needs access to more of the generation process, which becomes consequential in the paper’s preliminary work with an API.

Why checking the next token is difficult

In ordinary generation, a candidate token is evaluated in the context of what has already been written. When the property of interest is groundedness, its importance can depend on what comes later as well. A short phrase may introduce a supported explanation or set up an unsupported one. A word can look innocuous by itself even when the phrase ending at that word changes a claim in a consequential way. The appropriate object to score is the prefix, the cumulative text through that position. The property the authors ultimately care about belongs to the answer formed when that prefix is completed.

Prior work on guided decoding supplies a framework for intervening at this point. Some methods steer text toward a style or sentiment. Others impose constraints such as the inclusion of particular words. Plug-and-Play Language Models use a discriminator to steer generation by increasing the probability of a desired attribute. FUDGE directly reweights token probabilities with a classifier applied to partially generated text. NADO also uses token-level guidance and treats it as an approximation to an oracle for completed text. GeDi and DExperts take a different route to reweighting, using generative classifiers to avoid explicitly scoring every vocabulary entry in the manner discussed by the paper. These precedents show different ways to combine a generator’s preferences with an additional criterion. The criterion in KCTS changes with the evidence on each example.

Search-based decoding adds a related possibility. A decoder can defer commitment while it examines likely continuations and estimates their later reward. The paper cites uses of this principle in conditional generation, sentiment control, and alignment, among other settings. Its interest in search comes from the gap between a local score and the quality of a completed answer. If the highest-scoring candidate at the current position leads to a weak continuation, a greedy decision has already fixed that part of the text. A search procedure can spend some of its budget finding out what those early candidates lead to.

There is a corresponding difficulty in teaching a classifier what an incomplete answer means. Earlier training schemes can transfer the final negative label to a shorter prefix that still contains only supported material. Consider a response with an accurate explanation followed by a speculative aside. Truncating it before the aside can yield a well-supported fragment, even though the original answer deserved a negative judgment. The paper’s proposed boundary labels address this mismatch. The tree search and labeling proposal thus target distinct parts of the same decision. Search changes how the next token is chosen, and RIPA changes what evidence the decoder has available when making that choice.

The method, step by step

From the prompt to a committed token

The input gives the generator a task and the evidence it is meant to use. For dialogue, the distinction is easy to see. The dialogue history establishes what the speaker is responding to, while the reference contributes relevant facts. For summarization, the article is both the main input and the evidence against which to check the output. The generator is autoregressive. It proposes tokens using the input and the text it has already generated, and the selected token becomes part of the context at the next position.

KCTS starts a search from the already committed prefix. A branch represents one possible continuation of that prefix. As the tree grows, a path through it represents a longer candidate answer. The generator proposes plausible next tokens to populate the tree, and the classifier estimates how promising the partial text along a branch is from the standpoint of the supplied evidence. Each simulation updates values along the route it explored. The decoder uses the accumulated visits to decide which token to make part of the answer, then continues from the resulting prefix.

How KCTS chooses the next token

The steps in order.

How KCTS chooses the next tokenStep 1: Start from the committed response prefix1. Start from the committed response prefixStep 2: Follow promising branches using PUCT scores2. Follow promising branches using PUCT scoresStep 3: Expand a leaf with probable next tokens3. Expand a leaf with probable next tokensStep 4: Estimate the prefix’s groundedness with RIPA4. Estimate the prefix’s groundedness with RIPAStep 5: Update values along the explored path5. Update values along the explored pathStep 6: Repeat simulations within the search budget6. Repeat simulations within the search budgetStep 7: Commit the most visited child7. Commit the most visited childStep 8: Continue from the new root8. Continue from the new root

The classifier makes the search practical by giving it a value before a sentence ends. An ordinary rollout would complete the response from a leaf, then score the completion. Finishing the response repeatedly spends computation on hypothetical text that will usually be discarded. The paper also points to variance in those scores. A rollout’s completed wording can depend on the sampled continuation from the leaf. The approximation in KCTS gives the search an immediate value for the partial sequence at that point. The search still investigates successive tokens through expansion across simulations.

The generation objective and the prefix approximation

The paper begins with an idealized generation law conditioned on the task, the source, and groundedness.

y ∼ Pₗₘ(y | x, k, αₖ)

Here y is a generated text, x is the input that describes the task, and k is the reference knowledge. The symbol αₖ denotes the groundedness attribute for that reference. Pₗₘ stands for the generator’s probability distribution, | introduces the conditions on that distribution, and ∼ means that the output is drawn from it. The subscript ₖ emphasizes that the attribute is tied to the particular knowledge item.

The verifier estimates the probability of the positive groundedness label. The paper gives the classifier form of the score as follows.

f(y, k) = Pբ(αₖ = 1 | y, k)

Here f is the learned groundedness function, and Pբ denotes the probability assigned by the classifier f. The inputs y and k are the response and reference. The attribute αₖ takes the value 1 for the grounded class. The conditional bar | places the classification in the context of that response and reference. The score can be used to distinguish degrees of confidence even though the training labels are binary.

With the Bayesian decomposition used in earlier guided decoding, the paper expresses the conditioned generation distribution as proportional to a product.

Pₗₘ(y | x, k, αₖ) ∝ Pₗₘ(y | x) f(y, k)

The left side denotes the desired distribution over responses y given the task input x, reference k, and groundedness attribute αₖ. On the right, Pₗₘ(y | x) is the generator factor and f(y, k) is the groundedness factor. Juxtaposition multiplies them. The operator ∝ means proportional to, so the product supplies a score up to normalization. In the actual experiments, the prompt also presents the evidence text to the generator. The decomposition identifies the separate role of the verifier even when the prompt already exposes the generator to that evidence.

The corresponding whole-response objective chooses an output that maximizes this combined score.

y* = arg maxᵧ Pₗₘ(y | x) f(y, k)

y* denotes a maximizing output. The arg maxᵧ operation returns a choice of y with the largest score as y varies. The probability Pₗₘ(y | x) gives the generator’s preference under x, and f(y, k) judges the response against k. A response that has high probability but little support can receive a lower product. A response that tracks the reference but is implausible under the task input can also receive a low product. Both factors matter to the objective.

The paper then writes a token-level decision rule of the kind used in FUDGE.

yₜ* = arg maxᵧₜ Pₗₘ(yₜ | y<ₜ, x) f(y≤ₜ, k)

t denotes the current token position. yₜ is a candidate at that position, and yₜ* is the candidate that maximizes the displayed product. y<ₜ is the prefix strictly before the position, whereas y≤ₜ includes the candidate. The arg maxᵧₜ ranges over candidate tokens. Pₗₘ assigns each candidate a probability given the earlier tokens and x, and f scores the resulting extended prefix against k. The rule makes the local approximation explicit. Applying it greedily gives a way to choose the next token without solving the entire response optimization at once.

A verifier trained only on complete text needs an interpretation when its input stops mid-response. The authors use a prefix score as an approximation to future groundedness.

y ∼ P(y | y<ₜ, x),   f(y<ₜ, k) ≈ f(y, k)

y is a complete continuation drawn from P, the generation distribution conditioned on the existing prefix y<ₜ and task input x. The symbol ∼ indicates a draw from that distribution. The function f on the left of ≈ scores the unfinished prefix against reference k. On the right it scores the completed y against the same reference. The approximate equality describes the intended relationship between the prefix value and the eventual value. The method relies on a useful estimate, since different completions of the same prefix can have different degrees of support.

How the search uses that value

The tree root corresponds to the currently committed prefix. Each node reached from that root adds a token along its path. The authors use v for a node and ρ(v) for its parent. In their path notation, y<v consists of the root prefix plus the tokens on the way to v, with v itself excluded. This distinction matters because a next-token probability is conditioned on the text preceding the token, whereas the classifier’s motivation is to evaluate the partial text at a particular point in the generation.

Selection follows a rule called PUCT. It uses both what earlier simulations have found and the generator’s prior preference among possible tokens.

puct(i) = V(sᵢ)/nᵢ + cₚᵤ꜀ₜ P(yₛᵢ | x, y<ₛᵢ) √Nᵢ/(1 + nᵢ)

i indexes a child under consideration and sᵢ denotes its node. V(sᵢ) is the groundedness value associated with that node, nᵢ counts visits to it, and Nᵢ counts visits to its parent. yₛᵢ is the child’s token and y<ₛᵢ is the prefix before it. The prior P assigns a probability to that token given x and the prefix. cₚᵤ꜀ₜ adjusts the emphasis on exploration. √ takes the square root of the parent count, and the 1 in the exploration denominator offsets the child count. The child with the largest puct(i) is selected. Raising the exploration constant gives the prior and the visit-dependent exploration term more influence.

The two terms serve different purposes. The value term uses information from simulations that have already passed through a child. The exploration term keeps a plausible child worth considering when its parent has received attention but the child has been visited comparatively little. The resulting traversal can return to a branch repeatedly as its descendants look promising. It can also try another branch when there is enough reason to see where it leads.

Selection ends at a leaf. If this leaf represents an end-of-sequence token, abbreviated EOS, it is terminal. Otherwise, expansion runs the generator for a decoding step and uses the highest-probability candidates as the new children. The paper calls the width top-k. In that expression, k denotes the number of candidates retained. The same letter denotes the reference text in the groundedness equations, where the argument position distinguishes the meanings. Filtering lets the generator supply a manageable set of candidates. A token outside that set is unavailable at the corresponding expansion.

For conventional rollout evaluation, the leaf s would be continued to EOS and the completed y would receive its score.

V(s) = f(y, k)

Here V(s) is the value of the selected leaf s, f is the groundedness function, y is the finished rollout response, and k is the reference. A value obtained this way depends on how that particular response finishes. KCTS substitutes a score for a partial sequence.

V(s) ← f(y<ₛᵢ, k)

V(s) is the value assigned to the evaluated leaf. The arrow ← denotes assignment. The function f evaluates y<ₛᵢ, the partial path text in the paper’s node notation, against k. The index i identifies the node used to mark the evaluation point. This is the step that substitutes RIPA’s direct estimate for the score of a fully sampled continuation.

The evaluated value is then propagated along the path back toward the root. The paper describes this update as mean aggregation over the simulations passing through a node and gives the following expression.

V(ρ(sᵢ)) ← [Nᵢ · V(ρ(sᵢ)) + f(y<ₛᵢ, k)] / nᵢ

ρ(sᵢ) is the parent of the path node sᵢ, and V(ρ(sᵢ)) on the right is its value before the assignment indicated by ←. Nᵢ is the parent count and nᵢ is the child count from the selection notation. The dot · denotes multiplication. The term f(y<ₛᵢ, k) is the groundedness evaluation written for the partial sequence and reference. The equation as printed divides a parent update by the child count. The accompanying description says the update aggregates the simulations after the node by their mean, leaving a count ambiguity in the printed expression. Its function in the algorithm is to carry information from an evaluated continuation back to the nodes whose values will guide subsequent traversals.

After the allotted simulations, KCTS picks the root child with the highest visit count. This is a commitment criterion based on how the search distributed its effort. The child becomes the next root, and its token becomes part of the answer. In the reported settings, the simulation count N is 50, the exploration constant is 3, and MCTS uses a repetition penalty of 1.2. The shared candidate filter is k = 50. These settings control different operations. One concerns how many simulated traversals can inform a decision. The other concerns how many tokens can be proposed when a leaf is expanded.

Teaching RIPA where the label changes

The authors frame the complete-answer verifier as binary fact verification. The issue is how to provide analogous supervision when a classifier must evaluate each prefix. Randomly truncating a negative answer can remove the content responsible for its negative label. Labeling all token positions with the full answer’s outcome has a similar consequence for its earlier positions. RIPA is designed to give the classifier different targets on either side of the point where a response first contains unsupported content. FEVER

For a response with a supported beginning, the labels start at 1. They switch to 0 once the prefix includes the first hallucinated token, and remain there. What matters at each position is the status of the whole prefix ending there. A subsequent word can be ordinary and appropriate in isolation while the accumulated response still contains the original unsupported claim. The training signal therefore teaches the classifier both to recognize a boundary and to continue discounting prefixes that retain the error.

The authors connect this choice to earlier work on hallucinations that compound over the course of a response. An unsupported statement can become context for further unsupported statements, since the generator conditions on what it has already written. A classifier that learns to lower scores once a branch first enters such territory can reduce the search effort spent on its descendants. Within a fixed simulation budget, the resulting visits can go towards finding other promising continuations. This is the intended interaction between RIPA and tree search. The classifier estimates where the developing response has gone wrong, and the search can act on that estimate before the token becomes final.

The boundary also explains why the authors call the method an approximation. A positive label before the switch identifies a prefix that has remained supported in the constructed example. Its possible completions still vary. Conversely, labeling everything after a switch as negative treats the earlier error as persistent in the output, even if a later phrase changes the reader’s interpretation. The synthetic training procedure gives a concrete target for an otherwise difficult annotation problem. The test-time score is learned from that target.

Building negative and positive training examples

The authors use original examples and construct negative examples because human annotation of the first unsupported token would be difficult to obtain at scale. A dialogue training item has a response y, a context x, and evidence k. A knowledge shuffle holds the response and conversation fixed and substitutes another piece of knowledge, k′. The changed pairing makes the existing response unlikely to be grounded in its new reference. Its conversational relevance can remain intact, since the context and response have stayed together. The authors assign 0 to all its response positions.

Partial hallucination provides the within-response boundary. The procedure takes an original response and chooses an interior position at random using the condition below.

1 < i < T

i is the selected truncation position and T is the original response length. < expresses strict inequality, and 1 marks the first position. The cut is after the first token and before the original ending. The authors retain the response through position i and sample a new suffix.

The partial-hallucination description also calls for swapping the knowledge, then describes the completion using the symbol k in the sampling prompt. The text thus introduces k′ for the replacement while retaining k in its notation for what the completer receives. The supervision boundary is explicit. The prepared response begins with retained original text, and only the sampled suffix beyond the cut is assigned the negative label.

y ∼ Pₗₘ(y | x, yᵢ, k)

y on the left is the sampled response incorporating the continuation. Pₗₘ is the generator’s distribution, and ∼ means the response is sampled from it. x provides the task context, yᵢ denotes the original response retained through position i, and k is the knowledge argument as written in the completion condition. The vertical bar | introduces those conditions. The paper describes the completion as zero-shot and places the evidence text in the instruction.

To encourage unsupported continuations, the authors sample at a temperature above 1. Temperature affects how concentrated the sampling distribution is around the most probable candidates. Increasing it gives less probable tokens more opportunity to be chosen. For the Wizard of Wikipedia partial examples, the authors use Flan-T5-XL at temperature 1.4. They treat the extension as the negative span. This offers an inexpensive way to place a boundary, and the resulting labels are synthetic. Whether a generated suffix really departs from its evidence is a question the authors investigate separately.

The dialogue data include 8,832 partial hallucination examples, 10,000 knowledge shuffles, and 20,000 originals. The paper also describes the resulting dialogue mixture as 20k positive and 18.8k negative examples. For CNN/DM, the article supplies the knowledge and is the central input itself. The authors use partial hallucination there and report 12,811 negative examples and 13,180 positive examples. A random 9:1 split gives training and held-out classifier data. Those splits serve the verifier evaluation. The task results are reported separately on the named benchmark test sets.

The part that is trained and the simpler decoder

The authors train lightweight LoRA adapters in the generator’s decoder layers and place a single linear classification layer over its final hidden states. The hidden states are the internal representations computed as the network processes the input and output tokens. The added trainable weights amount to 0.21% in the reported implementation. Because the additions can be enabled or disabled, the original instruction-following generator remains available by itself. The classifier training uses effective batch sizes of 64 for knowledge-grounded dialogue and 32 for summarization, with 2000 training steps. The authors report using 8-bit quantization during training and inference. LoRA · Transformers

The paper also introduces Knowledge Weighted Decoding, or KWD. At a given position, the generator proposes candidates, the same RIPA classifier scores their extended prefixes, and the decoder reranks the candidates using those scores. KWD retains the local decision of weighted decoding and changes the classifier supervision. KCTS uses RIPA inside tree search, where downstream exploration can influence the current commitment. That distinction makes KWD an experimental comparison as well as a proposed decoder. It demonstrates what the classifier can contribute when there is no corresponding tree of alternative futures. The authors report releasing their implementation under the name Knowledge-Constrained-Decoding.

Experiments and results

What is held fixed across the comparisons

Wizard of Wikipedia provides the dialogue setting. The generator receives dialogue history and the benchmark’s designated supporting passage. The authors use the unseen-topic portion of the test set. In CNN/DM, the generator receives a news article and is asked for an abstractive summary, a condensed account that can use its own wording. The article serves as the evidence for factual consistency. These tasks share a source-conditioned generation problem while giving the source different roles. A dialogue response can use a small piece of information relevant to the turn. A summary also needs to select the important information across an article.

The main decoder comparisons use Flan-T5-XL, abbreviated FT5-XL. The dialogue task is described as unseen for the instruction-tuned comparison systems despite their exposure to some dialogue data. CNN/DM summarization was included in the training mixtures discussed for T0 and Flan. Thus the paper examines guidance on an unfamiliar kind of dialogue task and guidance intended to improve factuality on a summarization task that the instruction tuning already covered. The same generator in the decoding rows makes it easier to attribute differences to how a response is selected.

FUDGE, NADO, and the earlier MCTS method are the directly comparable decoding baselines. The experiments adapt them to the task of using the reference. FUDGE and the earlier MCTS use random-truncation classifiers. NADO uses its token-level labeling approach. KWD and KCTS both use RIPA. The paper also reports reference points for ChatGPT, GPT-3.5, and other instruction-tuned generators, along with a supervised FT5-XL dialogue result. The authors treat these as context for the decoding scores because the training and systems differ. An advantage over one of these reference points on a particular metric answers a narrower question than the same-generator comparisons.

The reported generation length settings are 32 tokens for grounded dialogue and 64 for summarization. Nucleus sampling, the ordinary sampling comparison, uses top-p 0.95 and temperature 1. Top-p sampling draws from a set formed from high-probability candidates up to the specified probability-mass threshold. The guided methods use top-k filtering with k = 50. NADO’s constraining factor is 0.25. These conditions matter when interpreting the scores. In particular, a decoder’s search behavior depends on which alternatives the candidate filter allows it to see.

How the paper measures grounding and usefulness

The paper reports overlap with human reference responses and overlap with the evidence separately. The response-overlap measures include BLEU, reported as BLEU-4 in the setup, as well as ROUGE-L, chrF, and METEOR. These scores register forms of textual similarity to a target response. A generated answer can use a source faithfully while differing in wording or emphasis from the human reference. Conversely, agreeing with the reference on some expressions leaves open whether every generated claim is supported.

Knowledge-F1, or KF1, measures unigram overlap with the evidence, where a unigram is an individual token. K-Copy uses edit distance to monitor how closely a response reproduces its evidence verbatim.

K-Copy(y, k) = 1 − LD(y, k) / max(|y|, |k|)

K-Copy(y, k) is the copy score for generated text y and reference k. LD denotes Levenshtein distance, which measures how much editing is needed to transform one string into the other. The vertical bars in |y| and |k| denote the respective string lengths, and max selects the larger length for normalization. The constant 1 is the upper endpoint before the normalized distance is subtracted. Identical strings have no edit distance and therefore receive the highest copy score. The authors give ≥70% as an example of a copy rate that may indicate diminished usefulness. The score is a way to monitor copying alongside evidence use.

UniEval is a learned evaluator trained in a Boolean question-answering format. In dialogue, its dimensions are naturalness, coherence with the conversation, and groundedness in the reference knowledge. For summaries, coherence concerns the text of the summary, consistency concerns its agreement with the article, fluency concerns the writing, and relevance concerns the gold target. The paper also uses MFMA, a learned factual-consistency metric for summarization. The authors select it based on prior reported correlation with human factuality judgments on CNN/DM material in the FRANK and QAGS benchmarks. UniEval consistency and MFMA can emphasize different properties of the same outputs, which matters when the ranking changes between them. Evaluation & benchmarks

The study further includes human assessments of selected examples. For dialogue, readers judge the response as a conversational contribution, including whether it feels like an unnatural copy. For summarization, they consider whether the claims are grounded and whether important information has been included. This distinction between groundedness and completeness helps explain how a concise summary can be faithful while covering relatively little. The training classifier’s own score also appears in the dialogue results. Its activation helps show whether search achieves a higher value on the signal it uses, while the external measures address how the resulting outputs are judged by other criteria.

Wizard of Wikipedia dialogue

On the unseen-topic test set, every guided decoder improves KF1 and UniEval groundedness over the zero-shot FT5-XL sampling comparison. Plain FT5-XL has KF1 of 34.50 and UniEval groundedness of 75.70. FUDGE raises these to 55.30 and 83.53. The earlier MCTS decoder reaches 55.54 and 83.90. KWD has the highest KF1 among the guided runs at 58.19. KCTS records 56.06 for KF1 and leads on UniEval groundedness at 91.78. Since KF1 measures shared words and UniEval estimates whether the reply is grounded, their different rankings are informative about what changed in the output.

Guided decoders on Wizard of Wikipedia unseen-topic test groundedness

KCTS receives the strongest groundedness score from UniEval.

Guided decoders on Wizard of Wikipedia unseen-topic test groundednessFUDGE: 83.53FUDGE83.53NADO: 81.10NADO81.10Earlier MCTS: 83.90Earlier MCTS83.90KWD: 87.86KWD87.86KCTS (this paper): 91.78KCTS (this paper)91.78
The numbers
System or settingUniEval groundedness score
FUDGE83.53
NADO81.10
Earlier MCTS83.90
KWD87.86
KCTS (this paper)91.78

The K-Copy scores show another aspect of the comparison. KCTS scores 51.90, compared with 56.58 for KWD and 54.04 for FUDGE. Plain FT5-XL has a lower K-Copy score of 37.07, alongside markedly weaker evidence overlap and groundedness. The useful comparison for KCTS is that its gain over guided alternatives on UniEval groundedness does not depend on achieving a higher copy score than those alternatives. Its 92.78 for UniEval coherence also exceeds KWD’s 90.51. On naturalness, KCTS receives 62.32, below FUDGE at 73.68 and the earlier MCTS decoder at 74.54. The automated dialogue results therefore include a clear cost on an output-quality dimension alongside the gains on grounding and coherence.

KCTS obtains the highest classifier activation among these decoding rows at 98.30. KWD records 97.54 and the earlier MCTS decoder 95.07. This follows the authors’ expectation that RIPA combined with search can find outputs with higher scores on the internal guidance measure. The separate UniEval groundedness result matters because classifier activation alone could indicate only that the decoder got better at satisfying its own scorer. The token-overlap results tell a further part of the story. KWD has BLEU of 12.74 and ROUGE-L of 28.27, against 11.42 and 27.43 for KCTS. The weighting and search variants can make different tradeoffs even with the same learned signal.

The dialogue human evaluation uses 100 randomly sampled examples and 3 evaluators. They rate fluency, relevance, and groundedness on a 3-point scale and flag unnatural copying. KCTS receives 2.92 for fluency, 2.55 for relevance, and 2.37 for groundedness. FUDGE receives 2.82, 2.35, and 2.19 on the same dimensions, and plain FT5-XL receives 2.64, 2.30, and 1.95. The copying indicator is 0.17 for KCTS and 0.21 for FUDGE. This comparison supports the interpretation that the more grounded responses were useful to the evaluators even though they depended more on the supplied knowledge than ordinary FT5-XL generation did.

The authors also report ratings for the subset that annotators agreed did not copy the source. KCTS receives 2.61 for relevance and 2.24 for groundedness there. FUDGE receives 2.40 and 1.97. These are ratings on the non-copy group, so they address whether the advantage is visible after excluding examples judged to be copying. ChatGPT, the external reference point, has overall ratings of 3.00 for fluency, 2.73 for relevance, and 2.62 for groundedness. This is a stronger dialogue showing in the human assessment than KCTS attains.

CNN/DM summarization

On the CNN/DM test set, KCTS has the highest MFMA score among the shared-generator decoding methods, 85.36. KWD is close at 85.11. The earlier guided baselines cluster around a different set of values, with FUDGE at 71.35, NADO at 72.01, and the earlier MCTS decoder at 71.28. As in dialogue, both RIPA-guided methods do well on the grounding-related measures, and changing from weighted decoding to search has an effect that depends on the metric.

Guided decoders on CNN/DM test factual consistency by MFMA

Both RIPA-guided decoders lead the earlier methods, with KCTS slightly ahead of KWD.

Guided decoders on CNN/DM test factual consistency by MFMAFUDGE: 71.35FUDGE71.35NADO: 72.01NADO72.01Earlier MCTS: 71.28Earlier MCTS71.28KWD: 85.11KWD85.11KCTS (this paper): 85.36KCTS (this paper)85.36
The numbers
System or settingMFMA score
FUDGE71.35
NADO72.01
Earlier MCTS71.28
KWD85.11
KCTS (this paper)85.36

KCTS leads the guided methods on several text-overlap scores. It records BLEU of 14.21, ROUGE-L of 28.10, chrF of 37.18, and METEOR of 31.37. KWD records 12.30, 27.20, 34.25, and 28.46 on those metrics. KCTS also has more lexical overlap with the source article, reaching KF1 of 22.97 compared with 20.39 for KWD. Its K-Copy score is 13.29, with KWD at 11.63. The overlap with a reference summary and the overlap with the original article are separate comparisons. Here KCTS has higher scores on both.

In the UniEval results, KWD has coherence 96.24, consistency 96.64, fluency 91.60, and relevance 88.48. KCTS receives 95.85, 96.03, 90.24, and 87.16. Both RIPA-guided methods are ahead of the earlier guided decoders on these dimensions. The authors suggest the larger overlap with the article in KCTS may make its summaries less abstractive and less similar to the material on which UniEval was trained. That suggestion offers a possible explanation for the change in ranking. The experiment directly establishes the score pattern, including that KCTS leads on MFMA while KWD leads on UniEval consistency.

The human summarization assessment uses 50 randomly chosen examples and the same 3 evaluators. KCTS receives 2.95 for fluency, 2.97 for groundedness, and 2.40 for completeness. FUDGE receives 2.89, 2.90, and 2.31. Plain FT5-XL is at 2.81, 2.60, and 2.13. ChatGPT scores 3.00 for fluency, 2.93 for groundedness, and 2.88 for completeness. Thus KCTS has the highest displayed human groundedness rating in this assessment, while ChatGPT has higher fluency and substantially higher completeness. The reported agreement values for fluency, groundedness, and completeness are 0.35, 0.44, and 0.19, respectively. The completeness comparison in particular comes from a dimension on which the raters were frequently less aligned.

What the ablations show

Keeping the classifier while changing the decoder

KWD supplies a controlled way to examine the value of the training signal. FUDGE and KWD both use weighted decoding, with the important change that KWD uses RIPA in place of random-truncation supervision. The earlier MCTS method and KCTS give the corresponding comparison within tree search. The better grounding scores of the RIPA variants across these comparisons support the claim that training labels contribute to the gains. The comparison works in both tasks and with both ways of selecting tokens. It would be harder to identify the contribution of the labels from a comparison between KCTS and FUDGE alone, where the search procedure also changes.

Comparing KWD with KCTS addresses the contribution of search once the classifier is held fixed. In dialogue, search raises the final classifier activation and external groundedness, with advantages on coherence and K-Copy as well. Weighted decoding leads on KF1 and some response-overlap metrics. In summarization, search has the advantage on MFMA and token overlap with the reference, while weighted decoding leads on the UniEval dimensions. This pattern gives a more specific interpretation of lookahead than a claim that tree search generally produces the best output. It can find continuations that score better under particular criteria, and the output changes in ways that other evaluators may value differently.

NADO provides a related comparison, but its classifier construction differs along more than one axis. It assigns scores to possible next tokens using vocabulary-indexed outputs, and its training transfers the sequence label to token positions. Different vocabulary outputs can receive different amounts of supervision, depending on how often their tokens appear in training. The authors mention this structure as a possible reason for NADO’s classification performance. Its results therefore concern the complete alternative guidance scheme, with both its architecture and its labeling choices in play.

Guiding only the beginning of a reply

The dialogue study varies how many initial positions are subject to KCTS. After the specified prefix length, ordinary nucleus sampling finishes the response. The conditions use T values of 5, 10, 16, and 32. In that order, the final replies have UniEval groundedness scores of 85.87, 86.41, 89.99, and 91.78. Even the condition with guidance for the first 5 tokens reaches higher groundedness than plain FT5-XL sampling at 75.70 on the unseen-topic test set.

The point of the experiment is what happens after the control has been turned off. Subsequent generation conditions on the opening created by KCTS. The higher final groundedness suggests that changing the beginning can change how the ordinary decoder completes the response. This supports the authors’ emphasis on early trajectory decisions. It also gives them a way to vary how many positions incur the search cost.

The results do not move in lockstep across measures. KF1 is 48.78 when the initial 5 tokens are guided and 48.24 when the initial 10 are guided. It reaches 51.49 at 16 and 56.06 at 32. UniEval coherence is 92.83 at 16, compared with 92.78 at 32. Classifier activation is 90.58 at 5, 85.43 at 10, 92.76 at 16, and 98.30 at 32. The groundedness scores give the clearest progression across the displayed lengths. The other measures show why a prefix-length result should be interpreted by its metric. The comparison provides evidence about how early guidance affects a later response, with the speed implications following from the number of positions at which search is used.

Checking the synthetic suffixes and the learned scorers

The authors examine whether the partial examples have the properties their training procedure assumes. In dialogue, the UniEval groundedness score goes from 0.95 on the originals to 0.63 on the partial hallucination data. In summarization, the UniEval consistency score goes from 0.88 to 0.36. The scores are reported on the scale used for this data analysis. The decline supports the expectation that the replacement suffixes weaken support on average. It leaves open exactly where each generated suffix first becomes unsupported.

The paper asks a separate practical question about high-temperature sampling. The decoder searches among candidates near the top of the generator’s distribution. If the synthetic examples mainly produced tokens the decoder would never consider, the training could teach the classifier about unlikely test cases. The authors therefore check whether the sampled tokens fall within the base Flan-T5-XL generator’s top-50 candidates. They report that 78% do so for knowledge-grounded dialogue and 68% for summarization. A substantial share of the sampled training material is thus relevant to the candidate range used at test time. This analysis checks candidate overlap, while the UniEval comparison checks the effect on grounding.

A held-out test of the classifiers on the synthetic data gives another view of the supervision. The full-sequence verifier scores best, and RIPA is the strongest of the token-level approaches in the paper’s comparison. Random truncation does worse, and NADO’s token-labeling method has the lowest reported accuracy among the compared token-level schemes. This is consistent with the authors’ explanation that labels can become noisy when shortened negative examples stop before the relevant mistake. Because the held-out data come from the same construction procedure, the result chiefly shows how well the classifiers recover the distinctions built into that procedure.

What changes in individual answers

The paper includes dialogue examples where the alternative responses use evidence differently. In a conversation about goldendoodles and allergies, the reference connects the dogs’ non-shedding coats to reduced dander. The plain FT5-XL reply affirms the conversational claim without adding the explanation. FUDGE brings in the dogs’ popularity with people who have allergies, which the reference does not establish. KCTS uses the connection between shedding and dander. This example makes the distinction between contextual relevance and grounding concrete. The popularity statement addresses the conversational topic, while the explanation based on dander draws on what the system was given.

The selected examples also include a shared failure. The speaker asks about the taste or smell of fish protein powder, and the reference concerns processing and its suitability as a food ingredient. KCTS still gives a favorable judgment about the taste. The available passage supplies some relevant background, while it leaves the exact question unanswered. The search and checker can therefore still produce a direct-sounding reply where the source affords only a limited answer. This example is especially helpful for interpreting the task because the problem is visible by comparing the requested property with the property discussed in the evidence.

In a summarization example about a footballer’s training outfit, the KCTS output retains who wore the outfit and who mocked it. FUDGE’s version confuses the people’s roles. The facts at stake include an attribution, and mentioning the right names or clothing terms would be insufficient to preserve it. The example illustrates why the learned consistency measures accompany overlap measures. The selected case shows the kind of improvement the method can produce, while the aggregate results establish how the tested decoders compare across the benchmark.

What the preliminary API experiment adds

The paper tests a variation of weighted decoding on 100 randomly sampled examples from the Wizard of Wikipedia unseen-topic test set using GPT-3.5. The interface supplies at most top-5 log probabilities, which gives ordinary post-generation reranking a much narrower candidate set than the main experiments use. To change the input to that selection, the authors use a proxy generator to propose candidates, score them with RIPA, and send biases to the API before sampling. They call this Pre-KWD. In this context, conventional KWD becomes Post-KWD, and the methods can also be combined.

Zᵢ = Zᵢᴸᴸᴹ + α [Z̃ᵢ + log f(y<ₜ,ᵢ, k)]

i indexes a candidate token and Zᵢ is its adjusted logit, a score before normalization into probabilities. Zᵢᴸᴸᴹ is that token’s logit under the API generator. Z̃ᵢ is the score from the proxy generator, and α adjusts the strength of the bias. log takes the logarithm of the RIPA score f, evaluated with the candidate i at position t following the existing prefix in y<ₜ,ᵢ, and with k as the evidence. The brackets group the proxy and grounding terms to be scaled by α. The proxy is GPT2-XL, which the authors choose because it shares a vocabulary with the GPT3 family.

On this sample, GPT-3.5 records KF1 of 25.75 and UniEval groundedness of 94.19. Post-KWD reaches 26.94 and 94.12. Pre-KWD reaches 27.44 and 94.43. The combined method has KF1 of 27.92 and groundedness of 95.18. The results are consistent with the authors’ account that applying guidance before sampling can matter when the exposed candidate list is narrow. They also show that improvements can depend on what is being measured. The post-only variant increases knowledge overlap while recording slightly lower UniEval groundedness than the unmodified API generation. The experiment extends the weighting idea under constrained access and leaves testing the full tree-search decoder under those conditions open.

Limitations

Limits identified by the authors

The authors identify additional inference work as a direct cost. NADO can compute its guidance scores with a generator pass and a discriminator pass per token. FUDGE evaluates the retained top-k candidates with the discriminator. For N simulations per token, the authors describe KCTS as taking N generator passes and N discriminator passes. Evaluating a prefix saves the expense of completing a fresh rollout in every simulation, but repeated evaluation still makes the decoder more expensive than ordinary generation. The authors point to reducing the candidate width or simulation budget as ways to change the tradeoff. They also mention smaller auxiliary weights and early stopping as possible ways to reduce cost.

For the API experiment, the authors describe a separate cost that scales with the generated length.

O(T)

O is order notation, and T is the number of generated tokens. The paper uses this expression for the additional cost associated with issuing a fresh request for each token, which can repeat computation on the existing prompt. The authors identify provider-side key-value caching as a way to reduce this repeated work. The limitation concerns their API setup and illustrates why leaving the generator’s weights fixed can still carry substantial costs at inference.

The paper also identifies gold evidence as an experimental simplification. The dialogue system receives the reference passage selected for the benchmark item. The study leaves retrieval outside the main evaluation, so performance with passages returned by a retrieval system remains open. Retrieved content could be irrelevant, incomplete, or internally inconsistent. Because KCTS targets fidelity to the evidence it receives, the behavior of a combined retrieval and generation system depends on the quality of both stages.

The ethics discussion makes the distinction between evidence fidelity and factual verification explicit. If supplied knowledge contains misinformation, steering the answer towards that knowledge can carry the misinformation into the response. The method estimates whether the generation follows the supplied source. The experiments supply no independent test of the truth of that source. This limit also applies to an apparently successful output with strong automated grounding scores.

The authors report that ChatGPT is generally preferred in the human assessments. They cannot establish a fair comparison given the limited public information about its training and design, and the main decoding experiments use a smaller generator. They describe their approach as applicable to other generators when the necessary access is available. The API experiment shows how some guidance can be applied with restricted access, but its evidence comes from weighting on a sample of dialogue, while the main KCTS results come from running tree search with Flan-T5-XL.

Limits visible in the experimental setup

The central estimate inherits the assumptions of its synthetic labels. A shuffled passage is likely to be unrelated to an answer in a dataset with many topics, but chance can produce a usable match. A sampled replacement suffix is designed to be more prone to hallucination, yet some of its content can still follow from the evidence. The drop in aggregate UniEval scores establishes that the procedure produces weaker outputs on average under that evaluator. It does not locate a human-verified error boundary for each sample. As a consequence, the classifier comparison establishes success on the synthetic supervision and leaves open the accuracy of boundary detection on naturally occurring errors.

The candidate filter bounds what lookahead can discover. The decoder can expand a branch only if the generator first proposes it among the retained candidates at that point. If the wording needed for an appropriately qualified response falls outside the filter, favorable classifier judgments on other branches cannot put it into the tree. The API experiment makes the width issue visible under an especially narrow returned list. The fish protein powder example shows a related substantive challenge. A passage may support background information but leave the user’s actual question unresolved. The paper supplies no guarantee that the generator will explicitly communicate that gap rather than attempting a direct answer.

The results also depend on how quality is measured. Knowledge overlap can rise with copying, and copying can be a sensible way to preserve some facts. The paper tracks K-Copy and investigates the human ratings on replies judged not to copy, which addresses part of that concern. Even so, automated metrics give differing rankings and can evaluate properties the search was not optimized to improve. The dialogue naturalness result and the summarization completeness result make these tradeoffs visible. Groundedness alone cannot describe how naturally a response is written or how much useful content it retains.

The human evaluations cover sampled subsets and use a small panel. The authors disclose that two evaluators are authors and the other is a postgraduate student at the same institution. In dialogue, agreement for fluency, relevance, groundedness, and the copying judgment is reported as 0.57, 0.46, 0.77, and 0.31, respectively. The relatively strong agreement on dialogue groundedness is helpful when interpreting that rating. Copying was less consistently judged. The summarization agreement figures likewise counsel care with fine distinctions, especially for completeness. The study supplies judgments from this panel under these tasks and instructions.

Finally, freezing the generator establishes that its original parameters are preserved. The experiment does not include a broad reassessment of its unrelated abilities with guidance enabled, or an end-to-end comparison of training and deployment costs for all possible alternatives. The same separation matters for the search budget. The paper shows that varying the number of guided opening tokens can change groundedness, but it does not supply a measured latency curve for that intervention. Its strongest evidence is the same-generator comparison on the chosen dialogue and summarization benchmarks, under conditions in which relevant evidence is already available.

What came after

The subsequent papers that cite KCTS place it in discussions of hallucination, test-time search, and verification. For these works, the stated research topics and the citation itself establish the connection. The specific role of KCTS in their arguments or implementations remains unspecified. In particular, a citation establishes awareness of the earlier work, while reuse of its classifier, training data, or decoding procedure would require a more specific account.

A Survey on Hallucination in Large Language Models places its subject in a broad treatment of hallucination principles, taxonomy, challenges, and open questions. KCTS addresses a particular part of that terrain by supplying a reference beforehand and intervening while text is generated. The citation connects that design to the survey’s wider subject. The distinction between an unsupported addition and an incorrect source is especially relevant to situating the paper in such a taxonomy.

A Survey of Large Language Models cites KCTS from a wider survey of language systems. The connection at that scope is to how outputs can be influenced after a generator has been trained. KCTS supplies a concrete instance of keeping the generator’s original weights fixed, adding a trained component, and changing the procedure that selects the output. The survey’s stated scope gives the context for the citation, while its precise characterization of KCTS is unspecified.

Inference Scaling Laws studies how to allocate inference computation for problem-solving. KCTS has a related decision about where to spend computation during generation. It allocates simulations to candidate continuations and can also vary how much of a response receives that extra work. The later study’s stated focus is compute-optimal inference for problem-solving. The parallel lies in the budget question, while KCTS tests its budget choices in a source-grounding setting.

Scaling of Search and Learning approaches search and learning through a reinforcement-learning roadmap. Its citation points to an earlier case where a learned value signal guides exploration at inference. In KCTS, that value comes from training a classifier to evaluate support for partial text, and the search uses it to choose continuations. The later work’s title identifies a wider relationship between learning and search. It does not specify whether the roadmap retains the reference-grounded reward or the RIPA labeling scheme.

s1: Simple test-time scaling cites KCTS in the context of changing what a system can do with computation at test time. KCTS spends that computation before making each guided token commitment. It can explore several branches, and it can concentrate the intervention on the opening tokens. The later work’s stated focus is simple test-time scaling. The citation connects these lines of inquiry at the level of inference effort, with the particular scaling mechanism left unspecified here.

Inference-Time Scaling of Verification concerns rubric-guided verification at test time for deep research agents. This makes the object of verification a useful point of comparison. KCTS scores a partially generated response relative to a supplied reference passage. The later work names a rubric and a deep research setting. The connection is an interest in using verification as part of inference, while the stated task and criterion differ.

Learning from Cognition addresses reinforcement-learning efficiency for reasoning through hierarchical metacognitive decomposition and refinement. KCTS offers an earlier example of making a property of a completed output available at intermediate positions. Its decomposition is by generated prefix, with training labels tied to the appearance of unsupported content. The later work’s stated focus concerns the structure of reasoning and refinement. Its citation establishes a connection to KCTS without identifying which parts of the earlier method, if any, enter that procedure.

Cite

Cite as Sehyun Choi, Tianqing Fang, Zhaowei Wang and Yangqiu Song. 2023. KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detection. Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing.

The paper itself, not this page. BibTeX from the library's record of the work. DOI 10.18653/v1/2023.emnlp-main.867

@inproceedings{choi2023kcts,
  title = {{KCTS: Knowledge-Constrained Tree Search Decoding with Token-Level Hallucination Detection}},
  author = {Sehyun Choi, Tianqing Fang, Zhaowei Wang and Yangqiu Song},
  booktitle = {Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.emnlp-main.867},
  url = {https://doi.org/10.18653/v1/2023.emnlp-main.867}
}

↑ back to top

This page in Markdown https://md.research.elamur.ai/free/en/papers/choi-2023-kcts-knowledge-constrained-tree-search/