VLM pipeline reports a page stopped by vLLM repetition detection as a full success

Open Beginner friendly
#5,592 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
69/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
python

Research direction

Read normalize_stop_reason and VlmPipeline._determine_conversion_status, then inspect the tests covering stop reasons and partial conversion status. Reproduce with a vLLM response whose finish_reason is repetition and check how the reason is normalized. Done means such a page is reported as incomplete, with a test confirming the conversion status.

Written by the indexing model from the issue text.

Description

Bug

vLLM can stop a generation early once the output keeps repeating itself. This is the repetition_detection sampling parameter from vllm-project/vllm#35451, and the response then ends with finish_reason "repetition".

normalize_stop_reason in docling 2.153.0 does not know this value and returns UNSPECIFIED. VlmPipeline._determine_conversion_status only reports PARTIAL_SUCCESS for LENGTH and CONTENT_FILTERED, so a page that was cut in the middle of a loop comes back as a full success. The text after the loop is missing and the caller has no way to know.

Steps to reproduce
  1. Serve Qwen/Qwen3-VL-8B-Instruct-FP8 with vLLM 0.34.0.
  2. Convert a PDF with the VLM pipeline and the api engine, temperature 0, and add "repetition_detection": {"min_pattern_size": 32, "max_pattern_size": 512, "min_count": 6} to params.
  3. Use a page that makes the model loop. Large scanned engineering drawings do it for us on about one page in three.
  4. vLLM answers with finish_reason "repetition" and the conversion status is success with no error item.

I expected the page to be reported as incomplete in the same way as a length stop, so it can be retried or flagged. Mapping "repetition" in _INCOMPLETE_FINISH_REASONS, either to LENGTH or to a new stop reason, would do it. I can open a pull request if that direction works for you.

Docling version

docling 2.153.0 (main), also seen with docling-serve 1.38.2

Python version

Python 3.12

Dominant language
Python
Stars
71k
Forks
5.4k
Avg merge
2d 22h
Merged PRs (30d)
161

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from docling-project/docling

All issues in docling-project/docling

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.