# Poster 30769

- Kind: Poster
- Talk page and recording: https://iclr.cc/virtual/2025/poster/30769

> Transcript of the talk's recording (session_asr), made by speech recognition or taken from the host's captions. It may contain errors. The words are the speakers'; listen to the recording on the talk's page before quoting it.

I am Eric Bigelow, and the title of this paper is Forking Paths in Neural Text Generation. First, I want to consider the problem of estimating uncertainty in text generation with large language models. Consider the following chain of thought prompt: Who is the current British head of state? Let's think step by step. We might expect an LLM to output a completion like this that ends in a final answer, in this case, King Charles.
With stochastic text generation, we might notice that when we sample different responses, we get different final answers sometimes. The first method from prior work to estimating uncertainty is to consider the token probability of the final answer. However, with chain of thought reasoning, this distribution will be largely deterministic given the preceding reasoning steps. The second method is to resample the full response including both the steps of reasoning as well as the final answer and aggregate these into a distribution over answers.
Our approach by contrast considers the uncertainty at each individual token during text generation. We consider one base path response, and we sample all possible alternative paths that could have happened for each different individual token during text generation was sampled differently, as well as the outcomes that these lead to. We propose a novel hypothesis that their individual forking tokens which if sampled differently will lead to dramatic differences in subsequent text generation.
Our method, called Forking Paths Analysis, gives us a novel view into the uncertainty dynamics in text generation. It consists of three stages. First, we systematically resample completions and extract outcomes. Given a single base path response and alternate tokens, the top n log probability tokens, we sample alternate path completions based on the base path up until that point and condition on each alternate token. And then we extract outcome representations, in our case, final answers, from these responses.
We aggregate these text completions into weighted outcome distributions next. To do so, we use two probabilities. First, the probability of the alternate token, W, and second, the probability of each sampled completion, here in green. The outcome representation is a vector, in our case a one-hot encoding. We aggregate a weighted sum of outcome representations into two different outcome distributions. The first is indexed by a single token index, T.
And the second is indexed by a token index T as well as an alternate token W. The first kind of outcome distribution is the main focus of this work. Next, we analyze these outcome distributions with statistical models. The first outcome distribution can be thought of as a multivariate time series since it's a sequence of categorical distributions where the x-axis is the token index T. We convert this multivariate time series into a univariate time series using a semantic drift transformation.
and analyze this using Bayesian change point detection to estimate the probability of a change point at each individual token index, as well as the probability for the estimated number of change points in a sequence. For our experiments, we use seven domains, six of these being common chain of thought reasoning tasks used to evaluate LLMs, and the seventh being an open-ended story generation task. Here is an example from Hotpot QA, a multi -hop question answering dataset.
We find dramatic uncertainty dynamics here, where first text generation follows a stable regime of uncertainty, with the most probable final answer being Robin Tunney, the correct answer, until the outcome distribution suddenly collapses after the single token. The outcome distribution collapses to a different final answer, Mia Sara. We also note that this is the first time this token is mentioned during the response.
Here is another example, a physics question from m l u, where we see a similar pattern of stable uncertainty until the outcome distribution suddenly collapses-again the first time the final answer is mentioned. Here is an example of mathematical reasoning from g s m a k where we see two forking tokens. However, these are at less uh a more surprising points-open parentheses for adding extraneous information:
Aggregating across tasks, we find that some tasks have more change points at the beginning of the task, such as last letter, and others such as MMLU and AQUA have more change points at the end. We analyze the other outcome distribution O, indexed by T and W, and can visualize it here. Here we can see that given alternate tokens, the outcome distribution can shift significantly from the base past outcome distribution.
We analyze this using survival analysis, which evaluates the probability that at each token index, the outcome distribution deviates significantly from the base pass distribution. And across many examples, we find relatively low survival rates by the end of text generation over a sequence. Considering all our tasks, we find many change points in five out of seven of our tasks, and across all tasks, relatively low survival rates by the end.
Taken together, these suggest that language models are often just one token away from saying something completely different. If you'd like to see more examples, please check out our interactive dashboard linked here and in the paper. Thank you.
