PaperFlow verbatim-quote validation rejects faithful quotes due to PDF extraction artifacts (whitespace, ligatures, hyphenation, page numbers, chunk boundaries)
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia in quantmind/flows/_paper_summary.py, in _validate_research_draft, e traccia il modo in cui PaperFlow.build() fornisce chunks e provenienza. Riproduci il problema con arXiv 1706.03762v7, quindi copri gli artefatti di estrazione elencati e i casi di confine tra chunks, mantenendo il rifiuto delle citazioni fabbricate. Il lavoro è completato quando le citazioni fedeli passano, le citazioni fabbricate continuano a essere rifiutate e l’esecuzione end-to-end di PaperFlow termina.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Summary
_validate_research_draft in quantmind/flows/_paper_summary.py requires a research finding's quote to be an exact substring of the cited chunk's text (finding.quote not in chunk.text). With PDF-sourced papers, pymupdf's extracted text contains layout artifacts inside sentences, so a model that quotes the words faithfully — but normalizes layout — fails the check, and PaperFlow.build() raises ValueError: research finding quote is not present in its chunk.
We hit this repeatedly running PaperFlow on the repo's own example paper (arXiv 1706.03762v7) with a non-OpenAI model (kimi-k3 via the litellm path), at temperature 0 and 1. Every rejected quote we inspected was word-for-word present in the paper; none was fabricated.
Artifact classes observed (all real cases from 1706.03762v7)
- Line breaks / irregular indentation inside sentences — extracted text:
"permission to\nreproduce the tables and figures in this paper solely for use in journalistic or\n scholarly works."; the model quotes the sentence with single spaces. - Ligature glyphs — pymupdf emits
ff/fi(e.g.effective); models writeeffective. NFKC normalization folds these. - End-of-line hyphenation —
"English-\nto-German"(hyphen must be kept when joining) vs. cases where the hyphen should be dropped. Neither plain whitespace collapsing nor unconditional dehyphenation handles both. - Page numbers interleaved mid-sentence at page breaks —
"...faster than recurrent layers when the sequence\n6\n\nlength n is smaller than..."(the6is the page number). A faithful quote naturally omits it. - Chunk-boundary spans and near-miss chunk attribution — with
chunk_size=512, chunk_overlap=64, a faithful quote can cross the cited chunk's boundary, and models sometimes cite a neighboring chunk index within their group. The quote is verbatim in the material the agent was shown, but not within the single cited chunk.
Suggested direction
Keep the anti-fabrication guarantee (every quoted fragment must appear verbatim in the text the agent saw) but compare on a normalized form:
- NFKC-normalize + collapse whitespace runs on both sides before the substring test;
- try both hyphenation joins for end-of-line hyphens (
-\n→""and-\n→-); - strip standalone page-number lines;
- as a fallback, match against the overlap-deduplicated concatenation of the agent's chunk group (treating
chunk_index/page_numberas provenance hints rather than exact pointers), so boundary-spanning quotes pass.
We implemented exactly this as a local wrapper around _validate_research_draft and confirmed: (a) all previously rejected faithful quotes pass, (b) a deliberately fabricated quote is still rejected, and (c) PaperFlow then completes end-to-end on 1706.03762v7. Happy to turn it into a PR if the direction sounds right.
Environment
- quant-mind @
10e9dbd0(v0.2.0), editable install, Python 3.12.13 (aarch64 linux) - Model:
litellm/moonshot/kimi-k3(also reproduced with a local qwen3:14b vialitellm/ollama_chat/...) - Same behavior at
temperature=0.0and1.0
- Lingua principale
- Python
- Stelle
- 3.1k
- Fork
- 492
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LLMQuant/quant-mind
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
LLMQuant/quant-mind#155 · 2 commenti ·
-
design(flows): structure tree drafted from truncated page text (1200 chars), diverging from PageIndex full-page constructionForse di nuovo libera @keli-wen l’ha presa 81 giorni fa e non c’è nessuna pull request aperta. Apertaarea: flows area: preprocess type: design
LLMQuant/quant-mind#133 · 1 commento · 1 assegnatario ·
-
feat(flows): surface token-usage and cost for runs and batch_runForse già presa @dhruvraajeev l’ha presa 82 giorni fa. Apertaarea: configs area: flows area: mind type: feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 45/100
LLMQuant/quant-mind#127 · 1 commento ·
-
design(config): define ownership of typed operation inputsForse di nuovo libera @keli-wen l’ha presa 86 giorni fa e non c’è nessuna pull request aperta. Apertaarea: flows type: feature
LLMQuant/quant-mind#121 · 1 assegnatario ·
-
bug: exchange-qualified multi-symbol lists are only partially capturedForse già presa @pengpengyi92 l’ha presa 83 giorni fa. Apertaarea: preprocess stale type: bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
LLMQuant/quant-mind#108 · 2 commenti ·
Tutte le issue di LLMQuant/quant-mind
Issue simili
-
Consolidate the now-identical CLI-native and composed tasks_packages guards (#5945 follow-up)Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
spec-kitty/spec-kitty#6112 ·
I maintainer di solito rispondono entro 1 giorno
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter servedForse già presa @Mrun25 l’ha presa oggi. Apertabug llm translation
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
BerriAI/litellm#46095 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
uberdeveloper/fastbt#29 ·
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
andrew-blake/melcloudhome#368 ·
I maintainer di solito rispondono entro 1 giorno
-
lane:discover
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
SPARDiffData/differential-data-collection#33 ·
I maintainer di solito rispondono entro 1 giorno