Out-of-Domain Finetuning to Bootstrap Hallucination Detection
Статья описывает метод улучшения детекции галлюцинаций (фактических несоответствий) в текстовых резюме с помощью дофайнтюнинга на данных из другого домена. Автор использует модель BART, дофайнтюненную на MNLI, для классификации фактической согласованности резюме через задачу NLI (Natural Language Inference). Прямой файнтюнинг на бенчмарке FIB (новостные резюме) за 10 эпох дал слабые результаты — PR AUC всего 0.69. Однако предварительный файнтюнинг на данных USB (резюме из Википедии) в течение 3 эпох перед основным файнтюнингом на FIB повысил PR AUC до 0.85, что означает улучшение на 23%. При пороге 0.8 recall вырос с 0.02 до 0.50, а precision — с 0.67 до 0.91. Ключевой вывод: трансферное обучение при файнтюнинге на внедоменных данных может существенно улучшить результаты даже при несовершенных метках, снижая потребность в дорогостоящей разметке целевого домена.
Out-of-Domain Finetuning to Bootstrap Hallucination Detection
Внедоменный файнтюнинг для начальной настройки детекции галлюцинаций
[ llm eval machinelearning python ] · 12 мин. чтения
It’s easy to finetune models for our specific tasks; we just need a couple hundred or a few thousand samples. However, collecting these samples is costly and time-consuming. What if, we could bootstrap our tasks with out-of-domain data? We’ll explore this idea here.
Файнтюнить модели под конкретные задачи несложно — нужно лишь несколько сотен или тысяч примеров. Однако сбор этих примеров обходится дорого и занимает много времени. А что если можно начать работу с внедоменных данных? Именно эту идею мы здесь рассмотрим.
The task is to finetune a model to detect factual inconsistencies aka hallucinations. We’ll focus on news summaries in the Factual Inconsistency Benchmark (FIB). It is a challenging dataset—even after finetuning for 10 epochs on the training split, the model still does poorly on the validation split (middle in image below).
Задача — файнтюнить модель для обнаружения фактических несоответствий, то есть галлюцинаций. Мы сосредоточимся на новостных резюме из Factual Inconsistency Benchmark (FIB). Это сложный датасет — даже после файнтюнинга на обучающей выборке в течение 10 эпох модель всё ещё показывает плохие результаты на валидационной выборке (в центре на изображении ниже).
To examine how out-of-domain data helps, we re-instantiate our model and finetune on Wikipedia summaries for 3 epochs before finetuning for 10 epochs on FIB. This led to PR AUC of 0.85 (right below)—a 23% improvement over finetuning on FIB alone. Also, the probability distributions are better separated, making the model more suitable for production where we have to pick a threshold to classify a summary as inconsistent.
Чтобы проверить, как помогают внедоменные данные, мы переинициализируем модель и файнтюним её на резюме из Википедии в течение 3 эпох перед файнтюнингом на FIB в течение 10 эпох. Это привело к PR AUC 0.85 (справа ниже) — улучшение на 23% по сравнению с файнтюнингом только на FIB. Кроме того, распределения вероятностей лучше разделены, что делает модель более пригодной для продакшена, где необходимо выбрать порог для классификации резюме как несогласованного.
Evals on non-finetuned vs. task-specific finetuning vs. out-of-domain + task-specific finetuning
Оценки: без файнтюнинга vs. задачно-специфичный файнтюнинг vs. внедоменный + задачно-специфичный файнтюнинг
Okay, that was the high-level overview. Next, let’s dive into the details and visuals.
Итак, это был обзор верхнего уровня. Теперь давайте погрузимся в детали и визуализации.
Classifying factual inconsistencies via NLI
Классификация фактических несоответствий через NLI
We can detect factually inconsistent summaries via the natural language inference (NLI) task. The NLI task works like this: Given a premise sentence and a hypothesis sentence, the goal is to predict if the hypothesis is entailed by, neutral, or contradicts the premise.
Фактически несогласованные резюме можно обнаруживать с помощью задачи вывода на естественном языке (NLI). Задача NLI работает так: дана посылка и гипотеза, и нужно предсказать, следует ли гипотеза из посылки, нейтральна ли она или противоречит ей.
Entailment, neutral, and contradiction labels in NLI (source)
Метки «следствие», «нейтральность» и «противоречие» в NLI (источник)
We can apply NLI to abstractive summaries too. Here, the source document is the premise and the summary is the hypothesis. Thus, if the summary contradicts the source, that’s a factual inconsistency aka hallucination.
NLI можно применять и к абстрактивным резюме. В этом случае исходный документ выступает посылкой, а резюме — гипотезой. Таким образом, если резюме противоречит источнику, это фактическое несоответствие, то есть галлюцинация.
Entailment, neutral, and contradiction labels in abstractive summaries (source)
Метки «следствие», «нейтральность» и «противоречие» в абстрактивных резюме (источник)
For the model, we’ll use a variant of BART that has been finetuned on the MNLI dataset. By default, an NLI model outputs probabilities for entailment (label = 2), neutral (label = 1), and contradiction (label = 0). To get the probability of factual inconsistency, we’ll drop the neutral dimension, apply a softmax on the remaining two dimensions, and take the probability of contradiction. It’s really just a single line of code:
В качестве модели мы используем вариант BART, который был дофайнтюнен на датасете MNLI. По умолчанию модель NLI выдаёт вероятности для «следствия» (label = 2), «нейтральности» (label = 1) и «противоречия» (label = 0). Чтобы получить вероятность фактического несоответствия, мы отбрасываем нейтральную размерность, применяем softmax к двум оставшимся и берём вероятность противоречия. По сути это всего одна строка кода:
def get_prob_of_contradiction(logits: torch.Tensor) -> torch.Tensor:
"""
Returns probability of contradiction aka factual inconsistency.
Args:
logits (torch.Tensor): Tensor of shape (batch_size, 3). The second dimension
represents the probabilities of contradiction, neutral, and entailment.
Returns:
torch.Tensor: Tensor of shape (batch_size,) with probability of contradiction.
Note:
This function assumes the probability of contradiction is in index 0 of logits.
"""
# Drop neutral logit (index=1), softmax, and get prob of contradiction (index=0)
prob = F.softmax(logits[:, [0, 2]], dim=1)[:, 0]
return prob
def get_prob_of_contradiction(logits: torch.Tensor) -> torch.Tensor: """ Returns probability of contradiction aka factual inconsistency. Args: logits (torch.Tensor): Tensor of shape (batch_size, 3). The second dimension represents the probabilities of contradiction, neutral, and entailment. Returns: torch.Tensor: Tensor of shape (batch_size,) with probability of contradiction. Note: This function assumes the probability of contradiction is in index 0 of logits. """ # Drop neutral logit (index=1), softmax, and get prob of contradiction (index=0) prob = F.softmax(logits[:, [0, 2]], dim=1)[:, 0] return prob
Finetuning to classify factual inconsistencies in FIB
Файнтюнинг для классификации фактических несоответствий в FIB
The Factual Inconsistency Benchmark (FIB) is a dataset for evaluating whether language models can spot factual inconsistencies in summaries. It is based on news summaries from CNN/Daily Mail and XSUM, with 100 and 500 news articles from each respectively. Each news article comes with a pair of summaries where one is factually consistent with the source document while the other isn’t.
Factual Inconsistency Benchmark (FIB) — это датасет для оценки способности языковых моделей обнаруживать фактические несоответствия в резюме. Он основан на новостных резюме из CNN/Daily Mail и XSUM, содержащих 100 и 500 новостных статей соответственно. К каждой статье прилагается пара резюме: одно фактически согласовано с исходным документом, другое — нет.
Given a gold summary and a distractor, can we assign a higher score to the factually consistent summary vs. the factually inconsistent summary? (source)
Имея эталонное резюме и резюме-отвлекатель, можем ли мы присвоить более высокий балл фактически согласованному резюме по сравнению с несогласованным? (источник)
Four of the authors annotated the summaries, and each summary was annotated by two annotators. First, they annotated reference summaries as factually consistent or inconsistent. Then, they edited the factually inconsistent summaries to be factually consistent with an emphasis on making minimal edits. Most edits involved removing or changing keywords or phrases that were not found in the news article.
Четверо авторов разметили резюме, и каждое резюме было размечено двумя аннотаторами. Сначала они разметили эталонные резюме как фактически согласованные или несогласованные. Затем отредактировали фактически несогласованные резюме, сделав их согласованными, с акцентом на минимальные правки. Большинство правок заключались в удалении или замене ключевых слов или фраз, отсутствующих в новостной статье.
To prepare for finetuning and evaluation, we first excluded the CNN/Daily Mail documents and summaries—they were found to be low quality during visual inspection. Then, we balanced the dataset by keeping one consistent summary and one inconsistent summary for each news article. Finally, we split it into training and validation sets, where validation made up 20% of the data (i.e., 100 news articles). To prevent data leakage, the same news article doesn’t appear across training and validation splits.
Для подготовки к файнтюнингу и оценке мы сначала исключили документы и резюме из CNN/Daily Mail — при визуальном осмотре они оказались низкого качества. Затем мы сбалансировали датасет, оставив по одному согласованному и одному несогласованному резюме для каждой статьи. Наконец, мы разделили данные на обучающую и валидационную выборки, где валидация составила 20% данных (т.е. 100 новостных статей). Во избежание утечки данных одна и та же статья не попадает одновременно в обучающую и валидационную выборки.
Upon visual inspection, it seems challenging to distinguish between consistent vs. inconsistent summaries. The latter tends to contain words from or similar to the source document but phrased to be factually inconsistent. Here’s the first sample in the dataset:
При визуальном осмотре отличить согласованные резюме от несогласованных кажется непростой задачей. Последние, как правило, содержат слова из исходного документа или похожие на них, но сформулированные так, чтобы быть фактически несогласованными. Вот первый пример из датасета:
Source: Vehicles and pedestrians will now embark and disembark the Cowes ferry separately following Maritime and Coastguard Agency (MCA) guidance. Isle of Wight Council said its new procedures were in response to a resident’s complaint. Councillor Shirley Smart said it would “initially result in a slower service”. Originally passengers and vehicles boarded or disembarked the so-called “floating bridge” at the same time. Ms Smart, who is the executive member for economy and tourism, said the council already had measures in place to control how passengers and vehicles left or embarked the chain ferry “in a safe manner”. However, it was “responding” to the MCA’s recommendations “following this complaint”. She added: “This may initially result in a slower service while the measures are introduced and our customers get used to the changes.” The service has been in operation since 1859.
Inconsistent summary: A new service on the Isle of Wight’s chain ferry has been launched following a complaint from a resident.
Consistent summary: Passengers using a chain ferry have been warned crossing times will be longer because of new safety measures.
Источник: Vehicles and pedestrians will now embark and disembark the Cowes ferry separately following Maritime and Coastguard Agency (MCA) guidance. Isle of Wight Council said its new procedures were in response to a resident's complaint. Councillor Shirley Smart said it would "initially result in a slower service". Originally passengers and vehicles boarded or disembarked the so-called "floating bridge" at the same time. Ms Smart, who is the executive member for economy and tourism, said the council already had measures in place to control how passengers and vehicles left or embarked the chain ferry "in a safe manner". However, it was "responding" to the MCA's recommendations "following this complaint". She added: "This may initially result in a slower service while the measures are introduced and our customers get used to the changes." The service has been in operation since 1859. Несогласованное резюме: A new service on the Isle of Wight's chain ferry has been launched following a complaint from a resident. Согласованное резюме: Passengers using a chain ferry have been warned crossing times will be longer because of new safety measures.
Evaluating the non-finetuned model on FIB confirms our intuition: The model struggled and had low ROC AUC and PR AUC (below). Furthermore, probability distributions for consistent vs. inconsistent summaries weren’t well separated—this makes it unusable in production where we have to pick a threshold to classify outputs as inconsistent.
Оценка модели без файнтюнинга на FIB подтверждает нашу интуицию: модель справлялась плохо и показала низкие ROC AUC и PR AUC (ниже). Более того, распределения вероятностей для согласованных и несогласованных резюме не были хорошо разделены — это делает модель непригодной для продакшена, где необходимо выбрать порог для классификации выходных данных как несогласованных.
The non-finetuned model performs badly on FIB
Модель без файнтюнинга показывает плохие результаты на FIB
After finetuning for 10 epochs via QLoRA, ROC AUC and PR AUC improved slightly to 0.68 - 0.69 (below). Nonetheless, the separation of probabilities is still poor. Taking a threshold of 0.8, recall is a measly 0.02 while precision is 0.67.
После файнтюнинга в течение 10 эпох с помощью QLoRA ROC AUC и PR AUC немного улучшились до 0.68–0.69 (ниже). Тем не менее разделение вероятностей по-прежнему плохое. При пороге 0.8 recall составляет жалкие 0.02, а precision — 0.67.
Even after finetuning for 10 epochs, performance isn't much better
Даже после файнтюнинга в течение 10 эпох результаты не намного лучше
Pre-finetuning on USB to improve performance on FIB
Предварительный файнтюнинг на USB для улучшения результатов на FIB
It seems that finetuning solely on FIB for 10 epochs wasn’t enough. What if we pre-finetune on a different dataset before finetuning on FIB?
Похоже, файнтюнинга исключительно на FIB в течение 10 эпох было недостаточно. А что если предварительно файнтюнить модель на другом датасете перед файнтюнингом на FIB?
The Unified Summarization Benchmark (USB) is made up of eight summarization tasks including abstractive summarization, evidence extraction, and factuality classification. While FIB documents are based on news, USB documents are based on a different domain—Wikipedia. Labels for factual consistency were created based on edits to summary sentences; inconsistent and consistent labels were assigned to the before and after versions respectively. Here’s the first sample in the dataset:
Unified Summarization Benchmark (USB) состоит из восьми задач суммаризации, включая абстрактивную суммаризацию, извлечение доказательств и классификацию фактуальности. Если документы FIB основаны на новостях, то документы USB относятся к другому домену — Википедии. Метки фактической согласованности создавались на основе правок в предложениях резюме: версиям до и после правки присваивались метки «несогласованный» и «согласованный» соответственно. Вот первый пример из датасета:
Source: Wendy Jane Crewson was born in Hamilton, Ontario, the daughter of June Doreen (née Thomas) and Robert Binnie Crewson. Also in 2012, Crewson began playing Dr. Dana Kinny in the CTV medical drama “Saving Hope”, for which she received Canadian Screen Award for Best Supporting Actress in a Drama Program or Series in 2013.
Inconsistent (before): Wendy Jane Crewson (born May 9, 1956) is a Canadian actress and producer.
Consistent (after): Wendy Jane Crewson is a Canadian actress.
Источник: Wendy Jane Crewson was born in Hamilton, Ontario, the daughter of June Doreen (née Thomas) and Robert Binnie Crewson. Also in 2012, Crewson began playing Dr. Dana Kinny in the CTV medical drama "Saving Hope", for which she received Canadian Screen Award for Best Supporting Actress in a Drama Program or Series in 2013. Несогласованное (до правки): Wendy Jane Crewson (born May 9, 1956) is a Canadian actress and producer. Согласованное (после правки): Wendy Jane Crewson is a Canadian actress.
Nonetheless, the labeling methodology isn’t perfect. Summaries that were edited due to grammatical or formatting errors were also labeled as non-factual. For example, in the second sample, the only difference between the consistent and inconsistent summary is that the latter is missing the word “the”. IMHO, both summaries are factually consistent.
Тем не менее методология разметки не идеальна. Резюме, отредактированные из-за грамматических или форматных ошибок, тоже получили метку «нефактуальный». Например, во втором примере единственное отличие между согласованным и несогласованным резюме — отсутствие артикля «the» в последнем. На мой взгляд, оба резюме фактически согласованы.
Source: When she returned to Canada, Crewson landed a leading role in the television movie “War Brides” (1980) directed by Martin Lavut, for which she received her first ACTRA Award nomination. From 1980 to 1983, she starred in the CBC drama series, “Home Fires”, a family saga set in Toronto during World War II. In 1991, Crewson appeared in her first breakthrough role in the American drama film “The Doctor” starring William Hurt.
Inconsistent (before): She began her career appearing on Canadian television, before her breakthrough role in 1991 dramatic film “The Doctor”.
Consistent (after): She began her career appearing on Canadian television, before her breakthrough role in the 1991 dramatic film “The Doctor”.
Источник: When she returned to Canada, Crewson landed a leading role in the television movie "War Brides" (1980) directed by Martin Lavut, for which she received her first ACTRA Award nomination. From 1980 to 1983, she starred in the CBC drama series, "Home Fires", a family saga set in Toronto during World War II. In 1991, Crewson appeared in her first breakthrough role in the American drama film "The Doctor" starring William Hurt. Несогласованное (до правки): She began her career appearing on Canadian television, before her breakthrough role in 1991 dramatic film "The Doctor". Согласованное (после правки): She began her career appearing on Canadian television, before her breakthrough role in the 1991 dramatic film "The Doctor".
Cleaning the USB data is beyond the scope of this write-up so we’ll just use the data as is. (Surprisingly—or unsurprisingly—finetuning on the imperfect USB data was still helpful.) For the training and validation sets, we’ll adopt the split provided by the authors.
Очистка данных USB выходит за рамки этой статьи, поэтому мы используем данные как есть. (Удивительно — или неудивительно — файнтюнинг на несовершенных данных USB всё равно оказался полезным.) Для обучающей и валидационной выборок мы используем разбиение, предложенное авторами.
First, we re-instantiate the model before finetuning on the USB training split for 3 epochs with the same QLoRA parameters. Then, we evaluate on the FIB validation split.
Сначала мы переинициализируем модель, а затем файнтюним её на обучающей выборке USB в течение 3 эпох с теми же параметрами QLoRA. После этого оцениваем на валидационной выборке FIB.
Finetuning on USB data didn’t seem to help with the FIB validation split. (To be clear, we’ve not finetuned on the FIB data (yet) so the poor performance is expected.) ROC AUC and PR AUC barely improved (below), and the separation of probabilities appears just as bad. Taking the same threshold of 0.8, recall is 0.10 while precision is 0.59. Considering that the FIB data is balanced, precision of 0.59 is barely better than a coin toss.
Файнтюнинг на данных USB, похоже, не помог с валидационной выборкой FIB. (Уточним: мы (пока) не файнтюнили модель на данных FIB, поэтому плохие результаты ожидаемы.) ROC AUC и PR AUC едва улучшились (ниже), а разделение вероятностей выглядит столь же плохо. При том же пороге 0.8 recall составляет 0.10, а precision — 0.59. Учитывая, что данные FIB сбалансированы, precision 0.59 едва лучше подбрасывания монетки.
Finetuning on 3 epochs of USB didn't seem to help much with FIB...
Файнтюнинг на 3 эпохах USB, похоже, мало помог с FIB...
But what happens when we add 10 epochs of finetuning on FIB? Our model now achieves PR AUC of 0.85—this is a 23% improvement over finetuning on FIB alone (PR AUC = 0.69). More importantly, the probability distributions of consistent vs. inconsistent summaries are better separated (right below), making the model more suitable for production. Relative to finetuning solely on FIB, at the same threshold of 0.8, we’ve increased recall from 0.02 to 0.50 (25x) and precision from 0.67 to 0.91 (+35%).
Но что произойдёт, если добавить 10 эпох файнтюнинга на FIB? Наша модель теперь достигает PR AUC 0.85 — это улучшение на 23% по сравнению с файнтюнингом только на FIB (PR AUC = 0.69). Что ещё важнее, распределения вероятностей согласованных и несогласованных резюме лучше разделены (справа ниже), что делает модель более пригодной для продакшена. По сравнению с файнтюнингом исключительно на FIB, при том же пороге 0.8 мы увеличили recall с 0.02 до 0.50 (в 25 раз) и precision с 0.67 до 0.91 (+35%).
Or did it? Adding 10 epochs of FIB led to greatly improved performance
Или всё-таки помог? Добавление 10 эпох FIB привело к значительному улучшению результатов
Considering that evals for the USB-finetuned (PR AUC = 0.60) and non-finetuned (PR AUC = 0.56) models weren’t that different, this improvement is unexpected. It suggests that, though finetuning on USB didn’t directly improve performance on FIB, the model did learn something useful that enabled the same 10 epochs of FIB-finetuning to achieve far better results. This also means that it may be tricky to directly assess the impact of data blending.
Учитывая, что оценки для модели с файнтюнингом на USB (PR AUC = 0.60) и без файнтюнинга (PR AUC = 0.56) не сильно отличались, это улучшение неожиданно. Это говорит о том, что, хотя файнтюнинг на USB не улучшил результаты на FIB напрямую, модель всё же усвоила нечто полезное, что позволило тем же 10 эпохам файнтюнинга на FIB достичь значительно лучших результатов. Это также означает, что напрямую оценить эффект смешивания данных может быть непросто.
Takeaway: Pre-finetuning on Wikipedia summaries improved factual inconsistency classification in news summaries, even though the former is out-of-domain.
Ключевой вывод: Предварительный файнтюнинг на резюме из Википедии улучшил классификацию фактических несоответствий в новостных резюме, несмотря на то что первые являются внедоменными.
In other words, we bootstrapped on Wikipedia summaries to identify factually inconsistent news summaries. Thus, we may not need to collect as much finetuning data for our tasks if there are open-source, permissive-use datasets that are somewhat related. While this may be obvious for some, it bears repeating that transfer learning for language modeling can extend beyond pretraining to finetuning (also see InstructGPT and its predecessor).
Другими словами, мы начали с резюме из Википедии, чтобы выявлять фактически несогласованные новостные резюме. Таким образом, нам может не понадобиться собирать столько данных для файнтюнинга под наши задачи, если существуют открытые датасеты со свободной лицензией, хотя бы отчасти связанные с нашей задачей. Хотя для некоторых это может быть очевидно, стоит повторить: трансферное обучение в языковом моделировании может выходить за рамки предобучения и распространяться на файнтюнинг (см. также InstructGPT и его предшественника).
(Also, it’ll likely work just as well if we blend both datasets and finetune via a single stage instead of finetuning in multiple stages on each dataset separately. That said, doing it in stages helped with understanding and visualizing the impact of each dataset.)
(Кроме того, скорее всего, аналогичный результат будет достигнут, если объединить оба датасета и файнтюнить за один этап, вместо поэтапного файнтюнинга на каждом датасете отдельно. Тем не менее поэтапный подход помог лучше понять и визуализировать влияние каждого датасета.)
• • •
• • •
I hope you found this as exciting to read as it was for me to run these experiments. The code is available here. What interesting findings and tricks have you come across while finetuning your own models? Also, what other approaches work well for factual inconsistency detection? Please DM me or leave a comment below!
Надеюсь, вам было так же интересно читать, как мне — проводить эти эксперименты. Код доступен здесь. Какие интересные находки и приёмы вы встречали при файнтюнинге собственных моделей? А какие ещё подходы хорошо работают для обнаружения фактических несоответствий? Пишите мне в личные сообщения или оставьте комментарий ниже!
References
Ссылки
Tam, Derek, et al. «Evaluating the factual consistency of large language models through summarization.» arXiv preprint arXiv:2211.08412 (2022). Krishna, Kundan, et al. «USB: A Unified Summarization Benchmark Across Tasks and Domains.» arXiv preprint arXiv:2305.14296 (2023). Lewis, Mike, et al. «Bart: Denoising sequence-to-sequence pre-training for natural language generation, translation, and comprehension.» arXiv preprint arXiv:1910.13461 (2019). Williams, Adina, Nikita Nangia, and Samuel R. Bowman. «A broad-coverage challenge corpus for sentence understanding through inference.» arXiv preprint arXiv:1704.05426 (2017). Nallapati, Ramesh, et al. «Abstractive text summarization using sequence-to-sequence rnns and beyond.» arXiv preprint arXiv:1602.06023 (2016). Narayan, Shashi, Shay B. Cohen, and Mirella Lapata. «Don't give me the details, just the summary! topic-aware convolutional neural networks for extreme summarization.» arXiv preprint arXiv:1808.08745 (2018). Dettmers, Tim, et al. «Qlora: Efficient finetuning of quantized llms.» arXiv preprint arXiv:2305.14314 (2023). Ouyang, Long, et al. «Training language models to follow instructions with human feedback.» Advances in Neural Information Processing Systems 35 (2022): 27730-27744. Stiennon, Nisan, et al. «Learning to summarize with human feedback.» Advances in Neural Information Processing Systems 33 (2020): 3008-3021.
Appendix
Приложение
You may be wondering how the model performed on USB. I excluded it from the main write-up so as not to distract from the FIB dataset—there were already so many graphs!
Вам, возможно, интересно, как модель показала себя на USB. Я не включил это в основной текст, чтобы не отвлекать от датасета FIB — графиков и так было много!
Performance of non-finetuned model on USB: The non-finetuned model struggled with the USB validation split and was barely able to distinguish between factually consistent vs. factually inconsistent summaries. The bulk of the probability density for both labels is at 0.0. This may be due to the labeling methodology where some grammatical or formatting errors were incorrectly labeled as factually inconsistent. See the second sample here.
Результаты модели без файнтюнинга на USB: Модель без файнтюнинга плохо справилась с валидационной выборкой USB и едва могла отличить фактически согласованные резюме от несогласованных. Основная масса плотности вероятности для обоих меток сосредоточена около 0.0. Это может быть связано с методологией разметки, при которой некоторые грамматические или форматные ошибки были ошибочно размечены как фактически несогласованные. См. второй пример здесь.
Similarly, the non-finetuned model performs poorly on USB
Аналогично, модель без файнтюнинга показывает плохие результаты на USB
Performance of finetuned model on USB: After three epochs, PR AUC increased from 0.62 to 0.92. Also, the separation of distributions is closer to what we’d like to see in production. Nonetheless, given the concerns with the labels, it’s hard to say if it’s learned to classify factual inconsistencies or other errors such as grammar and formatting.
Результаты модели после файнтюнинга на USB: После трёх эпох PR AUC вырос с 0.62 до 0.92. Разделение распределений также ближе к тому, что мы хотели бы видеть в продакшене. Тем не менее, учитывая вопросы к качеству меток, трудно сказать, научилась ли модель классифицировать фактические несоответствия или другие ошибки — грамматические и форматные.
But after 3 epochs it does much better
Но после 3 эпох модель справляется значительно лучше
Thanks to Shreya Shankar for reading drafts of this—the highlights in the sample summaries were her brilliant idea.
Благодарности: спасибо Shreya Shankar за рецензирование черновиков — выделение в примерах резюме было её блестящей идеей.
If you found this useful, please cite this write-up as:
Если это было полезно, пожалуйста, цитируйте эту статью следующим образом:
Yan, Ziyou. (Nov 2023). Out-of-Domain Finetuning to Bootstrap Hallucination Detection. eugeneyan.com. https://eugeneyan.com/writing/finetuning/.
Yan, Ziyou. (Nov 2023). Out-of-Domain Finetuning to Bootstrap Hallucination Detection. eugeneyan.com. https://eugeneyan.com/writing/finetuning/.
or
или
@article{yan2023finetune,
title = {Out-of-Domain Finetuning to Bootstrap Hallucination Detection},
author = {Yan, Ziyou},
journal = {eugeneyan.com},
year = {2023},
month = {Nov},
url = {https://eugeneyan.com/writing/finetuning/}
}
@article{yan2023finetune, title = {Out-of-Domain Finetuning to Bootstrap Hallucination Detection}, author = {Yan, Ziyou}, journal = {eugeneyan.com}, year = {2023}, month = {Nov}, url = {https://eugeneyan.com/writing/finetuning/} }
Join 11,800+ readers getting updates on machine learning, RecSys, LLMs, and engineering.
Присоединяйтесь к 11 800+ читателям, получающим обновления о машинном обучении, RecSys, LLM и инженерии.