Skills MCP Model 博客 提交 Skills

DeepSeek Prompt EngineeringComplete Guide

Prompt Engineering is the core skill for using DeepSeek. Master prompt techniques to elevate your DeepSeek response quality by an order of magnitude. From principles to practice, from beginner to expert, this guide covers everything.

Start Learning

Prompt Fundamentals

Understanding the core principles of prompt engineering is the first step to writing high-quality prompts. This section is suitable for all DeepSeek users, whether you are a complete beginner or an experienced developer.

What is Prompt Engineering?

Prompt engineering is the practice of carefully designing input text (prompts) to guide large language models (LLMs) to generate more accurate, relevant, and higher-quality outputs. Simply put, a good prompt equals a good response.

DeepSeek, as one of the most advanced large language models, is highly sensitive to prompts. The same question asked in different ways can yield vastly different response quality. Prompt engineering helps you find the most effective way to ask.

For example:

Poor Prompt

"Write an article"

Better Prompt

"Write an 800-word WeChat article on 'How AI is Changing Remote Work', aimed at workplace managers, with a professional but not dry tone, including 3 specific examples, and ending with 3 practical suggestions."

How do LLMs understand prompts?

Large language models like DeepSeek are essentially "next-token predictors." When you input text, the model predicts the most likely next word (token) based on patterns learned from training data, then generates the full response word by word.

This means:

  • Context is everything: The quality of the prompt directly influences the direction of the model's "guessing." The clearer the prompt, the easier it is for the model to give the correct answer.
  • The model does not "understand" intent: The model does not infer your true thoughts; it strictly predicts the next word based on the literal meaning of the prompt. So don't assume the model "should know."
  • Attention mechanism: DeepSeek uses the Transformer architecture, where each word in the prompt affects the model's attention allocation to the context. The position and emphasis of keywords affect output quality.

Four Principles of High-Quality Prompts

Principle 1

Clarity

Clearly state what you want and what you don't want. Avoid vague expressions. Use specific verbs and quantifiers, e.g., "list 5 points" is better than "talk about it."

Principle 2

Provide Context

Tell the model background information, target audience, and usage scenario. The richer the context, the more accurate the response. For example, tell the model "You are a senior Python engineer" instead of "You are an assistant."

Principle 3

Specify Format

Clearly specify the output format: JSON, table, Markdown, list, code block, etc. Format constraints greatly reduce the model's "free play" space, making output more controllable.

Principle 4

Iterate and Optimize

Not satisfied with the first prompt? Don't give up. Adjust wording, add details, try a different angle. Prompt engineering is essentially an iterative process; each adjustment brings the response closer to your expectation.

Role Prompting

Role playing is one of the most effective prompting techniques. By setting a clear persona, you can let DeepSeek answer questions as an expert in a specific field, significantly improving the quality and professionalism of responses.

Why is role playing effective?

DeepSeek has learned a large amount of text from various fields during training. When you set a role in the prompt (e.g., "senior Python engineer"), the model activates knowledge patterns and language styles associated with that role, making responses closer to professional standards in that field.

System Prompt

The System Prompt is the core tool for role playing. In API calls, the System Prompt is the first element of the messages array, setting the tone for the entire conversation. DeepSeek's official App and web version also use System Prompts in the background.

# API call example: System Prompt from openai import OpenAI client = OpenAI( api_key="sk-your-api-key", base_url="https://api.deepseek.com", ) response = client.chat.completions.create( model="deepseek-chat", messages=[ { "role": "system", "content": "You are a senior Python backend engineer with 10 years of experience. You excel in code optimization, system design, and security auditing. Please provide runnable code with clear explanations." }, { "role": "user", "content": "Help me optimize this database query code" }, ], )

Role Playing Prompt Template

Below is a general role playing prompt template. You can replace the content in brackets according to your needs:

You are a [role/identity] with [years of experience] of experience. You excel in [skill 1], [skill 2], and [skill 3]. Your response style: - [style requirement 1] - [style requirement 2] - [style requirement 3] Now, please help me [specific task].

Practical Examples

# Example 1: Programming Mentor You are an experienced programming mentor, skilled at explaining complex concepts in an easy-to-understand way. Your students are beginners just starting with Python. Response requirements: - Use everyday analogies to explain abstract concepts - Provide a simple code example for each concept - Give "common mistakes" tips where errors might occur - Answer in Chinese Please explain: What is a decorator in Python? # Example 2: Legal Advisor You are a legal advisor proficient in China's Labor Law and Labor Contract Law, with 15 years of experience. Please answer the following question in professional but accessible language. Requirements: - Cite specific legal provisions (with article numbers) - Distinguish between "legal provisions" and "practical advice" - If there is a dispute, explain the rights and obligations of both employees and employers - Finally, give a summary recommendation Question: Is it legal for a company to unilaterally reduce salary? If I encounter this situation, how should I protect my rights? # Example 3: Copywriter You are a senior WeChat official account copywriter, skilled at writing viral articles. Your readers are professionals aged 25-35. Writing style: - Titles should be attractive, using numbers and suspense - Start with a story or pain point - Insert a subheading every 300 words - End with a memorable quote - Around 1500 words total Please write a WeChat article about "How to Overcome Workplace Anxiety".

Chain-of-Thought Prompting

Chain-of-Thought (CoT) is a prompting technique that makes the model show its step-by-step reasoning process. For complex tasks requiring multi-step reasoning such as math, logic, and programming, CoT significantly improves answer accuracy.

Why is Chain-of-Thought effective?

Large language models generate answers in a single forward pass. For complex reasoning tasks, jumping directly to the final answer can easily lead to errors. CoT guides the model to "think step by step," breaking down complex problems into multiple simpler sub-problems, each easier for the model to answer correctly. Research shows that CoT can improve math reasoning accuracy by 20%-40%.

Comparison:

Without CoT

"What is 24 * 37 + 15 * 8 - 126 / 3?"

May directly give a wrong answer without reasoning process

With CoT

"Calculate 24 * 37 + 15 * 8 - 126 / 3. Please show your calculation process step by step, first multiplication, then division, and finally addition and subtraction."

Shows step-by-step reasoning, significantly improves accuracy

CoT Prompt Template

# General CoT Template Please think step by step and show your complete reasoning process: Problem: [Your problem] Please follow these steps: 1. Analyze the given conditions 2. List the solution steps 3. Calculate/reason step by step 4. Provide the final answer 5. Verify the correctness of the answer

Practical Examples

# Example 1: Math Reasoning Please reason step by step: Xiaoming has 150 yuan. He buys 3 books at 28 yuan each, and 2 pens at 6 yuan each. Then he uses the remaining money to buy some notebooks at 4 yuan each. How many notebooks can he buy at most? How much money is left? # Example 2: Logical Reasoning Please reason step by step: On an island, there are 5 people. 2 always tell the truth, 3 always lie. A says: "B is a truth-teller." B says: "C is a liar." C says: "D is a truth-teller." D says: "E is a liar." E says: "A is a truth-teller." Analyze each person's statement and deduce who tells the truth and who lies. # Example 3: Code Debugging Please analyze the following code step by step: def find_duplicates(arr): seen = set() for i in range(len(arr)): if arr[i] in seen: return arr[i] seen.add(arr[i]) return None Question: Under what circumstances does this code fail? Please analyze step by step: 1. Expected behavior of the code 2. Potential edge cases 3. Performance analysis 4. Provide the fixed code

CoT Variant: Zero-shot CoT

Zero-shot CoT is the simplest chain-of-thought technique. Simply add "Let's think step by step" or "Please reason step by step" at the end of the prompt to trigger the model's reasoning mode. No examples needed, zero cost to activate chain-of-thought.

# Zero-shot CoT Example A farmer has 17 sheep. All but 9 run away. How many sheep does the farmer have left? Please reason step by step. # This seemingly simple question is easy to get wrong. Adding "Please reason step by step" makes # DeepSeek carefully analyze: "All but 9 run away" means 9 did not run away.

Few-shot Prompting

Few-shot Learning is providing 1-5 examples in the prompt to let the model learn your format, style, and expectations. This is one of the most effective ways to get the model to output in a specific format.

Why is Few-shot effective?

Large language models have learned the ability of "In-Context Learning" during training. When you provide a few examples, the model extracts patterns (format, style, logic) from the examples and applies these patterns to new tasks. The advantage of Few-shot is: No need to fine-tune the model, just modify the prompt to change output behavior.

Few-shot Prompt Template

# Few-shot General Template Please translate the following English sentences into Chinese, keeping the original tone and style. Example 1: English: The future belongs to those who believe in the beauty of their dreams. Chinese: 未来属于那些相信梦想之美的人。 Example 2: English: It is during our darkest moments that we must focus to see the light. Chinese: 在最黑暗的时刻,我们必须专注于寻找光明。 Now translate: [English sentence to be translated]

Practical Examples

# Example 1: Sentiment Analysis (Few-shot) Please perform sentiment analysis on the following comments, output format: {"comment": "...", "sentiment": "positive/negative/neutral", "confidence": 0.0-1.0} Example 1: Comment: 这个产品的质量非常好,发货速度也很快,非常满意! Output: {"comment": "这个产品的质量非常好,发货速度也很快,非常满意!", "sentiment": "positive", "confidence": 0.95} Example 2: Comment: 用了三天就坏了,客服态度也很差,差评! Output: {"comment": "用了三天就坏了,客服态度也很差,差评!", "sentiment": "negative", "confidence": 0.92} Example 3: Comment: 产品收到了,包装还可以。 Output: {"comment": "产品收到了,包装还可以。", "sentiment": "neutral", "confidence": 0.80} Now analyze the following comment: [New comment] # Example 2: Code Comment Generation (Few-shot) Please generate Chinese comments for the following Python function. Refer to the comment style in the examples. Example 1: Function: def calculate_bmi(weight, height): return weight / (height ** 2) Comment: """ 计算 BMI(身体质量指数)。 参数: weight (float): 体重,单位:千克 height (float): 身高,单位:米 返回: float: BMI 值 公式: BMI = 体重 / (身高 ^ 2) """ Now generate comments for the following function: [New function] # Example 3: Email Writing (Few-shot) Please write a business email based on the following information. Refer to the format and tone of the examples. Example: Information: Notify the client that the project is delayed by one week because the technical solution needs adjustment. Email: Subject: Notice of schedule adjustment for [Project Name] Dear [Client Name], Hello! Thank you for your trust and support for [Project Name]. In the recent technical review, we found that the current technical solution needs optimization and adjustment to ensure the final delivery quality. Therefore, the project is expected to be delayed by one week. We understand the importance of time to you, and the team is working overtime to advance. The new delivery time is expected to be [New Date], and we will update you weekly. If you have any questions, please feel free to contact me. Best regards, [Your Name] [Company Name] [Contact Information] Now write an email based on the following information: [New information]

Few-shot Best Practices

  • Number of examples: 1-3 examples are usually enough; too many may dilute attention to the real task and consume more tokens.
  • Quality of examples: Examples should be accurate, standardized, and representative. Wrong examples will "teach" the model incorrectly.
  • Diversity of examples: If the task has multiple cases, try to provide an example for each case. For example, sentiment analysis covers positive, negative, and neutral.
  • Format consistency: The format of all examples must be exactly the same, otherwise the model will be confused.
  • Clear labels: Use labels like "Example 1", "Example 2" or "Input", "Output" to separate examples and tasks.

Structured Output

When you need DeepSeek to output data in a specific format, structured output prompts are the best choice. Whether it's JSON, tables, CSV, or custom formats, clearly specifying the format makes the output immediately usable.

JSON Output

JSON is the most commonly used output format for API calls and programmatic processing. DeepSeek supports JSON format very well; just clearly request it in the prompt.

# JSON Output Example Please output the following information in JSON format, without any other text or explanation: { "电影名称": "流浪地球", "导演": "", "主演": [], "上映年份": 0, "豆瓣评分": 0.0, "类型": [], "剧情简介": "", "获奖情况": [] } Please complete the above information, ensure the data is accurate and the JSON format is correct. # More concise JSON output method Please output the comparison information of the following three Python frameworks in pure JSON format, without markdown code block markers: [ { "name": "Framework name", "latest_version": "Latest version number", "pros": ["Advantage 1", "Advantage 2", "Advantage 3"], "cons": ["Disadvantage 1", "Disadvantage 2"], "best_for": "Best suited scenario" } ] Compare frameworks: Django, FastAPI, Flask

Table Output

DeepSeek can generate Markdown tables, which are great for comparative analysis, data organization, specifications, etc.

# Table Output Example Please compare the following 5 programming languages using a Markdown table, listing the following dimensions: | Language | Type | Learning Difficulty | Main Use | Average Salary | 2026 Trend | |----------|------|---------------------|----------|----------------|------------| | | | | | | | Compare languages: Python, JavaScript, Go, Rust, Java # Multi-column comparison table Please compare the three models DeepSeek V3, R1, and Coder using a table with the following columns: Model Name | Parameter Count | Best Scenario | Inference Speed | API Price | Open Source License | Recommendation Index (1-5 stars)

Custom Format Output

Besides JSON and tables, you can specify any custom format. The key is to provide a clear format template.

# Custom format: labeled bullet list Please output 5 Python performance optimization tips in the following format: --- Tip 1 --- Title: [Tip title] Difficulty: [Beginner/Intermediate/Advanced] Applicable scenario: [One-sentence description] Specific approach: [Detailed explanation, 2-3 sentences] Code example: [Code block] Expected effect: [Quantified description of performance improvement] --- Tip 2 --- ... (and so on) # Custom format: YAML output Please output a Docker Compose configuration file in YAML format for deploying a web application with the following services: - Nginx reverse proxy - Python FastAPI backend - PostgreSQL database - Redis cache Please ensure the configuration is complete and usable, with clear comments.

Step-by-Step Instructions

For complex tasks, a single prompt often fails to produce perfect results. Step-by-step instructions break down complex tasks into multiple steps, each confirmed independently before proceeding to the next, like peeling an onion layer by layer.

Why do step-by-step instructions work?

Complex tasks usually involve multiple dimensions (content, structure, style, format, etc.). Asking the model to meet all requirements at once can lead to trade-offs. Step-by-step instructions decompose the task into independent subtasks, each focusing on one goal, and finally assemble the complete output.

Step-by-step vs. one-shot instructions:

  • One-shot instruction: "Write a 3000-word AI industry analysis report" -- the model may produce a chaotic structure and empty content
  • Step-by-step instruction: First outline -> confirm, then write introduction -> expand section by section -> finally summarize -- each step's quality is controllable

Step-by-step instruction prompt template

# Step-by-step instruction template I need to complete [task description]. Please help me with the following steps: Step 1: [Step 1 description] Step 2: [Step 2 description] (wait for my confirmation of Step 1 before continuing) Step 3: [Step 3 description] (wait for my confirmation of Step 2 before continuing) Step 4: [Step 4 description] (wait for my confirmation of Step 3 before continuing) Now start with Step 1.

Practical examples

# Example 1: Long-form writing I want to write an in-depth article about "2026 AI Programming Tool Development Trends" for a tech blog. Target readers: developers with 2+ years of experience. Word count: around 3000 words. Please help me with the following steps: Step 1: First give 5 alternative titles, each with a one-sentence explanation of why it's attractive Step 2: After I select a title, list the article outline (4-5 subheadings, each with 2-3 bullet points) Step 3: After I confirm the outline, write the full article body Step 4: Finally, give me 3 recommended blurbs suitable for sharing on social media/Twitter Now start with Step 1, give 5 title options. # Example 2: Project proposal planning I want to plan a "user growth" proposal for a SaaS product. The product is a project management tool for small and medium-sized enterprises. Please help me with the following steps: Step 1: First analyze common pain points and opportunities for user growth in current SaaS products (list 5 points) Step 2: Based on the pain points, give 3 core growth strategies, each explaining applicable scenarios and expected effects Step 3: After I select a strategy, create a detailed execution plan for the chosen strategy (including timeline, resource requirements, KPIs) Step 4: Finally, evaluate potential risks and countermeasures for that strategy Now start with Step 1. # Example 3: Code refactoring I have a piece of legacy code that needs refactoring. Please help me with the following steps: Step 1: First analyze the problems in this code (structure, performance, readability, security) Step 2: Provide a refactoring plan (don't write code directly, first explain the approach) Step 3: After I confirm the plan, write the refactored code Step 4: Compare the improvements before and after refactoring Now start with Step 1. Here is my code: [paste code]

Best practices for step-by-step instructions

  • One goal per step: Each step should have the model complete one clear task, not multiple goals.
  • Explicitly wait for confirmation: Clearly write "wait for my confirmation before continuing" in the step description to ensure the model doesn't output everything at once.
  • Outline first, details later: For writing tasks, have the model produce an outline first, confirm direction and structure, then write the body to avoid going off track.
  • Correct promptly: If a step's output is unsatisfactory, directly tell the model "This step isn't quite right; what I actually want is..." and redo that step.

DeepSeek R1 Special Prompting Tips

DeepSeek R1 is a reasoning-enhanced model with built-in chain-of-thought (CoT) capability. Unlike V3, R1 automatically displays its thinking process before answering. Prompting strategies need to be adjusted for R1's characteristics.

Core differences between R1 and V3

DeepSeek V3

General conversational model

Suitable for daily conversation, writing, translation, and knowledge Q&A. Answers directly without showing thinking process. Prompting tips: role-playing, structured output, and step-by-step instructions work best.

DeepSeek R1

Reasoning-enhanced model

Performs better in mathematics, programming, and logical reasoning. Shows thinking process (think tags) before answering. Prompting tips: be concise and direct; no need to overuse CoT.

R1 prompting core principle: simplicity is king

R1 has built-in powerful reasoning capabilities, so you don't need to manually write CoT prompts. Too many prompts may actually interfere with R1's reasoning process. The prompting principles for R1 are:

  • Ask directly: No need for CoT prefixes like "think step by step"; R1 will reason automatically.
  • Be clear about requirements: Clearly state what you want, but don't teach R1 how to reason.
  • Avoid System Prompt: R1 is less sensitive to System Prompt than V3; it's recommended to put role information in the User Prompt.
  • Temperature parameter: Use a lower temperature (0.1-0.3) for R1 reasoning to get more stable and accurate results.

R1 practical prompt examples

# R1 example: Math competition problem Solve the following math problem: In triangle ABC, AB = 13, BC = 14, AC = 15. Find the area of triangle ABC. # Note: No need for "think step by step" -- R1 will automatically show its thinking process # R1 example: Programming algorithm Implement a function in Python to determine if a linked list has a cycle. Requirements: - Time complexity O(n), space complexity O(1) - Include complete test cases # R1 example: Logical reasoning There are 12 coins, one of which is counterfeit and has a different weight (but unknown whether heavier or lighter). Using a balance scale 3 times, find the counterfeit coin and determine whether it is heavier or lighter. Please provide a complete weighing scheme. # R1 example: Code review Review the following code for security and performance issues, and provide fix suggestions: [code content]

R1's think tags

R1's responses include a thinking process wrapped in <think> and </think> tags. In API calls, you can parse these tags to separate the "thinking process" from the "final answer".

# R1 API response structure example <think> This is R1's thinking process... I need to analyze the triangle's side lengths... Use Heron's formula: s = (a+b+c)/2 = (13+14+15)/2 = 21 Area = sqrt(s(s-a)(s-b)(s-c)) = sqrt(21*8*7*6) = sqrt(7056) = 84 </think> The area of triangle ABC is 84 square units. Using Heron's formula: - Semi-perimeter s = (13 + 14 + 15) / 2 = 21 - Area = sqrt(21 * 8 * 7 * 6) = sqrt(7056) = 84

R1 vs V3: When to use which?

Task type Recommended model Reason
Mathematical computation, proofs R1 R1's mathematical reasoning far exceeds V3, AIME score 79.8 vs 39.2
Complex programming, algorithms R1 For algorithmic reasoning and code debugging, R1 is more accurate
Logical reasoning, puzzles R1 For multi-step reasoning tasks, R1's CoT capability is naturally suited
Everyday conversation, writing V3 V3 responds more directly and fluently, no need to show thinking process
Translation, polishing V3 V3 processes language faster, output is more concise
Creative writing V3 V3 has better creativity and literary flair, R1 is more rational
Structured output, JSON V3 V3 better complies with format constraints

Scenario-based Prompt Template Library

20+ ready-to-use prompt templates covering high-frequency scenarios such as writing, programming, translation, analysis, summarization, brainstorming, code review, debugging, documentation, email, reports, etc. Copy and use directly, modify as needed.

Writing

# Template 1: Official Account Article You are a senior official account author, skilled in writing in-depth technology articles. Please write an official account article on the topic: [topic]. Target readers: [reader profile]. Word count: 1500-2000 words. Tone: [professional but not boring / light and humorous / serious and formal]. Requirements: - The title should be attractive, containing numbers or suspense - Start with a story/pain point/data - The body should be divided into 3-4 sections, each with a subheading - End with a summary and a memorable quote - Use formatting techniques such as bold and quotes appropriately # Template 2: Xiaohongshu Copy Please write a Xiaohongshu product recommendation copy on the topic: [product/experience]. Requirements: - Title starts with emoji, eye-catching - Body is colloquial, like sharing with friends - Clear paragraphs, each no more than 3 lines - Include 3-5 relevant hashtags - Word count 300-500 words - Highlight 3 core selling points or feelings # Template 3: Weekly Report / Daily Report Based on the following information, help me write a weekly report: Work completed this week: - [Work item 1] - [Work item 2] - [Work item 3] Next week's plan: - [Plan 1] - [Plan 2] Problems encountered: - [Problem description] Format requirements: - Formal but not rigid - Highlight achievements and progress - For problems, include solutions or directions for help

Programming

# Template 4: Code Generation Please write a [function description] in [language]. Requirements: - Code is complete and runnable, including necessary imports and dependencies - Include error handling - Add concise comments explaining key logic - Include a simple usage example - Time complexity: [requirement] # Template 5: Code Review Please review the following [language] code and provide improvement suggestions from the following dimensions: 1. Correctness: Is the logic correct? Are there edge-case bugs? 2. Security: Are there security issues such as SQL injection, XSS, sensitive information leakage? 3. Performance: Are there performance bottlenecks? How to optimize? 4. Readability: Are names clear? Is the structure reasonable? 5. Best practices: Does it follow best practices for the language? Code: [paste code] # Template 6: Bug Debugging My [language] code has the following problem: Expected behavior: [describe expected] Actual behavior: [describe actual] Error message: [paste error message/stack trace] Code: [paste code] Please help me: 1. Locate the bug's position and cause 2. Explain why this bug occurs 3. Provide a fix and the corrected code 4. Suggest how to avoid similar problems

Translation

# Template 7: Chinese-English Translation Please translate the following [Chinese/English] into [English/Chinese]. Translation requirements: - Faithfulness, expressiveness, elegance: accurately convey the original meaning, fluent and natural language - Maintain the tone and style of the original (formal/colloquial/literary) - Accurate translation of technical terms - If encountering culturally specific expressions, add a parenthetical note after the translation Original text: [text] # Template 8: Multilingual Translation Please translate the following Chinese into English, Japanese, and Korean, and output in JSON format: { "original": "original text", "english": "English translation", "japanese": "Japanese translation", "korean": "Korean translation" } Original text: [text]

Analysis

# Template 9: Data Analysis Please analyze the following data and provide insights and recommendations: Data: [paste data/table/CSV] Analysis requirements: 1. Data overview: key metrics and trends 2. Anomalies: identify data points significantly deviating from normal range 3. Correlations: point out relationships between data 4. Recommendations: provide 3 actionable recommendations based on the data 5. Output format: use tables for key data, bullet points for analysis conclusions # Template 10: Competitive Analysis Please compare and analyze [Product A] and [Product B]. Analysis dimensions: - Core feature comparison (table) - Pricing strategy - Target user groups - Strengths and weaknesses analysis (5 points each) - Market positioning differences - My recommendation (if I am [role], I choose [Product X] because...) # Template 11: SWOT Analysis Please conduct a SWOT analysis for [project/company/product] and output in table format: | Dimension | Content | |------|------| | Strengths | 1. ... 2. ... 3. ... | | Weaknesses | 1. ... 2. ... 3. ... | | Opportunities | 1. ... 2. ... 3. ... | | Threats | 1. ... 2. ... 3. ... | Finally, provide strategic recommendations based on the SWOT (3 items).

Summarization

# Template 12: Article Summary Please summarize the core content of the following article: Requirements: 1. Summarize the main idea of the article in 3 sentences 2. List 5 key points (each no more than 50 characters) 3. Point out the core arguments and reasoning methods of the article 4. If there is data, extract key data 5. Use one question to stimulate readers' further thinking Article: [paste article] # Template 13: Meeting Minutes Please organize structured meeting minutes based on the following meeting record: Meeting record: [paste meeting record] Minutes format: - Meeting topic: - Date/time: - Attendees: - Core agenda: 1. [Agenda] - Discussion points: ... - Resolution: ... 2. [Agenda] - Discussion points: ... - Resolution: ... - Action items: - [ ] [Task] - Owner: [Name] - Due date: [Date] - Next meeting time: [Date]

Brainstorming

# Template 14: Creative Brainstorming Please help me brainstorm on the topic: [Topic]. Requirements: - Give 20 creative ideas, unconventional, encourage bold ideas - Describe each idea in one sentence - Categorize as: conservative solutions (5), innovative solutions (10), disruptive solutions (5) - Finally, select the Top 3 you think are most worth trying and explain why # Template 15: Problem Solving I am facing the following problem: [Problem description] Please help me think of solutions from different angles: 1. From a technical perspective: What technical solutions are available? 2. From a process perspective: Can we avoid or solve it by changing the process? 3. From a resource perspective: What resources are needed (manpower, funding, time)? 4. From an alternative perspective: Are there completely different alternatives? 5. Please give comprehensive advice and recommend an optimal solution

Email and Reports

# Template 16: Business Email Please help me write a business email. Scenario: [Scenario description] Recipient: [Recipient identity/relationship] Tone: [Formal/Semi-formal/Friendly] Requirements: - Clear subject line - Polite opening greeting - Concise body, straight to the point - If there is a request, clearly state the action needed and the deadline - Polite closing # Template 17: Project Report Please help me write a project progress report. Project name: [Name] Reporting period: [Date range] Report audience: [Supervisor/Client/Team] Report structure: 1. Project overview (1-2 sentences) 2. Work completed this period (bullet list) 3. Key metrics/data (if any) 4. Issues and risks encountered 5. Next period plan 6. Items needing support

Learning and Education

# Template 18: Concept Explanation Please explain [Concept] in an easy-to-understand way. Requirements: - First explain in plain language - Then use a life metaphor to help understanding - Give a simple example - Point out common misconceptions - If possible, summarize the core points in no more than 50 characters Target audience: [Complete beginner/Some foundation/Professional] # Template 19: Learning Path I want to learn [Skill/Field], and my current level is [Beginner/Intermediate/Advanced]. Please help me create a learning roadmap: 1. Learning path (phased route from beginner to advanced) 2. Recommended learning resources for each stage (books, courses, websites) 3. The level to be achieved at each stage 4. Suggested practice projects (from easy to difficult) 5. Common learning mistakes 6. Estimated study time (with X hours per week, how long it will take)

Documentation and Instructions

# Template 20: API Documentation Please generate API documentation for the following code: [Code] Documentation format: - Interface name - Request method (GET/POST/PUT/DELETE) - Request URL - Request parameters (parameter name, type, required/optional, description) - Response format (JSON example) - Error code description - Call example (curl command) # Template 21: README Document Please generate a README.md for the following project: Project information: - Project name: [Name] - Project description: [One-sentence description] - Tech stack: [Tech stack] - Main features: [Feature list] README structure: - Project name and badges - Introduction - Features - Quick start (installation, configuration, running) - Usage examples - API documentation (if any) - Contribution guidelines - License

Common Mistakes and Optimization

Even if you master all the techniques, you can still make mistakes when writing prompts. Below are the most common prompt errors and their optimization methods to help you quickly troubleshoot and fix issues.

Mistake 1: Prompt is too vague

Bad example "Write an article about AI"
Problem No specific topic angle, word count, style, or audience specified; the model can only generate randomly
Optimized "Write an 800-word popular science article on 'How AI is changing medical diagnosis', aimed at the general public, with a relaxed and easy-to-understand tone, including 2 real cases, and ending with future prospects."

Mistake 2: Information overload

Bad example In one prompt, asking the model to complete 5 different tasks simultaneously (write an article, translate, analyze data, generate code, summarize a document)
Problem Attention is divided, and each task is done poorly. The model switches between tasks, leading to degraded output quality
Optimized Split into multiple independent conversations or use step-by-step instructions, focusing on one core task at a time

Mistake 3: Ignoring context window limits

Mistake In long conversations, early context is gradually "forgotten". The DeepSeek local deployment version has a default context of 128K tokens, but the longer the conversation, the less attention the model pays to early information
Optimization For long conversations, periodically "summarize and review" key information from earlier. Before critical instructions, use "Let's review the previous discussion..." to reactivate context. Start a new conversation when necessary

Mistake 4: Over-reliance on the model's "common sense"

Mistake Assuming the model knows your specific project background, internal company terminology, or the latest event information (training data has a cutoff date)
Optimization Provide necessary background information in the prompt. For questions requiring the latest information, use DeepSeek's web search feature. For project-specific content, clearly state it in the prompt

Error 5: Ignoring R1's think output

Error When calling R1 via the API, directly using the full output (including think tags) without separating the thinking process and the final answer
Optimization Parse R1's output, extract the content between <think> and </think> as the thinking process, and the content after the tags as the final answer. In user-facing scenarios, usually only the final answer is displayed.

Prompt Debugging Methodology

When DeepSeek's output does not meet expectations, systematically troubleshoot and optimize according to the following steps:

  1. Check if the prompt is clear: Are there vague words? Are there implicit assumptions? Add specific details.
  2. Check if context is missing: Does the model know the background information you need? Add role settings or background explanations.
  3. Check if the format is explicit: Have you specified the output format? If not, add format requirements.
  4. Try a different angle: For the same task, rephrase the question with different wording and structure.
  5. Use few-shot: Provide 1-2 examples of desired output for the model to imitate.
  6. Break it down into multiple steps: If one-shot output is not ideal, break it into step-by-step instructions and confirm gradually.
  7. Switch models: V3 and R1 each have advantages; if the current model performs poorly, try the other.
  8. Start a new conversation: Accumulated context in long conversations may interfere with the model; start a new conversation to begin fresh.

Iterative Optimization Example

The following is an iterative optimization process of a prompt from "bad" to "excellent":

# Version 1 (Bad) Write a Python crawler # Version 2 (Add goal) Write a Python crawler to scrape a news website # Version 3 (Add specific site and format) Write a Python crawler to scrape the news titles and links from the homepage of news.ycombinator.com, output as JSON format # Version 4 (Add requirements and constraints) Write a Python crawler to scrape the news titles and links from the homepage of news.ycombinator.com. Requirements: - Use requests + BeautifulSoup - Output as JSON format: [{"title": "...", "link": "...", "score": 0}] - Add request headers to disguise as a browser - Add request interval (2 seconds between each request) - Add error handling (network exceptions, parsing failures) - Code includes complete comments - Include a main function to demonstrate usage

DeepSeek Prompt Engineering FAQ

Are DeepSeek prompts the same as ChatGPT prompts? +
The basic idea is the same, but there are some differences. DeepSeek has better understanding of Chinese, and writing prompts directly in Chinese yields better results without needing to translate to English. DeepSeek R1 has built-in chain-of-thought, so you don't need to manually add CoT prompts like with ChatGPT. Additionally, DeepSeek's adherence to system prompts differs slightly from ChatGPT, so it's recommended to put key instructions in the user prompt.
Should prompts be in Chinese or English? +
It depends on the task. If you want Chinese output, writing the prompt in Chinese works best. If the task is programming-related, English prompts may be more precise (since programming terms are mostly in English). DeepSeek also supports mixed Chinese-English prompts well; using English for key terms and Chinese for instructions is a common best practice. The general principle: write the prompt in the language you express most accurately.
Does DeepSeek R1 need CoT prompts? +
No. R1 has built-in chain-of-thought reasoning and will automatically show the thinking process. You don't need to manually add prompts like "think step by step". For R1, prompts should be concise and direct, clearly stating what you want. Excessive CoT instructions may actually interfere with R1's reasoning. For V3, manually adding CoT prompts is still effective.
How to make DeepSeek output pure JSON without extra text? +
In the prompt, explicitly require "output in pure JSON format, do not include any other text, explanations, or markdown code block markers". Also provide a JSON template (with empty values) so the model knows the expected field structure. If extra text still appears, try lowering the temperature (0.1-0.3) and add emphasis like "output only JSON, do not output anything else".
How long should a prompt be? Is more detailed always better? +
It's not about length, but precision. Key information (goal, format, constraints, background) should be clear, but redundant repetition and irrelevant information should be avoided. A rule of thumb: if you can explain the task in 3 sentences, the prompt should be 3 sentences. If more context is needed, provide more context. Avoid "long and vague" prompts, which are worse than "short but clear" prompts.
How to set the temperature parameter for DeepSeek? +
Temperature controls the randomness of output: 0-0.3 is suitable for tasks requiring precision and consistency (code generation, translation, math reasoning); 0.5-0.7 is suitable for general conversation and Q&A; 0.8-1.2 is suitable for creative writing and brainstorming. For R1 reasoning, it's recommended to use a lower temperature (0.1-0.3); for V3 creative writing, you can increase it appropriately. Note: temperature of 0 does not mean completely deterministic; the model may still produce minor variations.

More DeepSeek Learning Resources

每日精选 Skill 推荐,免费送到你邮箱

输入邮箱,每天接收一个精选 AI Agent 技能推荐。完全免费,持续更新。

完全免费,取消任意时间。我们不会发送垃圾邮件。