| File Name | Description |
|---|---|
annotation_data_final_no_None.json | Human annotated data. |
annotation_data_final_sent_tokenized_gemini-2.0-flash.json | Gemini annotated data. |
cleaned.json | 5 manually cleaned document annotations. |
sentence_labeled_no_cleaning_drop_extrinsic_only.json | Development set; excludes extrinsic information error type. |
sentence_labeled_no_cleaning.json | Full development set. |
test_no_cleaning_no_drop.json | Full test set. |
test_no_cleaning_only_drop_extrinsic.json | Test set; excludes extrinsic information error types. |
unfaithful_w_fixed_gem_annot.json | Manually fixed unfaithful summary sentences for 17 docs (based on Gemini annotations). |
uniq_doc_topic_with_meta.json | Metadata containing unique documents and topics. |
This script trains a binary classifier (Faithful vs. Unfaithful) to evaluate the reliability of summarization models. It supports fine-tuning transformer models (e.g., RoBERTa, ModernBERT) using a weighted CrossEntropyLoss to handle class imbalance.
Trainer with Early Stopping and best model checkpointing based on Balanced Accuracy.train_classifier.py (RAW_TRAIN_PATH and CLEAN_VAL_PATH).python train_classifier.py
This script evaluates trained classification models (e.g., RoBERTa) on faithfulness datasets.
Use this when checking one specific model against one test file
python evaluate_classifier.py \
--model /path/to/model \
--data /path/to/data
python eval.py --batch
To modify the batch experiments, edit the BATCH_EXPERIMENTS list in evaluate_classifier.py:
BATCH_EXPERIMENTS = [
{
"model_path": "path/to/model_A",
"test_sets": [
("Description 1", "path/to/test_1.json"),
("Description 2", "path/to/test_2.json")
]
},
# ... Add more models
]
models.md contains link to the trained models and current evaluation results.
This file contains the evaluation pipeline for testing whether paraphrasing source documents (e.g., simplifying complex sentences) mitigates hallucination in Large Language Models (LLMs).
The script measures the Conditional Log-Likelihood of "Unfaithful" vs. "Fixed" summaries given the original source text versus a modified (paraphrased) source text.
For a given document and summary pair, we calculate the probability assigned by various LLMs (Vicuna, Llama-3, etc.) to specific target sentences:
$$\Delta \text{LogLikelihood} = \log P(\text{SummarySent} | (\text{Source}{\text{modified}} + \text{Prev SummarySents})) - \log P(\text{Summary} | (\text{Source}{\text{original}} + \text{Prev SummarySents}))$$
python mitigation.py \
--data path/to/data.json \
--out_dir ./results
This script processes the raw JSONL output files generated by the mitigation experiment pipeline and converts them into structured CSV reports for analysis.
The script tracks two primary values for each document/model pair:
Run the script by pointing to the log directory and providing the timestamp of the experiment run:
python analyze_results.py \
--base_dir /path/to/log/dir \
--timestamp "time_stamp"
This script executes an experiment to verify if modifying source documents (e.g., simplifying syntax, organizing discourse) can reduce hallucinations in abstractive summarization.
GeminiJudgeAttributor to label summary sentences as "yes" (faithful) or "no" (unfaithful) and identifies which source sentences are responsible ("attribution").SourceModifier uses GPT-4o to rewrite the specific implicated source sentences using a defined strategy (e.g., syntax_transform).Set API keys:
export OPENAI_API_KEY="sk-..."
export GEMINI_API_KEY="AIza..."
Adjust the model list and modification mathods in the if __name__ == "__main__": block.
Run:
python generation_exp.py
template_stream_*.jsonl: A detailed line-by-line log of every summary sentence generated, its judge label, and any modifications applied.aggregate_*.json: High-level statistics comparing the unfaithfulness rate before (baseline) and after mitigation.12 commits
Python
98.7%
Shell
1.3%
| File Name | Description |
|---|---|
annotation_data_final_no_None.json | Human annotated data. |
annotation_data_final_sent_tokenized_gemini-2.0-flash.json | Gemini annotated data. |
cleaned.json | 5 manually cleaned document annotations. |
sentence_labeled_no_cleaning_drop_extrinsic_only.json | Development set; excludes extrinsic information error type. |
sentence_labeled_no_cleaning.json | Full development set. |
test_no_cleaning_no_drop.json | Full test set. |
test_no_cleaning_only_drop_extrinsic.json | Test set; excludes extrinsic information error types. |
unfaithful_w_fixed_gem_annot.json | Manually fixed unfaithful summary sentences for 17 docs (based on Gemini annotations). |
uniq_doc_topic_with_meta.json | Metadata containing unique documents and topics. |
This script trains a binary classifier (Faithful vs. Unfaithful) to evaluate the reliability of summarization models. It supports fine-tuning transformer models (e.g., RoBERTa, ModernBERT) using a weighted CrossEntropyLoss to handle class imbalance.
Trainer with Early Stopping and best model checkpointing based on Balanced Accuracy.train_classifier.py (RAW_TRAIN_PATH and CLEAN_VAL_PATH).python train_classifier.py
This script evaluates trained classification models (e.g., RoBERTa) on faithfulness datasets.
Use this when checking one specific model against one test file
python evaluate_classifier.py \
--model /path/to/model \
--data /path/to/data
python eval.py --batch
To modify the batch experiments, edit the BATCH_EXPERIMENTS list in evaluate_classifier.py:
BATCH_EXPERIMENTS = [
{
"model_path": "path/to/model_A",
"test_sets": [
("Description 1", "path/to/test_1.json"),
("Description 2", "path/to/test_2.json")
]
},
# ... Add more models
]
models.md contains link to the trained models and current evaluation results.
This file contains the evaluation pipeline for testing whether paraphrasing source documents (e.g., simplifying complex sentences) mitigates hallucination in Large Language Models (LLMs).
The script measures the Conditional Log-Likelihood of "Unfaithful" vs. "Fixed" summaries given the original source text versus a modified (paraphrased) source text.
For a given document and summary pair, we calculate the probability assigned by various LLMs (Vicuna, Llama-3, etc.) to specific target sentences:
$$\Delta \text{LogLikelihood} = \log P(\text{SummarySent} | (\text{Source}{\text{modified}} + \text{Prev SummarySents})) - \log P(\text{Summary} | (\text{Source}{\text{original}} + \text{Prev SummarySents}))$$
python mitigation.py \
--data path/to/data.json \
--out_dir ./results
This script processes the raw JSONL output files generated by the mitigation experiment pipeline and converts them into structured CSV reports for analysis.
The script tracks two primary values for each document/model pair:
Run the script by pointing to the log directory and providing the timestamp of the experiment run:
python analyze_results.py \
--base_dir /path/to/log/dir \
--timestamp "time_stamp"
This script executes an experiment to verify if modifying source documents (e.g., simplifying syntax, organizing discourse) can reduce hallucinations in abstractive summarization.
GeminiJudgeAttributor to label summary sentences as "yes" (faithful) or "no" (unfaithful) and identifies which source sentences are responsible ("attribution").SourceModifier uses GPT-4o to rewrite the specific implicated source sentences using a defined strategy (e.g., syntax_transform).Set API keys:
export OPENAI_API_KEY="sk-..."
export GEMINI_API_KEY="AIza..."
Adjust the model list and modification mathods in the if __name__ == "__main__": block.
Run:
python generation_exp.py
template_stream_*.jsonl: A detailed line-by-line log of every summary sentence generated, its judge label, and any modifications applied.aggregate_*.json: High-level statistics comparing the unfaithfulness rate before (baseline) and after mitigation.12 commits
Python
98.7%
Shell
1.3%