File size: 9,281 Bytes
c550325 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | ---
license: cc-by-nc-sa-4.0
language:
- en
task_categories:
- text-retrieval
- question-answering
pretty_name: ChapterEnd
size_categories:
- 1K<n<10K
tags:
- retrieval
- rag
- benchmark
- evaluation
- textbooks
- openstax
- synthetic-vs-human
configs:
- config_name: human
default: true
data_files:
- split: test
path: human.jsonl
- config_name: generated
data_files:
- split: test
path: generated.jsonl
- config_name: corpus
data_files:
- split: corpus
path: corpus.jsonl
---
# ChapterEnd
Real end-of-chapter questions from six open textbooks, side by side with LLM-written questions about the same sections.
I built it to answer one question: do retrieval scores measured on generated questions hold up on questions that people wrote? In my tests they don't. The same BM25 gets 91.7% Recall@1 on the generated questions here and 54.6% on the human ones.
## Why this exists
I was reproducing [STAIR](https://arxiv.org/abs/2609.03874), a paper from IBM Research that finds the right section of a book by reading its table of contents. Its benchmark, [SearchTome](https://huggingface.co/datasets/meghanadh/SearchTome), is made of questions written by an LLM, which is how most document benchmarks are built now. I wanted to see what happens with questions written by humans and couldn't find a test set for it.
OpenStax textbooks turned out to be a good source. Every chapter ends with review questions written by the book's authors, grouped by the section they belong to, so the correct answer comes with the question.
## What the two kinds look like
Three sections, with one question of each kind:
| Section | Written by the textbook authors | Written by an LLM |
|---|---|---|
| Sleep and Why We Sleep | How could researchers determine if given areas of the brain are involved in the regulation of sleep? | What does comparative research indicate about the relationship between predatory risk and the amount of deep sleep in different species? |
| Overview of Photosynthesis | What two products result from photosynthesis? | What process provides the majority of energy for living organisms on Earth? |
| How To Organize Economies | What are the three ways that societies can organize themselves economically? | How does the scarcity of resources affect the media's decision to send reporters to cover an event? |
The LLM was shown one paragraph at a time, so its questions follow that paragraph closely. The authors ask about the section as a whole, often in words the text doesn't use.
## The numbers
| | Human | Generated |
|---|---|---|
| Questions | 3,568 | 2,604 |
| Sections they point to | 492 (shared) | 492 (shared) |
| BM25 Recall@1 | 54.6% | 91.7% |
| BM25 Recall@5 | 82.7% | 98.6% |
## Load it
```python
from datasets import load_dataset
human = load_dataset("Samurai007AK/ChapterEnd", "human", split="test")
generated = load_dataset("Samurai007AK/ChapterEnd", "generated", split="test")
corpus = load_dataset("Samurai007AK/ChapterEnd", "corpus", split="corpus")
```
## The task
You get a question and the book it comes from. Rank that book's sections so the one that answers the question is first. A section is an OpenStax lesson module, for example "2.1 Describe the Income Statement, Statement of Owner's Equity, Balance Sheet, and Statement of Cash Flows". Books have between 32 and 142 sections, so guessing at random gets 1 to 3% Recall@1.
The books are different from SearchTome's, so scores here can't be compared with scores there.
## What's inside
| File | Rows | |
|---|---|---|
| `corpus.jsonl` | 492 | one section per row |
| `human.jsonl` | 3,568 | questions written by the textbook authors |
| `generated.jsonl` | 2,604 | questions written by Mistral-7B-Instruct-v0.2 |
| `score.py` | | Recall@1 and Recall@5 for a run file |
| `bm25_baseline.py` | | the BM25 baseline, also a template for a run file |
**corpus.jsonl**: `module_id` (the OpenStax page id), `book`, `path` (chapter and section title) and `paragraphs` (the section text as a list).
**human.jsonl**: `qid`, `book`, `question` (as printed), `question_no_lo` and `lo_tagged` (explained below), `page_type` (which end-of-chapter page it came from, such as "Review Questions") and `gold` (the `module_id` of the correct section).
**generated.jsonl**: `qid`, `book`, `question`, `gold`, and `gold_paragraph` (which paragraph of that section the question was written from).
| Book | Sections | Human | Generated |
|---|---|---|---|
| Principles of Economics 3e | 142 | 1,060 | 356 |
| Psychology 2e | 88 | 571 | 404 |
| Principles of Accounting, Volume 1 | 84 | 777 | 417 |
| Concepts of Biology | 82 | 351 | 517 |
| Principles of Accounting, Volume 2 | 64 | 665 | 440 |
| Business Law I Essentials 2e | 32 | 144 | 470 |
## Scoring your own method
Write a JSONL file with one line per question, best section first. Only rank sections from the question's own book.
```
{"qid": "h0000", "ranking": ["046014ef-296a-4ef2-ae9d-8e58aec02bf3", "..."]}
```
```
python score.py human.jsonl my_run.jsonl
python score.py generated.jsonl my_run.jsonl
```
To reproduce the BM25 numbers, run `pip install rank_bm25 numpy` and then `python bm25_baseline.py`.
## Two things that fooled me
My first results on the human questions were wrong twice, for reasons worth knowing if you build something similar.
The first time, every method scored far lower than made sense. The end-of-chapter pages themselves ("Review Questions", "Key Terms", "Summary") were in my corpus, and they contain the questions word for word, so every retriever found the page that quotes the question. BM25 did this for 442 of 450 questions I sampled. The corpus here contains lesson sections only.
The second time, one method looked suspiciously good on accounting. 1,441 accounting questions start with a learning-objective tag like "LO 2.1", and that number is the number of the correct section 99.3% of the time. A model that reads the table of contents can match the digits and skip the question. `question_no_lo` has the tag removed and `lo_tagged` marks those questions, and `score.py` reports tagged and untagged questions separately.
## Baselines
Recall@1 on the human questions. BM25 and the dense retriever score paragraphs, and a section gets the score of its best paragraph. The re-rankers re-order the retrieved candidates.
| Method | All | LO-tagged | Untagged |
|---|---|---|---|
| Dense retrieval, bge-base-en-v1.5 | 62.2 | 52.2 | 69.0 |
| bge-reranker-v2-m3, zero-shot | 58.2 | 44.9 | 67.2 |
| BM25 | 54.6 | 45.6 | 60.7 |
| bge-reranker-base, zero-shot | 53.0 | 40.6 | 61.4 |
| bge-reranker-base, fine-tuned on generated questions | 44.3 | 25.8 | 56.8 |
The last row surprised me most. Fine-tuning the re-ranker on generated questions improved it on generated questions and made it worse on human ones, from 53.0 to 44.3.
## How it was built
Text and human questions come from the OpenStax archive API. On each end-of-chapter page the questions are grouped by lesson section, in order, so a question's correct section is the matching section of its chapter. Where the number of groups didn't match the number of sections I skipped the page (149 of 450). I dropped questions shorter than 25 characters and exact duplicates within a book.
For the generated set, Mistral-7B-Instruct-v0.2 wrote three questions per paragraph for a random sample of paragraphs from these books. The correct section is the one containing the paragraph. This file is the held-out test part of that set.
## What it can't tell you
- It covers six books in English. I tried twelve more OpenStax books and left them out because their end-of-chapter pages didn't line up with their sections.
- The correct section is the one the book files the question under. Sometimes another section answers it too, so Recall@1 is a little harsh on every method.
- Some human questions aren't search queries. A few point at a figure or table and some ask for an opinion. I kept them as printed.
- The generated questions come from one model and one prompt. Another question writer may give a smaller or larger gap.
## License and credit
All text and questions come from [OpenStax](https://openstax.org) textbooks (Rice University), licensed [CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/). This dataset carries the same license: credit OpenStax, no commercial use, share changes under the same terms. The two scripts are MIT. OpenStax did not create or endorse this dataset.
Books: [Principles of Accounting, Volume 1](https://openstax.org/details/books/principles-financial-accounting) · [Volume 2](https://openstax.org/details/books/principles-managerial-accounting) · [Business Law I Essentials 2e](https://openstax.org/details/books/business-law-i-essentials-2e) · [Concepts of Biology](https://openstax.org/details/books/concepts-biology) · [Principles of Economics 3e](https://openstax.org/details/books/principles-economics-3e) · [Psychology 2e](https://openstax.org/details/books/psychology-2e)
## Citation
```bibtex
@misc{konar2026chapterend,
author = {Arijit Konar},
title = {ChapterEnd: human-written textbook questions for section retrieval},
year = {2026},
url = {https://huggingface.co/datasets/Samurai007AK/ChapterEnd}
}
```
|