bactrainus-hotpotqa / README.md
Iman998's picture
Pin the immutable release revision in the dataset card
f5a70de verified
|
Raw
History Blame Contribute Delete
14 kB
---
language:
- en
license: cc-by-sa-4.0
pretty_name: Bactrainus HotpotQA Training Suite
task_categories:
- question-answering
- text-generation
tags:
- multi-hop-question-answering
- hotpotqa
- evidence-selection
- question-decomposition
- chain-of-thought
- supervised-fine-tuning
- bactrainus
size_categories:
- 100K<n<1M
arxiv: "2501.06286"
configs:
- config_name: structured
data_files:
- split: train
path: data/structured/train-*.parquet
- config_name: reader-sft
data_files:
- split: train
path: data/reader-sft/train-*.parquet
- config_name: cot-reader-sft
data_files:
- split: train
path: data/cot-reader-sft/train-*.parquet
- config_name: paragraph-selector-sft
data_files:
- split: train
path: data/paragraph-selector-sft/train-*.parquet
- config_name: question-decomposer-sft
data_files:
- split: train
path: data/question-decomposer-sft/train-*.parquet
- config_name: sentence-selector-sft
data_files:
- split: train
path: data/sentence-selector-sft/train-*.parquet
- config_name: decomposed-sentence-selector-sft
data_files:
- split: train
path: data/decomposed-sentence-selector-sft/train-*.parquet
- config_name: joint-selector-reader-sft
data_files:
- split: train
path: data/joint-selector-reader-sft/train-*.parquet
---
<div style="font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; border: 1px solid #cbd5e1; border-radius: 16px; overflow: hidden; background: #ffffff; margin-bottom: 28px;">
<div style="background: linear-gradient(135deg, #1f4e79 0%, #12263a 100%); padding: 26px; color: white;">
<div style="display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;">
<h1 style="margin: 0; font-size: 28px; font-weight: 800; color: white; border: none;">Bactrainus HotpotQA Training Suite</h1>
<span style="background: #0f766e; color: white; font-size: 11px; font-weight: 700; padding: 5px 11px; border-radius: 20px; letter-spacing: 0.5px;">COMPLETE RELEASE</span>
</div>
<p style="margin: 9px 0 0 0; font-size: 15px; color: #dbeafe; font-weight: 500;">One canonical HotpotQA source, eight clean and ID-aligned training views.</p>
</div>
<div style="display: flex; gap: 8px; flex-wrap: wrap; padding: 13px 24px; background: #f8fafc; border-bottom: 1px solid #e2e8f0;">
<span style="background: #dbeafe; color: #1e40af; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid #bfdbfe;">90,447 SOURCE IDs</span>
<span style="background: #ccfbf1; color: #115e59; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid #99f6e4;">8 CONFIGURATIONS</span>
<span style="background: #fef3c7; color: #92400e; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid #fde68a;">SFT READY</span>
<span style="background: #ede9fe; color: #5b21b6; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid #ddd6fe;">ID-ALIGNED</span>
<span style="background: #dcfce7; color: #166534; font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 20px; border: 1px solid #bbf7d0;">CC BY-SA 4.0</span>
</div>
<div style="padding: 22px 24px; color: #334155; line-height: 1.65; font-size: 14px;">
<p style="margin: 0;">The Bactrainus training suite turns the complete <strong>90,447-example</strong> HotpotQA <code>distractor/train</code> split into a canonical structured dataset and seven ready-to-train chat-formatted SFT configurations. Every row keeps the official HotpotQA identifier as <code>source_id</code>, so the same example can be followed across paragraph selection, decomposition, sentence selection, evidence-grounded reasoning, and answer generation without relying on row order.</p>
<div style="display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 18px;">
<div style="border: 1px solid #bfdbfe; border-radius: 9px; background: #eff6ff; padding: 13px;">
<strong style="display: block; color: #1f4e79; margin-bottom: 4px;">Traceable provenance</strong>
<span style="font-size: 13px;">Pinned upstream revision, machine-readable source manifest, and reviewed annotation patches.</span>
</div>
<div style="border: 1px solid #99f6e4; border-radius: 9px; background: #f0fdfa; padding: 13px;">
<strong style="display: block; color: #115e59; margin-bottom: 4px;">Complete modular coverage</strong>
<span style="font-size: 13px;">Reader, CoT, paragraph selector, decomposer, sentence selector, and joint SFT data.</span>
</div>
<div style="border: 1px solid #fde68a; border-radius: 9px; background: #fffbeb; padding: 13px;">
<strong style="display: block; color: #92400e; margin-bottom: 4px;">Strict integrity checks</strong>
<span style="font-size: 13px;">Schema, evidence bounds, task labels, row counts, ID equality, and 80 shard checksums.</span>
</div>
</div>
</div>
</div>
![Bactrainus modular architecture](architecture.svg)
## At a glance
| Property | Value |
|---|---|
| Upstream dataset | [`hotpotqa/hotpot_qa`](https://huggingface.co/datasets/hotpotqa/hotpot_qa) |
| Upstream revision | `1908d6afbbead072334abe2965f91bd2709910ab` |
| Upstream configuration | `distractor` |
| Published split | `train` |
| Source examples | 90,447 |
| Candidate paragraphs | 2-10 as supplied upstream; 89,609 examples contain 10 |
| Dataset configurations | 8 |
| Identity key | `source_id` |
| Storage | Sharded Parquet with Zstandard compression |
| License | CC BY-SA 4.0 |
## Load the data
```python
from datasets import load_dataset
dataset = load_dataset(
"bactrianus/bactrainus-hotpotqa",
"cot-reader-sft",
split="train",
)
print(dataset.num_rows) # 90447
print(dataset[0]["source_id"])
print(dataset[0]["messages"])
```
For a reproducible experiment, pin the dataset commit:
```python
dataset = load_dataset(
"bactrianus/bactrainus-hotpotqa",
"structured",
split="train",
revision="7f3a1d4d21f22aad7262d8ffd6520f31186b284d",
)
```
## Configurations
Each configuration contains exactly 90,447 unique `source_id` values.
| Configuration | What the model sees | Training target |
|---|---|---|
| `structured` | Canonical question and the complete candidate set | Answer, paragraph titles, and supporting facts as typed fields |
| `reader-sft` | Question and gold supporting sentences | Final short answer |
| `cot-reader-sft` | Question and gold supporting sentences | Ordered evidence trace followed by the answer |
| `paragraph-selector-sft` | Question and the complete candidate set | Minimal supporting paragraph titles |
| `question-decomposer-sft` | Question and selected supporting paragraphs | Ordered, paragraph-grounded sub-questions |
| `sentence-selector-sft` | Question and selected supporting paragraphs | Supporting title/index pairs |
| `decomposed-sentence-selector-sft` | Question, sub-questions, and selected paragraphs | Supporting title/index pairs |
| `joint-selector-reader-sft` | Question and the complete candidate set | Supporting title/index pairs and final answer |
The seven SFT views are deterministic transformations of `structured`. The CoT
view is a traceable **evidence trace**: each step copies an annotated supporting
sentence and records its exact title and zero-based sentence index. The
decomposition view is generated from the
paragraphs available after paragraph selection and is therefore complete,
stable, and reproducible.
## Record formats
### Canonical `structured` record
```json
{
"source_id": "official-hotpotqa-id",
"question": "...",
"answer": "...",
"question_type": "bridge",
"difficulty": "hard",
"candidate_paragraphs": [
{"title": "...", "sentences": ["...", "..."]}
],
"supporting_facts": [
{"title": "...", "sentence_index": 1}
],
"gold_paragraph_titles": ["..."]
}
```
The candidate paragraphs preserve upstream count and order. Every supporting title
must resolve to one of those paragraphs and every sentence index is checked
against the corresponding sentence list.
### SFT record
```json
{
"source_id": "official-hotpotqa-id",
"task": "cot_reader",
"messages": [
{"role": "system", "content": "..."},
{"role": "user", "content": "..."},
{"role": "assistant", "content": "...training target..."}
]
}
```
The data stores framework-neutral chat turns. Apply the native chat template of
the chosen base model during tokenization; no tokenizer-specific control tokens
are embedded in the Parquet files.
### CoT target shape
```text
rationale:
1. [Paragraph title, sentence 0] Exact annotated evidence sentence.
2. [Second title, sentence 2] Exact annotated evidence sentence.
answer: ***FINAL ANSWER***
```
### Decomposition target shape
```text
sub-questions:
1. What information in "First paragraph" is needed to answer the original question?
2. How does the relevant information in "Second paragraph" combine with the previous evidence to determine the answer?
```
## How the suite is built
The release builder downloads the immutable upstream revision by default,
normalizes the Hugging Face feature layout, constructs every view from the same
typed record, writes Parquet shards in a private staging directory, and installs
them only after strict validation succeeds.
```bash
git clone https://github.com/Iman998/bactrainus.git
cd bactrainus
python -m pip install -e ".[data]"
# From the dataset-package directory:
python scripts/build_release.py --root .
python scripts/validate_release.py --root .
```
A complete official JSON or JSONL export can also be used:
```bash
python scripts/build_release.py hotpot_train_v1.1.json --root .
```
`SOURCE_MANIFEST.json` records the upstream repository, immutable revision,
configuration, split, row count, identity key, and published configurations.
`CHECKSUMS.sha256` records every Parquet shard digest.
The pinned upstream split contains 22 supporting-fact entries whose sentence
indices are outside their annotated paragraphs. `SOURCE_PATCHES.json` records
each affected `source_id`, original index, action, and replacement when needed.
This reviewed repair covers 0.010% of supporting-fact entries, retains all
90,447 questions, and is applied before any SFT view is constructed.
## Integrity guarantees
The validator enforces:
- exactly 90,447 rows and 90,447 unique IDs in every configuration;
- identical `source_id` sets across all eight configurations;
- the exact upstream two-to-ten paragraph distribution, including 89,609 ten-paragraph records;
- valid evidence titles and zero-based sentence bounds;
- exact task identifiers and ordered `system` / `user` / `assistant` messages;
- the documented 17,972 easy, 56,814 medium, and 15,661 hard examples; and
- SHA-256 coverage for every published Parquet shard.
No development examples, model predictions, score tables, notebooks,
credentials, or checkpoints are bundled with the training suite.
## Recommended use
Use `structured` when designing a new task representation or auditing evidence.
Use an SFT configuration when training the corresponding modular component.
The IDs make it straightforward to combine configurations without fuzzy joins:
```python
reader = load_dataset(
"bactrianus/bactrainus-hotpotqa", "reader-sft", split="train"
)
decomposer = load_dataset(
"bactrianus/bactrainus-hotpotqa", "question-decomposer-sft", split="train"
)
assert set(reader["source_id"]) == set(decomposer["source_id"])
```
This repository is training data, not an independent held-out benchmark. Follow
the official HotpotQA protocol for benchmark reporting and disclose preprocessing,
prompt, retrieval, and answer-normalization choices.
## Limitations
- The suite inherits factual, coverage, annotation, and social biases from
Wikipedia and HotpotQA.
- The distractor setting supplies a bounded candidate set and does not measure
open-corpus retrieval.
- Supporting facts are dataset annotations and may not exhaust every relevant
sentence.
- Gold-grounded CoT and decomposition targets favor traceability and
reproducibility over stylistic diversity.
- Prompt wording is one clean task formulation and may need adaptation for a
different model family.
## License and attribution
This dataset is released under
[CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/), consistent with
the upstream HotpotQA license. Redistributions and adaptations must preserve
attribution and use a compatible ShareAlike license. See
[`ATTRIBUTION.md`](ATTRIBUTION.md) for the complete attribution statement.
## Citation
If you use this training suite, cite both Bactrainus and HotpotQA:
```bibtex
@article{barati2025bactrainus,
title = {Bactrainus: Optimizing Large Language Models for Multi-hop Complex Question Answering Tasks},
author = {Barati, Iman and Ghafouri, Arash and Minaei-Bidgoli, Behrouz},
journal = {arXiv preprint arXiv:2501.06286},
year = {2025},
url = {https://arxiv.org/abs/2501.06286}
}
@inproceedings{yang2018hotpotqa,
title = {{HotpotQA}: A Dataset for Diverse, Explainable Multi-hop Question Answering},
author = {Yang, Zhilin and Qi, Peng and Zhang, Saizheng and Bengio, Yoshua and Cohen, William W. and Salakhutdinov, Ruslan and Manning, Christopher D.},
booktitle = {Proceedings of the 2018 Conference on Empirical Methods in Natural Language Processing},
year = {2018},
pages = {2369--2380},
doi = {10.18653/v1/D18-1259}
}
```
## Links
- Models: <https://huggingface.co/bactrianus>
- Clean code: <https://github.com/Iman998/bactrainus>
- Article archive: <https://arxiv.org/abs/2501.06286>
For the full method, experiments, and interpretation, read the
[Bactrainus article on arXiv](https://arxiv.org/abs/2501.06286).