mirror of
https://github.com/deepseek-ai/DeepSeek-R1.git
synced 2026-11-05 00:47:42 +00:00
[GH-ISSUE #61] Critical Context Loss in DeepSeek-R1: Model Hallucinates <think> Tag into Arbitrary Replacements, Fails to Maintain Coherent Reasoning #50
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
deepseek-ai/DeepSeek-R1#50
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @scratchfens481 on GitHub (Jan 24, 2025).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-R1/issues/61
Serious Context Consistency Issues in DeepSeek-R1-Distill-Qwen-14B Model
Problem Description
We've identified a severe context consistency issue affecting the model's usability and reliability. The model exhibits concerning behavior: failing to maintain context consistency even within the same response. It shows particular hallucination regarding the keyword
<think>, which appears to be ignored during processing.Steps to Reproduce
<think>tags and their subsequent linesActual Behavior
During reasoning, the model:
<think>tags<think>withfinalfinalwas the original requirementExample response:
Expected Behavior
The model should:
<think>withfinal)Impact
This context inconsistency:
Technical Analysis
This appears to be a fundamental issue with the model's attention mechanism or context window implementation, not just an output formatting error. The model loses key context within a single response, suggesting potential issues with:
Recommendations
Consider:
Environment Information
https://ollama.com/library/deepseek-r1:14bSeverity
High - This issue fundamentally affects the model's reliability in any task requiring context consistency. The severe context loss significantly impacts the model's final effectiveness.
Follow-up
We have observed that this model struggles to integrate context effectively during inference. Even the most concise and clear prompts are often confused by the model. This leads to a loss of information and the creation of hallucinations during the reasoning process. This issue has also been replicated on DeepSeek-R1-Distill-Qwen-32B Q4_K_M GGUF.
Could this be caused by an issue with the tokenizer? However, the severe context loss also occurs in Q&A without the tag.
But looking at the token vocabulary: {
"id": 151648,
"content": "
<think>","normalized": false,
"lstrip": false,
"rstrip": false,
"single_word": false,
"special": false
},
Maybe this isn't a tokenization issue. The token exists properly in the vocabulary with normal attributes. The problem lies in the model's attention/context handling, as it initially recognizes
<think>but loses context mid-generation and replaces it with "final" despite having<think>as a valid token.I haven't tested this on other methods or other model weights in this series - perhaps this issue only exists on Ollama?
I will provide complete dialogue examples to help better identify the issue.
User:
修改这段代码,使得其不返回
<think>所在一行和它的下一行内容。代码:
Assistant:
这个代码的工作原理是:
skip_next为False。skip_next为True,则跳过当前循环,并重置skip_next为False。skip_next设为True,这样下一轮循环将跳过该行。这种方法会确保当遇到包含"final"的行时,它本身和下一行都会被跳过。
@amspsingh04 commented on GitHub (Jan 24, 2025):
I pulled deepseek r1 (8b) from ollama and experienced the same thing
given prompt:
It hallucinated towards the middle and eventually just answered that the datasets would be similar, losing sight of what the original question was.
Model's thinking:
Final Answer
@github-actions[bot] commented on GitHub (Feb 24, 2025):
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this issue is still relevant, please leave a comment to keep it open. Thank you for your contributions!
@github-actions[bot] commented on GitHub (Mar 15, 2025):
false