MMProLong-Data-Public / code /docs /public_data_recipe.md
ZhaoweiWang's picture
Back up code/docs/public_data_recipe.md
ba88950 verified
|
Raw History Blame Contribute Delete
6.08 kB
# Public-document pilot: local and distributed evidence
This is a new public-document data construction run. It does not replace the
Seed-internal experiment corpus or establish reproduction of the paper's results.
The original synthesis scripts remain available unchanged.
## Why two multi-needle types
The historical `build_example_prompt` selects one continuous 8–15-page segment.
The generated evidence must therefore lie within at most 15 consecutive pages,
even after the QA is combined with the complete document for training. It does
not sample independently separated evidence from the full document. The initial
six-row public pilot's two multi-page examples each had a one-page evidence gap.
The new 100-row run contains:
- **36 single-needle** examples. One necessary evidence page; assigned positions
cycle through four quarters of the content-bearing part of each PDF.
- **18 local multi-needle** examples. Two or three necessary pages in an assigned
continuous 8–15-page window. Windows may occur throughout the document body.
- **18 distributed multi-needle** examples. Two to four necessary pages selected
from different document positions. Nine target a medium span and nine a far
span, measured over the complete final PDF context.
- **18 reasoning** examples. Numeric calculation/comparison/counting, with one
or two necessary evidence pages and a machine-checkable arithmetic record.
- **10 unanswerable** examples. Five missing-detail questions and five questions
with a required operand absent. Exact target answer: `Not answerable.`
These are **record quotas for a validation batch**, not token sampling weights.
Among answerable examples, the record proportions retain 4:4:2 for single
extraction, combined multi extraction, and reasoning.
## Measure actual evidence, not just the requested label
For a final context of N pages, the normalized span is
`(max(evidence_pages) - min(evidence_pages)) / (N - 1)`.
Near is at most 0.2; medium is greater than 0.2 and at most 0.5; far is greater
than 0.5. Local/distributed describes the sampling rule, so a local window can
still produce a medium normalized span in a shorter document. The actual span,
needle count, page positions, and estimated token positions are stored separately.
Page order is preserved. Reference pages remain in the final context, but are
excluded from the allowed answer-evidence region. Consequently the policy does
not claim that evidence is uniformly distributed over all final context tokens.
Every cited page must contribute a distinct necessary fact. Repeating one answer
in a caption, table and prose does not make it multi-needle. A separate verifier
checks for a complete answer elsewhere on a single page, and rejects such cases.
## Whole-context unanswerable checks
The generator and a separate verifier call receive **every final context page**.
The verifier must find no answer in text, tables, figures, captions or appendices,
and must check whether the missing value can be derived from other information.
An absent answer in an excerpt is not sufficient.
Unanswerable records use `answerable=false`, `evidence_pages=[]`, and a separate
`missing_information` explanation. `related_context_pages` are only inspection
anchors and are never presented as answer evidence. Verification records include
all checked page IDs and the SHA-256 of the exact PDF context. Truncation after
verification is prohibited; a context over the token budget must be rejected.
Full-context model verification is a quality filter, not a formal proof of
absence. A human-reviewed validation sample and benchmark decontamination are
still required before claiming release quality.
## Run the 100-row pilot
Install the synthesis requirements, then provide five eligible, versioned public
PDFs and matching metadata JSON files under `ROOT/sources/`. Metadata includes
`id`, `source`, `title`, `authors`, `source_url`, `pdf_url`, `license`,
`license_url`, `sha256`, and `page_count`. The current pilot accepts CC BY 4.0
documents, 32–50 pages, with at least 20 body pages and at least 60% body content.
Keep license records and attribution with the documents. Source acquisition and
license checking happen before running these commands.
Article-level CC BY is not blanket clearance for separately copyrighted figures.
The 2026-10-23 rights audit found explicit “Images © their respective authors,
reproduced for scholarly review” notices in `2609.29669v1`. Its 20 full-PDF pilot
examples are held out of public release pending figure clearance or source
replacement. The preparer now rejects PDFs containing that explicit notice;
this text check is not an exhaustive per-image rights audit. A clean replacement
document is needed before regenerating a five-document release candidate.
```bash
python data_synthesis_doc_vqa/public_vqa_pipeline.py prepare --root "$ROOT"
python data_synthesis_doc_vqa/public_vqa_pipeline.py generate \
--root "$ROOT" --env-file "$MODEL_ENV_FILE" --workers 2 --rounds 4
python data_synthesis_doc_vqa/export_public_vqa.py --root "$ROOT"
```
Credentials are loaded from the specified dotenv file and are never written to
output records. `VQA_API_*` variables are preferred; `JUDGE_API_*`/`OPENAI_API_*`
are supported for existing local configurations. The model is selectable through
`--model`; this run uses the existing `gpt-5.5-2026-04-24` deployment. No private
gateway address is embedded in the implementation.
Completed outputs and rejected candidates are saved separately. Generation is
resumable and avoids redoing accepted records. The exporter requires all 100
slots to pass both structural gates and whole-context model verification. It
uses the existing VeOmni/LLaVA formatting helpers, embeds all page image bytes,
and refuses to silently shorten a verified context.
Before a larger public release: add more document types/domains, check PDF hashes
and source URLs against evaluation manifests, audit near-duplicate questions,
review the positive and negative labels, and run a GPU data-loading smoke test.