[BUG] Reasoning tag removal fails when <think> is part of the input prompt

Aperta Adatta ai principianti
#1,453 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@selimfedakar ci sta già lavorando.

Dal 28/10/2026.

  • #1454 di @selimfedakar — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python

Direzione di ricerca

Read Pipeline._post_process_outputs and trace how it receives the input prompt and generated output. Check the existing tests for reasoning tag removal, then add coverage for a prompt containing <think> when the output contains only </think>. Done means reasoning content is removed in this case and the existing behavior still works.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Describe the bug

When evaluating Qwen3.5-4B on a benchmark using exact-match accuracy, I observed unexpectedly low performance due to reasoning content not being removed from generated outputs.

The issue is in Pipeline._post_process_outputs, which removes reasoning content only when both <think> and </think> are present in the generated output.

For Qwen3.5-4B, the opening <think> tag is already included in the input prompt by the chat template, so only </think> appears in the generated output. As a result, reasoning content is not removed and affects exact-match accuracy.

Expected behavior

Reasoning removal should also handle cases where the opening tag is part of the input prompt.

A similar approach is implemented in Transformers' chat response parsing, which considers the input prefix when parsing generated responses.

Lingua principale
Python
Stelle
2.6k
Fork
605
Merge medio
2g 3h
PR unite (30g)
3

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di huggingface/lighteval

Tutte le issue di huggingface/lighteval

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.