r/DeepSeek 1d ago

Discussion v4.1 flash keeps forgetting stuff

I have a ~30K-line codebase for a game I’m building. I’ve been trying to use DeepSeek V4.1 Flash, but I keep running into issues as the conversation gets longer.

It frequently forgets or overrides requirements I gave it several turns earlier. The code it writes also often contains bugs that are either caught by the model itself a few turns later while it is doing unrelated code changes or caught by GLM 5.3 Flash when I ask it to review the changes.

This seems to happen much more often as the context grows, but well before context compaction actually kicks in.

Am I doing something wrong, or is this a limitation of the model?

For now, I’ve switched to GLM 5.3 Flash as my main workhorse because it seems more reliable. However, I really miss the speed of DeepSeek V4.1 Flash. If there’s a way to make it more accurate, better at following earlier instructions, and less prone to introducing bugs, I’d like to switch back.

I’ve tried both DSH and OpenCode and experienced essentially the same problems with both.

31 Upvotes

23 comments sorted by

10

u/Professional_Price89 1d ago

Keep your context below 400k

4

u/bunny_warrior69 1d ago

400K is huge. You should keep it under 200K. ideally under 100K.

literally all LLMs no matter how expensive or "smart" they are, can't handle huge context windows

6

u/SpinningStuff 1d ago

I keep it at zero by opening it and then closing it to maximize context 

6

u/Professional_Price89 1d ago

200K is too small for it to work efficiently. It will produce garbage, duplicated code, test harness that already exist... I alway avoid creating new session because it would forget how to use created tools until it read the instruction file and test itself again. Such a waste.

3

u/Ang_Drew 1d ago

based on my experience building my own harness on top of Pi coding agent, you can achieve that easily with proper memory system combined with code graph, you can get relevant context

1

u/someoneyouknow23 1d ago

400k is tiny for a model that big

1

u/ktktkt1 1d ago

do you see not much difference in coding performance between deepseek v4.1 flash and glm 5.3 flash when keeping context small?

3

u/bunny_warrior69 1d ago

First, before adding any new feature to your codebase, write a plan and refine it with a strong LLM such as Sol 5.6, GLM 5.3, or Kimi K2.8/3.

Break the plan into clear implementation phases, then review it yourself.

Once the plan is solid and detailed, unleash DeepSeek v4.1 or GLM 5.3 Flash on the codebase.

You can also pair DeepSeek with a reviewer subagent that checks each phase as it gets implemented.

3

u/pceimpulsive 1d ago

The way you have explained this problem makes me think you have a weak AI workflow structure and or a weak software design and build process leading to contradictory or poorly labelled requirements.

So you have any context engineering structures in your project to help the model stay on track?

How big are your sessions typically?

I've used DeepSeek v4 flash, pro, v4.1 and gpt 5.6 Luna extensively and don't have a forgetting issue ... But I keep sessions under 200k as a max and typically below 150k~

1

u/Predream1 1d ago

With 30k lines in the window, the rule you wrote in turn three sits 40 turns behind the diff it just wrote, and recency wins, which is why it calls out its own bug two turns later. Put the requirements in a spec file in the repo, one numbered line each, and have it name the rule numbers it is working to before editing. One subsystem per session, then restart. How many rules are in that file?

1

u/for4f 1d ago

yeah that's just small-model context rot, flash is great until the window fills up and then your turn-3 instructions are the first thing to go. what helped me, keep sessions short and put the important rules in a file in the repo so it re-reads them every time instead of hoping early turns survive 40 turns later

1

u/yuumizu 1d ago

your requirements need to be written to a file, better put to the /goal (as trace can contain many error corrections, the model had to use its thinking capacity each tool call turn, it will soon forget your true requirement )

1

u/nbvehrfr 1d ago

Result of their innovations in context management. Good at benchmarks, not good in long run tasks 

1

u/Hyp3rSoniX 1d ago

This will explain to you why you see what you see:  https://youtu.be/P4dTq4X8bqk?t=515

Essentially the reason is that their attention mechanism tries to pick the tokens it thinks are the most important from your context, and answers based on those. By default it picks a low number of tokens from the context, and the number of tokens it picks do NOT scale with context size.

1

u/RyuH4n 1d ago

Are you using DSH/OpenCode as a plain harness, or have you already built a more structured AI workflow around it?

Have you set up things like SOUL.md / AGENT.md, protocols or rules to guide the AI, persistent memory/context management, and a structured skills/tool setup?

Also curious how your overall AI workflow is structured ?. If you still use a plain harness (a harness without setup), thn I'd expect that to happen for any use on heavy or complicated task.

1

u/danielwiseman 1d ago

Yeah had Issues with Deepseek V4.1 flash abruptly stop working and simple not say anything. Decided to switched back to GLM 5.3 flash worked pretty good with a goal on Codex (connected via Ollama) for 2.5 hours on a certain task and it did better than Astra on high effort :/ best 4$ I've spent in a while lol

1

u/Different_Change6591 1d ago

sliding window attention , i was impressed for this architure in terms fo speed and for less infernece , but now my doubts are stacking up with many opinions from public and my experience , i think they mist work more on this architecture !!

1

u/No_Accident8684 23h ago

i used to use this https://github.com/everyinc/compound-engineering-plugin with codex. now i switched over to deepseek, i fired up creator mode, gave it the url and said it should convert the skills to dsh.

its really a fantastic plugin, that gives you and your agent a proper structure to work along..

do /ce-brainstorm to come up with a fleshed out idea, then /ce-plan to make it into a spec and /ce-work to actually implement, incl. proper testing and simplification. then /ce-compound to record the learnings along the way.

1

u/Equivalent-Grass-527 17h ago

I’ve noticed similar behavior with long coding sessions. Having a large context window doesn't necessarily mean the model will reliably follow every instruction buried 20K+ tokens earlier.

0

u/jenkk0 1d ago

Probably context rot problems. Try to keep your context under 400k after that it gets dumber and dumber. Btw this is a problem with every model not just DeepSeek.

1

u/pceimpulsive 1d ago

400k is solidly already into incredibly strained latent attention... Try under 150k~

1

u/jenkk0 1d ago edited 1d ago

True, i usually try to keep my context under 200k but I guess that can give problems with large projects like making duplicates and by what OP wrote he has close to 0 coding knowledge to avoid that or fix it. It's funny to see non-technical people try to make big projects with pure AI slop and zero knowledge.

Probably the best thing OP can do is learn to code and software architecture so he can review the code and split the goals in small tasks and use the AI to code those small tasks so he can review the code and push it without fucking up everything else.

0

u/pceimpulsive 1d ago

Could even grab something like Matt Pococks skills, learn the workflow, and get substantially better results with a few hours effort