CoolFace
Datasetpublic

sxiong/TG_LLM_output

TG-LLM Output This dataset contains inference outputs from the two-stage TG-LLM framework on the TGQA test set. TG-LLM performs temporal reasoning in two steps: Story-to-Temporal-Graph Translation (Story2TG): converts a story into a temporal graph. Temporal-Graph Reasoning (TGR): reasons over the predicted temporal graph to answer temporal questions. The original TGQA dataset is available at sxiong/TGQA, and the source code is available in the TG-LLM repository.… See the full description on the dataset page: https://huggingface.co/datasets/sxiong/TG_LLM_output.

sourceHugging Facemitupdated 23d agoView on Hugging Face
1likes93downloads
Dataset Card

TG-LLM Output

This dataset contains inference outputs from the two-stage TG-LLM framework on the TGQA test set. TG-LLM performs temporal reasoning in two steps:

  1. 1.Story-to-Temporal-Graph Translation (Story2TG): converts a story into a temporal graph.
  2. 2.Temporal-Graph Reasoning (TGR): reasons over the predicted temporal graph to answer temporal questions.

The original TGQA dataset is available at `sxiong/TGQA`, and the source code is available in the `TG-LLM` repository.

Models

Both LoRA adapters use `meta-llama/Llama-2-13b-chat-hf` as the base model.

Dataset Configurations

ConfigurationSplitRowsDescription
TGQA_story_TG_transtest101Stories, reference temporal graphs, prompts, and predicted temporal graphs.
TGQA_TGRtest3,316Temporal questions and answers generated from the Story2TG predictions.

The TGR prompts use the predicted temporal graphs produced in the first stage. The meta.TG field retains the reference temporal graph from TGQA for analysis; it is not the graph included in the TGR prompt.

Inference Configuration

  • —Precision: BF16
  • —Prompt format: plain text
  • —In-context learning: disabled
  • —Decoding: deterministic greedy decoding (do_sample=False, num_beams=1)
  • —Story2TG maximum new tokens: 1,024
  • —TGR maximum new tokens: 512

No sample reached its maximum generation length.

Data Fields

TGQA_story_TG_trans

  • —id: Story identifier.
  • —story: Input story.
  • —TG: Reference temporal graph from TGQA.
  • —prompt: Full prompt provided to the Story2TG model.
  • —prediction: Temporal graph generated by the Story2TG model.

TGQA_TGR

  • —id: Question identifier.
  • —story: Source story.
  • —question: Temporal reasoning question.
  • —answer: List of reference answers.
  • —prompt: Full TGR prompt containing the predicted temporal graph.
  • —prediction: Generated reasoning trace and answer.
  • —correct: Whether the parsed prediction exactly matches a reference answer.
  • —meta: Additional reference data:
  • —TG: Reference temporal graph from TGQA.
  • —candidates: Candidate answers.
  • —external knowledge: Temporal relations and arithmetic supplied in the prompt.
  • —Q-Type: TGQA question-type index.

For correct, answers are compared case-insensitively after removing spaces. For question types 2 and 3, only the leading numeric value is compared, matching the TG-LLM evaluation protocol.

Results

All 3,316 TGR predictions were successfully parsed: Exact match (macro average) -- 77.5%.

Accuracy by Task

Q-TypeTaskCorrect / TotalExact Match
0Pairwise start-time ordering290 / 30395.7%
1Five-event chronological ordering830 / 99083.8%
2Event duration168 / 22176.0%
3Time between event starts238 / 29281.5%
4Event start time280 / 30392.4%
5Same start year289 / 30395.4%
6Event overlap / still happening147 / 21269.3%
7Immediate predecessor / successor210 / 50441.7%
8Event-duration comparison116 / 18861.7%

Loading the Data

After uploading this directory to a Hugging Face dataset repository, load either configuration with datasets:

python
from datasets import load_dataset

story_to_tg = load_dataset(
    "sxiong/TG_LLM_output",
    "TGQA_story_TG_trans",
    split="test",
)

tgr = load_dataset(
    "sxiong/TG_LLM_output",
    "TGQA_TGR",
    split="test",
)

Citation

bibtex
@inproceedings{xiong2024large,
  title={Large language models can learn temporal reasoning},
  author={Xiong, Siheng and Payani, Ali and Kompella, Ramana and Fekri, Faramarz},
  booktitle={Proceedings of the 62nd Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)},
  pages={10452--10470},
  year={2024}
}