What are the best p...
 
Notifications
Clear all

What are the best prompt engineering techniques for DeepSeek?

4 Posts
5 Users
0 Reactions
395 Views
0
Topic starter

So Ive been messing around with the DeepSeek API lately for this little side project Im doing for a local bakery nearby. Im trying to help them automate their inventory tracking and order summaries but GPT-4 was just eating through my tiny $20 budget way too fast so I switched over to DeepSeek since the pricing is way better. It seems pretty solid for the most part but honestly Im struggling to get the output format consistent and sometimes it just ignores my negative constraints entirely.

I did some digging online and saw a few people saying that DeepSeek handles instructions better if you use very specific XML tags like tags for instructions or examples but then I read another thread on a dev forum saying that the newer models actually get confused if you over-engineer the prompts too much. Some people swear by few-shot prompting but when I try it the model sometimes just starts hallucinating more examples instead of following the logic for my actual data. Im also not sure if I should be using the R1 reasoning style prompts or just stick to the standard V3 stuff... like does it really need me to tell it to think step by step if its already a reasoning model? It feels kinda redundant and Im worried Im just wasting tokens at this point.

What are the actually effective prompt engineering techniques you guys have found specifically for DeepSeek to keep it from drifting or losing the plot mid-response?


4 Answers
10

DeepSeek is a solid choice for local business stuff since the cost per token is basically negligible compared to OpenAI. I have been using the DeepSeek-V3 API for a few months now and found that it likes structure but hates fluff. To keep your inventory summaries consistent, you should try these specific tweaks:

  • Use XML tags like or to wrap your content. DeepSeek models respond really well to clearly defined boundaries between instructions and the actual data.
  • If it is ignoring negative constraints, try phrasing them as positive requirements. Instead of saying dont include notes, try output only the raw numbers in the specified JSON format.
  • Stop using think step by step if you are on the DeepSeek-R1 Reasoning Model. Since R1 has a built-in reasoning chain, forcing it to do more logic can actually lead to weird repetition or token waste. I usually recommend V3 for standard tasks because it is snappy, but R1 is the way to go if your inventory tracking involves complex calculations. If the model starts hallucinating examples from your few-shot prompts, just wrap the examples in a single tag and explicitly state that the examples are for reference only. It usually stops the drift tho and keeps the output clean.


10

Re: "DeepSeek is a solid choice for local business..."

  • I totally agree! Honestly I am obsessed with how well DeepSeek handles structured data when you set it up right! If you are struggling with it drifting away from your format, you absolutely have to try the JSON output mode specifically. It is amazing for stuff like inventory tracking because it forces the model to stay inside the lines. A few things I always do:
  • Define the schema very clearly in the system prompt
  • Put few-shot examples inside example tags to stop hallucinations
  • Use clear separators for the bakery input data Also, DeepSeek-V3 API has been fantastic for my small business automation projects! Skip the think step by step fluff for V3 tho, otherwise you are just burning tokens for no reason. It works like a charm for logic-heavy tasks without needing the extra reasoning overhead. Love seeing more people jump on the DeepSeek train!


3

Gonna try this over the weekend. Will report back if it works!


3

Can confirm this works. Did the same thing on mine and its been solid ever since.


Share: